fix(web): repo-root-relative file chips open in subfolder projects #14510
MergedGigioxx(GitHub profile, opens in a new tab)merged 6 commits into
main fromrefs/pull/14510/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/web/src/components/ChatMarkdown.tsx line 2584OutdatedResolvedby Gigioxx(GitHub profile, opens in a new tab)@@ -2565,11 +2567,18 @@2567+ : stripRepeatedWorkspacePrefix(workspaceRelativePath, cwd);2568+ if (!isBasename && strippedPath === null) return null;25652569 const result = await searchProjectEntries({25662570 environmentId,25672571 input: {25682572 cwd,2569- query: workspaceRelativePath,2573+ query: strippedPath ?? workspaceRelativePath,25702574 limit: WORKSPACE_BASENAME_LOOKUP_LIMIT,25712575 kind: "file",25722576 },25732577 });2574- return result._tag === "Success"2575- ? pickWorkspaceBasenameMatch(workspaceRelativePath, result.value.entries)2578+ if (result._tag !== "Success") return null;2579+ if (strippedPath === null) {2580+ return pickWorkspaceBasenameMatch(workspaceRelativePath, result.value.entries);2581+ }2582+ // A real child folder named like the project keeps the literal path.2583+ const paths = new Set(result.value.entries.map((entry) => entry.path));2584+ return !paths.has(workspaceRelativePath.replaceAll("\\", "/")) && paths.has(strippedPath)
juliusmarminge added labelsmacroscope-review
juliusmarminge assignedjuliusmarminge
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this10b6779
juliusmarminge closed this
Sign in to join this conversation.



macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed