Skip to content

Commit a5ad85f

Browse files
authored
Merge pull request #46 from grimmerk/claude/loving-leakey
fix(file-history): ensure file items not truncated by slice limit
2 parents 4041622 + 19be620 commit a5ad85f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/vscode-based-ide-utility.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,15 @@ export const readVSCodeBasedIDEState = (): VSWindowModel[] => {
8181
// console.log('IDE state:', jsonData);
8282

8383
if (jsonData.entries) {
84-
// Include fileUri entries now for file history support
85-
// and limit to 100
86-
jsonData.entries = jsonData.entries
87-
.filter((entry: VSCodeBasedEntry) => {
88-
return entry.folderUri || entry.workspace || entry.fileUri;
89-
})
84+
// Separate folders/workspaces and files to ensure file items
85+
// are always included regardless of how many folders exist
86+
const foldersAndWorkspaces = jsonData.entries
87+
.filter((entry: VSCodeBasedEntry) => entry.folderUri || entry.workspace)
9088
.slice(0, 100);
89+
const files = jsonData.entries
90+
.filter((entry: VSCodeBasedEntry) => entry.fileUri)
91+
.slice(0, 50);
92+
jsonData.entries = [...foldersAndWorkspaces, ...files];
9193
}
9294

9395
const resp = convertVSCodeBasedSqliteToVSWindowModelArray(jsonData);

0 commit comments

Comments
 (0)