Skip to content

PDChat: allow disabling the message input (notifications-only mode) with an optional explanatory message#83

Merged
davidnmbond merged 2 commits into
mainfrom
feature/issue-82-chat-input-disable
Jul 20, 2026
Merged

PDChat: allow disabling the message input (notifications-only mode) with an optional explanatory message#83
davidnmbond merged 2 commits into
mainfrom
feature/issue-82-chat-input-disable

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

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 IChatService members:

  • bool IsInputPermitted (default true) — when false, the text area + Send button are not rendered.
  • string? InputDisabledMessage (default null) — 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 IChatService implementers need no changes.

Behaviour

IsInputPermitted InputDisabledMessage Result
true (default) (ignored) Normal input — unchanged
false null/empty (default) Input not rendered; notifications-only, nothing shown
false non-empty Input replaced by the message

Changes

  • IChatService: new default-implemented members.
  • PDChatPDMessages: params plumbed through; CanSend/CanSendLocal gated.
  • PDMessages.razor: renders input / message / nothing; PDMessages.razor.css: disabled-message styling (light + dark).
  • DumbChatService + demo PDChatPage: concrete impl and two live controls ("Enable Message Input", "Input Disabled Message").

Verification

  • dotnet build of library + demo: 0 errors (TreatWarningsAsErrors on).
  • Demo host served at /pdchat; toggling input off hides the box while toasts keep working; a message appears when configured.

Note: this branch also carries in-progress toast-API work that was already present in the working tree at branch-creation time (richer Toast* members, toast stack rendering, ChatToastOptions/PDChatToastAnimation models, demo docs). It is included here per the maintainer's instruction rather than split out.

🤖 Generated with Claude Code

…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>
@codacy-production

codacy-production Bot commented Jul 20, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high · 5 medium · 14 minor

Alerts:
⚠ 20 issues (≤ 0 issues of at least minor severity)

Results:
20 new issues

Category Results
ErrorProne 2 medium
1 high
Performance 2 medium
CodeStyle 14 minor
Complexity 1 medium

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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.

Run reviewer

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
@davidnmbond
davidnmbond merged commit a20d3cb into main Jul 20, 2026
1 of 3 checks passed
@davidnmbond
davidnmbond deleted the feature/issue-82-chat-input-disable branch July 20, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDChat: allow disabling the message input (notifications-only mode) with an optional explanatory message

1 participant