Skip to content

fix(components): pin agent-config option popups below their trigger - #1212

Merged
wibus-wee merged 2 commits into
mainfrom
lody/d8d5a97f-96c
Oct 2, 2026
Merged

wibus-wee merged 2 commits into
mainfrom
lody/d8d5a97f-96c

Conversation

@wibus-wee

Copy link
Copy Markdown
Member

Related issue

Problem / pressure

In the agent configuration dialog, a select whose option list is taller than the dialog flipped upward over the whole form. Measured live on the running desktop app (builtin Devin): the Model trigger sits at y=716–748 with ~330px of room above and ~250px below inside the dialog's scroll region, while the published catalog holds 108 models (~3000px). Floating UI bestFit picks the taller side and maxHeight: var(--available-height) lets the popup swallow the form — the "dropdown flies up over the dialog" behaviour.

Summary

  • agent-config-dialog.tsx TitleGenerationFields renders OptionSelector (field appearance) instead of bare Select: ≥6 options (shouldOfferOptionSearch) gets a search field; every popup is pinned side="bottom" with avoidCollisions={false}; list height caps at min(60vh, 320px, --available-height); mounts inside [data-lody-dialog-content] per the dialog-contained-menu rule.
  • AgentConfigDialog.stories.tsx: new EditLongOptionLists story — a synthetic runtime-provenance capability fixture with a 108-model catalog.
  • i18n keys settings.agent.dialog.optionSearch{Placeholder,Empty} (en + zh_CN); bilingual note implemented/bug-fix/2026-10-02-agent-config-selector-popup-pin.

Visual explanation

Simple change: one render branch swaps Select for the existing shared OptionSelector; positioning and search are the component's own.

Before / after

Captures from the EditLongOptionLists story under Playwright; before is the same fixture with the component change stashed.

Before After
before after

Test plan

  • pnpm --filter @lody/components typecheck (tsgo) ✓
  • oxlint / oxfmt --check on touched files ✓; pnpm lint:i18n ✓; pnpm docs check ✓
  • vitest run tests/agent-config-dialog.test.tsx — 44 pass ✓
  • Storybook + Playwright acceptance captures (table above)
  • Not run: full pnpm check suite; packaged-app visual pass pending a build

Generated with Devin

A select whose option list is taller than the dialog flipped upward over
the whole form: one provider publishes about a hundred models (~3000px)
against ~330px above and ~250px below the trigger, and Floating UI bestFit
picks the taller side. TitleGenerationFields now renders OptionSelector:
lists of 6+ options get a search field, every popup stays side=bottom with
avoidCollisions off, and the list caps at min(60vh, 320px,
--available-height). Adds a Storybook fixture covering the regression and
a bilingual note recording the measured geometry.

Model: swe-2-high
@wibus-wee
wibus-wee marked this pull request as ready for review October 2, 2026 17:17
@wibus-wee
wibus-wee merged commit 0f443da into main Oct 2, 2026
13 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.

1 participant