Improve sidebar UI and project interactions#73
Open
Junyi-99 wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines the sidebar’s behavior in constrained/empty states: it collapses and disables the Agents “Summary” card when no agents exist, introduces a windowed vertical tab bar that keeps the ≡ menu button pinned, and adds a “New local session” entry as the first item in the global context menu.
Changes:
- Collapse the idle Summary card to a compact empty-state when no agents are available, and disable the Generate action in that state.
- Replace the vertical tab bar geometry with a windowed layout around the focused session, keeping the menu button pinned and hit-testing consistent.
- Add
NewLocalSessionto the global menu and wire it to open the local new-session picker.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/ui/sidebar.rs | Adds UI regression tests for compact idle Summary-without-agents and overflowed tab bar/menu pinning. |
| tests/unit/ui/layout.rs | Updates tab layout tests to validate windowing/pinned-menu geometry and display-width accounting. |
| tests/unit/model/state.rs | Adjusts Summary height invariants and adds coverage for the “collapsed until agent exists” behavior. |
| tests/unit/app/action/reduce.rs | Updates global menu expectations and adds test coverage for new global “New local session” action. |
| src/ui/sidebar/tabs.rs | Switches rendering to tab_bar_layout() output and draws overflow markers + pinned menu. |
| src/ui/sidebar/sessions.rs | Disables Generate when no agents, and renders a compact idle empty-state (“No agents detected”). |
| src/ui/sidebar/mod.rs | Re-exports MENU_LABEL from geometry and derives can_generate from agent_entries. |
| src/model/state/mod.rs | Updates vertical/tabs click hit-testing to use tab_bar_layout() visible ranges. |
| src/model/state/layout.rs | Collapses idle Summary card height to 3 rows when there are no agents. |
| src/model/menu.rs | Adds MenuItem::NewLocalSession and places it first in the global context menu list. |
| src/model/geometry.rs | Introduces TabBarLayout/VisibleTab and the tab_bar_layout() windowing logic; adds shared MENU_LABEL. |
| src/app/action/reduce/menu.rs | Handles MenuItem::NewLocalSession in the global menu confirm path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+60
to
+67
| pad_to(1, &mut spans, &mut cursor); | ||
| if layout.left_clipped { | ||
| spans.push(Span::styled( | ||
| format!("{TAB_OVERFLOW_MARKER} "), | ||
| Style::default().fg(theme.dim).bg(theme.bg), | ||
| )); | ||
| cursor += 2; | ||
| } |
Comment on lines
+123
to
+129
| if layout.right_clipped { | ||
| spans.push(Span::styled( | ||
| format!(" {TAB_OVERFLOW_MARKER}"), | ||
| Style::default().fg(theme.dim).bg(theme.bg), | ||
| )); | ||
| cursor += 2; | ||
| } |
Comment on lines
+175
to
+181
| fn tab_run_width(labels: &[&str], start: usize, end: usize) -> u32 { | ||
| let tabs = (start..end) | ||
| .map(|i| u32::from(tab_width(i, labels[i]))) | ||
| .sum::<u32>(); | ||
| let separators = end.saturating_sub(start + 1) as u32; | ||
| u32::from(TAB_LEADING_PAD) | ||
| + if start > 0 { |
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.
Summary
Validation