Skip to content

fix(model-pill): unify the placeholder across model selector pills - #1187

Merged
sudomaggie merged 1 commit into
developfrom
fix/model-pill-placeholder-parity
Sep 1, 2026
Merged

fix(model-pill): unify the placeholder across model selector pills#1187
sudomaggie merged 1 commit into
developfrom
fix/model-pill-placeholder-parity

Conversation

@Harry19081

Copy link
Copy Markdown
Member

Problem

ModelSelectorPill's defaultLabel is the placeholder shown until a model is
picked. Eight surfaces render one, and they disagreed:

Surface key en / zh
SessionCreator ControlButtons sessions:creator.model Model / 模型
SessionCreator RunnerRow sessions:creator.model Model / 模型
Install, SessionCreatorOrgMembersPanel, AgentLauncherSection, RunGroupRunRow sessions:creator.model Model / 模型
ChatPanel ModelPill sessions:creator.selectModel Select model / 选择模型
AgentControlInputTrailing common:adeManager.selectModel Select model / 选择模型

So the same control introduced itself two different ways depending on where it
was rendered. The six that say "Model" also agree with useModelPillLabel's own
built-in fallback, which is the literal "Model" — the two outliers were passing
the action string where the placeholder belongs.

AgentControlInputTrailing made it worse by feeding one string to both
defaultLabel and ariaLabel, collapsing the two roles into a single prop.

Solution

All eight defaultLabels now resolve sessions:creator.modelModel / 模型.

Accessible names are deliberately untouched: every pill still announces "Select
model" / 选择模型, so sessions:creator.selectModel and
common:adeManager.selectModel both stay live. The result is a consistent split
that ControlButtons was already using — the visible placeholder names the
thing, the accessible name names the action.

Keeping that split in the Agent Control palette required separating the two
props, which is why this touches four files for a two-line behavioural change:
AgentControlInputTrailing takes a new modelLabel alongside selectModelLabel,
and useAgentControlPalette exposes it.

Cross-namespace t("sessions:creator.model") from a common-namespace hook
matches what the neighbouring ModelPill already does for model-picker copy.

Potential risks

  • Copy change, two locales. sessions:creator.model exists only in en and
    zh — the same coverage the strings it replaces had, so no locale loses a
    translation. The other eleven locales fall back exactly as before.
  • "Model" is less instructive than "Select model" for a first-time user
    looking at an unfilled pill. The accessible name still carries the verb, and
    the pill's affordance (chevron, click target) carries the rest. This is the
    trade the six existing surfaces already made.
  • No behaviour change. defaultLabel is only read when there is no model
    selection; every pill with a selection renders the model name and is
    unaffected.
  • common:adeManager.selectModel is now aria-only. It is still referenced,
    so it is not dead, but its sole remaining use is an accessible name — worth
    knowing if someone later greps for visible uses.

Verification

Run against this branch in an isolated worktree checked out at its own commit
(not the shared dirty checkout), with node_modules symlinked:

  • npx tsc --noEmit --pretty false -p tsconfig.json — exit 0.
  • npx vitest run --config config/vitest.config.ts src/scaffold/GlobalSpotlight src/engines/ChatPanel/InputArea src/features/SessionCreator src/components/ModelSelectorPill
    — 79 files, 452 tests, all passing.
  • npx eslint src/scaffold/GlobalSpotlight/palettes/AgentControlPalette/ src/engines/ChatPanel/InputArea/components/ModelPill.tsx — clean.
  • npx prettier --check on the changed files — clean.
  • Audited every defaultLabel= and useModelPillLabel( call site in src/ to
    confirm all eight now resolve the same key, and that
    sessions:creator.selectModel / common:adeManager.selectModel still have
    live ariaLabel consumers.

Not run / not applicable:

  • No new test. This is a one-token key swap per call site with no branching,
    and the existing suites already render both pills. A reviewer who wants drift
    protection could ask for an assertion pinning the placeholder key — say so and
    I will add it.
  • No screenshots. ORG2 is a Tauri app with no browser-renderable entry point;
    the change is a string swap with no layout effect.
  • No "Pre-commit hook ran." trailer. The commit was built with plumbing
    (temp index + commit-tree) so the unrelated uncommitted work in the shared
    checkout could not enter it. Hooks were skipped, so typecheck, lint and tests
    were run by hand as listed above. The hook's TypeScript gate cannot fail a
    commit anyway (TSC_OUTPUT=$(...) || true then $? is always 0).
  • Base. Built on origin/develop (aa17dccd7). That commit's unused-export
    sweep on AgentControlInputTrailingProps and AgentControlPaletteProps is
    preserved rather than reverted — the local checkout predates it.

Six of the eight ModelSelectorPill surfaces passed sessions:creator.model
("Model") as defaultLabel, matching useModelPillLabel's own "Model"
fallback. The ChatPanel pill and the Agent Control palette instead passed
the action string ("Select model"), so the same control introduced itself
two different ways depending on where it was rendered. The Agent Control
palette fed one string to both defaultLabel and ariaLabel, collapsing the
two roles into one.

All eight now resolve sessions:creator.model. Accessible names are
untouched: every pill still announces "Select model", so the visible
placeholder names the thing and the accessible name names the action --
the split ControlButtons already used. AgentControlInputTrailing takes a
separate modelLabel prop so the palette can keep both.
@Harry19081 Harry19081 added UX Improvements to user experience, workflow smoothness frontend-ui Frontend UI, design system, accessibility, layout, or theming labels Sep 1, 2026
@sudomaggie
sudomaggie merged commit 38d8cc0 into develop Sep 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend-ui Frontend UI, design system, accessibility, layout, or theming UX Improvements to user experience, workflow smoothness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants