Skip to content

Commit c9ae3bf

Browse files
BunsDevclaude
andcommitted
fix: resolve type errors in DiffPanel, WorkspaceFileTree, and toast options
- DiffPanel: pass resolvedLocale as 3rd arg to formatShortTimestamp - WorkspaceFileTree: use api.dialogs (plural) instead of api.dialog - useAutoDeleteMergedThreads: move dismissAfterVisibleMs into data object Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 679926b commit c9ae3bf

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

apps/web/src/components/DiffPanel.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { useTurnDiffSummaries } from "../hooks/useTurnDiffSummaries";
2525
import { useStore } from "../store";
2626
import { useAppSettings } from "../appSettings";
2727
import { formatShortTimestamp } from "../timestampFormat";
28+
import { useI18nContext } from "../i18n/I18nProvider";
2829
import { DiffPanelLoadingState, DiffPanelShell, type DiffPanelMode } from "./DiffPanelShell";
2930
import { DiffStatLabel, hasNonZeroStat } from "./chat/DiffStatLabel";
3031
import { Button } from "./ui/button";
@@ -270,6 +271,7 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) {
270271
const navigate = useNavigate();
271272
const { resolvedTheme } = useTheme();
272273
const { settings } = useAppSettings();
274+
const { resolvedLocale } = useI18nContext();
273275
const [diffRenderMode, setDiffRenderMode] = useState<DiffRenderMode>("stacked");
274276
const [diffWordWrap, setDiffWordWrap] = useState(settings.diffWordWrap);
275277
const patchViewportRef = useRef<HTMLDivElement>(null);
@@ -570,14 +572,14 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) {
570572
{selectedTurnId === null
571573
? "All changes"
572574
: selectedTurn?.turnId === latestSelectedTurnId
573-
? `Latest • ${formatShortTimestamp(selectedTurn.completedAt, settings.timestampFormat)}`
575+
? `Latest • ${formatShortTimestamp(selectedTurn.completedAt, settings.timestampFormat, resolvedLocale)}`
574576
: `Change ${
575577
selectedTurn?.checkpointTurnCount ??
576578
(selectedTurn
577579
? inferredCheckpointTurnCountByTurnId[selectedTurn.turnId]
578580
: null) ??
579581
"?"
580-
}${selectedTurn ? formatShortTimestamp(selectedTurn.completedAt, settings.timestampFormat) : ""}`}
582+
}${selectedTurn ? formatShortTimestamp(selectedTurn.completedAt, settings.timestampFormat, resolvedLocale) : ""}`}
581583
</SelectButton>
582584
<SelectPopup>
583585
<SelectItem value="all">All changes</SelectItem>
@@ -594,7 +596,11 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) {
594596
}`}
595597
</span>
596598
<span className="text-muted-foreground text-xs">
597-
{formatShortTimestamp(summary.completedAt, settings.timestampFormat)}
599+
{formatShortTimestamp(
600+
summary.completedAt,
601+
settings.timestampFormat,
602+
resolvedLocale,
603+
)}
598604
</span>
599605
</span>
600606
</SelectItem>

apps/web/src/components/WorkspaceFileTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export const WorkspaceFileTree = memo(function WorkspaceFileTree(props: {
211211
const api = readNativeApi();
212212
if (!api) return;
213213
const name = basenameOfPath(pathValue);
214-
const confirmed = await api.dialog.confirm(`Are you sure you want to delete "${name}"?`);
214+
const confirmed = await api.dialogs.confirm(`Are you sure you want to delete "${name}"?`);
215215
if (!confirmed) return;
216216
try {
217217
await api.projects.deleteEntry({ cwd: props.cwd, relativePath: pathValue });

apps/web/src/hooks/useAutoDeleteMergedThreads.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,13 @@ export function useAutoDeleteMergedThreads(settings: AppSettings) {
7676
if (prState === "merged" && !timersRef.current.has(thread.id)) {
7777
// PR just detected as merged – start countdown.
7878
const threadTitle = thread.title || `Thread ${thread.id.slice(0, 8)}`;
79-
const minutesLabel =
80-
delayMinutes === 1 ? "1 minute" : `${delayMinutes} minutes`;
79+
const minutesLabel = delayMinutes === 1 ? "1 minute" : `${delayMinutes} minutes`;
8180

8281
const toastId = toastManager.add({
8382
type: "info",
8483
title: `PR merged – "${threadTitle}" will be deleted`,
8584
description: `Auto-deleting in ${minutesLabel}. Click Cancel to keep it.`,
86-
dismissAfterVisibleMs: TOAST_VISIBLE_MS,
85+
data: { dismissAfterVisibleMs: TOAST_VISIBLE_MS },
8786
actionProps: {
8887
children: "Cancel",
8988
onClick: () => {

bun.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)