Skip to content

Lite: improve selection handling and add branch selection with diff view#12923

Open
OliverJAsh wants to merge 25 commits intomasterfrom
but-selection-and-branch-diff
Open

Lite: improve selection handling and add branch selection with diff view#12923
OliverJAsh wants to merge 25 commits intomasterfrom
but-selection-and-branch-diff

Conversation

@OliverJAsh
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 02:30
@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Skipped Skipped Mar 19, 2026 2:30am

Request Review

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 updates the Lite UI’s selection model to support richer, more explicit selections (branch / commit / file) and adds a branch-diff preview path, alongside UI/UX tweaks for expanding commits and improving selection styling.

Changes:

  • Introduces discriminated-union selection types (Branch / Commit / CommitFile / ChangesFile) and default selection behavior.
  • Adds branch selection in the workspace stack view with a diff preview for the selected branch ref.
  • Refactors commit row rendering (expand/collapse control, drag disable while editing) and updates related CSS styling.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/but-sdk/src/generated/index.d.ts Adds doc comment for assignHunk API.
apps/lite/ui/src/routes/project-shared.tsx Refactors commit/file row components; adds expand control and drag gating.
apps/lite/ui/src/routes/project-shared.module.css Adds/updates styles for selection, highlighting, file rows, expand/menu controls.
apps/lite/ui/src/routes/project-index.tsx Adds branch selection + branch diff preview; revamps workspace selection normalization/defaulting.
apps/lite/ui/src/routes/project-index.module.css Adds styling for branch buttons, move-target positioning, dependency indicator.
apps/lite/ui/src/routes/project-branches.tsx Migrates branch page selection to tagged union; adds commit expand logic + Match-based preview.
apps/lite/ui/src/global.css Changes global button border styling.
apps/lite/AGENTS.md Documents Lite component conventions and React Compiler guidance.
Comments suppressed due to low confidence (1)

apps/lite/ui/src/global.css:24

  • In global.css, button { border: none; border-color: black; } leaves border-color as a no-op. Either remove border-color or reintroduce an explicit border style so the rule is internally consistent.
button {
	border: none;
	border-color: black;
	font: inherit;
	line-height: inherit;
	text-align: left;
}

type="button"
className={styles.expandButton}
onClick={() => {
startExpandTransition(toggleExpand);
.selected {
background-color: black;
/* TODO: */
background-color: black !important;
Comment on lines 1186 to 1191
{stack.segments.map((segment) => {
const branchName = segment.refName?.displayName ?? "Untitled";
const branchRef = getSegmentBranchRef(segment);
const anchorRef = segment.refName ? segment.refName.fullNameBytes : null;
return (
<li key={branchName}>
Comment on lines +633 to 637
if (!stackIds.has(selection.stackId)) return null;
return selection;
}),
Match.exhaustive,
);
Comment on lines +69 to +77
if (commitIds.has(selection.commitId)) return selection;
const branchSelection: Selection = {
_tag: "Branch",
branchName: selection.branchName,
};
return branchSelection;
}),
Match.exhaustive,
);
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.

2 participants