Skip to content

fix: a dropped file types its path; the terminal answers a right-click (#16) - #17

Merged
Maxaubert merged 1 commit into
mainfrom
fix/16-drop-types-path
Sep 19, 2026
Merged

Maxaubert merged 1 commit into
mainfrom
fix/16-drop-types-path

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Closes #16.

The bug, and the false claim

Dropping a file on the terminal did nothing, and the terminal had no right-click menu. In Prism both live in TermDock.tsx, the split dock; when the dock was stripped to make this app, the drop handler and the menu went with it. quotePaths, pasteInto and any terminal onDrop had ZERO callers outside lib/.

The owner had chosen to keep "Find, paste and drop", and the README, the spec and PR #3 all listed "a file dropped on the window types its path" as shipped. It was never tested, so the claim was false for a day. Found by the sync mapping for #15.

The fix

On App's terminal host (data-term-host):

  • Drop: the dropped files' paths are typed at the cursor through quotePaths and termInput, quoted as the paste rule quotes copied files, and NEVER followed by Enter. Only over a shell (the start screen and Settings have nothing to type into). Counts as typing, so its echo is not scored as the agent working.
  • Right-click: Paste (the terminal's own paste rule via pasteInto: an image forwards the keystroke to the agent, files become quoted paths, text is a bracketed paste), Find in scrollback, Close tab. No Copy row: xterm owns its selection, and Ctrl+C over one already copies.

Verification

  • New e2e scenario dropAndMenu performs a REAL drop with Chromium's own drag events (Input.dispatchDragEvent carrying a file path), since a synthetic DataTransfer holds a File with no path and would prove nothing about getPathForFile. It asserts the path is typed, that it is quoted (the file is named my notes.txt), that nothing ran, that the menu has its three rows and that Find opens the bar.
    • Against the OLD code: FAIL a file dropped on the terminal types its path, FAIL the terminal answers a right-click (null).
    • With the fix: 5 of 5 pass.
  • npm run typecheck: clean. npm run lint: 0 errors. npm test: 355 pass. npm run e2e: 13 scenarios pass.
  • Packaged and installed on this machine; exe timestamp polled (08:40:50 -> 09:58:32).

Lesson written into CLAUDE.md

Nothing in a feature list is true until a test has done it, and when a Prism component is stripped, grep what ELSE it owned before calling a feature kept.

Notes

🤖 Generated with Claude Code

…wers a right-click (#16)

Both lived in Prism's split dock and went with it when the dock was stripped,
while the README and the spec went on listing the drop as shipped. They are on
App's terminal host now: the drop goes through quotePaths and termInput and never
presses Enter; the menu is Paste, Find in scrollback and Close tab. The e2e
performs a real drop with Chromium's drag events and fails on the old code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Maxaubert
Maxaubert merged commit 24b6b79 into main Sep 19, 2026
1 check passed
@Maxaubert
Maxaubert deleted the fix/16-drop-types-path branch September 19, 2026 14:12
Maxaubert added a commit that referenced this pull request Sep 25, 2026
…ns, what is on disk (#67) (#68)

- Paste is sanitised: no ESC or control can end the bracketed paste (#1).
- Windows tools are started by full path; main leaves its launch folder (#3).
- Paths are quoted for the shell they go to; cd quoting is complete (#5, #7).
- The updater installs main's own offer only, pre-answers the close at the
  quit, hears a failed handoff and removes its temp folder (#14, #15, #19).
- tabs.json and window.json are written atomically (#18).
- Command-line paths resolve against the typing folder; a drive root works
  (#16, #17). The DWM helper's stdin errors are heard (#13).
- The review and the three-PR plan are in docs/.


Claude-Session: https://claude.ai/code/session_01LJbePcRzre7AusNzPNS2Bk

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Sep 25, 2026
…ns, what is on disk (#67) (#68)

- Paste is sanitised: no ESC or control can end the bracketed paste (#1).
- Windows tools are started by full path; main leaves its launch folder (#3).
- Paths are quoted for the shell they go to; cd quoting is complete (#5, #7).
- The updater installs main's own offer only, pre-answers the close at the
  quit, hears a failed handoff and removes its temp folder (#14, #15, #19).
- tabs.json and window.json are written atomically (#18).
- Command-line paths resolve against the typing folder; a drive root works
  (#16, #17). The DWM helper's stdin errors are heard (#13).
- The review and the three-PR plan are in docs/.


Claude-Session: https://claude.ai/code/session_01LJbePcRzre7AusNzPNS2Bk

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

A file dropped on the terminal does not type its path; the terminal has no right-click menu

1 participant