feat(tui): add sidebar_position config option#18497
Open
amosbird wants to merge 2 commits intoanomalyco:devfrom
Open
feat(tui): add sidebar_position config option#18497amosbird wants to merge 2 commits intoanomalyco:devfrom
amosbird wants to merge 2 commits intoanomalyco:devfrom
Conversation
…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.
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.
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #16349 (TUI portion)
Type of change
What does this PR do?
Adds a
sidebar_positionoption totui.jsonconfig so users can move the TUI sidebar to the left side of the screen.The implementation uses
row-reverseflex direction on the main layout container whensidebar_positionis set to"left". This cleanly swaps the sidebar without restructuring the component tree. The narrow-screen overlay mode also flips its alignment accordingly (flex-startvsflex-end).Schema: Added
sidebar_position: z.enum(["right", "left"]).optional()toTuiOptionsintui-schema.ts. No extra wiring needed — it flows throughuseTuiConfig()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 typecheckpasses inpackages/opencode(only pre-existing error indialog-provider.tsxremains)bun test test/config/tui.test.ts— 22 tests pass, including 2 new tests forsidebar_positionconfig loading"left"and"right"(and omitted) values in the TUIScreenshots / recordings
N/A — terminal UI change, verified manually.
Checklist