Repository navigation
test(native-chat): keep #26586's path-link cases as regression tests - #26819
Conversation
Command-, route-, version- and host-shaped text stays plain unless the host confirms the path, in chat and terminal alike, since #26675. Co-authored-by: Kelvin Amoaba <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughAdded regression tests for file links in terminal text and rendered comments. Terminal tests cover command-like text, URLs, versions, file paths, and Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The added file-link regression tests present no identified merge-blocking risk; normal checks remain appropriate. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ELI5
Chat used to underline things that only looked like files (slash commands such as
/code-review, web routes such as/api/v1, version numbers such asHTTP/1.1, web addresses missing theirhttps://). Clicking one showed "File not found."#26675 (merged) fixed the cause: chat now asks the workspace's machine whether a path exists before underlining it, the same way the terminal does.
Kelvin's #26586 attacked the same bug with chat-only text rules. This PR keeps his examples as regression tests against the merged check and adds no new rules. It is a tests-only PR.
What Changed
The problem it guards against. A chat reply mentioning
/code-review,/api/v1,HTTP/1.1,z-ai/glm-5.3,example.com/docs/guide.htmlorgit log origin/main..HEADgot an underline that led to "File not found." Onmainthese already stay plain, because none of them exists on the host. Nothing tested that with Kelvin's examples until now.What is different for you: nothing. No product code changes. Chat and terminal behave exactly as on
main.What the tests pin down, in rendered chat markdown and in the terminal's own link detection (a mocked host answers which paths exist):
gitcommand stay plain when they don't exist.conf.d/nginx.conf,v1.2/notes.md), numeric extensions (man/ls.1,lib/libfoo.so.1,docs/archive.7z), absolute paths under any root (/etc/hosts,/data/raw,/mnt/c/Users/me/notes.md), spaced paths (~/Library/Application Support/…,C:\My Folder\notes.txt:12:3,My Folder/notes.md) andfile://links (includingfile:///tmp/Makefileand%20-encoded names with#L4)./code-review,example.com/docs/guide.htmlinside the workspace), it links in both chat and terminal.docs/Makefileand.github/CODEOWNERSand leavesBUILD SUCCESSFULalone.Each #26586 case, decided against
main/code-review,/clear and /compact,/orca-native-chat:orca-chat-visuals/code-reviewpath would still link, as in the terminal./api/v1HTTP/1.1,1.5/2.0,z-ai/glm-5.3git log origin/main..HEADin inline codeexample.com/docs/guide.html,127.0.0.1/api/data.jsonexample.com/folder still links, which a list of web-address endings would get wrong.conf.d/nginx.conf,v1.2/notes.md,docs/archive.7z,man/ls.1,lib/libfoo.so.1/etc/hosts,/usr/local/bin,/data/out.json,/data/raw,/mnt/c/…,/Users/…/main.ts:12/data), which matters on SSH hosts and containers.~/Library/Application Support/…,C:\My Folder\notes.txt:12:3file://links, including extensionless names,%20and#L4/tmpnever links/tmpexists on every Mac and Linux host, so chat links it, as the terminal does. Text alone can't tell a slash command from a real top-level folder; the host can.My Folder/notes.md,"Brennan's Folder/notes.md")mainalready tests this; Kelvin's examples are added.docs/Makefile,.github/CODEOWNERSlinking in chatsrc/components), and #26675 split folders and bare names into a later PR. The terminal already links them, which a test here now covers.Brewfile,Justfile, …), shared with the terminalJustfile, and every new name is one more existence check on each terminal hover, including over SSH. Paths with a folder (docs/Makefile) don't use the list. It belongs with the bare-names PR.lib/hostname-segment.ts)statcalls inside a request already being sent, not another SSH round trip.Why
#26675 fixed the cause. A path is underlined only when the machine that owns the workspace says it exists, and chat and terminal share that step. Re-adding shape rules on top would make chat and terminal disagree again. It would also wrongly hide real paths that happen to look like a command or web address.
Kelvin's examples are still the best list of what used to go wrong, so they live on as regression tests on both surfaces.
This replaces draft #26697, which carried the same tests while #26675 was still open. This one is based on
main.Kelvin Amoaba (@AmoabaKelvin) wrote the original cases in #26586 and is credited with a
Co-authored-by:trailer on the commit.Linked Issue
Refs STA-9683. Follows #26675 and carries over the cases from #26586.
Visual Proof
N/A: tests only. Nothing changes on screen.
Testing
tscfor the renderer project (config/tsconfig.tc.web.json): passes.18 explicit suites pass with
--maxWorkers=2: the two new files plus terminal link detection, batching, click fallback, file-link target,file://, CJK and regex-safety suites, CommentMarkdown link suites, and the native-chat file-link existence, click and paced-markdown suites.orca-ci-checks --no-typecheckpasses locally.Not run by hand: no app launch, since nothing on screen changes. The SSH, WSL and Windows existence paths come from fix(native-chat): underline a file path only once its workspace confirms it exists #26675; these tests mock the host's answer.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Tests only; reviewed against #26675's merged behaviour and #26586's diff.
Agent skill upstream boundary
Notes
/mnt/c/…paths; behaviour comes from the shared resolver.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Author: Brennan Benson (@BrennanKB5)