Repository navigation
fix: worktree tab overflow - #5415
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe PR introduces a 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
src/renderer/src/components/tab-bar/tab-strip-overflow-navigation.ts (1)
181-183: 💤 Low valueConsider using
querySelectordirectly for better performance.The current approach iterates all
[data-tab-id]elements viaquerySelectorAllthen filters withfind. A direct attribute selector would be more efficient, especially with many tabs.♻️ Suggested optimization
- const activeTab = Array.from(strip.querySelectorAll<HTMLElement>('[data-tab-id]')).find( - (candidate) => candidate.getAttribute('data-tab-id') === activeVisibleTabId - ) + const activeTab = strip.querySelector<HTMLElement>( + `[data-tab-id="${CSS.escape(activeVisibleTabId)}"]` + )Using
CSS.escapeensures the selector remains safe if tab IDs ever contain special characters.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 93885e1b-f90e-466e-8069-4432e0c6388d
📒 Files selected for processing (18)
src/renderer/src/assets/main.csssrc/renderer/src/components/right-sidebar/GitHistoryPanel.test.tsxsrc/renderer/src/components/right-sidebar/GitHistoryPanel.tsxsrc/renderer/src/components/right-sidebar/GitHistoryRow.tsxsrc/renderer/src/components/right-sidebar/git-history-format.tssrc/renderer/src/components/tab-bar/BrowserTab.tsxsrc/renderer/src/components/tab-bar/EditorFileTab.tsxsrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/components/tab-bar/TabBar.context-menu.test.tssrc/renderer/src/components/tab-bar/TabBar.tsxsrc/renderer/src/components/tab-bar/tab-strip-overflow-navigation.tssrc/renderer/src/components/tab-bar/tab-title-tooltip.test.tsxsrc/renderer/src/components/tab-bar/tab-width-rules.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
💤 Files with no reviewable changes (1)
- src/renderer/src/assets/main.css
* Move width constraints from tab roots to outer containers to ensure correct sizing and prevent layout breakdown. * Track a dynamic tab layout signature to recompute overflow navigation boundaries whenever tab states, status, or labels change. * Handle malformed timestamps in git history formatting to prevent application crashes on invalid or infinite date numbers. * Remove redundant tooltip titles from the tab bar scroll buttons.
* fix worktree tab overflow * address tab overflow review feedback * Fix tab width rules and improve overflow navigation updates * Move width constraints from tab roots to outer containers to ensure correct sizing and prevent layout breakdown. * Track a dynamic tab layout signature to recompute overflow navigation boundaries whenever tab states, status, or labels change. * Handle malformed timestamps in git history formatting to prevent application crashes on invalid or infinite date numbers. * Remove redundant tooltip titles from the tab bar scroll buttons. --------- Co-authored-by: Jinjing <[email protected]>
Summary
Demo
Before -- notice how chungus the tabs are and no way to navigate with mouse to see the other tabs that are out of view:

This shows the arrows that appear that make it possible to actually scroll to see out of view tabs:

Tests