feat: replace the "fast preview" mode with an explicit embedded-JPG mode - #7
Merged
Conversation
"FAST" named a layer whose content varies per file: usually the camera's
embedded JPEG, but a half-size RAW decode when the file has no embedded
preview. The label therefore told the user nothing about what was on screen,
and the embedded JPEG had no view mode of its own despite being what that
button usually showed.
Split the two things it conflated:
- RawLayer.thumbnail (was fastPreview) keeps the cheap-image-with-fallback
behaviour and stays internal — grid tiles, filmstrip, preload, and the
preview's first frame, always at a bounded targetWidth.
- RawLayer.embeddedJpeg is new: the container's JPEG with no fallback, so a
null result is the authoritative "this file has none". It backs both the new
view mode and the availability probe that greys it out.
User-facing modes are now RawViewMode {embeddedJpeg, decodedRaw, pairedJpeg},
set only from the preview's top-right switch. The settings page's "RAW Preview
Source" section is gone — two controls for one value is what made the old
model confusing. The mode is app-wide and persisted, and every mode is always
listed in the menu with unavailable ones disabled rather than removed, so the
menu no longer changes shape between files.
The switch also had to take effect immediately. ImagePreviewPage is a pushed
route, so its pageBuilder runs once and its settings object is frozen at open
time; writing the mode only through the persistence callback left the visible
page unchanged until reopened. The mode is now owned by the page's own state
for the visible effect and reported upward for persistence. The field is
renamed to `initialSettings` so the snapshot boundary is stated at every use
site, and documented as an invariant — the remaining reads of it are correct
only because the settings dialog cannot be open at the same time as the
preview.
Also drops a redundant decode: the preview no longer requests a
full-resolution thumbnail layer, whose fallback path ran the same
half_size=1 processing as the decoded layer it was about to be replaced by.
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.
"FAST" named a layer whose content varies per file: usually the camera's embedded JPEG, but a half-size RAW decode when the file has no embedded preview. The label therefore told the user nothing about what was on screen, and the embedded JPEG had no view mode of its own despite being what that button usually showed.
Split the two things it conflated:
User-facing modes are now RawViewMode {embeddedJpeg, decodedRaw, pairedJpeg}, set only from the preview's top-right switch. The settings page's "RAW Preview Source" section is gone — two controls for one value is what made the old model confusing. The mode is app-wide and persisted, and every mode is always listed in the menu with unavailable ones disabled rather than removed, so the menu no longer changes shape between files.
The switch also had to take effect immediately. ImagePreviewPage is a pushed route, so its pageBuilder runs once and its settings object is frozen at open time; writing the mode only through the persistence callback left the visible page unchanged until reopened. The mode is now owned by the page's own state for the visible effect and reported upward for persistence. The field is renamed to
initialSettingsso the snapshot boundary is stated at every use site, and documented as an invariant — the remaining reads of it are correct only because the settings dialog cannot be open at the same time as the preview.Also drops a redundant decode: the preview no longer requests a full-resolution thumbnail layer, whose fallback path ran the same half_size=1 processing as the decoded layer it was about to be replaced by.