GeezerVison is showing github.com — fix(shared): inline code like `I/W217:220` no longer renders as a file chip by fixfon · Pull Request #22220 · pingdotgg/t3code
Conversation
Closes #22181
Problem
Inline code such as I/W217:220 (spreadsheet cell shorthand) renders as a file chip labeled W217 · L220. In inlineCodeFilePathCandidate, the extension check only ran when there was no :line suffix (if (!hasPosition && !FILE_EXTENSION_PATTERN.test(basename)) return null;). Any trailing :\d+ skipped it, so a slashed, extensionless, unprefixed span became a candidate.
Change
packages/shared/src/markdownLinks.ts: a position suffix still lets an extensionless basename through (bin/run:12, scripts/deploy:40), unless the basename is shaped like an A1 cell reference (1 to 3 letters followed by digits, SPREADSHEET_CELL_PATTERN). Spreadsheet columns stop at XFD, hence the 3-letter cap.
- Now plain code:
I/W217:220, A/B12:40, Sheet/XFD1:2.
- Still chips:
bin/run:12, scripts/deploy:40, docker/Dockerfile:8, src/app.ts:10, src/app.ts:10:4, and ./I/W217:220 (an explicit prefix still wins).
I kept this narrower than the issue's first suggestion (requiring an extension or a known extensionless name), because that would turn bin/run:12 and other extensionless scripts into plain code.
Not covered: foo/TODO:12 still becomes a chip. By shape it is the same as bin/run:12, and telling them apart would need an all-caps heuristic. A short digit-suffixed script name such as bin/py3:12 now reads as a cell reference and stays plain code.
#22188 edits the same file (trailing-slash folder links). Its check runs before the basename logic and doesn't interact with this one; a trial git merge-tree of the two branches has no conflicts.
Scope and approval
#22181 is not triaged yet. It qualifies as a very small, focused fix of an obvious bug: one condition in inlineCodeFilePathCandidate plus one pattern constant, in the same branch #13899 fixed for version-shaped basenames. Bare names like TODO:12 already stay plain code; this closes the slashed variant for cell references only.
Verification
- New
it.each block in markdownLinks.test.ts covering the cases above.
- On
main without the fix: Tests 3 failed | 152 passed (155). The three failures are the I/W217:220, A/B12:40 and Sheet/XFD1:2 rows, which returned the input instead of null.
- With the fix:
markdownLinks.test.ts 155/155 passes. Together with the two consumers of the function (threadFindText.test.ts, apps/web/src/markdown-links.test.ts), 204/204 pass.
vp fmt --check, vp lint on the changed files, and the packages/shared typecheck are clean.
- Not checked: the rendered chip in the running app.
Claude Sonnet 5.5 (xhigh) via T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…e chip
A `:line` suffix skipped the extension check for slash-containing inline
code, so spreadsheet cell shorthand such as `I/W217:220` became a file
chip that dropped the `I/` prefix and the row range from the visible text.
A position still vouches for an extensionless file (`bin/run:12`), but a
basename shaped like an A1 cell reference (1-3 letters plus digits) no
longer does.
Approvability
Verdict: Approved at d533fff
Macroscope's review found this PR approvable — This small shared-library fix prevents spreadsheet-style inline code such as I/W217:220 from being misclassified as a file chip while preserving ordinary file-path detection. It is covered by focused regression tests and has a narrow, self-contained runtime effect.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d5de7290-5024-4190-b157-88bb14cd510f
📥 Commits
-
Reviewing files that changed from the base of the PR and between 41b513d and d533fff.
📒 Files selected for processing: 2
-
packages/shared/src/markdownLinks.test.ts
packages/shared/src/markdownLinks.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
-
The inline code path classifier now rejects spreadsheet-cell shorthand with position suffixes. It accepts positioned extensionless paths that do not match the spreadsheet-cell pattern. Tests cover both outcomes.
Changes: Inline code path filtering
| Layer / File(s) |
Summary |
Validate positioned extensionless candidates packages/shared/src/markdownLinks.ts, packages/shared/src/markdownLinks.test.ts |
The classifier rejects spreadsheet-cell-shaped basenames with position suffixes and accepts other positioned extensionless paths. Tests cover rejected shorthand and accepted path candidates. |
Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers: maria-rcks
Merge Risk: ⚪ Minimal · up to d533f
-
Spreadsheet shorthand remains plain inline code, while positioned extensionless paths retain their file-link behavior. No identified issue blocks merging.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title is concise, uses the conventional commit format, and clearly describes the primary fix for spreadsheet-like inline code paths. |
| Description check |
 |
The description covers the problem, implementation, scope and approval rationale, verification results, limitations, related work, and the agent used. It provides sufficient reproduction context and t… |
| Linked Issues check |
 |
Issue #22181 requires spreadsheet shorthand such as I/W217:220 to remain ordinary inline code. The change adds SPREADSHEET_CELL_PATTERN and rejects matching extensionless basenames after a positio… |
| Out of Scope Changes check |
 |
The diff changes only inlineCodeFilePathCandidate and adds focused tests for the linked bug. The retained chip cases and explicit-prefix behavior are supporting coverage for issue #22181. No unrelat… |
Full details: Description check
-
Explanation
The description covers the problem, implementation, scope and approval rationale, verification results, limitations, related work, and the agent used. It provides sufficient reproduction context and test details.
Full details: Linked Issues check
-
Explanation
Issue #22181 requires spreadsheet shorthand such as I/W217:220 to remain ordinary inline code. The change adds SPREADSHEET_CELL_PATTERN and rejects matching extensionless basenames after a position suffix. The tests cover I/W217:220, A/B12:40, and Sheet/XFD1:2. The guard preserves explicit prefixes, extensions, and extensionless positioned paths such as bin/run:12 as documented by the PR.
Full details: Out of Scope Changes check
-
Explanation
The diff changes only inlineCodeFilePathCandidate and adds focused tests for the linked bug. The retained chip cases and explicit-prefix behavior are supporting coverage for issue #22181. No unrelated product behavior or files are changed.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note 🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for this. Julius has #23203 open for the same issue (#22181) with a different rule, so we are going with that one and closing this to keep one fix in review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
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.
|