Skip to content

Commit 7f33613

Browse files
CallumAlderclaude
andcommitted
fix(web): recheck the literal path after a sub-path search
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent dc272e6 commit 7f33613

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎apps/web/src/components/ChatMarkdown.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -795,13 +795,13 @@ function useChatMarkdownState({
795795
if (isBasename) {
796796
return pickWorkspaceBasenameMatch(workspaceRelativePath, result.value.entries);
797797
}
798-
if (strippedPath === null) {
799-
return pickWorkspaceSuffixMatch(workspaceRelativePath, cwd, result.value.entries);
800-
}
801-
const match = pickStrippedWorkspaceMatch(strippedPath, cwd, result.value.entries);
798+
const match =
799+
strippedPath === null
800+
? pickWorkspaceSuffixMatch(workspaceRelativePath, cwd, result.value.entries)
801+
: pickStrippedWorkspaceMatch(strippedPath, cwd, result.value.entries);
802802
if (match === null) return null;
803-
// Search can be truncated or still scanning, so it cannot rule out the
804-
// literal path. Check the host before redirecting to the stripped match.
803+
// Search can be truncated or still scanning, and the literal path can appear
804+
// while it runs. Check the host before redirecting to the match.
805805
return (await literalPathIsMissing()) ? match : null;
806806
};
807807
const openFileInPanel = (fileLinkMeta: MarkdownFileLinkMeta, panelPath: string) => {

0 commit comments

Comments
 (0)