Conversation
|
| label: isDirectory | ||
| ? `${parentDirLabel(file.dir, file.name)}/` |
There was a problem hiding this comment.
Folder chip label gains trailing
/ that is lost on XML round-trip
When a folder chip is created here its label is parentDirLabel(...) + "/" (e.g. "src/sub/"). But chipFromTag reconstructs the chip via deriveFileLabel(path), which never appends the slash, so the displayed label silently changes to "src/sub" after any XML serialise → deserialise cycle (e.g. task history reload). Either drop the trailing slash from the suggestion label, or add it in chipFromTag when tag === "folder", so the two paths agree.
| label: isDirectory | |
| ? `${parentDirLabel(file.dir, file.name)}/` | |
| ? parentDirLabel(file.dir, file.name) | |
| : parentDirLabel(file.dir, file.name), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/suggestions/getSuggestions.ts
Line: 96-97
Comment:
**Folder chip label gains trailing `/` that is lost on XML round-trip**
When a folder chip is created here its label is `parentDirLabel(...)` + `"/"` (e.g. `"src/sub/"`). But `chipFromTag` reconstructs the chip via `deriveFileLabel(path)`, which never appends the slash, so the displayed label silently changes to `"src/sub"` after any XML serialise → deserialise cycle (e.g. task history reload). Either drop the trailing slash from the suggestion label, or add it in `chipFromTag` when tag === `"folder"`, so the two paths agree.
```suggestion
? parentDirLabel(file.dir, file.name)
: parentDirLabel(file.dir, file.name),
```
How can I resolve this? If you propose a fix, please make it concise.| const fzfCache = new Map< | ||
| string, | ||
| { fzf: Fzf<FileItem[]>; filesLength: number } | ||
| { fzf: Fzf<FileItem[]>; filesLength: number; includeDirectories: boolean } | ||
| >(); |
There was a problem hiding this comment.
fzfCache keyed only on repoPath — mode not part of the key
The cache stores one entry per repoPath. Any two callers that pass different includeDirectories values for the same repo will continuously invalidate each other's entry: the check at lines 116-119 compares the flag, misses, and overwrites. Today only getSuggestions.ts calls fetchRepoFiles (always with includeDirectories: true), so this is harmless, but the cache will silently degrade if a second caller is added. Consider composing the key from both repoPath and includeDirectories to make the constraint explicit.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/hooks/useRepoFiles.ts
Line: 92-95
Comment:
**`fzfCache` keyed only on `repoPath` — mode not part of the key**
The cache stores one entry per `repoPath`. Any two callers that pass different `includeDirectories` values for the same repo will continuously invalidate each other's entry: the check at lines 116-119 compares the flag, misses, and overwrites. Today only `getSuggestions.ts` calls `fetchRepoFiles` (always with `includeDirectories: true`), so this is harmless, but the cache will silently degrade if a second caller is added. Consider composing the key from both `repoPath` and `includeDirectories` to make the constraint explicit.
How can I resolve this? If you propose a fix, please make it concise.45c09a5 to
d11ad1b
Compare
f69dd50 to
47e8241
Compare
d11ad1b to
1ae2eb3
Compare
47e8241 to
d78fc1d
Compare
1ae2eb3 to
7b69326
Compare
d78fc1d to
57408e9
Compare
7b69326 to
826393f
Compare
57408e9 to
ece1312
Compare
826393f to
1f3492a
Compare
ece1312 to
e914c6a
Compare
1f3492a to
4d14c5c
Compare
e914c6a to
66286c1
Compare
4d14c5c to
b918c7b
Compare
66286c1 to
498b379
Compare
b918c7b to
3320711
Compare
498b379 to
0b936a9
Compare
3320711 to
b90d092
Compare
0b936a9 to
272a9d2
Compare
38d67eb to
720059c
Compare
272a9d2 to
f8085c8
Compare
f8085c8 to
14ba8f9
Compare
720059c to
20c8825
Compare
14ba8f9 to
3b8015e
Compare
Merge activity
|

You can now attach/mention folders
Closes #1775