PDChat: allow disabling the message input (notifications-only mode) with an optional explanatory message#83
Merged
Conversation
…y message (fixes #82) Add IsInputPermitted (default true) and InputDisabledMessage (default null) as default-implemented IChatService members so existing implementers are unaffected. When IsInputPermitted is false, PDMessages renders no input; if InputDisabledMessage is set, it is shown in the input's place, otherwise the chat becomes a pure notifications-only ("toast-only") surface. Plumbed through PDChat into PDMessages, with CanSend/CanSendLocal gated accordingly, scoped CSS for the disabled-input message (light + dark), and a concrete DumbChatService implementation plus live demo controls. Note: this commit also carries the in-progress toast-API work that was already present in the working tree (richer Toast* members on IChatService, toast stack rendering in PDChat, ChatToastOptions/PDChatToastAnimation models, demo docs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 2 medium 1 high |
| Performance | 2 medium |
| CodeStyle | 14 minor |
| Complexity | 1 medium |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 Duplication 0
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
…-input-disable # Conflicts: # PanoramicData.Blazor/PDChat.razor.css # PanoramicData.Blazor/PDMessages.razor # PanoramicData.Blazor/PDMessages.razor.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #82.
What
Adds a supported way to disable the interactive PDChat message input so the component can run as a notifications-only ("toast-only") surface, with an optional developer-configurable message shown where the input would be.
API (non-breaking)
Two default-implemented
IChatServicemembers:bool IsInputPermitted(defaulttrue) — whenfalse, the text area + Send button are not rendered.string? InputDisabledMessage(defaultnull) — when set (and input not permitted), shown in the input's place; when null/empty, nothing is shown (pure toast-only).Defaults reproduce today's behaviour exactly, so existing
IChatServiceimplementers need no changes.Behaviour
IsInputPermittedInputDisabledMessagetrue(default)falsefalseChanges
IChatService: new default-implemented members.PDChat→PDMessages: params plumbed through;CanSend/CanSendLocalgated.PDMessages.razor: renders input / message / nothing;PDMessages.razor.css: disabled-message styling (light + dark).DumbChatService+ demoPDChatPage: concrete impl and two live controls ("Enable Message Input", "Input Disabled Message").Verification
dotnet buildof library + demo: 0 errors (TreatWarningsAsErrorson)./pdchat; toggling input off hides the box while toasts keep working; a message appears when configured.🤖 Generated with Claude Code