Skip to content

feat(form-builder): show thinking spinner while LLM streams#8135

Open
Kelsey-Ethyca wants to merge 3 commits intodemo/aprilfrom
feat/pc-form-builder-thinking-spinner
Open

feat(form-builder): show thinking spinner while LLM streams#8135
Kelsey-Ethyca wants to merge 3 commits intodemo/aprilfrom
feat/pc-form-builder-thinking-spinner

Conversation

@Kelsey-Ethyca
Copy link
Copy Markdown
Contributor

Ticket []

Description Of Changes

While the privacy center form builder's chat is streaming a response from the LLM, the input disabled and Send swapped to Stop, but there was no visual indication that the model was actually working. This PR adds a small antd Spin row labelled "Thinking…" at the bottom of the messages list, visible only while status === "streaming".

The spinner uses Spin from fidesui (the project's shared antd Spin wrapper, already used in ~12 places across admin-ui).

Code Changes

  • clients/admin-ui/src/features/properties/privacy-center-config/form-builder/ChatPane.tsx — import Spin from fidesui; render a <Spin size="small" /> Thinking… row at the bottom of the messages list while streaming. Reuses the existing auto-scroll useEffect (isStreaming is already in its dep array).
  • clients/admin-ui/src/features/properties/privacy-center-config/form-builder/__tests__/ChatPane.test.tsx — two new test cases asserting the indicator is visible while status="streaming" and absent when status="idle".

Steps to Confirm

  1. Check out this branch and start admin-ui (nox -s "dev(slim)" -- fides-pkg fides-admin-ui).
  2. Navigate to a property → privacy center config → a form (e.g. default_access_policy).
  3. Type any non-trivial request into the chat composer (e.g. "add a date of birth field with validation") and press Send.
  4. Confirm a Thinking… row with an animated antd spinner appears at the bottom of the messages list while the LLM streams.
  5. Confirm the spinner disappears once the assistant message arrives or when Stop is pressed.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

The chat composer disabled its input and swapped Send for Stop while
streaming, but gave no visual feedback that the model was working on a
response. Add an antd Spin row labelled "Thinking…" at the bottom of
the messages list while status is "streaming", with two unit tests
covering the visible/hidden states.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment May 8, 2026 9:01pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored May 8, 2026 9:01pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 10%
8.18% (3782/46188) 7.21% (1906/26426) 5.68% (771/13565)
fides-js Coverage: 78%
79.39% (2011/2533) 65.99% (1240/1879) 73.09% (345/472)
privacy-center Coverage: 88%
85.97% (331/385) 81.36% (179/220) 78.87% (56/71)

@Kelsey-Ethyca Kelsey-Ethyca marked this pull request as ready for review May 7, 2026 19:52
@Kelsey-Ethyca Kelsey-Ethyca requested a review from a team as a code owner May 7, 2026 19:52
@Kelsey-Ethyca Kelsey-Ethyca requested review from kruulik and removed request for a team May 7, 2026 19:52
@Kelsey-Ethyca
Copy link
Copy Markdown
Contributor Author

Screen.Recording.2026-05-08.at.4.48.58.PM.mov

Replace the visible "Thinking…" text with an ARIA status region
(role="status", aria-live="polite", aria-label) so screen readers still
announce the streaming state, and tighten the test to assert both the
accessible region and the spinner's aria-busy attribute.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant