Skip to content

feat: ability to mention folders#1841

Merged
charlesvien merged 1 commit intomainfrom
04-22-feat_ability_to_mention_folders
Apr 23, 2026
Merged

feat: ability to mention folders#1841
charlesvien merged 1 commit intomainfrom
04-22-feat_ability_to_mention_folders

Conversation

@jonathanlab
Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab commented Apr 22, 2026

You can now attach/mention folders
Closes #1775

CleanShot 2026-04-22 at 16.47.56.gif

@jonathanlab jonathanlab marked this pull request as ready for review April 22, 2026 14:59
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 22, 2026

Comments Outside Diff (1)

  1. apps/code/src/renderer/features/message-editor/components/AttachmentMenu.tsx, line 453 (link)

    P2 navigator.platform is deprecated

    window.navigator.platform was deprecated in the Web Platform spec. In Electron the main process exposes process.platform which is reliable and not subject to any future deprecation. A simple module-level constant would also avoid recomputing this on every render. Consider using window.navigator.userAgent.toLowerCase().includes("windows") or a tRPC call exposing process.platform.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/code/src/renderer/features/message-editor/components/AttachmentMenu.tsx
    Line: 453
    
    Comment:
    **`navigator.platform` is deprecated**
    
    `window.navigator.platform` was deprecated in the Web Platform spec. In Electron the main process exposes `process.platform` which is reliable and not subject to any future deprecation. A simple module-level constant would also avoid recomputing this on every render. Consider using `window.navigator.userAgent.toLowerCase().includes("windows")` or a tRPC call exposing `process.platform`.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All 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.

---

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.

---

This is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/components/AttachmentMenu.tsx
Line: 453

Comment:
**`navigator.platform` is deprecated**

`window.navigator.platform` was deprecated in the Web Platform spec. In Electron the main process exposes `process.platform` which is reliable and not subject to any future deprecation. A simple module-level constant would also avoid recomputing this on every render. Consider using `window.navigator.userAgent.toLowerCase().includes("windows")` or a tRPC call exposing `process.platform`.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat: ability to mention folders" | Re-trigger Greptile

Comment on lines +96 to +97
label: isDirectory
? `${parentDirLabel(file.dir, file.name)}/`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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.

Comment on lines 92 to 95
const fzfCache = new Map<
string,
{ fzf: Fzf<FileItem[]>; filesLength: number }
{ fzf: Fzf<FileItem[]>; filesLength: number; includeDirectories: boolean }
>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 45c09a5 to d11ad1b Compare April 22, 2026 15:41
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from f69dd50 to 47e8241 Compare April 22, 2026 15:41
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from d11ad1b to 1ae2eb3 Compare April 22, 2026 22:58
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from 47e8241 to d78fc1d Compare April 22, 2026 22:59
@jonathanlab jonathanlab force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 1ae2eb3 to 7b69326 Compare April 23, 2026 10:28
@jonathanlab jonathanlab force-pushed the 04-22-feat_ability_to_mention_folders branch from d78fc1d to 57408e9 Compare April 23, 2026 10:30
@jonathanlab jonathanlab force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 7b69326 to 826393f Compare April 23, 2026 10:44
@jonathanlab jonathanlab force-pushed the 04-22-feat_ability_to_mention_folders branch from 57408e9 to ece1312 Compare April 23, 2026 10:45
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 826393f to 1f3492a Compare April 23, 2026 10:51
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from ece1312 to e914c6a Compare April 23, 2026 10:51
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 1f3492a to 4d14c5c Compare April 23, 2026 10:58
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from e914c6a to 66286c1 Compare April 23, 2026 10:59
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 4d14c5c to b918c7b Compare April 23, 2026 11:05
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from 66286c1 to 498b379 Compare April 23, 2026 11:06
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from b918c7b to 3320711 Compare April 23, 2026 11:12
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from 498b379 to 0b936a9 Compare April 23, 2026 11:12
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 3320711 to b90d092 Compare April 23, 2026 11:23
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from 0b936a9 to 272a9d2 Compare April 23, 2026 11:23
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch 2 times, most recently from 38d67eb to 720059c Compare April 23, 2026 11:32
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from 272a9d2 to f8085c8 Compare April 23, 2026 11:32
@charlesvien charlesvien changed the base branch from 04-22-feat_convert_pasted_links_to_gh_chip_support_prs to graphite-base/1841 April 23, 2026 11:41
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from f8085c8 to 14ba8f9 Compare April 23, 2026 11:41
@graphite-app graphite-app Bot changed the base branch from graphite-base/1841 to main April 23, 2026 11:42
@charlesvien charlesvien force-pushed the 04-22-feat_ability_to_mention_folders branch from 14ba8f9 to 3b8015e Compare April 23, 2026 11:42
@charlesvien charlesvien merged commit 67bd552 into main Apr 23, 2026
15 of 16 checks passed
Copy link
Copy Markdown
Member

Merge activity

@charlesvien charlesvien deleted the 04-22-feat_ability_to_mention_folders branch April 23, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to mention folders, not just files

3 participants