Console: group image thumbnails into per-ratio tiles + crop editor overlay#656
Open
jirkamotejl wants to merge 14 commits into
Open
Console: group image thumbnails into per-ratio tiles + crop editor overlay#656jirkamotejl wants to merge 14 commits into
jirkamotejl wants to merge 14 commits into
Conversation
…nt, and collapsible detail
… BEM summary class
…e, preserve expand state on save)
…ratio of its sizes
…stead of snapping to a canonical list
mreq
approved these changes
Jun 30, 2026
| if (e.key === 'Escape' && this._isEditing()) this.cancelEditing() | ||
| } | ||
| document.addEventListener('keydown', this.escHandler) | ||
| } |
Member
There was a problem hiding this comment.
tohle patri do ruby stimulus_controller action s @document viz. https://github.com/sinfin/folio/blob/feat/ids-only-console/.skills/folio-stimulus/SKILL.md#events
Member
There was a problem hiding this comment.
Na tohle bychom meli zavest nejakou konvenci. Patri tohle vedle komponenty podobne jako sidecar assets? Za me asi jo, ale melo by to byt podlozene rozhodnuti.
Replace the per-ratio summary cards (representative preview + variant count + per-card 'all thumbnails' detail) with a row of compact preview tiles, each labelled by its aspect ratio (W×H) with a corner crop button that opens the existing modal editor. A single 'all generated thumbnails' disclosure now lists every size below the tiles. Tile preview URLs are resolved through the same CDN / temporary-url rewriting the detail thumbnails use, fixing broken (raw Dragonfly/doader) previews. The group label still defaults to the W×H ratio and stays overridable via Folio::File#thumbnail_ratio_label.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reworks the Console image-detail thumbnails (
files#show) into a row of per-aspect-ratio preview tiles and turns the crop editor into a modal overlay.W×Hform (e.g.16×9), with a small crop button in the corner. A single collapsible "all generated thumbnails" list (native<details>) below the tiles lists every generated size (crop + non-crop).RATIO_TOLERANCE) instead of one tile per exact ratio. Each bucket is labelled with its cleanest reduced ratio.Folio::File#thumbnail_ratio_label(ratio, thumbnail_size_keys)(defaultnil) lets a host app relabel groups (e.g. by on-site usage); without an override the tile shows theW×Hratio.srcthrough the same CDN / temporary-url rewriting the detail thumbnails use (Folio::S3.cdn_url_rewrite/temporary_urlfor doader placeholders), instead of a rawfile.thumb(key).urlthat could be unreachable.Folio::DestroyThumbnailUidsJob.Reviewer notes
RATIO_TOLERANCE = 0.04is provisional — pending design sign-off. It deliberately merges near-identical ratios while keeping visually distinct ones apart (e.g. 2:1 stays separate from 16:9). Real image sets still surface some non-canonical ratios (e.g.12×7,40×21) as their own tiles; whether/how to snap those to canonical ratios is the open design question.thumbnail_ratio_labelhook.