fix(web): keep thread branch metadata consistent #4926
Closedmaxktz(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/4926/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/web/src/components/SidebarV2.tsx line 502Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -496,3 +497,4 @@496497 })497498 : null,498499 );500+ const branchRefs = useEnvironmentQuery(
- apps/web/src/components/SidebarV2.tsx line 512Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -496,3 +497,16 @@496497 })497498 : null,498499 );500+ // Keep this project-scoped so local threads share one cached refs query instead of501+ // launching a separate Git command group for every branch-backed row.502+ const branchRefs = useEnvironmentQuery(503+ thread.branch !== null && thread.worktreePath === null && gitCwd !== null504+ ? vcsEnvironment.listRefs({505+ environmentId: thread.environmentId,506+ input: { cwd: gitCwd, limit: 2 },507+ })508+ : null,509+ );510+ const defaultBranchRef = branchRefs.data?.refs.find((refName) => refName.isDefault);511+ const isDefaultBranch =512+ defaultBranchRef?.name === thread.branch ||
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
33611b40-e003-46e3-802c-601838ab8c7eYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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.
❤️ Share