Skip to content

Conversation

@nshcr
Copy link
Contributor

@nshcr nshcr commented Jan 9, 2026

This PR adds an all changed files preview to applied branches in the branch tab. Currently, only unapplied branches have a preview of all changed files. I'm not sure what considerations led to this behavioral difference, but in my opinion, keeping the behavior consistent here would provide a better user experience.

By the way, I noticed that the same component is also used in the stacked branch view, so I added a prop to ensure the ChangedFiles component is rendered only in the appropriate places.

Copilot AI review requested due to automatic review settings January 9, 2026 08:27
@vercel
Copy link

vercel bot commented Jan 9, 2026

@nshcr is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an "All changed files" panel to applied branches in the branch tab, bringing consistency with unapplied branches which already have this feature. The change enhances user experience by providing a consistent interface across different branch states.

Key changes:

  • Added a showChangedFiles prop to BranchView component to control the visibility of the ChangedFiles panel
  • Integrated the ChangedFiles component rendering within BranchView when the prop is enabled
  • Updated BranchesView to pass showChangedFiles prop when displaying applied branches

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/desktop/src/components/BranchesView.svelte Passes showChangedFiles prop to BranchView for applied branches in workspace
apps/desktop/src/components/BranchView.svelte Adds optional showChangedFiles prop (defaults to false), imports necessary dependencies, creates derived state for selection and branch references, and conditionally renders ChangedFiles component

Comment on lines +216 to +222
persistId={`unapplied-branch-${branchName}`}
changes={changes.changes}
stats={changes.stats}
allowUnselect={false}
/>
{/snippet}
</ReduxResult>
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The persistId uses the prefix "unapplied-branch-" but this component is for applied branches. This should be changed to "applied-branch-" to accurately reflect the context and avoid confusion. The persistId is used to store UI state like scroll position and expansion states, so having accurate naming is important for debugging and maintenance.

Suggested change
persistId={`unapplied-branch-${branchName}`}
changes={changes.changes}
stats={changes.stats}
allowUnselect={false}
/>
{/snippet}
</ReduxResult>
persistId={`applied-branch-${branchName}`}
changes={changes.changes}
stats={changes.stats}
allowUnselect={false}
/>
{/snippet}
</ReduxResult}

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I knew Copilot would catch this mistake :P.

I believe that when a branch transitions from unapplied to applied, it should not lose its persisted list mode state. For that reason, I reused the same persistId prefix as in the UnappliedBranchView component.

persistId={`unapplied-branch-${branchName}`}

Changing the persistId prefix there would introduce backward-compatibility concerns, and since persistId are not user-visible, I think reusing the unapplied prefix for applied branches is acceptable for now.

@Byron
Copy link
Collaborator

Byron commented Jan 10, 2026

Thanks so much for contributing, I love the energy!

Not having looked at more than the screenshot, let me invite our HoD @PavelLaptev right away for opinions :).

@PavelLaptev
Copy link
Contributor

Thanks for the PR, @nshcr. I’ll merge it. :-)

There’s one issue, though—the selected branch lacks proper styles, so it appears unselected. I can address this in the next PR.

image

@PavelLaptev PavelLaptev merged commit 13100ce into gitbutlerapp:master Jan 12, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants