Skip to content

[DEV-40] Capture ideas from anywhere into a new pm-desktop ticket with one shortcut - #50

Merged
danii1 merged 4 commits into
mainfrom
feature/dev-40-attempt-2
Aug 24, 2026
Merged

[DEV-40] Capture ideas from anywhere into a new pm-desktop ticket with one shortcut#50
danii1 merged 4 commits into
mainfrom
feature/dev-40-attempt-2

Conversation

@danii1

@danii1 danii1 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements DEV-40: a Quick Capture feature for pm-desktop that opens a new ticket pre-filled from the clipboard via a global OS shortcut.

What was built

Shared pure logicpackages/pm-desktop/src/shared/quick-capture.ts

  • Default binding CommandOrControl+Shift+Space, accelerator validation, clipboard-text sanitizer (50k-char cap; huge/empty/noise → "not useful"), source-tab inference (Figma URL → Figma, stack-trace-like → Error log, else Prompt), keyboard-event→accelerator mapping for the in-app recorder.

Main processsrc/main/quick-capture.ts (Electron injected as ports, auto-update.ts pattern)

  • Registers/unregisters the OS global shortcut from persisted settings (quickCaptureEnabled, default off — opt-in); disabled state never holds a hotkey.
  • On invoke: reads clipboard at invocation time (never logged/persisted), classifies it, focuses/restores/creates the window (app.focus({steal:true}) for macOS background), defers delivery until page load completes. Registration failures return a clear conflict message instead of failing silently.
  • Wired in index.ts (startup sync + dispose on quit) and ipc.ts (pm:get-quick-capture-status, pm:set-quick-capture-settings, push channel pm:quick-capture).

Renderer

  • App subscribes to captures: with a ready project it opens a new ticket workspace as the active tab via the existing reducer (existing tickets and running streams untouched) prefilled via composerForCapture; without one it leaves the Welcome/setup path visible. A focus token moves the caret into the composer's source editor.
  • Settings dialog gained a Quick Capture section: enable/disable switch, shortcut recorder, Use-default reset, and conflict/error display.

Tests — shared helpers, main registration + delivery (conflict, invalid binding, rebind releases old key, deferred delivery to a freshly created window, empty clipboard), preload early-event latch, ComposerForm focus signal, composerForCapture. 544 pm-desktop tests pass, plus monorepo-wide typecheck, lint, format, and build.

Docs — README section and docs/pm/usage.md Quick Capture guide.

Note: ships off by default (an OS-wide hotkey felt like opt-in territory); flipping it on registers the documented default immediately.

devintern-internal[bot] and others added 4 commits August 23, 2026 03:02
- Quick Capture (main): replace the pending-delivery WeakSet flag with a
  WeakMap holding the latest payload, so a second invocation while the
  window is still loading overwrites (not drops) the pending capture and
  settle delivers exactly once whatever snapshot is most recent.
  Regression-tested via deliverQuickCapture and invokeQuickCapture; the
  FakeWindow test double now keeps a stable webContents identity to match
  Electron.

- Quick Capture wiring (renderer): extract App's onQuickCapture handler
  into state/quick-capture-handler.ts (handleQuickCaptureEvent) and move
  defaultComposerForProject into state/composer-values.ts. The handler is
  unit-tested for both paths: fresh ticket opened prefilled from the
  capture (inferred source tab, cached issue types, project defaults) and
  no-op when no configured project is ready. App now bumps the composer
  focus signal only when a workspace actually opened.
@danii1
danii1 merged commit ab2501f into main Aug 24, 2026
1 check passed
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.

1 participant