Skip to content

Scope the bar key monitor to its panel; resolve paste target robustly - #66

Merged
momenbasel merged 1 commit into
mainfrom
maintainer/pr-42-infra
Aug 12, 2026
Merged

Scope the bar key monitor to its panel; resolve paste target robustly#66
momenbasel merged 1 commit into
mainfrom
maintainer/pr-42-infra

Conversation

@momenbasel

Copy link
Copy Markdown
Owner

Extracts the two infrastructure fixes from #42 that the Aug 11 review asked to split out and land on their own:

  1. handleKey now guards on event.window === barController?.window, so keys aimed at the Rename / Create Pinboard alerts (or any other window shown while the bar is up) stay with their own responder chain instead of being eaten by the search handler.
  2. pasteTarget resolves lastActiveApp → previousApp → frontmost, skipping Pesty itself and terminated apps, and showBar() keeps lastActiveApp in sync. This fixes stale paste targets on the menu-bar and reopen paths.

pasteMenuTitle and the rest of the context-menu/editor work stay with #42.

Credit to @alvst — extracted from #42.

— automated maintainer pass on behalf of @momenbasel

Made with Cursor

…et robustly

Two infrastructure fixes extracted from #42:

- The local key monitor now ignores events destined for any window other
  than the bar panel, so typing into the Rename / Create Pinboard alerts
  (and any future editor or Settings surface shown while the bar is up)
  reaches that window instead of being swallowed into search.

- Pasting resolves its target through lastActiveApp -> previousApp ->
  frontmost, skipping Pesty itself and terminated apps. previousApp is
  only captured inside showBar(), so the menu-bar and reopen paths used
  to paste into a stale target. showBar() also keeps lastActiveApp in
  sync when it captures the frontmost app.

Co-authored-by: Alvie Stoddard <alviestoddard@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings August 12, 2026 05:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@momenbasel
momenbasel merged commit bcc3dc3 into main Aug 12, 2026
1 check passed
@momenbasel
momenbasel deleted the maintainer/pr-42-infra branch August 12, 2026 05:43
momenbasel added a commit that referenced this pull request Aug 12, 2026
The context menu now offers Paste to <target app>, Paste as Plain
Text, Copy, Edit, Writing Tools, Rename, a Pin submenu with colored
pinboard dots, Preview, Share, and Delete. Editing opens a native
rich-text editor panel with formatting controls, live stats, undo,
find, and Writing Tools; colors get a color-well editor.

Edits can no longer make CloudKit delete the clip that was just
edited: updateContent bumps createdAt and removes same-content
duplicates in the same container as an explicit, deliberate delete, so
the edited record is always the newest copy of its content key and
remote dedupe can never drop it into a reconciliation delete. Edits
update the existing record in place - no delete and recreate, no
dropped fields - and pinboard copies with their own UUIDs are left
untouched while legacy shared-id copies stay consistent.

A minimal main menu is installed at launch so the editor's Cmd-Z/X/C/
V/A/F shortcuts, Cmd-Q, and Cmd-W actually work; the app stays an
accessory so no menu bar appears. Save in the editor is bound to
Cmd-Return since Return types a newline, Rename pre-fills the custom
title rather than baking in the auto-generated one, the preview window
clears its tracked item via a window delegate when closed, and editing
no longer silently overwrites the live system clipboard.

Supersedes #42. Builds on the key-monitor scoping and pasteTarget
infrastructure from #66.

Co-authored-by: momenbasel <momenbasel@users.noreply.github.com>
Co-authored-by: Alvie Stoddard <alviestoddard@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.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.

2 participants