fix(ui): reduce minimum terminal width for sidebar visibility#3371
fix(ui): reduce minimum terminal width for sidebar visibility#3371donglovejava wants to merge 2 commits into
Conversation
The sidebar was only showing when terminal width >= 100 columns, which is too restrictive for many terminal setups. Reduced the minimum width to 60 columns to make the sidebar visible in more common terminal configurations. This fixes the issue where the sidebar would not appear in v0.8.62+ when using typical terminal sizes that are narrower than 100 columns.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Code Review
This pull request registers several new native tools in the engine's tool catalog, reduces the minimum visible width for the sidebar, and introduces a helper script to modify the engine's user content detection. It also includes several documentation patches and PR summaries. Feedback highlights a layout bug where reducing the sidebar minimum width to 60 can result in an empty sidebar due to rendering constraints; a minimum width of 64 is recommended instead. Additionally, the helper Python script contains a hardcoded absolute Windows path that should be made relative to ensure cross-environment compatibility.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // motion (~12 fps) instead of teleport-frames. | ||
| const UI_STATUS_ANIMATION_MS: u64 = 80; | ||
| const SIDEBAR_VISIBLE_MIN_WIDTH: u16 = 100; | ||
| const SIDEBAR_VISIBLE_MIN_WIDTH: u16 = 60; |
There was a problem hiding this comment.
Reducing SIDEBAR_VISIBLE_MIN_WIDTH to 60 introduces a bug where the sidebar is displayed but remains completely empty.\n\nIn sidebar_width_for_chat_area (line 170), the sidebar width is calculated as:\nlet sidebar_width = preferred_sidebar.max(24).min(chat_width.saturating_sub(40));\nFor a chat_width of 60, chat_width.saturating_sub(40) is 20. Thus, sidebar_width becomes 20.\n\nHowever, in render_sidebar (crates/tui/src/tui/sidebar.rs), there is an early return check:\nif area.width < 24 || area.height < 8 { ... return; }\nSince 20 < 24, the sidebar content is not rendered, leaving a blank background block that unnecessarily squeezes the chat area.\n\nTo ensure the sidebar has at least the minimum required width of 24 while keeping the chat area at its minimum of 40, the minimum terminal width should be 64 (24 + 40).
| const SIDEBAR_VISIBLE_MIN_WIDTH: u16 = 60; | |
| const SIDEBAR_VISIBLE_MIN_WIDTH: u16 = 64; |
| import re | ||
|
|
||
| file_path = r'C:\project\F_project1\CodeWhale\crates\tui\src\core\engine.rs' |
There was a problem hiding this comment.
The script uses a hardcoded Windows absolute path (C:\\project\\F_project1\\...), which will fail on other environments (e.g., CI/CD pipelines or other developers' machines). If this script is intended to be part of the repository, please use a relative path. Otherwise, if it was committed accidentally, it should be removed.
import os\nimport re\n\nfile_path = os.path.join(os.path.dirname(__file__), 'crates', 'tui', 'src', 'core', 'engine.rs')Allow the pinned sidebar to render on narrower terminals while keeping a conservative 64-column lower bound so the transcript and sidebar both have usable space. Adjusted from the original 60-column proposal after layout review and added focused /sidebar status coverage for the 63/64-column boundary. Harvested from PR #3371 by @donglovejava.
|
Thanks @donglovejava — I carried the sidebar visibility improvement into the v0.8.64 integration branch as a scoped harvest:
I kept the release branch to the sidebar behavior only, adjusted the lower bound to 64 columns after layout review, and left the unrelated tool-catalog/local artifact files out of the harvest. Verified with:
Appreciate the report and the fix direction. |
Update the focused sidebar render-state test to assert the 64-column boundary introduced by the sidebar visibility threshold change. Follow-up to PR #3371 by @donglovejava. Verification: - cargo fmt --all -- --check - git diff --check - cargo test -p codewhale-tui --bin codewhale-tui --locked sidebar_width_gate_uses_sixty_four_column_boundary
|
Follow-up update: after carrying the safe sidebar threshold slice into #3373, the macOS CI exposed one stale test expectation that still used the old narrow-width number. I pushed a test-only follow-up on the integration branch as |
Summary
This PR fixes the sidebar display issue reported in #3328 where the sidebar would not appear in typical terminal configurations.
Problem
The sidebar was only showing when terminal width >= 100 columns (SIDEBAR_VISIBLE_MIN_WIDTH = 100), which is too restrictive for many common terminal setups. Most developers use terminals with widths between 80-100 columns, where the sidebar would remain hidden.
Solution
Reduced SIDEBAR_VISIBLE_MIN_WIDTH from 100 to 60 in crates/tui/src/tui/ui.rs, making the sidebar visible in more common terminal configurations.
Testing
Impact
Users with narrower terminal windows will now see the sidebar properly, improving the overall user experience without affecting users with wider terminals.
🤖 Generated with Claude Code