fix(annotate): make Ask AI announcement provider cards clickable (#972)#975
Merged
Conversation
The PlanAIAnnouncementDialog rendered provider cards as plain <div>s with selection styling but no onClick, so clicking a card did nothing despite the UI implying it switched the active AI provider. Cards now render as buttons for actually-detected providers and call the existing AI config change handler (same path as the Settings provider selector). Providers that aren't installed are shown greyed out as "not installed" rather than appearing selectable. The dialog is fed the raw detected provider list (aiProviders) instead of visibleAIProviders, so the agent-terminal substitution doesn't make every card read "not installed".
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.
Fixes #972
Problem
The
PlanAIAnnouncementDialog(the one-time "New: Ask AI for annotated documents" popup) shows provider cards — Claude, OpenCode, Pi, Codex — with clear selection styling: one card reads "SELECTED" while the others look unselected. This strongly implies the cards are clickable to switch the active AI provider.They weren't. Each card was a plain
<div>with noonClick, so clicking did nothing. A user with both Claude Code and OpenCode installed (Plannotator auto-detectsclaude-codeas origin) would see OpenCode sitting right there, click it to switch, and get no response — the affordance lied.Fix
<button>s for actually-detected providers and call the existing AI config change handler — the same path used by the Settings provider selector (handleAIConfigChange→saveAIProviderSelection).App.tsx, so the "SELECTED" badge updates live on click — no new state needed.aiProviders) rather thanvisibleAIProviders, so the agent-terminal substitution doesn't collapse the list to a single pseudo-provider and make every card read "not installed".Note on the report's "additional issue" (buttons unresponsive in
--render-html)The report also claimed that in
--render-htmlmode the embedded iframe captured pointer events, making all dialog buttons (including Dismiss) unresponsive.I could not reproduce this. The dialog renders as a portal overlay above the iframe at
z-[100], which receives clicks normally — and manual testing (annotate <file.html> --render-html --gate, fresh incognito session) confirmed Dismiss, Open AI Chat, and the cards all work. The reported symptom was the dead-cards bug above: clicking the cards did nothing, which read as "the whole dialog is frozen." This change resolves it; no iframe/layering change was needed.Testing
tsc --noEmitclean forpackages/uibuild:hookand review app build succeedannotate --render-html --gate(incognito): cards switch provider, badge updates, uninstalled providers greyed, Dismiss / Open AI Chat responsive