Skip to content

Commit 4a9bd64

Browse files
authored
refactor(desktop): declutter sidebar PR display (#56)
Remove the repo-level 'N open PR' summary line, demote the per-worktree PR pill to a plain 'PR #N' label shown alongside the branch age, and swap the branch row's fork glyph for a green call-merge icon.
1 parent a929685 commit 4a9bd64

2 files changed

Lines changed: 28 additions & 22 deletions

File tree

app/lib/desktop/chat/desktop_sidebar.dart

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,6 @@ class _RepoGroupState extends ConsumerState<_RepoGroup> {
169169
],
170170
),
171171
),
172-
if (repo.openPrCount > 0)
173-
Padding(
174-
padding: const EdgeInsets.fromLTRB(16, 0, 16, 4),
175-
child: Text(
176-
'${repo.openPrCount} open PR${repo.openPrCount > 1 ? 's' : ''}',
177-
style: theme.textTheme.bodySmall?.copyWith(color: kRepoAccent),
178-
),
179-
),
180172
for (final wt in visible)
181173
_WorktreeGroup(
182174
key: ValueKey(wt.id),
@@ -296,11 +288,11 @@ class _WorktreeGroupState extends ConsumerState<_WorktreeGroup> {
296288
child: Row(
297289
children: [
298290
const SizedBox(width: 4),
299-
Icon(
300-
Symbols.fork_right,
291+
const Icon(
292+
Symbols.call_merge,
301293
size: 24,
302294
weight: 200,
303-
color: theme.colorScheme.outline,
295+
color: kRepoAccent,
304296
),
305297
const SizedBox(width: 6),
306298
Expanded(
@@ -335,23 +327,38 @@ class _WorktreeGroupState extends ConsumerState<_WorktreeGroup> {
335327
),
336328
),
337329
// Sub-row below the branch, inside the same hover/tap group: the
338-
// PR pill when present, else the low-emphasis branch age. Fixed
339-
// height so the row always reserves its place, even when empty.
330+
// PR number label (when present) followed by the low-emphasis
331+
// branch age. Fixed height so the row always reserves its place.
340332
Padding(
341333
padding: const EdgeInsets.fromLTRB(38, 0, 16, 4),
342334
child: SizedBox(
343335
height: 16,
344336
child: Align(
345337
alignment: Alignment.centerLeft,
346-
child: worktree.pr != null
347-
? PrPill(pr: worktree.pr!)
348-
: Text(
349-
_branchAgeLabel(worktree.committedAt),
338+
child: Row(
339+
mainAxisSize: MainAxisSize.min,
340+
children: [
341+
if (worktree.pr != null) ...[
342+
Text(
343+
'PR #${worktree.pr!.number}',
350344
style: theme.textTheme.labelSmall?.copyWith(
351-
color: theme.colorScheme.outline,
352-
fontWeight: FontWeight.w300,
345+
color: worktree.pr!.isDraft
346+
? theme.colorScheme.outline
347+
: kRepoAccent,
348+
fontWeight: FontWeight.w500,
353349
),
354350
),
351+
const SizedBox(width: 8),
352+
],
353+
Text(
354+
_branchAgeLabel(worktree.committedAt),
355+
style: theme.textTheme.labelSmall?.copyWith(
356+
color: theme.colorScheme.outline,
357+
fontWeight: FontWeight.w300,
358+
),
359+
),
360+
],
361+
),
355362
),
356363
),
357364
),

app/test/desktop/desktop_sidebar_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ void main() {
200200
);
201201

202202
expect(find.text('PR #42'), findsOneWidget);
203-
expect(find.text('1 open PR'), findsOneWidget);
204203
});
205204

206205
testWidgets('empty state prompts to start a session', (tester) async {
@@ -432,9 +431,9 @@ void main() {
432431

433432
// The diff chip stays inline with the branch row...
434433
expect(find.text('+1'), findsOneWidget);
435-
// ...while the PR pill drops to its own line below it.
434+
// ...while the PR label drops to its own line below it.
436435
final branchY = tester.getTopLeft(find.text('feat/x')).dy;
437-
final prY = tester.getTopLeft(find.byType(PrPill)).dy;
436+
final prY = tester.getTopLeft(find.text('PR #42')).dy;
438437
expect(prY, greaterThan(branchY));
439438
});
440439

0 commit comments

Comments
 (0)