Skip to content

feat(tui): add sidebar_position config option#18497

Open
amosbird wants to merge 2 commits intoanomalyco:devfrom
amosbird:feat/tui-sidebar-position
Open

feat(tui): add sidebar_position config option#18497
amosbird wants to merge 2 commits intoanomalyco:devfrom
amosbird:feat/tui-sidebar-position

Conversation

@amosbird
Copy link

@amosbird amosbird commented Mar 21, 2026

Issue for this PR

Closes #16349 (TUI portion)

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a sidebar_position option to tui.json config so users can move the TUI sidebar to the left side of the screen.

The implementation uses row-reverse flex direction on the main layout container when sidebar_position is set to "left". This cleanly swaps the sidebar without restructuring the component tree. The narrow-screen overlay mode also flips its alignment accordingly (flex-start vs flex-end).

Schema: Added sidebar_position: z.enum(["right", "left"]).optional() to TuiOptions in tui-schema.ts. No extra wiring needed — it flows through useTuiConfig() automatically.

Usage in tui.json:

{
  "sidebar_position": "left"
}

Omitting the option or setting "right" preserves the current default behavior.

How did you verify your code works?

  • bun typecheck passes in packages/opencode (only pre-existing error in dialog-provider.tsx remains)
  • bun test test/config/tui.test.ts — 22 tests pass, including 2 new tests for sidebar_position config loading
  • Manually tested both "left" and "right" (and omitted) values in the TUI

Screenshots / recordings

N/A — terminal UI change, verified manually.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…t or right

Add a 'sidebar_position' option to tui.json that accepts 'right' (default) or 'left',
allowing users to move the TUI sidebar to the left side of the screen.

Uses row-reverse flex direction for minimal, clean implementation.
Handles both wide-screen inline sidebar and narrow-screen overlay modes.
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 21, 2026
Update tui.mdx and config.mdx across all 18 locales (en + 17 translations)
to document the new sidebar_position option with localized descriptions.

Add two tests for sidebar_position config loading in tui.test.ts.
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 21, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add option to swap left/right panel layout

1 participant