Skip to content

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

Open
pratikbuilds wants to merge 1 commit into
corbitsdev:mainfrom
pratikbuilds:claude/i142-prompt-input-80e9b4
Open

pratikbuilds wants to merge 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.

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

1 participant