Skip to content

Paste project paths into the agent launcher - #27

Merged
howdeploy merged 1 commit into
howdeploy:mainfrom
TroopJostle:feat/launcher-paste-project-path
Sep 5, 2026
Merged

Paste project paths into the agent launcher#27
howdeploy merged 1 commit into
howdeploy:mainfrom
TroopJostle:feat/launcher-paste-project-path

Conversation

@TroopJostle

Copy link
Copy Markdown
Contributor

Summary

  • add a dedicated button for pasting the project path from the clipboard
  • accept quoted paths, file URLs, and URI-list clipboard content
  • show localized errors when the clipboard has no usable path or cannot be read

Verification

  • node --test tests/agent-launch-dialog.test.mjs
  • npm run typecheck
  • npm test (536 tests)

@howdeploy

Copy link
Copy Markdown
Owner

Nice, focused change — reusing the existing clipboard bridge with no new IPC surface is exactly the right shape, and splitting this out of #26 made it much easier to review. Happy to merge once one bug in the core feature is fixed:

  1. URI-list parsing picks the wrong line. A real clipboard payload from Nautilus/GNOME looks like:
    x-special/nautilus-clipboard
    copy
    file:///home/user/project
    
    The first non-empty line is the x-special/nautilus-clipboard marker, not the path — so pasting from the GNOME file manager inserts the marker instead of the directory. Please select the first line that actually looks like a path (starts with / or file://), skipping the marker and the copy/cut verb line.

Non-blocking follow-ups (fine as a separate PR after merge):

  • Expand a leading ~/ before calling setCwd — users copy that form often, and today it only fails later at launch time with a raw main-process error.
  • Move directoryPathFromClipboard into src/renderer/src/lib/ and cover it with real behavioral unit tests (paired quotes, URI lists, Windows drive paths, file:// percent-decoding) instead of source-regex assertions — shortcuts.ts is the existing pattern for this.
  • The button icon reads as "copy" while the action is paste — if a suitable vendored Lucide asset exists in src/renderer/src/assets/icons/lucide, please use it (no hand-drawn icons per repo policy).

Since there are no CI checks on the branch, please confirm npm test, npm run typecheck, and npm run build pass locally on the head commit.

@howdeploy
howdeploy merged commit 2bc4d94 into howdeploy:main Sep 5, 2026
@TroopJostle

TroopJostle commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Since #27 has already merged, the fix is in follow-up PR #31 (commit 994e18b). The parser now selects the first path-looking line, skipping the GNOME marker, copy/cut verbs, comments, and blank lines. It handles LF, CRLF, and CR payloads and preserves Windows drive/UNC support.

Also moved directoryPathFromClipboard into src/renderer/src/lib/ and added behavioral tests for GNOME payloads, paired quotes, URI lists, Windows paths, percent-decoding, and invalid input.

All requested checks pass locally on head commit 994e18b:

  • npm test — 542 passed, 0 failed
  • npm run typecheck
  • npm run build

Leaving ~/ expansion for the separate follow-up you suggested. There is no paste/clipboard asset in the vendored Lucide set, so the icon is unchanged pending that follow-up.

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.

2 participants