Fixes #16099. Fixes #16096.
HTML documents can open as source after a user selects source once, because t3code.renderBrowserFile=false persists globally. Document links with literal #, ?, or Unicode filenames can fail before rendering: browser-document checks truncate decoded paths as URLs, and the shared Markdown parser rejects characters in bare relative paths.
Keep HTML source mode local to the current document so new documents open rendered. Explicit line targets still open source, and Markdown/table preferences remain unchanged. Use the shared filesystem-path classifier for HTML/PDF previews. Accept Unicode letters, numbers, and combining marks, plus decoded #, ?, and %, in the existing relative-path patterns. Preserve exact filename spelling and separate URL queries/fragments before decoding. The Unicode fix extends the same path-recognition change already in this PR and reaches web, desktop, and mobile callers.
Based on nightly v0.0.46-nightly.20261005.2676 (7812230572f2). Prior content-type and desktop CSP fixes are already in this base. Related history: #9143, #10935, #11935, #11191, and #9140.
Validation:
- Four render-state regressions failed before the preference fix. Eleven Unicode regressions failed before the parser extension, including the web document resolver and mobile link presentation.
- Latest focused run: 240 shared, web, and mobile file-link tests passed. Coverage includes the reported Chinese PDF path, encoded paths, decomposed accents, Indic marks, Arabic numbers, supplementary-plane letters, line targets, literal delimiters, and external URL/route exclusions.
- Earlier focused checks: 62 HTTP/asset-access and 21 file-preview/render-state tests passed. Those implementations are unchanged by the Unicode extension.
- Client-runtime typecheck and targeted lint/format/diff checks pass for the extension. Web typecheck passed for the earlier viewer changes. The unchanged breadcrumb effect has an existing lint dependency warning.
- T3 preview browser with isolated dev state: an existing local report changed from source to rendered while the old global preference remained
false. Source toggling and explicit line targets worked.
- Filename checks: an encoded
report%23final.html link rendered the document and sibling CSS. Both literal and encoded 線性代數/期中 報告.html links in rendered Markdown opened the HTML document; its load script reported success. The Unicode line link opened source with line 3 highlighted.
Filename classification, before and after:


Unicode links, before (ordinary relative web anchors) and after (the linked HTML document renders):


Screenshots use synthetic files. Native mobile was not tested; its shared link-presentation tests pass. No transport, asset-permission, or sandbox contracts change. Intermittent blank frames on reopening documents were observed separately and are not claimed fixed. Windows File Explorer launch failures remain tracked in #11780; this PR does not change the launcher.
Models: GPT-6-Astra and GPT-6.1-Sol. Harness: Codex through T3 Code.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
6733ac2b-be26-4320-a157-48bd2030bad3📥 Commits
Reviewing files that changed from the base of the PR and between 6d4f26ea667be9c5586855667e40c9ffa560efb2 and 2fa1ef6f2419def2ad9878c6198767c0d5c570a8.
📒 Files selected for processing (4)
apps/mobile/src/lib/markdownLinks.test.tsapps/web/src/components/files/browserDocumentPaths.test.tspackages/client-runtime/src/markdownLinks.test.tspackages/client-runtime/src/markdownLinks.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
Markdown file-link parsing now recognizes Unicode paths and encoded delimiters. Browser and PDF preview checks use the full path. HTML render selection and reveal handling are tracked for the current document.
Changes#
Document preview behavior
packages/client-runtime/src/markdownLinks.ts,packages/client-runtime/src/markdownLinks.test.ts,apps/mobile/src/lib/markdownLinks.test.tsapps/web/src/browser/openFileInPreview.ts,apps/web/src/markdown-links.ts,apps/web/src/components/files/BrowserDocumentFrame.tsx,apps/web/src/components/files/browserDocumentPaths.test.ts,apps/web/src/markdown-links.test.tsapps/web/src/components/files/useFilePreviewRenderState.ts,apps/web/src/components/files/useFilePreviewRenderState.test.tsx,apps/web/src/components/files/FilePreviewPanel.tsx,docs/user/composer.mdFilePreviewPaneluses the hook, and tests cover document changes, remounts, and line requests. The documentation states that another HTML file opens in rendered view.Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
2fa1eOrdinary relative Unicode document links appear to benefit from this change. No confirmed issue blocks merging.
Security Architecture Review#
Security architecture risk: 🔵 Low · up to
2fa1eThe change is limited to file-link interpretation and document previews. The inspected paths retain existing file-access mediation and HTML isolation. No introduced vulnerability was verified, but end-to-end enforcement and recovery coverage remains incomplete.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 1 | ❌ 2 | ❓ 2
❌ Failed checks (2 warnings, 2 inconclusive)#
#16099,useFilePreviewRenderStatekeeps HTML render state local to the current path and defaults each new path or remount to rendered mode. Its tests cover the saved `t3code.renderBrowserFile=fa…#16096's current state and coding requirements so its implementation and tests can be assessed.#16099changes are in scope. The PR also changes browser-document path classification and shared Markdown link parsing for literal delimiters and Unicode filenames. The current PR description asso…#16096's current state and scope to determine whether the path-classification and Markdown-parser changes are in scope.✅ Passed checks (1 passed)
Full details: Linked Issues check
Explanation
For
#16099,useFilePreviewRenderStatekeeps HTML render state local to the current path and defaults each new path or remount to rendered mode. Its tests cover the savedt3code.renderBrowserFile=falsevalue, document changes, and line requests.FilePreviewPanelstill opens an unhandled line request in source mode and preserves the Markdown and table preferences. The PR also says it fixes#16096, but that issue's requirements and state were not provided, so compliance with all claimed linked issues cannot be established.Full details: Out of Scope Changes check
Explanation
The
#16099changes are in scope. The PR also changes browser-document path classification and shared Markdown link parsing for literal delimiters and Unicode filenames. The current PR description associates these changes with#16096, but#16096's issue details were not provided. The evidence does not establish whether those changes meet that issue's scope or are unrelated.Full details: Description check
Explanation
The description gives clear problem and change details, links issues, and reports focused tests and browser checks. However, it does not provide maintainer approval for the preference-scope decision, which the linked issue identifies as needing review.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.