feat(desktop): make Markdown file references in sessions openable - #3845
Closed
nagarwal-godaddy wants to merge 3 commits into
Closed
feat(desktop): make Markdown file references in sessions openable#3845nagarwal-godaddy wants to merge 3 commits into
nagarwal-godaddy wants to merge 3 commits into
Conversation
…ations Extend `MakaUriDest` additively with a `file-ref` kind that carries the raw reference text exactly as written — no decoding, no resolution, no boundary decisions in the UI package. Relative/absolute `.md`/`.markdown` destinations become actionable only when a dispatcher is installed, so TUI and eval surfaces sharing this package keep today's inert rendering; every URI scheme (including `file://`) stays out of the file-reference path entirely. Percent-encoded spellings of space/CJK references are recognized identically to their raw forms. Generated-by: pi
Add `workspace-files:readText` / `openLocally` / `revealInFolder`, following
the reconnectable-read artifacts pattern. Resolution and sandbox-boundary
enforcement happen only in desktop main, against the session's Runtime Host
workspace root via the shared `@maka/runtime/path-containment` authority:
- realpath'd-root containment rejects `../` traversal and out-of-root
absolute paths;
- symlink escapes fail because canonical targets are resolved before
containment is decided;
- reads are Markdown-only, size-capped, and strictly read-only;
- open/reveal reach injected main-process `shell` wrappers only — the
external-link guard and its closed allowlist are untouched;
- remote hosts and unknown sessions get typed failures.
The renderer never receives absolute paths, mirroring the artifact pane
contract. Main-process tests cover each rejection plus space/CJK and
percent-encoded references.
Generated-by: pi
Route `MakaUriDest` kind `file-ref` through the EXISTING workbar generated- files pane so there is no second document viewer: clicking a recognizable workspace `.md` reference stages a one-shot preview request, opens the files tab (which never unmounts the transcript, keeping conversation scroll intact), and renders the file read-only through the shared text preview surface. Failures — missing/moved, outside-workspace, oversize — render as inline non-destructive notices; "Open locally" and "Reveal in folder" are explicit user actions forwarded to main-process shell wrappers over IPC. Adds en + zh-CN copy for the new surface. Generated-by: pi
|
Closing to re-create this PR from my personal account (nitishagar) with a corrected branch name — no code changes. |
Astro-Han
reviewed
Aug 26, 2026
Astro-Han
left a comment
Contributor
There was a problem hiding this comment.
I reviewed this head and found no blocking issues.
Makes transcript Markdown file references openable via additive file-ref kind, main-side realpath sandboxed open/reveal (1MB, md only, no file://), hosted fallback to non-destructive notice.
No P0-P3. Note: exact head currently has no hosted checks — needs CI green before merge.
简体中文
该头无阻断,待 CI。Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
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.
Summary
Markdown file references in session transcripts (e.g.
[Guide](docs/notes.md),including percent-encoded space/CJK spellings) were rendered inert. They are now
actionable in Desktop: clicking stages a preview request and opens the workbar
generated-files tab, where the file is shown read-only through the existing
artifact text viewer — no second document viewer. The pane header offers two
explicit user actions: "Open locally" and "Reveal in folder" (main-process shell).
Every failure mode (missing/moved, outside-workspace, oversize, unavailable)
renders as an inline, non-destructive notice; the conversation stays mounted with
its scroll position.
Trust model (unchanged boundaries):
@maka/uionly gains an additivefile-refdestination kind carrying the rawreference text; it never resolves paths, and links stay inert wherever no
dispatcher is installed (TUI/eval surfaces unchanged).
file://and all otherschemes remain excluded from this path.
session's Runtime Host workspace root via
@maka/runtime/path-containment(
isPathInsideover realpath'd root/canonical target):../traversal,out-of-root absolutes, and symlink escapes are rejected with typed errors;
reads are Markdown-only and size-capped.
shellwrappers; the external-linkguard and its closed allowlist are untouched.
workspace_unavailablefailures.Fixes #2664
Verification
workspace-file-refs-ipc-main.test.ts, 9 cases): inside-rootreads incl. raw space/CJK + percent-encoded refs;
../escape rejected;out-of-root absolute rejected; symlink escape rejected; missing → typed
not_found; non-Markdown/scheme/control-char refs rejected; size cap;open/reveal resolve through the same boundary check and never reach the shell
on refusal; remote-host and unknown-session failures.
@maka/uitests: recognition of relative/absolute/percent-encoded/CJKrefs; scheme rejection; actionable rendering only with a dispatcher installed;
inert rendering without one and for
file://.npm run lint,npm run format:check,npm run typecheck,npm --workspace @maka/ui test(234 pass), desktop main suite (1495 pass, incl. the workbar feature-boundary
tests),
npm run build,npx knip --workspace apps/desktop,npx knip --workspace packages/ui.status-check comment was posted before starting
(feat(desktop): make Markdown file references in sessions openable #2664 (comment)) and the
claimant had not replied nor opened a PR by the time this was filed.
AI use
Select exactly one:
Tool(s) and scope: implemented end-to-end by "pi" (coding agent); commits carry
Generated-by: pitrailers.Checklist
Does this PR entail a change in behavior?