Skip to content

refactor(files): files page rework with unified gcode loader, metadata page and USB mount fixes - #291

Merged
gmmcosta15 merged 37 commits into
devfrom
refactor/files-arch
Sep 28, 2026
Merged

gmmcosta15 merged 37 commits into
devfrom
refactor/files-arch

Conversation

@gmmcosta15

Copy link
Copy Markdown
Collaborator

Description

  • Feature
  • Bug fix
  • Code refactor
  • Documentation

Rework of the files page and its data layer, plus the USB mount path that fed it. 30 commits, 32 files, +3491/-1790.

Files page and metadata

  • Reconcile-based files page with single-owner metadata and LRU caches, filesPage.py cut roughly in half.
  • New shared gcode_loader unifying gcode metadata and thumbnail parsing, table-driven, with a tail RAM cap.
  • New metadataPage with categorized 2x2 cards, units, key-left/value-right rows and touch scroll.
  • New themed blocks_combobox for material filtering, opaque popup, matched row font.
  • Sortable file list including Print Time by estimated_time, new sort_asc/sort_desc icons.
  • Info button in the confirm box and print page opens the metadata detail view.
  • Last print duration from job history, completed jobs only, chamber temp dropped.

Fixes

  • USB symlink was created under a literal ~ because the cfg value was never expanded, so no drive ever appeared and stale links could not be reaped.
  • device_mounted / device_unmounted were declared and wired but never emitted, so drives showed on unplug instead of insert.
  • Dead symlinks looked live because os.path.exists follows the link, now os.path.ismount(os.path.realpath(...)).
  • Dir listings now resolve against each response's own request dir, fixing wrong-folder contents.
  • USB preload race, O(N^2) list rebuild, expand-arrow double-tap, late thumbnail repaint, list model crash.
  • Nozzle temp key with PLA-type fallback, RTL-flipped metadata rows, batched filelist entries.

Motivation

The files page mixed data ownership, parsing and presentation, which made USB behaviour unfixable in place. The USB layer was separately broken end to end: the symlink was never created on any printer, so the UI had nothing to show and a manual refresh was the only workaround.

Tests

  • 75 new unit tests in 7 files covering udisks symlink liveness, entry delegate, moonrest headers, thumbnail loader, files data, files page and metadata page.

…a, USB embedded-thumbnail fallback, themed material-filter combobox (+VLAN), subdir add/remove/selection fixes, LRU caches
… file list and metadata detail page with touch-scroll and themed combobox
…tyle combobox (centered, gray bg, black arrow, non-bold)
…mlink dir auto-refresh, file-info button in confirm box
…x, trim/reorder/enlarge metadata rows, USB symlink dir auto-refresh, crash-safe list model
… in confirm box, cleaner unified metadata rows
…pand-arrow double-tap, O(N^2) rebuild, late thumbnail repaint
…erver-side thumbnail probe, shared gcode loader base
… add symlink-liveness tests, and flatten _raw_value/editorEvent complexity
…aths and USB DRIVE names, add a settle refresh, plus mutation/typecheck/semgrep tooling gates
@gmmcosta15 gmmcosta15 added enhancement New feature or improvement breaking Needs a migration or a coordinated rollout refactor Code change, no behavior change labels Jul 28, 2026
@gmmcosta15 gmmcosta15 self-assigned this Jul 28, 2026
@gmmcosta15
gmmcosta15 requested a review from HugoCLSC July 28, 2026 14:18
@gmmcosta15
gmmcosta15 merged commit 89b8b41 into dev Sep 28, 2026
8 checks passed
@gmmcosta15
gmmcosta15 deleted the refactor/files-arch branch September 28, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Needs a migration or a coordinated rollout enhancement New feature or improvement refactor Code change, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants