Skip to content

Add Shift+Space preview and wire ⌘K actions popover#8

Merged
GordonBeeming merged 2 commits into
mainfrom
gb-branch-2
May 13, 2026
Merged

Add Shift+Space preview and wire ⌘K actions popover#8
GordonBeeming merged 2 commits into
mainfrom
gb-branch-2

Conversation

@GordonBeeming
Copy link
Copy Markdown
Owner

Summary

  • Shift+Space large preview — opens a Quick Look-style overlay at ~85% of the panel area, showing the selected screenshot plus filename, captured-at, file size, dimensions, and the OCR snippet (scrollable, selectable). Esc closes the preview first; a second Esc dismisses the panel. Plain space still types into the search field so multi-word queries (text:hello world) keep working.
  • ⌘K actions popover — the footer hint that's said "Actions ⌘K" since v0.1 is finally wired. Pops a Raycast-style action list anchored to the footer, listing every RowAction in canonical order with currently-bound shortcuts ( for the primary, ⌘P for pin, ⌘⇧C for copy OCR) shown alongside. Pin label flips between "Pin" and "Unpin" based on the selected record.
  • Esc cascade — now goes actions popover → preview → panel dismiss, in that order, so a single peek never costs you your place in the grid.

All changes are in Sources/Vista/PanelContentView.swift — no model, store, or preferences changes.

Test plan

  • Build via ./Scripts/dev-run.sh and summon the panel.
  • Shift+Space opens preview at ~85% size; image, filename, date, size, and OCR snippet all render.
  • Shift+Space toggles off; Esc once closes preview, Esc twice dismisses panel.
  • Plain space still types into the search field — try text:foo bar.
  • Arrow keys during preview swap the previewed image without flicker.
  • OCR edge cases: brand-new screenshot pre-OCR shows "OCR still running…"; an empty/white image shows "No text detected".
  • Click the dimmed scrim outside the preview card → closes preview.
  • ⌘K opens actions popover; every entry runs against the selected record.
  • Shortcut hints in the popover match what actually fires (↵ / ⌘P / ⌘⇧C).
  • Pin label says "Pin" for unpinned records, "Unpin" for pinned.
  • No regressions: Enter (primary), ⌘P (pin), ⌘⇧C (copy OCR text) all still work from the grid.
  • Caps-lock on doesn't break Shift+Space (regression coverage for the strict-equality bug fixed mid-development).

Shift+Space opens a Quick Look-style preview at ~85% of the panel,
showing the screenshot plus filename, captured-at, file size and the
OCR snippet. Esc closes the preview first, leaving the panel up; a
second Esc dismisses. Plain space still types into the search field so
multi-word queries keep working.

⌘K now opens a Raycast-style actions popover anchored to the existing
footer hint, listing every RowAction with the currently-wired
shortcuts (↵, ⌘P, ⌘⇧C) shown alongside.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming marked this pull request as ready for review May 13, 2026 09:41
Copilot AI review requested due to automatic review settings May 13, 2026 09:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a0171181d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Vista/PanelContentView.swift
Comment thread Sources/Vista/PanelContentView.swift
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds two user-facing panel affordances in Vista’s floating panel UI: a Shift+Space “Quick Look”-style large preview overlay for the selected screenshot, and a wired-up ⌘K actions popover anchored to the footer hint, along with an updated Esc dismissal cascade.

Changes:

  • Add PreviewOverlay and keyboard handling so Shift+Space toggles a large preview while plain Space still types into the search field.
  • Wire the footer “Actions ⌘K” hint to a real popover that lists RowAction entries and executes them against the selected record.
  • Update Esc handling to close actions popover → preview overlay → dismiss panel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/Vista/PanelContentView.swift
Comment thread Sources/Vista/PanelContentView.swift Outdated
Address reviewer comments on #8:
- PreviewOverlay: guard against stale thumbnail loads racing the
  selection by checking Task.isCancelled before assigning the image.
  Task.detached is unstructured so the outer .task(id:) cancellation
  doesn't propagate; without the check, a slow load for the previous
  record can land after a faster load for the new one and briefly
  show the wrong screenshot.
- handlePanelKey: pass ⌘K through when no record is selected instead
  of swallowing it, so the shortcut doesn't become a dead key on
  empty result lists.
- ActionsPopover: shortcut hints now support multiple bindings per
  row, so when Copy OCR Text is the user's primary action the popover
  shows both ↵ and ⌘⇧C instead of hiding the still-live ⌘⇧C binding.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming merged commit 3762634 into main May 13, 2026
2 checks passed
@GordonBeeming GordonBeeming deleted the gb-branch-2 branch May 13, 2026 10:03
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