feat(ui): parse file-path candidates with line and column suffixes - #11217
Closed
sylwester-liljegren wants to merge 1 commit into
Closed
feat(ui): parse file-path candidates with line and column suffixes#11217sylwester-liljegren wants to merge 1 commit into
sylwester-liljegren wants to merge 1 commit into
Conversation
Replace the regex-based parseFilePath with extractSuffix and
normalizeCandidatePath helpers, and make extractFilePathFromHref return
structured { path, line, column } data instead of a bare string.
This shifts inline-code detection from "does this string look like a
file?" to "extract a candidate path so the filesystem can confirm it
later", which also handles :line / :line:col and :start-end line ranges,
a/ and b/ diff prefixes, and Windows drive paths. Unit tests are
rewritten to cover the new helpers and the structured href result.
This was referenced Jun 14, 2026
Contributor
Author
|
Closing in favor of a buildable 2-PR stack. The path-parsing change can't be its own PR: removing/altering the file-path API breaks its only consumers (marked.tsx, message-part.tsx) until the UI commit lands, so this PR's CI failed typecheck (marked.tsx importing the removed parseFilePath). Path-parsing is now combined with the UI in #11219, stacked on the independent filesystem-validation PR #11218. Both of those are green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Re-split of #10340 per maintainer feedback (no separate tracking issue exists). Part 1 of 3.
Stack (review/merge in order): #11217 (this PR) → #11218 → #11219
Context
First slice of the clickable-file-links work from #10340, rebased onto current
mainand split into smaller reviewable pieces as requested. This PR only changes the path-parsing layer: turning inline code / link hrefs into structured{ path, line, column }candidates that a later slice validates against the filesystem.Implementation
parseFilePath(a "does this look like a file?" matcher) with two small helpers:extractSuffix(strips:line/:line:col/:start-endsuffixes) andnormalizeCandidatePath(adds a./prefix to bare relative paths, stripsa/+b/diff prefixes, leaves absolute/Windows/UNC paths alone).extractFilePathFromHrefnow returns{ path, line, column }instead of a bare string, and preservesfile://decoding and Windows-drive handling.packages/ui/src/file-path.ts(shared opencode path, keeps itskilocode_changemarker) andpackages/kilo-ui/src/file-path.ts(Kilo-only).Screenshots / Video
N/A — no user-visible change in this slice.
How to Test
Manual/local verification
Reviewer test steps
packages/ui/:bun test src/file-path.test.tsextractSuffix,normalizeCandidatePath, andextractFilePathFromHref.Blocked checks and substitute verification
typecheckof just this slice fails on purpose: its consumers (marked.tsx,message-part.tsx) are updated in the dependent UI PR (feat(ui): parse and render clickable file links #11219). The full stack typechecks/tests/builds green. Substitute verification: ran this module's unit tests directly — agent-executed, 48 pass.Checklist