Skip to content

feat(website): add in-app open rows to the file-path menu - #19121

Merged
cruisercohen merged 2 commits into
mainfrom
fix/9411-path-chip-in-app-actions
Oct 12, 2026
Merged

cruisercohen merged 2 commits into
mainfrom
fix/9411-path-chip-in-app-actions

Conversation

@cruisercohen

@cruisercohen cruisercohen commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A dashboard user on any machine can act on a path chip from its right-click menu and see the result on their own screen.

On a dashboard opened from a different machine than the gateway, the path-chip menu's native rows ("Show in file manager", "Open with default app") act on the gateway host. A remote viewer is offered nothing that works where they are looking. Through a plain ssh -L tunnel the gateway treats the browser as local, so a launcher opens on the remote machine and the click looks dead.

Why it matters

Running the gateway on a remote or headless host and using the dashboard from a laptop is a common setup. In that setup every row of the path menu either does nothing visible or copies a path that does not exist on the viewer's machine. The in-app side panel can already open the file or folder, but the menu never offers it.

Not a goal

  • Detecting whether the browser shares a machine with the gateway, or changing the locality gate that authorises native openers on the gateway host.
  • A user preference that swaps native rows for in-app rows.
  • Downloading a remote file and opening a local copy in a desktop app.
  • Any backend change.

What changed (motivation → approach → change)

  • Motivation: the menu's only actions run on the gateway host, and the browser cannot reliably tell whether that host is the one in front of the user.
  • Approach: keep every native row and its gate exactly as it is, and add in-app rows that need no locality decision. They reuse the handlers the chip's own click already uses, so they work in every deployment and cannot be silently wrong.
  • Change:
    • FilePathMenu accepts optional onFileOpen / onFolderOpen handlers. When the host passes them, the menu adds in-app rows as their own group above the native rows, behind a separator. Each row names what opens:
      • A file gets Open in side panel (the file, via onFileOpen) and Show folder in side panel (its containing folder as a side-panel folder tab, via onFolderOpen). The folder label leads with the folder, so it reads apart from "Open in side panel" and not as selecting the file in a listing.
      • A directory gets Open in side panel for the directory itself (as a folder tab, via onFolderOpen). It gets no parent-folder row, because two folder rows would leave the reader unsure which folder opens.
      • The containing folder is computed separator-aware, so Windows gateway paths work. A path with no parent folder gets no folder row.
    • Path chips (InlineCode) thread the renderer's handlers. "Open in side panel" goes through the same activation as a plain click, so a file:12 citation still lands on line 12. It duplicates the plain click on purpose. The issue's detection-free proposal asks for both in-app items in the menu, and the right-click menu is where a user looks after a click on the native rows appeared to do nothing.
    • The file tab header (MarkdownPanel → FileHeaderBreadcrumb) accepts onFolderOpen. The side panel wires it to its folder-tab opener. The file is already on screen there, so the header menu gets no "Open in side panel" row.
    • A renderer that passes no handlers (a surface with no side panel) keeps today's menu exactly.
    • New strings components.filePathMenu.open_in_side_panel / show_folder_in_side_panel in every locale, plus the regenerated pseudolocale.

Design summary

The design weighed three shapes:

  • A (chosen): detection-free, additive in-app rows. It touches no security or locality gate and reuses existing in-app actions. It removes the "every row is dead here" state in every deployment.
  • B (rejected): decide native vs in-app from a client-declared co-location signal or a user preference. That means changing or supplementing the gate that authorises spawning native openers on the gateway host, which is a security boundary. It would also need per-surface defaults so a browser on the gateway's own machine stays native.
  • C (rejected for this PR): download and open a local copy from the desktop shell. It is a new feature with its own temp-file lifecycle and file-type policy, complementary to A, and better as its own issue.

The issue also suggested treating a plain {ok: true} reveal response as a failure. That is not correct on current main: that response is the genuine local success case, so it is left alone.

Backwards compatibility

Compatible: the new props are optional, and with no handler passed the menu renders exactly the rows it renders today.

Removes nothing: the diff only adds optional props, menu rows and a separator before them. No existing row, gate, prop or string is removed, renamed or narrowed.

