Repository navigation
fix(dashboard): offer the file manager only where the host has one - #23019
KiroCrewCaptain merged 1 commit into
Conversation
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level blocker: the reveal gate now sits on a host fact the launcher also checks, so the menu and the click give the same answer. Notes
[DESIGN-REVIEWED] 6178832 Description read[DESCRIPTION-READ] 39383233620d5d44bdc67d57461e81ae555a4a20d1fce0456a2dda628048ff9f 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 |
UX Review (Opus 5.5, fork) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the new Shift+click copy state and the Office card's new launch-failure notice. No supplied screenshot shows either one. The context-menu changes are shown, but no first-time reader has seen them, because this fork lane has no blind read. Evidence gaps
Notes
[UX-REVIEWED] 6178832 Description read[DESCRIPTION-READ] 427092dcd11e2781ad0fd73b74b7f2c885096a3a2d77317ce943fca5f6fec6ed That sha256 names everything this verdict read: the PR description, plus the 9 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 |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The changes stay within the Goal and fix the cause: the reveal gate now asks whether the host can open a file manager, not just whether the browser is local. One platform premise is unconfirmed. Notes
What this change shipsInventory (9 items) — 7 justifiedIntent: stop offering native file-manager actions on a gateway host that cannot open one, and say so when a reveal can only copy. FIX.
[FIRST-PRINCIPLES-REVIEWED] 6178832 Description read[DESCRIPTION-READ] 672dbd4850676e84447ac5b982909fb7f967747c1966d35917f1e55e95116702 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)Reviewed Opus 5.5 adjudication downgraded every blocking finding. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents. Review detailsBLOCKING -- website/src/components/markdown/InlineCode.tsx:717 -- Separate copy states preserve success after the latest copy fails
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 — LOW harm. Every condition checks out. The two chips each call Recovery: the stale "Copied!" clears itself when the The real fix costs more than that. It means merging the two instances into one shared state whose |
bolichen97
left a comment
There was a problem hiding this comment.
I reviewed head d9aa504 and found nothing to change.
What I checked:
desktop_launcher_availabletests the same literal launcher each platform spawned before, in the same platform order. Both hand-offs now return False through it before any spawn. The spawn argv, the sensitive path check and every/api/revealanswer are unchanged.GET /api/dashboard/brandingstays behind the dashboard token gate. The new field is a stat of a fixed system path, run in a worker thread.- Every surface that gated reveal on
directLocalalone now readsuseCanReveal.useCanOpenFilebuilds on it, so Windows still hides Open and keeps Reveal. revealOrOpenlost its return flags. Its only reader wasuseCopyAck, which the diff updates.- I ran
test/test_reveal_in_file_manager.py,test/test_dashboard_branding.py,test/test_platform_compat_refactor_facade.pyandtest/test_dashboard_handlers_core_coverage.pyat this head: 718 passed.
Not approving yet. These maintainer checks remain: the readiness label is still checking, several backend and E2E jobs are pending, and the Opus 5.5 review job ended without a verdict for this commit. The change also spans more than 20 files, so a maintainer gives the final approval.
One behavior note, not a blocker: with no in-app opener wired (for example a path chip in a user message), a plain click on a remote or launcher-less session still asks the gateway for a reveal. It now shows the "copied instead" notice where it used to copy silently. The notice is accurate. If you prefer that click to copy in the browser, as Shift+click now does, that can be a follow-up.
d9aa504 to
94e4b8b
Compare
|
Two
The Goal line, |
bolichen97
left a comment
There was a problem hiding this comment.
Thanks for the follow up push. I read the change since my last pass: the new Linux desktop session check in desktop_launcher_available (DISPLAY or WAYLAND_DISPLAY), the matching early return in both launchers, the reworded docs and comments, and the new tests.
The new check is sound. _reveal_env copies the gateway's own environment and only pins PATH, so the variable this reads is the same one xdg-open would inherit, and the branding answer and the click still agree. macOS and Windows paths are unchanged. Locally, with no display variable set, test/test_reveal_in_file_manager.py and test/test_dashboard_branding.py pass on this head.
One thing blocks merge, and it is small: the new autouse fixture in test/test_reveal_in_file_manager.py requests the shared monkeypatch. The repo rule against that shape is blocking, and the required SAST (Semgrep) check fails on this exact line with test-autouse-shared-monkeypatch. The GPT lane raised the same point. Details and a two line fix are inline.
Once that lands and the remaining checks finish, this looks good to me. Approval stays with a maintainer because the PR touches more than 20 files.
Reviewed head: 94e4b8b
|
|
||
| class TestRevealInFileManager: | ||
| @pytest.fixture(autouse=True) | ||
| def _a_desktop_session(self, monkeypatch: pytest.MonkeyPatch) -> None: |
There was a problem hiding this comment.
The new autouse fixture patches through the shared monkeypatch, which the repo forbids and Semgrep now fails on.
_a_desktop_session is autouse and takes monkeypatch, the same instance each test in the class receives. Any test that later calls monkeypatch.undo() would also drop this fixture's DISPLAY pin, and the Linux tests would then read whatever the runner has. That is the shape the D11 rule in AUTOSDE.yaml (item 12, newly added autouse fixture requesting the shared monkeypatch) marks as blocking, and the required SAST (Semgrep) check fails here with semgrep.kirocrew.test-autouse-shared-monkeypatch.
@pytest.fixture(autouse=True)
def _a_desktop_session(self, monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("DISPLAY", ":0")
monkeypatch.delenv("WAYLAND_DISPLAY", raising=False)Suggestion: request the floor's own instance for the fixture. The monkeypatch override in conftest.py is ordered after _floor_monkeypatch, so the per test setenv and delenv calls in this class still override it and are undone first.
@pytest.fixture(autouse=True)
def _a_desktop_session(self, _floor_monkeypatch: pytest.MonkeyPatch) -> None:
_floor_monkeypatch.setenv("DISPLAY", ":0")
_floor_monkeypatch.delenv("WAYLAND_DISPLAY", raising=False)Rule: tests are deterministic (D11, autouse fixtures use _floor_monkeypatch).
There was a problem hiding this comment.
Fixed in 2044101: _a_desktop_session now requests _floor_monkeypatch and patches through it, as you suggested. The per-test monkeypatch calls in this class still override it and unwind first. Semgrep with the CI configs reports 0 findings against the rebased base. test/test_reveal_in_file_manager.py, test/test_dashboard_branding.py and test/test_host_isolation_floor.py pass locally.
94e4b8b to
2044101
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Thanks for the quick fix. I read the change since my last pass on 94e4b8b: apart from the rebase onto main, the only change in the PR content is the autouse fixture in test/test_reveal_in_file_manager.py, which now requests _floor_monkeypatch for both the DISPLAY pin and the WAYLAND_DISPLAY removal. That resolves the point I raised last time, and the per test monkeypatch overrides in the class still unwind first because the monkeypatch override in conftest.py depends on _floor_monkeypatch.
What I verified on this head:
- The required SAST (Semgrep) check passes; the
test-autouse-shared-monkeypatchfailure is gone. - With no display variable set,
test/test_reveal_in_file_manager.pyandtest/test_dashboard_branding.pypass locally (43 passed). - The previous GPT lane blocking finding was about this same fixture and no longer applies. The GPT lane run on this head ended as review incomplete, so its sticky comment still shows the older head; a rerun should clear it.
Still open before merge: the GPT lane rerun, the Opus lane on this head, and the lint, type check and desktop build jobs that are still running. The code itself looks good to me. Approval stays with a maintainer because the PR touches more than 20 files.
Reviewed head: 2044101
|
Could a maintainer re-run these two on 2044101? Both failed on infrastructure, not on the diff.
|
2044101 to
1999cc6
Compare
A browser behind an ssh -L tunnel reaches the gateway as direct-local, so a path chip's menu offered "Show in file manager" even when the gateway host was a headless Linux box. There /api/reveal can only answer the clipboard fallback, and the menu then flipped its Copy row to "Path copied", so the reveal row read as if it were wired to Copy. The branding payload now reports desktop_launcher: whether this host can open a file manager right now, meaning its launcher is present and, on Linux, the gateway's own environment names a display server. The reveal and open launchers ask the same function, and every reveal/open surface gates on it beside direct_local. A path chip's Shift+click copies the path where no reveal can land, as its hint says. When a copy still comes back (a launcher that did not start), revealOrOpen writes it and says so in the caller's notice instead of passing it off as the action.
1999cc6 to
6178832
Compare
|
A maintainer rebased this branch onto current main as 6178832 and resolved the one conflict, in |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed at 6178832.
This head is a rebase onto current main. I compared it with the head I last reviewed: the change's own hunks are the same, and only context lines moved where main had edited the same doc paragraphs and the open_with_default_app signature (wait_for_exit). The rebase keeps main's version of both.
I read every changed hunk at this head:
desktop_launcher_availablechecks only fixed system paths (/usr/bin/open,C:\Windows\explorer.exe,/usr/bin/xdg-open) and, on Linux,DISPLAYorWAYLAND_DISPLAY. Both launchers call it first, so the menu and the click give the same answer. The spawned command lines and_reveal_envare unchanged./api/dashboard/brandingadds one boolean, computed in a worker thread. No request input decides it.- The front end gates every reveal and open surface on
useCanReveal. A copy made in place of an open is now reported through the error notice instead of the Copy row's label. Shift+click on a chip that cannot reveal copies the path without its line suffix, as the hint says. - Tests, locale strings, specs and screenshots match the code.
Security checklist at this head: auth/authz no change; no new input parsing; no trust boundary widened (the server side direct-local gate on /api/reveal is unchanged, and the new flag only hides actions); no sandbox change; no approval gate change; no secret handling. The change can only make the reveal refuse more often, never less.
Good to ship. All AI review lanes pass on this head. 54 files, every hunk read. I will approve once the remaining Backend Tests shards and PR Readiness finish green on this head.
bolichen97
left a comment
There was a problem hiding this comment.
Approving at 6178832.
This head is a rebase onto current main. I compared it with the head I last reviewed: the change's own hunks are the same, and only context lines moved where main had edited the same doc paragraphs and the open_with_default_app signature (wait_for_exit). The doc paragraphs keep main's text; in open_with_default_app the resolution keeps both main's wait_for_exit and this PR's early desktop_launcher_available() check.
I read every changed hunk at this head:
desktop_launcher_availablechecks only fixed system paths (/usr/bin/open,C:\Windows\explorer.exe,/usr/bin/xdg-open) and, on Linux,DISPLAYorWAYLAND_DISPLAY. Both launchers call it first, so the menu and the click give the same answer. The spawned command lines and_reveal_envare unchanged./api/dashboard/brandingadds one boolean, computed in a worker thread. No request input decides it.- The front end gates every reveal and open surface on
useCanReveal. A copy made in place of an open is now reported through the error notice instead of the Copy row's label. Shift+click on a chip that cannot reveal copies the path without its line suffix, as the hint says. - Tests, locale strings, specs and screenshots match the code.
Security checklist at this head: auth/authz no change; no new input parsing; no trust boundary widened (the server side direct-local gate on /api/reveal is unchanged, and the new flag only hides actions); no sandbox change; no approval gate change; no secret handling. The change can only make the reveal refuse more often, never less.
All AI review lanes pass on this head, and CI and readiness are green. 54 files, every hunk read.
bolichen97
left a comment
There was a problem hiding this comment.
Approving at 6178832.
This head is a rebase onto current main. I compared it with the head I last reviewed: the change's own hunks are the same, and only context lines moved where main had edited the same doc paragraphs and the open_with_default_app signature (wait_for_exit). The rebase keeps main's version of both.
I read every changed hunk at this head:
desktop_launcher_availablechecks only fixed system paths (/usr/bin/open,C:\Windows\explorer.exe,/usr/bin/xdg-open) and, on Linux,DISPLAYorWAYLAND_DISPLAY. Both launchers call it first, so the menu and the click give the same answer. The spawned command lines and_reveal_envare unchanged./api/dashboard/brandingadds one boolean, computed in a worker thread. No request input decides it.- The front end gates every reveal and open surface on
useCanReveal. A copy made in place of an open is now reported through the error notice instead of the Copy row's label. Shift+click on a chip that cannot reveal copies the path without its line suffix, as the hint says. - Tests, locale strings, specs and screenshots match the code.
Security checklist at this head: auth/authz no change; no new input parsing; no trust boundary widened (the server side direct-local gate on /api/reveal is unchanged, and the new flag only hides actions); no sandbox change; no approval gate change; no secret handling. The change can only make the reveal refuse more often, never less.
All AI review lanes pass on this head, and CI and readiness are green. 54 files, every hunk read.
bolichen97
left a comment
There was a problem hiding this comment.
Approving at 6178832.
This head is a rebase onto current main. I compared it with the head I last reviewed: the change's own hunks are the same, and only context lines moved where main had edited the same doc paragraphs and the open_with_default_app signature (wait_for_exit). The rebase keeps main's version of both.
I read every changed hunk at this head:
desktop_launcher_availablechecks only fixed system paths (/usr/bin/open,C:\Windows\explorer.exe,/usr/bin/xdg-open) and, on Linux,DISPLAYorWAYLAND_DISPLAY. Both launchers call it first, so the menu and the click give the same answer. The spawned command lines and_reveal_envare unchanged./api/dashboard/brandingadds one boolean, computed in a worker thread. No request input decides it.- The front end gates every reveal and open surface on
useCanReveal. A copy made in place of an open is now reported through the error notice instead of the Copy row's label. Shift+click on a chip that cannot reveal copies the path without its line suffix, as the hint says. - Tests, locale strings, specs and screenshots match the code.
Security checklist at this head: auth/authz no change; no new input parsing; no trust boundary widened (the server side direct-local gate on /api/reveal is unchanged, and the new flag only hides actions); no sandbox change; no approval gate change; no secret handling. The change can only make the reveal refuse more often, never less.
All AI review lanes pass on this head, and CI and readiness are green. 54 files, every hunk read.
|
Hold at 6178832 for one unanswered current-head AI concern. The headless fix is sound. Unanswered, and I could not settle it from the code:
To clear: confirm on a Linux desktop with the service installed that reveal worked before and still works. If it no longer does, keep the display check in the dashboard answer only, as First Principles suggests, or accept another session signal. AI findings judged non-blocking
— crew-pr-reviewer (r136) |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Lanes pass on 6178832, checks green, no conflict, no open change request.
|
On the hold above: the code bears it out. The installed Linux service is a system unit with no display variable, so under it this check hides reveal and open on a GNOME desktop. #30083 fixes it: when the gateway's own environment names no display, the session comes from the user's systemd manager, and a headless host stays hidden. |
…rvice The installed Linux service is a system unit, so the gateway's own environment never names a display server. Since kirodotdev#23019 that hid "Show in file manager" and "Open with default app" on every Linux desktop running the service, including GNOME, where xdg-open used to reach Nautilus over the session bus. When the gateway's own environment names no display, ask the user's systemd manager (`systemctl --user show-environment`, 2 s timeout, answer kept for 30 s). Copy only DISPLAY, WAYLAND_DISPLAY, XAUTHORITY, XDG_CURRENT_DESKTOP and KDE_SESSION_VERSION, each passing a plain character check, and count a display only while its socket exists, checked again on every use of a kept answer. A reachable session bus alone is not a desktop, so a headless host stays hidden and refused. The open action asks before its stat-and-launch transaction, so no spawn lands inside it. Closes kirodotdev#30026
…rvice The installed Linux service is a system unit, so the gateway's own environment never names a display server. Since kirodotdev#23019 that hid "Show in file manager" and "Open with default app" on every Linux desktop running the service, including GNOME, where xdg-open used to reach Nautilus over the session bus. When the gateway's own environment names no display, ask the user's systemd manager (`systemctl --user show-environment`, 2 s timeout, answer kept for 30 s), run with the environment `systemctl_user_env` gives every `systemctl --user` spawn. Copy only DISPLAY, WAYLAND_DISPLAY, XAUTHORITY, XDG_CURRENT_DESKTOP and KDE_SESSION_VERSION, each passing a plain character check, and count a display only while its socket exists, checked again on every use of a kept answer. The launcher gets them on top of the same session-bus pointers. A reachable session bus alone is not a desktop, so a headless host stays hidden and refused. The open action asks before its stat-and-launch transaction, so no spawn lands inside it. Closes kirodotdev#30026
…rvice (#30083) The installed Linux service is a system unit, so the gateway's own environment never names a display server. Since #23019 that hid "Show in file manager" and "Open with default app" on every Linux desktop running the service, including GNOME, where xdg-open used to reach Nautilus over the session bus. When the gateway's own environment names no display, ask the user's systemd manager (`systemctl --user show-environment`, 2 s timeout, answer kept for 30 s), run with the environment `systemctl_user_env` gives every `systemctl --user` spawn. Copy only DISPLAY, WAYLAND_DISPLAY, XAUTHORITY, XDG_CURRENT_DESKTOP and KDE_SESSION_VERSION, each passing a plain character check, and count a display only while its socket exists, checked again on every use of a kept answer. The launcher gets them on top of the same session-bus pointers. A reachable session bus alone is not a desktop, so a headless host stays hidden and refused. The open action asks before its stat-and-launch transaction, so no spawn lands inside it. Closes #30026
…rvice (#30083) The installed Linux service is a system unit, so the gateway's own environment never names a display server. Since #23019 that hid "Show in file manager" and "Open with default app" on every Linux desktop running the service, including GNOME, where xdg-open used to reach Nautilus over the session bus. When the gateway's own environment names no display, ask the user's systemd manager (`systemctl --user show-environment`, 2 s timeout, answer kept for 30 s), run with the environment `systemctl_user_env` gives every `systemctl --user` spawn. Copy only DISPLAY, WAYLAND_DISPLAY, XAUTHORITY, XDG_CURRENT_DESKTOP and KDE_SESSION_VERSION, each passing a plain character check, and count a display only while its socket exists, checked again on every use of a kept answer. The launcher gets them on top of the same session-bus pointers. A reachable session bus alone is not a desktop, so a headless host stays hidden and refused. The open action asks before its stat-and-launch transaction, so no spawn lands inside it. Closes #30026 (cherry picked from commit 1b8a195)
Problem / Motivation
Goal: On a gateway host that has no file manager to open, the dashboard stops offering "Show in file manager" and "Open with default app", and a reveal that still ends in a copy says so instead of passing for the action.
A path chip's right-click menu offers "Show in file manager" in a dashboard opened from a laptop browser against a remote headless Linux gateway, reached through an
ssh -Ltunnel. Choosing it opens nothing; the path lands on the clipboard and the menu's second row flips to "Path copied" with a check mark, so the row reads as if it were wired to Copy. A folder named in a user message shows exactly that two-row menu.Why it matters
Viewing a gateway on a remote Linux machine through an SSH tunnel is a common way to run the dashboard. Every reveal and open there could only copy, so the menu offered actions that can never work on that host and then acknowledged the copy as if the user had chosen Copy. It reads as broken wiring and teaches people not to trust the menu's labels.
Not a goal
/api/reveal's own checks or the shape of its answers, the direct-local check, or the desktop shell's own reveal handlers.What changed (motivation → approach → change)
Reproduced on
main3d6cda4, with synthetic paths under/tmpand/home/user/project, on a headless Linux host (no/usr/bin/xdg-open, noDISPLAYorWAYLAND_DISPLAY):branding.direct_localPOST /api/reveal(reveal, then open)127.0.0.1(what anssh -Ltunnel looks like)true200 {"ok": true, "copy": "<path>"}, SELsuccessX-Forwarded-Forset)false200 {"ok": true, "copy": "<path>"}, SELdenied/remote_requestServer rows: the real
api_brandingandapi_reveal_pathhandlers in-process, with the real locality check and launcher. UI rows: the real built SPA with/api/**answered the same way (website/scripts/capture-reveal-headless-host.mjs). The row made exactly one/api/revealcall withaction: "reveal", so nothing was mis-wired.Root cause. The native rows were gated on
directLocalalone. That says the request came from loopback, not that the host can open a file manager;origin.pydocuments that anssh -Lpeer is indistinguishable from a local browser. On a host with no launcher every reveal and open could only degrade to a clipboard copy, which the menu acknowledged with the Copy row's own "Path copied".Change.
desktop_launcher_available()(platform_compat_trust.py, re-exported byplatform_compat.py) says whether this host can open a file manager right now: the launcher the hand-offs start is present (/usr/bin/open,C:\Windows\explorer.exe,/usr/bin/xdg-open), and on Linux the gateway's own environment names a desktop session (DISPLAYorWAYLAND_DISPLAY). No request input decides it.reveal_in_file_managerandopen_with_default_appask it before spawning, so the dashboard and a click cannot drift: a Linux host with no session gets the copy answer a host with no launcher gets. The spawn lines (literal absolute launchers, the path as an argv element, no shell), the sensitive-path check,..rejection and the direct-local gate are unchanged.GET /api/dashboard/brandingaddsdesktop_launcher, read in a worker thread, behind the dashboard token gate as before.api/client/themes.tstypes it;useBranding.tsxexposes it asdesktopLauncher,falsewhen absent.useCanReveal()(directLocal && desktopLauncher) anduseCanOpenFile()are the one SPA gate, read by every reveal/open surface: the path-chip and breadcrumb menu, both file overflows, the folder and project panel buttons, the deck viewer and the Office card. On a host that can't open a file manager they look as they already do for a remote viewer: in-app rows where wired, plus Copy path or Download. That is the conventionFilePathMenu.tsxdocuments for a remote viewer, a Windows open and a directory open (hide a native row that can never perform); those gates and "Open in side panel" are unchanged.:line) in the browser and confirms "Copied!", as Ctrl/Cmd+click does, instead of asking the gateway for a reveal that could only come back as a copy. Its hover hint says "Shift+click to copy path" there.copyanswer still arrives (a launcher present but failing to start),revealOrOpenwrites it and says so in the caller's notice: "Couldn’t open this path on the machine running Kiro Crew, so it was copied instead." If the write fails too, it reports the plainreveal_failedwording. Nothing relabels Copy or Open as "Path copied", andrevealOrOpendrops the{ copied, copyFailed }flags that relabel used.components.filePathMenu.reveal_copied_insteadinlocales/en.jsonand all 11 translations,en-XA.jsonregenerated. Specs:learn-cron-dashboard.md,side.md,platform-compat.md.Backwards compatibility
Compatible: nothing is renamed or removed from the wire.
/api/revealkeeps its checks and answer shapes. On a Linux host with no desktop session it gives its copy answer instead of startingxdg-openwith no session to open into.desktop_launcheris a new branding field the SPA reads asfalsewhen absent.The diff hides controls on one host shape (direct-local, but unable to open a file manager) and drops a return value, so the readers:
Reader: website/src/components/FilePathMenu.tsx:FilePathMenuItems -- chat -- FilePathMenu.test.tsx "a direct-local session whose gateway host has no desktop launcher"; FilePathMenu.inApp.test.tsx "a direct-local session on a host with no desktop launcher keeps only the in-app rows and Copy path"
Reader: website/src/components/FilePathMenu.tsx:useCopyAck (the only reader of revealOrOpen's removed flags) -- chat -- FilePathMenu.test.tsx "a reveal or open the host could only answer with a copy"
Reader: website/src/components/markdown/InlineCode.tsx:InlineCode -- chat -- MarkdownRenderer.contextmenu.test.tsx "on a direct-local session whose gateway host has no desktop launcher"
Reader: website/src/components/MarkdownPanelHeader.tsx:OverflowMenu -- chat -- MarkdownPanel.test.tsx "hides both desktop hand-off entries when the gateway host has no desktop launcher"
Reader: website/src/components/FileRenderers.tsx:OfficeViewer -- chat -- FileRenderers.test.tsx "hides Open on a direct-local session whose gateway host has no desktop launcher"
Reader: website/src/pages/chat/FolderPanel.tsx:FolderPanel -- chat -- FolderPanel.test.tsx "hides the reveal button when the gateway host has no desktop launcher"
Reader: website/src/pages/chat/FilesHomePanel.tsx:FilesHomePanel -- chat -- FilesHomePanel.test.tsx "hides the reveal action when the gateway host has no desktop launcher"
Reader: website/src/apps/file-explorer/FileViewer.tsx:FileViewer -- app -- FileExplorerPageCoverage.test.tsx "FileExplorerPage reveal"
Reader: website/src/apps/pptx-maker/DeckViewer.tsx:DeckViewer -- app -- PptxDeckViewerCov80.test.tsx "hides the reveal action when the gateway host has no desktop launcher"
Reader: website/src/pages/chat/ChatPageMessageContent.tsx:DirChip -- chat -- routes Shift+click through revealOrOpen, which names a copy instead of making it silently; ChatPageW3Coverage.test.tsx
Reader: src/kiro_crew/dashboard/file_api/desktop.py:api_reveal_path -- chat -- a launcher that declines, as both do on a Linux host with no desktop session, gets the copy answer it always got; test_reveal_path.py "test_reveal_local_headless_returns_no_desktop_copy"
Tests
The production hunks were reverted under the new tests: 17 backend and 21 frontend cases went red, and all went green again once the hunks were restored. Every case below is one of them, except the guard marked as such.
Proof: not provable -- other: prove.py stops at "corrupt patch" because its production diff carries this PR's six screenshot PNGs as raw bytes, so the hunks were reverted by hand as above
A host that can't open a file manager hides both rows:
test/test_reveal_in_file_manager.py:desktop_launcher_availablechecks exactly the launcher each platform spawns; on Linux it also needsDISPLAYorWAYLAND_DISPLAY, and macOS needs neither; with no launcher, or no session, neither hand-off spawns.test/test_dashboard_branding.py: branding reportsdesktop_launcherfrom the host, andfalsefor a Linux host withxdg-openbut no session.FilePathMenu.test.tsx: no native rows there, for a file and for a directory (the reported two-row menu is now["Copy path"]);FilePathMenu.inApp.test.tsxkeeps the in-app rows.MarkdownRenderer.contextmenu.test.tsx: a directory chip menu offers only Copy path; the hover promises a copy; Shift+click copies the path without its line, asks the gateway nothing, and confirms "Copied!".FileRenderers.test.tsx,MarkdownPanel.test.tsx,FolderPanel.test.tsx,FilesHomePanel.test.tsx,PptxDeckViewerCov80.test.tsx,FileExplorerPageCoverage.test.tsx: each surface hides its control there.A host that can open one shows them:
useBrandingDirectLocal.test.tsx:desktop_launchermaps through, and absent or not yet loaded reads asfalse.FilePathMenu.test.tsx"keeps both native rows on a direct-local host that can open a file manager". This is the guard against hiding too much; it passes onmaintoo.directLocal, so the desktop cases keep exercising the rows.A launch that fails says so in plain words:
FilePathMenu.test.tsx: a copy answer to a reveal or an open is named in the notice and leaves the Copy row alone; a failed write reports the plain failure; a reveal that opened says nothing.apiRevealPath.test.ts:revealOrOpenwrites and reports a copy answer, and reports the plain failure when the write fails.MarkdownPanel.test.tsx,FileExplorerPageCoverage.test.tsxandFileRenderers.test.tsx: the two overflows and the Office card name a copy answer in place.Manual verification
127.0.0.1on this headless host for setups (a) and (b), with the results in the table above. On the same host with this branch,desktop_launcher_available()answersFalsewith no session and withDISPLAY=:0(noxdg-openinstalled), andreveal_in_file_managerspawns nothing.website/scripts/capture-reveal-headless-host.mjs, using the real built SPA on a loopback static server (ephemeral port, closed after each run) with/api/**answered as the handler answers. I ran it once against themainbuild and three times against this branch (SCENARIO=headless,launch-failed,desktop). With a launcher present and working, the menu, the click and the clipboard are unchanged frommain.gates[], the repo semgrep rules plus CI's registry packs (diff-scoped, 0 new findings),npm run i18n:checkwith a base ref. Every gate passes except the backend related-tests gate, whose failures on this host fail the same way onmain.Screenshots / video
All data is synthetic. Committed under
temp-screenshots/reveal-headless-host/(fork PR).Before (
main, headless direct-local host), the folder chip in a user message, then the same menu after choosing "Show in file manager":After, same host: the user-message folder chip, then a folder chip in the assistant reply, whose bubble wires the side panel:
A host whose launcher fails to start, and a desktop host (unchanged)
Related Issues
Related: #9411 (closed by #19121, which added the in-app rows), #22857 and #11338 (remote file actions), #15600 (a Files-pane preview's chip hint).
Sibling sweep
Swept: git grep -nE "directLocal|isLocal\b|revealPath|/api/reveal" -- website/src, and git grep -nE "reveal_in_file_manager|open_with_default_app" -- src
Sibling: website/src/components/FilePathMenu.tsx:174 -- changed here
Sibling: src/kiro_crew/platform_compat_trust.py:810 -- changed here
Sibling: website/src/components/library/LibraryTable.tsx:593 -- tracked in #11338
Sibling: website/src/pages/chat/FilesHomePanel.tsx:101 -- not affected -- a failed external-terminal launch shows the side panel's fallback note and opens the in-app terminal
Sibling: website/src/pages/settings/DisplayPanel.tsx:357 -- not affected -- it only turns on the same external-terminal launch, which has that fallback
Sibling: website/src/components/CrashReportNotice.tsx:63 -- not affected -- the desktop shell reveals its own crash folder; a plain browser has no bridge, so the action is absent
Pattern harvest
Rule candidate: review-prompt
Pattern: a UI control whose backend can only fall back to a different action is gated on who is asking (
directLocal) but not on whether the host can perform it, and it acknowledges the fallback with another control's own confirmation.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.