feat: disclaimer option parity for ASP.NET Core ChatKit wrapper - #8
feat: disclaimer option parity for ASP.NET Core ChatKit wrapper#8SamuelMcAravey with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: SamuelMcAravey <11021165+SamuelMcAravey@users.noreply.github.com>
Test Docs Summary
Artifacts: testdocs (docs/testing/generated) |
There was a problem hiding this comment.
Pull request overview
Adds test and documentation coverage for the ASP.NET Core ChatKit wrapper’s existing “disclaimer” option passthrough, ensuring the runtime forwards disclaimer configuration into ChatKit.js options and documenting tag-helper usage.
Changes:
- Extend the JS runtime
buildOptionstest to assertdisclaimer.textanddisclaimer.highContrastare forwarded. - Add a new “Disclaimer” documentation section describing tag-helper attributes, global defaults, overrides, and omission behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Incursa.OpenAI.ChatKit.AspNetCore/ClientApp/chatkit-runtime/src/entry.test.mjs | Adds assertions that buildOptions(...) forwards disclaimer into the ChatKit options object. |
| docs/30-contracts/chatkit-tag-helper.md | Documents disclaimer configuration via tag-helper attributes and global ASP.NET Core options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| disclaimer-high-contrast="true" /> | ||
| ``` | ||
|
|
||
| The disclaimer block is omitted from the serialized config entirely when no text is configured. Setting `disclaimer-high-contrast` alone without a text value has no effect. |
There was a problem hiding this comment.
The last sentence is inaccurate as written: disclaimer-high-contrast can have an effect without a per-instance disclaimer-text if a global default options.Disclaimer.Text is configured (the tag helper will then serialize the disclaimer using the default text plus the overridden high-contrast value). Consider rewording to clarify that high-contrast alone has no effect only when no disclaimer text is configured anywhere (neither per-instance nor globally).
| The disclaimer block is omitted from the serialized config entirely when no text is configured. Setting `disclaimer-high-contrast` alone without a text value has no effect. | |
| The disclaimer block is omitted from the serialized config entirely when no disclaimer text is configured anywhere (neither per-instance nor globally). In that case, setting `disclaimer-high-contrast` alone without a text value has no effect. |
The ASP.NET Core wrapper already had the full disclaimer plumbing in C# (
ChatKitAspNetCoreOptions.Disclaimer, tag-helper attributes,BuildDisclaimerConfig, andruntimeHost.jsforwarding) but lacked a JS-level test covering the runtime passthrough and any documentation.Changes
entry.test.mjs— Extends thebuildOptionstest to include adisclaimerpayload and assertsoptions.disclaimer.text/options.disclaimer.highContrastare forwarded to ChatKit options.chatkit-tag-helper.md— Adds a "Disclaimer" section covering:disclaimer-textanddisclaimer-high-contrasttag-helper attributesChatKitAspNetCoreOptions.DisclaimerExample
Or globally with a per-instance override:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.