Tests

  • New FilePathMenu.inApp.test.tsx:
    • On a remote session, a file gets both in-app rows while the native rows stay hidden.
    • Selecting the rows calls onFileOpen with the file and onFolderOpen with its folder, and never calls the reveal endpoint.
    • A directory gets only "Open in side panel", which opens the directory itself, and gets no row when only a file opener is passed.
    • A Windows path's folder row opens C:\Users\me, and a path with no parent gets no folder row.
    • Each row appears only for the handler passed. With no handlers there are no new rows and no separator.
    • Native gating is unchanged:
      • Direct-local shows the native rows after the in-app group, with the separator between them.
      • A Windows gateway still hides "Open with default app".
    • Through MarkdownRenderer:
      • a file:12 chip opens with { line: 12 }
      • a file chip shows its containing folder
      • a directory chip opens itself
      • a renderer with no handlers keeps the native-only menu
    • 10 of these 14 cases fail against main's component code. The 4 that pass assert that a row is absent.
  • MarkdownPanel.test.tsx: the header breadcrumb menu offers "Show folder in side panel" (with no "Open in side panel" row), and stays native-only without a handler.
  • New sidePanelFileTabOpenFolder.test.tsx: the file tab's folder handler opens a focused folder:<dir> tab carrying the file tab's origin chat. It fails with the side-panel wiring reverted.
  • Run locally:
    • vitest on the final head over every path-menu, MarkdownPanel, SidePanel and MarkdownRenderer suite plus the suites that read the touched files' source (120 files, all green), and src/i18n (46 files, all green).
    • tsc -p tsconfig.app.json, and eslint on the touched files
    • npm run i18n:check (all checks ok), and npm run gen:ui (no index change)
    • the comment-history, brand-name, focus-cue and feature-map gates

Manual verification

Rendered the real MarkdownRenderer, FilePathMenu, MarkdownPanel and FolderPanel in the isolated path-chips capture entry. That entry mounts as a remote session (directLocal false). Right-clicked a file chip and a directory chip in dark and light themes, before and after the change.

For the header frames and the local-session frames only, a local, uncommitted edit to that entry did two things: it passed onFolderOpen to its panel scene, and it mounted the real branding provider with a seeded direct_local: true answer.

Before, both chip menus held only "Copy path". After:

  • On a remote session:
    • The file chip offers "Open in side panel", "Show folder in side panel", a separator, then "Copy path".
    • The directory chip offers "Open in side panel" and "Copy path".
    • The file tab header offers "Show folder in side panel" and "Copy path".
  • On a local session, the file chip offers the two in-app rows, the separator, then "Open with default app", "Show in file manager" and "Copy path". The header offers "Show folder in side panel", the separator, then the same native rows.

Not exercised: a click-through inside a live remote deployment; the handler calls it makes are covered by the tests above.

Screenshots / video

Before (main): remote session, file chip. Copy path is the only row.

before-file-dark

After: remote session, file chip, dark and light.

after-file-dark

after-file-light

After: local session, file chip. The in-app group sits above the native rows, which are unchanged.

after-file-local-dark

After: file tab header, remote and local. The red notices behind the menu come from the capture entry's stubbed backend, not from this change.

after-header-dark

after-header-local-dark

Where the folder row lands: the folder tab body (FolderPanel) the row opens, rendered for the folder that holds README.md.

after-folder-tab-dark

More frames

After: directory chip, remote session. "Open in side panel" opens the directory itself; there is no parent-folder row.

after-dir-dark

after-dir-light

Before (main): directory chip, remote session, Copy path only.

before-dir-dark

Related Issues

Fixes #9411

Related: #11345 (opens remote files in a local editor over ssh links), which is complementary.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable): N/A, no user docs describe this menu
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

A path chip's right-click menu offered only native actions that run on
the gateway host, so a dashboard viewed from another machine had no row
that did anything visible there. The menu now also offers "Open in side
panel" for a file and "Show in Files panel" for its containing folder
whenever the host passes the matching handler. Path chips thread the
renderer's handlers; the file tab header threads the side panel's
folder-tab opener. Native rows and their locality/Windows gates are
unchanged, and there is no backend change.

Fixes #9411
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 11, 2026
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of d2270d82bf2469014448d9495db65e1d48500dbd — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] d2270d8

Description read

[DESCRIPTION-READ] d28871bcba3a7e270258af36142c1800ad6dc2740010c89b8be2d989754c1a35

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of d2270d82bf2469014448d9495db65e1d48500dbd — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

On a path chip, "Open in side panel" does the same thing as left-clicking the chip. The folder rows are the only new capability here.

Not justified as shipped

  • Item 1 — duplicate of activatePath in website/src/components/markdown/pathReferences.ts:300: the description says it "duplicates the plain click on purpose". The new menu row calls activatePath(path, kind, false, actions, …), the same call a plain click makes. For a directory chip, that function already sends a plain click to onFolderOpen (line 320). 2 of 2 chip "Open in side panel" rows repeat the click. The reason given is that the menu "is where a user looks after a click on the native rows appeared to do nothing". No reported user is named.
    Subtraction: delete openFileFromMenu in InlineCode.tsx, and drop the openInPanel branch, which then has no callers.
    Clears when: a linked report shows a remote viewer who opened the menu but never tried the plain click.

