Skip to content

fix(desktop): show base branch in changes view#557

Merged
Kitenite merged 3 commits into
mainfrom
ai-slack-c0a51nbf5nz-1767162422-075339
Jan 1, 2026
Merged

fix(desktop): show base branch in changes view#557
Kitenite merged 3 commits into
mainfrom
ai-slack-c0a51nbf5nz-1767162422-075339

Conversation

@charliecreates
Copy link
Copy Markdown
Contributor

Description

Updates the Changes panel section header to display the currently selected base branch (instead of hard-coding "Against Main").

Related Issues

Closes #555

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

  • bun run lint
  • bun turbo run typecheck --filter=@superset/desktop (Bun 1.3.3)
  • cd apps/desktop && bun test (Bun 1.3.3)
  • cd apps/desktop && bun run compile:app (Bun 1.3.3)

Skipped locally:

  • bun turbo run build --filter=@superset/desktop (electron-builder packaging) — devbox is linux/arm64, so packaging output isn’t representative of CI (ubuntu/x64).

Screenshots (if applicable)

Additional Notes

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 31, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@charliecreates
Copy link
Copy Markdown
Contributor Author

charliecreates Bot commented Dec 31, 2025

Expand this to see my work.
  • Inspected PR #557 and confirmed the only change is in ChangesView.tsx, swapping the hard-coded "Against Main" label for title={Against ${effectiveBaseBranch}} while keeping status.againstMain, expandedSections["against-main"], and toggleSection("against-main") behavior intact.
  • Verified that effectiveBaseBranch in ChangesView.tsx is derived from useChangesStore().baseBranch, branchData?.defaultBranch, and a fallback of "main", and that this same value is passed as defaultBranch into trpc.changes.getStatus.useQuery for backend consistency.
  • Reviewed apps/desktop/src/lib/trpc/routers/changes/status.ts to confirm getStatus accepts defaultBranch, uses it to compute the comparison branch, and still returns results under the againstMain field, meaning the new dynamic label does not break server expectations.
  • Searched for remaining "Against Main", againstMain, and "against-main" usages and confirmed that only the user-facing label text changed, leaving internal identifiers stable across ChangesView and related components.
  • Examined apps/desktop/src/lib/trpc/routers/changes/branches.ts to confirm that getBranches returns a plain defaultBranch like "main" or "master" (without origin/ prefixes), matching how effectiveBaseBranch is displayed in the CategorySection title.
  • Located useChangesStore in apps/desktop/src/renderer/stores/changes/store.ts (via ripgrep) to prepare for validating how baseBranch is stored and how it interacts with section keys like "against-main".

@charliecreates
Copy link
Copy Markdown
Contributor Author

Change looks correct and nicely minimal: the “Against …” section header now reflects the selected base branch instead of being hard-coded to “Main”.

A couple small follow-ups I’d consider to make this more robust/maintainable:

  • In apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/ChangesView/ChangesView.tsx, the UI label uses effectiveBaseBranch, but the actual branch used by the backend is ultimately status.defaultBranch (since the router normalizes with input.defaultBranch || "main"). Using status.defaultBranch for the label would guarantee the header matches the data shown (even in odd cases like an empty/invalid baseBranch):

    • e.g. title={Against ${status.defaultBranch}}
  • Naming drift: the data field status.againstMain (and ChangeCategory key "against-main") now effectively means “against base/default branch”, not necessarily main. Totally fine to keep this PR scoped, but it’d be worth a follow-up refactor to rename to something like againstBase / "against-base" to reduce future confusion.

  • Optional UX nit: when baseBranch is null and branchData hasn’t loaded yet, effectiveBaseBranch falls back to "main" and triggers an initial getStatus call against main. On repos whose default is master (or anything else), this can briefly show a misleading “Against main” label / empty comparison until the next refetch. If that’s been seen in practice, gating getStatus on branchData?.defaultBranch when baseBranch is unset would prevent the flicker.

@Kitenite Kitenite merged commit 3b59595 into main Jan 1, 2026
5 checks passed
@Kitenite Kitenite deleted the ai-slack-c0a51nbf5nz-1767162422-075339 branch January 1, 2026 06:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 1, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

This was referenced Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] “Against Main” label is incorrect when base branch is not main

2 participants