Skip to content

fix(annotate): make Ask AI announcement provider cards clickable (#972)#975

Merged
backnotprop merged 1 commit into
mainfrom
fix/972
Jun 26, 2026
Merged

fix(annotate): make Ask AI announcement provider cards clickable (#972)#975
backnotprop merged 1 commit into
mainfrom
fix/972

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

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 no onClick, so clicking did nothing. A user with both Claude Code and OpenCode installed (Plannotator auto-detects claude-code as origin) would see OpenCode sitting right there, click it to switch, and get no response — the affordance lied.

Fix

  • Provider cards now render as <button>s for actually-detected providers and call the existing AI config change handler — the same path used by the Settings provider selector (handleAIConfigChangesaveAIProviderSelection).
  • Selection state was already lifted in App.tsx, so the "SELECTED" badge updates live on click — no new state needed.
  • Providers that aren't installed are shown greyed out with a "not installed" label instead of looking selectable, since the dialog's card list is the full set of supported provider types, not just the detected ones.
  • The dialog is fed the raw detected provider list (aiProviders) rather than visibleAIProviders, 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-html mode 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 --noEmit clean for packages/ui
  • build:hook and review app build succeed
  • Manually verified in annotate --render-html --gate (incognito): cards switch provider, badge updates, uninstalled providers greyed, Dismiss / Open AI Chat responsive

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".
@backnotprop backnotprop merged commit 6982d99 into main Jun 26, 2026
13 checks passed
@backnotprop backnotprop deleted the fix/972 branch June 26, 2026 20:02
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.

PlanAIAnnouncementDialog: provider cards are not clickable (missing onClick handler)

1 participant