Skip to content

fix(tui): use focused action token for question form border - #50037

Merged
kitlangton merged 1 commit into
v2from
form-border-token
Sep 19, 2026
Merged

kitlangton merged 1 commit into
v2from
form-border-token

Conversation

@kitlangton

@kitlangton kitlangton commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Why

In light mode the question form (FormPrompt) has no visible left border. #49820 flipped hue steps to run mode-relative — light themes now go dark at 100 to light at 900 — and removed the mode === "light" ? 800 : 200 conditionals from the other raw-hue call sites, but missed this one:

// packages/tui/src/routes/session/form.tsx
borderColor={theme.hue.interactive[themeMode() === "light" ? 800 : 200]}

Before the flip, light interactive[800] was the dark end (#1e40af). After it, 800 is #d4e5fd, which disappears against the #fafafa raised background. Dark mode was unaffected because its 200 branch was already the foreground step.

What Changes

The border now uses theme.background.action.primary.focused, the same semantic token the sibling permission panel (permission.tsx) already uses for its identical border={["left"]} + SplitBorder treatment. In the built-in theme that resolves to $hue.interactive.200 in both modes, so dark mode renders identically to before and light mode gets its border back. The now-unused useThemes / themeMode bindings are removed.

This also clears the last mode-conditional raw hue lookup in the TUI. The remaining raw theme.hue.* reads are all fixed-step (200, 500, or the terminal palette).

Demo

Both halves run the same Drive script (built-in opencode theme, light mode, 100×30, simulated model calling the question tool). Left: origin/v2 at b81e10a. Right: this branch.

form-border-demo.mp4

Zoomed on the panel's left edge — left before, right after:

zoom

Scope

One call site plus its dead imports. No theme schema or asset changes.

Verification

cd packages/tui
bun run test test/cli/tui/form.test.tsx test/cli/tui/input-scope.test.tsx   # 32 pass
bun typecheck

Pre-push hook ran bun run lint and repo-wide typecheck (35/35). test/app-lifecycle.test.tsx has a pre-existing wait-timeout failure that reproduces identically on unmodified origin/v2; not related. End to end: the Drive before/after recording above.

@kitlangton
kitlangton enabled auto-merge (squash) September 19, 2026 19:05
@kitlangton
kitlangton merged commit dfa44e9 into v2 Sep 19, 2026
14 checks passed
@kitlangton
kitlangton deleted the form-border-token branch September 19, 2026 19:07
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
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