Skip to content

fix: resolve OS image list duplication when switching filters#110

Merged
SuperKali merged 1 commit intomainfrom
fix/image-modal-filter-duplication
Mar 2, 2026
Merged

fix: resolve OS image list duplication when switching filters#110
SuperKali merged 1 commit intomainfrom
fix/image-modal-filter-duplication

Conversation

@SuperKali
Copy link
Member

Summary

  • Fix infinite list growth in the "Choose Operating System" modal when switching between filter buttons (Stable, Nightly, Apps, Minimal)
  • Reset active filter to "All Images" when the modal is closed, so re-opening always starts from the full list

Root Cause

The React list key used a composite of armbian_version-distro_release-kernel_branch, which is not unique across image variants. For example, on the Radxa Dragon Q6A board:

Composite Key Occurrences Variants
25.11.1-noble-edge 3 gnome, minimal, xfce
26.2.1-trixie-edge 3 homeassistant, omv, openhab

Duplicate React keys cause the reconciliation algorithm to skip DOM deletion of overwritten fibers, leaving orphaned nodes that accumulate on each filter switch.

Changes

src/components/modals/ImageModal.tsx

  1. Replaced the non-unique composite key with image.file_url, which is guaranteed unique per image
  2. Added a useEffect that resets filterType to 'all' when the modal closes

Test plan

  • Open the app, select a board with many images (e.g. Radxa Dragon Q6A)
  • Rapidly switch between filter buttons (Stable, Nightly, Apps, Minimal, All Images)
  • Verify the list length stays consistent and the scrollbar does not grow
  • Close and re-open the modal, verify the filter resets to "All Images"

Fixes #108

Use unique `file_url` as React list key instead of the composite
`armbian_version-distro_release-kernel_branch` which was not unique
across image variants, causing orphaned DOM nodes on each filter switch.

Also reset the active filter back to "All Images" when the modal closes
so re-opening always starts from the full list.

Fixes #108
@SuperKali SuperKali added enhancement New feature or request component: modal-image Image selection modal component: backend Rust backend related labels Mar 2, 2026
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

🧪 Test Builds

Version: 0.0.0-pr.110 | PR: #110 | Status: ready for testing

Platform Download
Linux x64 📦 .deb / .AppImage
Windows x64 📦 .exe
macOS ARM64 📦 .dmg
ℹ️ About these builds
  • 🔓 Public downloads via nightly.link (no GitHub login required)
  • ⚠️ Unsigned builds for testing purposes only
  • Expires in 7 days
  • 🔄 Updated on every push to this PR

@github-actions github-actions bot added the status: ready for review Ready to be reviewed label Mar 2, 2026
@SuperKali SuperKali merged commit 983d6d0 into main Mar 2, 2026
9 checks passed
@SuperKali SuperKali deleted the fix/image-modal-filter-duplication branch March 2, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: backend Rust backend related component: modal-image Image selection modal enhancement New feature or request status: ready for review Ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OS Select - Repeated switching between filter-buttons

1 participant