Skip to content

fix(terminal): retain Japanese middle dots and tildes in file links - #23322

Merged
nwparker merged 1 commit into
mainfrom
nwparker/publish-23061-09-26
Sep 27, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/publish-23061-09-26

Conversation

@nwparker

@nwparker nwparker commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

Orca cut some Japanese file paths halfway through their names. Keep four middle-dot and tilde characters so supported terminal links reach the intended file.

What Changed

Extend the existing desktop path detector with ・, ・, 〜, and ~. For example, C:/tmp/中黒・テスト/a.txt remains a complete link. Add 60 cases for path styles, delimiters, URI handling and Windows line/column suffixes.

Why

Reusing the detector with four explicit characters preserves the existing excluded delimiters, such as comma and full stop. These four admitted characters may also be used as Japanese prose separators, so adjacent text such as /tmp/a.txt〜次 is now one candidate; the detector cannot infer whether that is a filename or prose. Accepting entire Unicode punctuation blocks would also absorb delimiters. Adapted from Yi-111-a’s #23061 proposal, with coauthor attribution preserved.

Linked Issue

Related to #23019. Native Windows opening from that report remains unproven; this PR does not claim that platform behavior is verified.

Visual Proof

Attached before/after captures come from the accepted macOS audit of the identical detector source: before, the full path offers no file action; after, the full destination appears and the controlled file contents open. The published images are labeled crops/redactions that remove local path prefixes and terminal identity while preserving the CJK suffix, Open file action and rendered contents. These are real pointer/popover clicks in a hidden, isolated Electron renderer, not a fresh publication-build run or a native PTY encoding test.

Testing

  • Local interaction tested through agent-driven macOS renderer clicks in the accepted audit.
  • Automated tests added.

Fresh integration validation on macOS, with ORCA_BACKGROUND_LAUNCH=1:

  • node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts with the 12 focused detector, URI, performance, click/open routing, SSH, WSL, wrapped-range and runtime path-resolution test files: 233 passed.
  • node node_modules/typescript/bin/tsc --noEmit -p config/tsconfig.tc.web.json: passed.
  • node config/scripts/check-changed-code-quality.mjs against pinned publication main: passed, no new findings.

Historical regression evidence: 56 of the new 60 cases failed before the fix. Historical counts overlap with the fresh 233 tests and are not additional coverage.

Review

Independent review of this exact publication head found no patch-introduced correctness, security or maintainability issues. It independently passed the same 233 tests plus Unicode and real xterm cell probes. Current-head CI passed: all eight test shards, relay integration, static analysis, typechecking, both package lanes and aggregate verify. Pullfrog passed; its adjacent-prose nit is documented above and its pre-existing relative-path suggestion was answered with the bounded scope. CodeRabbit was rate-limited and supplied no completed review. Additional native Windows validation could not start and remains a documented evidence gap.

Agent skill upstream boundary

  • Not applicable; no skill installer code changed.

Notes

Native Windows/Linux, live SSH opening, folder UI, native PTY encoding and PDF opening remain untested. Routing tests are not native platform proof. Mobile remains unchanged. Unprefixed first directories such as 会社・事業/a.txt retain the existing limitation; ./会社・事業/a.txt is covered. Existing hard-row CJK reconstruction and wide-character wrap-filler limitations also remain unchanged. No filesystem authorization, remote protocol, Git/provider behavior, or path encoding changed.

Checklist

  • This PR is small and focused
  • Explained user behavior, mechanism and alternatives
  • Before/after captures attached
  • Self-reviewed for correctness, security and performance
  • Cross-platform, SSH and folder behavior considered
  • Current-head configured CI gates pass; specialized jobs skipped by existing path filters are not claimed as execution evidence

Before, cropped: complete CJK path offers no file action

After, cropped and redacted: CJK path offers Open file

After, cropped and redacted: exact CJK suffix and intended contents

Adapt the bounded character extension from PR #23061 and cover all four characters across path styles, delimiters, URIs and Windows location suffixes.

Co-authored-by: Yi-111-a <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1260d16d-d81c-480a-a99b-6ffcc29ea5e4

📥 Commits

Reviewing files that changed from the base of the PR and between 1d2c0e5 and b6363ba.

📒 Files selected for processing (2)
  • src/renderer/src/lib/terminal-links-cjk.test.ts
  • src/renderer/src/lib/terminal-links.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Minor suggestions only.

Reviewed changes

  • CJK punctuation in LOCAL_PATH_REGEX — adds ・ (U+30FB), ・ (U+FF65), 〜 (U+301C), and ~ (U+FF5E) to the trailing character class so Japanese folder names containing them linkify whole.
  • CJK path test suite — 60 cases covering posix/Windows-drive/UNC/./ path styles, :line:col resolution, delimiter termination, and the URI pass.

Verified this run: terminal-links-cjk.test.ts and terminal-links.test.ts plus all terminal-link-*.test.ts pass (278 tests); the changed-code quality gate reports 0 new findings. Old-vs-new regex comparison confirms the reported cases (/tmp/前・後/a.txt, C:/tmp/中黒・テスト/a.txt, //nas/base/会社・事業/a.pdf) now match whole.

ℹ️ Nitpicks

  • The new comment at terminal-links.ts:36 says "without admitting prose delimiters", but ・ and 〜/~ are themselves Japanese prose separators (list elements and ranges). A path immediately followed by one now absorbs the following prose into a single link — e.g. /tmp/a.txt〜次 was /tmp/a.txt before this change and is /tmp/a.txt〜次 now — and no test pins that tradeoff.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread src/renderer/src/lib/terminal-links.ts Resolved
@nwparker

Copy link
Copy Markdown
Contributor Author

Thanks — that ambiguity is real. Allowing these four filename characters also allows adjacent Japanese list/range prose such as /tmp/a.txt〜次 into the candidate. The comment refers to keeping the other excluded delimiters (covered by the matrix), not to recognizing all Japanese prose boundaries. I made that tradeoff explicit in the PR description; this bounded change deliberately avoids extension-based truncation, which would break valid names. Independent review also found no introduced correctness finding within the stated scope.

@nwparker
nwparker merged commit fa36422 into main Sep 27, 2026
34 checks passed
Yi-111-a added a commit to Yi-111-a/orca that referenced this pull request Sep 29, 2026
Keep kana middle dots in CJK path names, including the first relative segment, and keep wave dashes out so a range marker after a path is not part of the link. stablyai#23322 added the dashes to the continuation class; the tests on this branch still stop at them.
Yi-111-a added a commit to Yi-111-a/orca that referenced this pull request Sep 29, 2026
stablyai#23322 expects a wave dash inside a directory name. A dash in the final segment is still range prose, so the link stops there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant