Skip to content

fix(prompt-input): close popups on intent only, name chosen option - #150

Merged
TheGreatAxios merged 1 commit into
corbitsdev:mainfrom
pratikbuilds:claude/i142-prompt-input-80e9b4
Oct 31, 2026
Merged

TheGreatAxios merged 1 commit into
corbitsdev:mainfrom
pratikbuilds:claude/i142-prompt-input-80e9b4

Conversation

@pratikbuilds

Copy link
Copy Markdown
Collaborator

Summary

PromptInput toolbar and token fixes (findings 12, 13, 14, 17 and 18).

  • 12, picker names: a closed model or mode picker is named for its field and its choice ("Model, Deep") rather than the label alone.
  • 13, IME Escape: an Escape that ends an IME composition is left to the IME and no longer closes a host-opened add, model or mode popup. This covers isComposing and Safari's keyCode === 229, which Safari sends after isComposing has already turned false.
  • 14, empty popups: a popup whose items, models or modes run out closes, telling its owner once, and stays closed when they return (useClosedWhileDisabled becomes useClosedWhileUnavailable).
  • 17, empty tokens: splitPromptSegments skips empty tokens, which matched without advancing and looped forever.
  • 18, full-chat story: "Use a command" puts the / at the start of a line, where a command can begin, so the command list opens. "Mention an agent" already worked; the new browser test covers both items.

Verification

  • bun run check
  • bun run test:e2e, with new cases in e2e/full-chat.spec.ts and the updated picker names in e2e/prompt-input-toolbar.spec.ts
  • The IME tests cover both isComposing and keyCode 229 for the add and model popups, and fail without the guard.

Closes #142

Addresses corbitsdev#142 findings 12, 13, 14, 17 and 18.

- 12: a closed model or mode picker is named for its field and its choice
  ("Model, Deep") rather than the label alone; the browser tests query
  that combined name.
- 13: an Escape that ends an IME composition is left to the IME and no
  longer closes a host-opened add, model or mode popup. That covers
  `isComposing` and Safari's keyCode 229, sent once `isComposing` has
  already turned false.
- 14: a popup whose items, models or modes run out closes, telling its
  owner once, and stays closed when they return.
- 17: splitPromptSegments skips empty tokens, which matched without
  advancing and looped forever.
- 18: the full-chat story's "Use a command" puts the `/` at the start of a
  line, where a command can begin, so the command list opens. "Mention an
  agent" already opened its list: the hook re-reads the caret after a
  host edit, so the issue's stated cause did not reproduce; the new
  browser test covers both items.
@corbits-triage

corbits-triage Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Approve

Includes the chosen option in closed PromptInputModelSelect and PromptInputModeSelect combobox names, ignores IME composition Escape (isComposing and keyCode === 229) in useClaimEscape, closes toolbar popups when their options become empty, skips empty tokens in splitPromptSegments, and places / on a new line in the full-chat story's "Use a command" action.

Findings

  • src/hooks/use-prompt-input.ts:167 (informational) — While useClaimEscape in src/ui/prompt-input-toolbar.tsx:88 and onKeyDown in src/hooks/use-prompt-input.ts:241 both ignore event.isComposing || event.keyCode === 229, the window-capture claimEscape listener in src/hooks/use-prompt-input.ts:167 only checks !event.isComposing without && event.keyCode !== 229.

@TheGreatAxios
TheGreatAxios merged commit 60bdc98 into corbitsdev:main Oct 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups from the conversation PR review

2 participants