Skip to content

Add the PromptInput toolbar #103

Closed

Description

@pratikbuilds

Add the optional parts around the message box: a toolbar, an add menu, model and mode pickers, a float, a context chip and a note.

Part of #94.

Depends on #102.

Why

Around the message box sit optional controls: add files, pick a model or mode, show what you're replying to. Each app turns on only what it needs, so every part is opt-in and leaving one out leaves no gap.

What

  • src/ui/prompt-input-toolbar.tsx:
    • PromptInputToolbar: the row that holds the controls.
    • PromptInputAddMenu: add files and other content.
    • PromptInputButton: a toolbar button.
    • PromptInputModelSelect and PromptInputModeSelect: controlled pickers.
    • PromptInputFloat: content floating above the box.
    • PromptInputContext: what the message replies to.
    • PromptInputNote: a one-line note under the box.
  • stories/chat/prompt-input.stories.tsx: add everything on, model picker open, with a note, and a replying chip.
  • e2e/fixtures.tsx: a prompt-input-toolbar scenario, with e2e/prompt-input-toolbar.spec.ts.
  • src/ui/prompt-input-toolbar.test.tsx; exports in src/index.ts.

Requirements

  • R32: the eight toolbar parts.
  • R5–R12: the shared component rules (picker values are controllable).

Constraints

Done when

  • Unit tests: the model and mode selects call their change callbacks with the chosen id and reflect a controlled value.
  • Browser spec: the pickers and the add menu open, move and choose by keyboard, close on Escape and return focus to their trigger.
  • No serious or critical axe violation in the new stories, in light or dark.
  • bun run check, bun run build, bun run test:e2e and bun run dep-guard pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions