Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ release/
node_modules/
.worktrees/
.claude/
.omc/
.planning/
.letta/
package-lock.json
Expand Down
8 changes: 2 additions & 6 deletions src/components/ChangedFilesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,8 @@ export function ChangedFilesList(props: ChangedFilesListProps) {
});
});

const totalAdded = createMemo(() =>
files().reduce((s, f) => s + (f.committed ? f.lines_added : 0), 0),
);
const totalRemoved = createMemo(() =>
files().reduce((s, f) => s + (f.committed ? f.lines_removed : 0), 0),
);
const totalAdded = createMemo(() => files().reduce((s, f) => s + f.lines_added, 0));
const totalRemoved = createMemo(() => files().reduce((s, f) => s + f.lines_removed, 0));
const uncommittedCount = createMemo(() => files().filter((f) => !f.committed).length);

/** For each file, compute the display filename and an optional disambiguating directory. */
Expand Down
29 changes: 23 additions & 6 deletions src/components/ScrollingDiffView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { For, Show, createSignal, createEffect, onMount, onCleanup } from 'solid-js';
import type { JSX } from 'solid-js';
import { theme } from '../lib/theme';
import { theme, bannerStyle } from '../lib/theme';
import { sf } from '../lib/fontScale';
import { getStatusColor } from '../lib/status-colors';
import { openFileInEditor } from '../lib/shell';
Expand Down Expand Up @@ -591,7 +591,10 @@ function FileSection(props: {
padding: '2px 8px',
'border-radius': '4px',
color: getStatusColor(props.file.status),
background: 'rgba(255,255,255,0.06)',
background:
props.file.status === 'M'
? 'rgba(255,255,255,0.06)'
: `color-mix(in srgb, ${getStatusColor(props.file.status)} 15%, transparent)`,
}}
>
{STATUS_LABELS[props.file.status] ?? props.file.status}
Expand Down Expand Up @@ -672,9 +675,23 @@ function FileSection(props: {
</div>
</Show>

<Show when={!props.file.binary}>
<Show when={!props.file.binary && props.file.status === 'D'}>
<div
style={{
...bannerStyle(theme.error),
margin: '12px',
'font-size': sf(12),
'text-align': 'center',
'font-weight': '600',
}}
>
This file was deleted
</div>
</Show>

<Show when={!props.file.binary && props.file.status !== 'D'}>
<div style={{ 'padding-bottom': '8px', background: 'rgba(0, 0, 0, 0.15)' }}>
<Show when={props.file.hunks.length > 0 && props.file.status !== 'D'}>
<Show when={props.file.hunks.length > 0 && props.file.status === 'M'}>
<GapView
startLine={1}
endLine={props.file.hunks[0].newStart}
Expand All @@ -691,7 +708,7 @@ function FileSection(props: {
<For each={props.file.hunks}>
{(hunk, hunkIdx) => (
<>
<Show when={hunkIdx() > 0}>
<Show when={hunkIdx() > 0 && props.file.status === 'M'}>
<GapView
startLine={
props.file.hunks[hunkIdx() - 1].newStart +
Expand Down Expand Up @@ -777,7 +794,7 @@ function FileSection(props: {
</>
)}
</For>
<Show when={props.file.hunks.length > 0 && props.file.status !== 'D'}>
<Show when={props.file.hunks.length > 0 && props.file.status === 'M'}>
<TrailingGap
lastHunk={props.file.hunks[props.file.hunks.length - 1]}
lang={lang()}
Expand Down
Loading