fix: sidebar header repo/branch not syncing when switching tabs#97
fix: sidebar header repo/branch not syncing when switching tabs#97matt1398 merged 2 commits intomatt1398:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a user experience bug where the sidebar header, which displays repository and branch information, did not correctly update when navigating between tabs linked to different repositories. The change ensures that the header accurately reflects the context of the currently active tab, providing a more consistent and intuitive interface for users. The fix is minimal, targeted, and includes robust testing to maintain stability. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the bug where the sidebar header failed to sync when switching between tabs from different repositories. The root cause was correctly identified, and the fix of using the worktree ID (projectId) for lookup instead of a potentially stale session ID is robust and direct. The addition of a targeted regression test that confirms the fix, especially by simulating an empty session cache, is excellent. I have one minor suggestion in the new test file to improve its robustness.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanged tab activation logic to detect a worktree by comparing worktree.id to the given projectId (instead of checking worktree.sessions membership) and break once found. Tests were added (two identical cases) to exercise repository/worktree selection when switching tabs across repositories. Changes
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
Address Gemini Code Assist review suggestion — assert tabB is defined before accessing its id for clearer test failure messages.
Summary
setActiveTab()searchedrepositoryGroupsusingwt.sessions.includes(sessionId), which fails when the cachedwt.sessionsarray is stale after initial fetch. The fallback path updatesselectedProjectId(session list) but notselectedRepositoryId/selectedWorktreeId(header)wt.id === projectId— each tab already stores the correct worktree ID, so this is a direct stable match independent of session cache stateTest plan
pnpm typecheckpassespnpm testpasses (653 tests, including newsetActiveTabcross-repo sync test)pnpm buildsucceedsSummary by CodeRabbit
Bug Fixes
Tests