What this change ships

Inventory (6 items) — 4 justified

Intent: a dashboard user on another machine can act on a path from its right-click menu and see the result on their own screen. ADDITION.

  1. Path-chip menu adds "Open in side panel" (file or directory). Duplicate of activatePath, which the chip's plain click already calls.
  2. File-chip menu adds "Show folder in side panel" (the containing folder). justified
  3. File tab header menu adds "Show folder in side panel". justified
  4. A separator now splits the in-app rows from the native rows. justified
  5. Two new strings in every locale, plus the regenerated pseudolocale. justified
  6. A folder tab opened from a file tab keeps that file tab's origin chat. Undeclared in the Goal sections; it is mentioned only in the Tests section.

[FIRST-PRINCIPLES-REVIEWED] d2270d8

Description read

[DESCRIPTION-READ] 46afcd1c28d25f801fee5d071e3f18b126f6ff6976cb658511d286ad4e2cace7

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of d2270d82bf2469014448d9495db65e1d48500dbd — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The blind reader could not tell which folder "Show folder in side panel" opens, or how "side panel" differs from "file manager".

Watch

  • "Show folder in side panel" doesn't say which folder. The string doesn't say it means the folder that contains the file. The blind reader read it correctly, but only "a guess", and wrote that "'folder' might mean this folder or the one above it" and "'Open' and 'Show' might do the same thing" (shots 2 and 4). In shot 4 the row also sits above "Show in file manager", which uses "Show" in a different sense. This is friction on every right-click of a file chip, though nothing fails.
  • "Side panel" and "file manager" don't say where each opens. Shot 4 puts "Open in side panel" / "Show folder in side panel" next to "Open with default app" / "Show in file manager". The reader said both "sound like a list of files… nothing in the menu says which is which." Local-session users see these four rows on every click. The separator is the only sign that one group stays in the app and the other opens on the computer.

Suggestions

  • Rename show_folder_in_side_panel to "Open containing folder in side panel". It names the folder and uses the same verb as the row above it.

[UX-REVIEWED] d2270d8

Description read

[DESCRIPTION-READ] bb15af6695da81e4849ebc913c7bab3fa32a67c4fbf41cdbc95b4541f22600af

That sha256 names everything this verdict read: the PR description, plus the 13 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed d2270d82bf2469014448d9495db65e1d48500dbd — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d2270d8

Verdict parsed from the review's SHA-scoped output markers for commit d2270d82bf2469014448d9495db65e1d48500dbd.

False positive or not applicable? A repository writer can comment:
/ai-review override fable d2270d82bf2469014448d9495db65e1d48500dbd: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of d2270d82bf2469014448d9495db65e1d48500dbd and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d2270d8

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d2270d82bf2469014448d9495db65e1d48500dbd: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 11, 2026
@cruisercohen
cruisercohen force-pushed the fix/9411-path-chip-in-app-actions branch from 911df85 to 6554e98 Compare October 11, 2026 16:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 11, 2026
"Show in Files panel" read as selecting the file inside a listing and
as a different place from "Open in side panel", and on a directory it
was unclear whether the directory or its parent opened. A directory now
gets "Open in side panel" for the directory itself, and a file gets
"Show folder in side panel" (key show_folder_in_side_panel, every
locale) for its folder. The in-app rows sit in their own group above
the native rows, behind a separator.
@cruisercohen
cruisercohen force-pushed the fix/9411-path-chip-in-app-actions branch from 6554e98 to d2270d8 Compare October 11, 2026 16:45
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 11, 2026
@cruisercohen
cruisercohen marked this pull request as ready for review October 11, 2026 17:09
@cruisercohen
cruisercohen requested review from a team and KiroCrewCaptain as code owners October 11, 2026 17:09
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 11, 2026
@cruisercohen
cruisercohen enabled auto-merge (squash) October 11, 2026 17:10

@bolichen97 bolichen97 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.

Approved at head d2270d8: PR Readiness is green, no open change requests, and the review lanes passed. (AI-assisted review at bolichen97's request.)

@cruisercohen
cruisercohen merged commit e8d44ae into main Oct 12, 2026
104 checks passed
@cruisercohen
cruisercohen deleted the fix/9411-path-chip-in-app-actions branch October 12, 2026 04:59
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 12, 2026
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.

Remote dashboard: native path-chip actions fail silently; should fall back to the in-app side panel

2 participants