Skip to content

Commit 544da81

Browse files
committed
fix(web): reset legacy changed-files expansion preferences
1 parent 5e78a61 commit 544da81

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎apps/web/src/components/chat/ChangedFilesTree.tsx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
7171
<Button
7272
type="button"
7373
size="icon-xs"
74-
variant="ghost"
75-
className="text-muted-foreground"
74+
variant="ghost-muted"
7675
aria-label={
7776
allDirectoriesExpanded ? "Collapse all folders" : "Expand all folders"
7877
}
@@ -98,8 +97,7 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
9897
<Button
9998
type="button"
10099
size="xs"
101-
variant="ghost"
102-
className="text-muted-foreground hover:text-foreground"
100+
variant="ghost-muted"
103101
aria-label="Open diff"
104102
onClick={() => onOpenTurnDiff(turnId, files[0]?.path)}
105103
/>

‎apps/web/src/uiStateStore.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe("parsePersistedState", () => {
159159
invalid: "not-a-date",
160160
},
161161
defaultAdvertisedEndpointKey: "desktop-core:lan:http",
162-
threadChangedFilesExpansionVersion: 1,
162+
threadChangedFilesExpansionVersion: 2,
163163
threadChangedFilesExpandedById: {
164164
"environment:thread-1": {
165165
"turn-1": false,
@@ -186,8 +186,9 @@ describe("parsePersistedState", () => {
186186
});
187187
});
188188

189-
it("ignores changed-file expansion values saved with legacy folder semantics", () => {
189+
it.each([undefined, 1])("ignores changed-file expansion version %s", (version) => {
190190
const parsed = parsePersistedState({
191+
...(version === undefined ? {} : { threadChangedFilesExpansionVersion: version }),
191192
threadChangedFilesExpandedById: {
192193
"environment:thread-1": {
193194
"turn-1": false,
@@ -296,7 +297,7 @@ describe("uiStateStore persistence", () => {
296297
"environment:thread-1": "2026-02-25T12:35:00.000Z",
297298
},
298299
defaultAdvertisedEndpointKey: "desktop-core:lan:http",
299-
threadChangedFilesExpansionVersion: 1,
300+
threadChangedFilesExpansionVersion: 2,
300301
threadChangedFilesExpandedById: {
301302
"environment:thread-1": {
302303
"turn-1": false,

‎apps/web/src/uiStateStore.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { create } from "zustand";
33
import { normalizeProjectPathForComparison } from "./lib/projectPaths";
44

55
export const PERSISTED_STATE_KEY = "t3code:ui-state:v1";
6-
const THREAD_CHANGED_FILES_EXPANSION_VERSION = 1;
6+
// Version 1 stored card visibility, not folder expansion.
7+
const THREAD_CHANGED_FILES_EXPANSION_VERSION = 2;
78
const LEGACY_PERSISTED_STATE_KEYS = [
89
"t3code:renderer-state:v8",
910
"t3code:renderer-state:v7",
@@ -25,7 +26,7 @@ export interface PersistedUiState {
2526
expandedProjectCwds?: string[];
2627
projectOrderCwds?: string[];
2728
defaultAdvertisedEndpointKey?: string | null;
28-
threadChangedFilesExpansionVersion?: typeof THREAD_CHANGED_FILES_EXPANSION_VERSION;
29+
threadChangedFilesExpansionVersion?: number;
2930
threadChangedFilesExpandedById?: Record<string, Record<string, boolean>>;
3031
}
3132

0 commit comments

Comments
 (0)