Skip to content

fix: make info panel thumbnail/histogram independent toggles (#538) - #598

Merged
julyx10 merged 2 commits into
julyx10:mainfrom
leeyupeng:lap/pr-issue-538
Nov 27, 2026
Merged

julyx10 merged 2 commits into
julyx10:mainfrom
leeyupeng:lap/pr-issue-538

Conversation

@leeyupeng

Copy link
Copy Markdown
Contributor

Summary

Fixes #538. The thumbnail and histogram buttons in the File Info preview section behaved like a radio pair — only one could be shown at a time. They are now independent toggles, so both panels can be viewed simultaneously.

Behavior

  • Clicking each button toggles its own panel; both can be active at once.
  • Turning off the last visible panel collapses the Preview section (same look as the other collapsed info sections, e.g. Organization).
  • Re-opening the section restores the last unchecked panel, so a single accidental uncheck is easy to recover.
  • A normal header collapse/expand (one or both panels visible) leaves the checked state unchanged.
  • Histogram remains unavailable for video files; a stale "restore histogram" state on a video falls back to restoring the thumbnail.

Screenshot

538-preview-toggles

Changes

  • src-vite/src/components/FileInfo.vue — buttons now call togglePreviewPanel('thumbnail' | 'histogram') and reflect showThumbnailPanel / showHistogramPanel independently (no more role="tablist" — they are no longer mutually exclusive); preview section renders the thumbnail and/or histogram panels stacked (mt-3 spacing when both visible); togglePreviewPanel collapses showPreview when no panel remains and records previewRestore; togglePreview restores that
    panel on re-open; navigator-visibility and video-preview triggers now key off the thumbnail panel instead of "not histogram".
  • src-vite/src/stores/configStore.js — replaced infoPanel.previewMode ('thumbnail' | 'histogram') with showThumbnail + showHistogram (+ transient previewRestore); persist.serializer.deserialize migrates the old persisted radio choice so existing users keep their previous state.
  • src-vite/package.json — added test:preview-toggle script.
  • src-vite/tests/filePreviewToggle.test.mjs — new regression tests (7) covering toggle independence, video guard, collapse/restore, config migration, and template structure.

Verification

  • pnpm build ✅
  • pnpm test:preview-toggle — 7/7 pass
  • Full existing frontend suite: failure counts unchanged vs baseline (one pre-existing startup failure also present on clean main — unrelated)
  • Manual: cargo tauri dev → File Info → Preview → both buttons can be active together; unchecking both collapses the section and re-opening restores the last unchecked panel

Fixes #538

lee and others added 2 commits November 26, 2026 20:41
…#538)

- thumbnail and histogram buttons are now independent toggles; both can
  be shown simultaneously
- turning off the last visible panel collapses the preview section like
  the other info sections; re-opening restores the last unchecked panel
- config: previewMode ('thumbnail' | 'histogram') replaced by
  showThumbnail + showHistogram, with a deserialize migration for the
  persisted radio choice (plus transient previewRestore)
- tests: filePreviewToggle.test.mjs (7) covering toggle independence,
  video guard, collapse/restore, migration, and template structure
@julyx10
julyx10 merged commit c06d764 into julyx10:main Nov 27, 2026
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.

Info buttons histogram and thumbnail from exclusive to toggle buttons

2 participants