Repository navigation
refactor: unify agent sidebar into generic tabbed panel with Git sub-views - #22837
Merged
Merged
Conversation
DanielleMaywood
left a comment
Collaborator
There was a problem hiding this comment.
Looks fine, will wait for chromatic to be visible before hitting green button
Comment on lines
+945
to
+962
| // Compute local diff stats by counting +/- lines across all | ||
| // repository unified diffs. | ||
| const localDiffStats = useMemo(() => { | ||
| let additions = 0; | ||
| let deletions = 0; | ||
| for (const repo of gitWatcher.repositories.values()) { | ||
| const diff = repo.unified_diff; | ||
| if (!diff) continue; | ||
| for (const line of diff.split("\n")) { | ||
| if (line.startsWith("+") && !line.startsWith("+++")) { | ||
| additions++; | ||
| } else if (line.startsWith("-") && !line.startsWith("---")) { | ||
| deletions++; | ||
| } | ||
| } | ||
| } | ||
| return { additions, deletions }; | ||
| }, [gitWatcher.repositories]); |
Collaborator
There was a problem hiding this comment.
How reliable is this method?
Member
Author
There was a problem hiding this comment.
Seems fine for now. All of this is ssomewhat janky, but I'll be fixing shortly.
kylecarbs
force-pushed
the
stevendanna/refactor-agent-sidebar-git-panel
branch
from
March 9, 2026 14:00
25a4786 to
373c64b
Compare
DanielleMaywood
approved these changes
Mar 9, 2026
| ? `ssh ${workspaceAgent.name}.${workspace.name}.${workspace.owner_name}.${sshConfigQuery.data.hostname_suffix}` | ||
| : undefined; | ||
| const shouldShowSidebar = (hasDiffStatus || hasGitRepos) && showSidebarPanel; | ||
| const shouldShowSidebar = showSidebarPanel; |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Refactors the right-side panel in the Agents page into a generic tabbed container with a unified Git panel.
Changes
Architecture
SidebarTabViewis now a generic tabbed container with no git-specific logic, ready for additional tabsGitPanelcomponent with an internal Remote/Local segmented controlGit Panel
FilesChangedPanelDiffStatBadgerendered inside the Remote/Local segmented buttons (full-height, no rounding, inactive opacity 50%)Visual polish
bg-surface-quaternary/25,hover:bg-surface-tertiary/50)text-content-secondary(not primary)min-w-0+px-2to prevent inflated widthGitCompareArrowsIconfor Remote,FileDiffIconfor Local)bg-surface-secondarywith consistent icon/text sizing)Cleanup
DiffStatsInline,computeDiffStatsexport,workingDiffStatsmemo,ChatDiffStatusResponseimportRepoChangesPanelto a pureDiffViewerwrapperTopBarto use a genericpanelprop instead of diff-specific props