Skip to content

feat: replace the "fast preview" mode with an explicit embedded-JPG mode - #7

Merged
stmtc233 merged 1 commit into
mainfrom
feat/raw-view-mode
Sep 5, 2026
Merged

feat: replace the "fast preview" mode with an explicit embedded-JPG mode#7
stmtc233 merged 1 commit into
mainfrom
feat/raw-view-mode

Conversation

@stmtc233

@stmtc233 stmtc233 commented Sep 5, 2026

Copy link
Copy Markdown
Owner

"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.

"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.
@stmtc233
stmtc233 merged commit 0f03aa9 into main Sep 5, 2026
10 checks passed
@stmtc233
stmtc233 deleted the feat/raw-view-mode branch September 5, 2026 05:28
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