Skip to content

Add paste-style clip cards - #96

Open
alvst wants to merge 1 commit into
momenbasel:mainfrom
alvst:alvie/pr-26-paste-style-cards
Open

Add paste-style clip cards#96
alvst wants to merge 1 commit into
momenbasel:mainfrom
alvst:alvie/pr-26-paste-style-cards

Conversation

@alvst

@alvst alvst commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Cards currently spend their space on chrome rather than on the clip: a 68pt header with a small icon in a tile, and an image — the one card type you identify purely by looking — squeezed into whatever the padding leaves. This adds an alternative card style behind a setting.

What changed

  • New "Paste-style clip cards" setting, on by default. Turning it off restores the tile header, the inset image, and the generic file glyph exactly as before.
  • The header shrinks from 68pt to 50pt and the source app's icon is scaled past the card's top-right corner, cropped by the card's own rounded rectangle so it frames the corner instead of sitting in a tile. The header is sized around the icon rather than the icon blown up to fill it, since scaling artwork past its natural size is what makes it look soft.
  • The icon is drawn from artwork trimmed to its opaque bounds — macOS app icons carry a transparent margin about 10% wide, so aligning the raw image to the corner would leave a gap the size of that padding.
  • Image clips, and file clips pointing at an image (which is how a copied screenshot actually arrives), run edge to edge over a transparency checkerboard so a cut-out is distinguishable from white. The body's padding moved onto the content and footer so the image can reach the card edges while the footer keeps its inset.
  • File clips with no preview get their real 104pt Finder document icon instead of the 32pt generic doc.fill glyph; a multi-file clip fans out the real icons of its first three, first on top. A clip with no usable file URL still falls back to the glyph.
  • A multi-file clip's header reads "5 files" rather than the generic type label — naming only the first file hid the rest.

Screenshots

Before:
00-baseline screenshots bar.png

After:
15-paste-style-cards screenshots off.png
15-paste-style-cards screenshots on.png

Notes for review

  • Everything here is behind the toggle. With it off, the rendered card is the current one, not an approximation of it.
  • Whether a file clip is an image is decided from its path extension, never by opening it — that check runs on every render.
  • No dependencies. It touches the same file as alvie/pr-25-clip-card-metadata; the two deliberately use differently-named helpers, so either can merge first.

This feature should be bundled into v2.

Part of #80.

Cards spend their space on chrome instead of on the clip. The header
is a 68pt band with a small icon boxed in a tile, and an image clip -
the one kind of card you identify purely by looking - is squeezed into
whatever the padding leaves behind.

Behind the new "Paste-style clip cards" toggle, the header shrinks to
50pt and the source app's icon is scaled past the card's top-right
corner, cropped by the card's own rounded rectangle so it frames the
corner rather than sitting inside a tile. The header is sized around
the icon rather than the icon blown up to fill the header, because
scaling artwork past its natural size is what makes it look soft. The
icon is drawn from artwork trimmed to its opaque bounds: macOS app
icons carry a transparent margin about 10% wide, so aligning the raw
image to the corner would leave a gap the size of that padding.

Image clips - and file clips that point at an image, which is how a
copied screenshot actually arrives - now run edge to edge, over a
transparency checkerboard so a cut-out is distinguishable from white.
The card body's padding moved onto the content and footer so the image
can reach the card edges while the footer keeps its inset. Whether a
file clip is an image is decided from its path extension, never by
opening it: that runs on every render.

File clips with no preview get the same treatment. The 32pt generic
"doc.fill" glyph becomes the file's real Finder icon at 104pt, because
that badge is the whole identity of a document you can't see into; a
clip with no usable file URL still falls back to the glyph. A clip of
several files fans out the real icons of its first three, first on
top, which says both what kind of files these are and that there is
more than one - something a single page icon cannot. Its header reads
"5 files" rather than the generic type label, since a multi-file clip
is one clip of many files and naming only the first hid the rest.

A file that does have a preview shows it. Every PDF, model, and
document otherwise looked alike, so a single non-image file now
renders the system's Quick Look thumbnail of its real contents,
generated once per path and cached - along with the paths the system
has no preview for, so a file it cannot render is not asked about
again on the next card that shows it. Generation runs in a task keyed
on the clip rather than on the render pass, so scrolling the strip
starts no work of its own.

A clip whose file has moved or been deleted dims its icon and says
"File not found", and draws that icon from the file's type rather than
its path: asking the workspace about a path that no longer exists
hands back a blank page, which reads as a failed render. This is the
one thing here that is not behind the toggle. It reports a fact about
the clip rather than restyling it, and a clip that can no longer paste
anything should say so in either layout.

The toggle defaults on; turning it off restores the tile header, the
inset image, and the generic file glyph exactly as before - save for
that missing-file caption, which is information rather than style.
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