Skip to content

[codex] Fix history media actions and add right-click screenshot cancel#43

Merged
lzhgus merged 2 commits intomainfrom
codex/history-media-actions-and-right-click-cancel
Apr 14, 2026
Merged

[codex] Fix history media actions and add right-click screenshot cancel#43
lzhgus merged 2 commits intomainfrom
codex/history-media-actions-and-right-click-cancel

Conversation

@lzhgus
Copy link
Copy Markdown
Owner

@lzhgus lzhgus commented Apr 14, 2026

Summary

This PR fixes history actions for non-PNG captures and improves screenshot cancellation for mouse-first workflows.

What changed

  • preserve media type when saving items from History
    • GIF entries save as .gif
    • video entries save as .mp4
    • screenshots continue to save as image files
  • copy GIF/video history entries to the pasteboard as file URLs instead of assuming they are images
  • add right-click support in the screenshot overlay
    • right-click cancels screenshot mode
    • if an area drag is in progress, the first right-click clears the current selection and a subsequent right-click exits
  • add SharedKit regression coverage for file format / filename extension mapping

Why it changed

History actions were hardcoded for PNG screenshots, so GIF and video entries in Screenshot History were downloaded as PNGs and clipboard behavior for media entries was incorrect.

Separately, screenshot cancellation required pressing Esc, which interrupted mouse-only capture flow. Issue #41 requested a right-click shortcut for canceling screenshot mode.

Impact

User impact

  • History downloads now preserve the expected file type for GIF and video captures
  • Copy from History works more naturally for media entries
  • Screenshot mode is easier to cancel without moving to the keyboard

Developer impact

  • History media handling is now routed through shared FileFormat helpers instead of a PNG-only assumption
  • Overlay cancellation behavior remains localized to CaptureOverlayView

Root cause

The History save/copy path assumed every stored asset was a PNG image. That was true for screenshots but not for recordings/GIFs.

Validation

  • swift test --package-path Packages/SharedKit
  • xcodebuild -project Capso.xcodeproj -scheme Capso -configuration Debug build

Notes

History downloads and clipboard actions assumed every history entry was a PNG,
so GIF and video items were mislabeled on save and copied in an unusable form.
The screenshot overlay also required Esc to cancel, which interrupted mouse-only
capture flow. This change derives history actions from media type and adds
right-click cancel/clear behavior directly in the capture overlay.

Constraint: History recordings are stored as temporary source assets, so user-facing save actions must emit shareable media types
Constraint: Keep screenshot cancellation localized to overlay input handling without changing coordinator ownership
Rejected: Save/copy recordings as raw .mov only | does not match the user-visible recording export format
Rejected: Add the optional settings toggle now | broader settings/UI scope than the requested fix bundle
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: History copy/save behavior must branch by capture mode or file type; do not assume every history asset is a PNG
Tested: swift test --package-path Packages/SharedKit; xcodebuild -project Capso.xcodeproj -scheme Capso -configuration Debug build
Not-tested: Manual clipboard paste/save validation for GIF and video entries; manual right-click overlay interaction on multi-display setups
Related: #41
@lzhgus lzhgus marked this pull request as ready for review April 14, 2026 04:57
The preview Copy action wrote the raw temporary .mov file to the pasteboard,
so GIF recordings pasted as mov files even though Save exported the requested
format. This change routes Copy through the same export pipeline, writes a
clipboard-ready GIF/MP4 file, and surfaces progress/failure feedback in the
preview UI.

Constraint: Preview copy must preserve the selected recording format without breaking the existing export/save flow
Constraint: Clipboard file URLs must reference real files long enough for paste targets to consume them
Rejected: Write the temporary .mov directly for all copy actions | violates the user's selected GIF/MP4 output format
Rejected: Convert only GIF copy and leave video copy as .mov | inconsistent preview behavior between copy and save actions
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep preview Copy and Save aligned on output format; do not bypass export for formats that require conversion
Tested: xcodebuild -project Capso.xcodeproj -scheme Capso -configuration Debug build
Not-tested: Manual paste validation into Finder/Slack/Notes for copied GIF/MP4 files
Related: PR #43
@lzhgus lzhgus merged commit 4bedbc1 into main Apr 14, 2026
5 checks passed
@lzhgus lzhgus deleted the codex/history-media-actions-and-right-click-cancel branch April 14, 2026 05:06
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