Skip to content

switch to table, optimize status, and more#12

Merged
andiwand merged 3 commits into
mainfrom
switch-to-table-optimize-status
Jun 7, 2026
Merged

switch to table, optimize status, and more#12
andiwand merged 3 commits into
mainfrom
switch-to-table-optimize-status

Conversation

@andiwand

@andiwand andiwand commented Jun 7, 2026

Copy link
Copy Markdown
Member
  1. Flat table instead of nested collapsible list
  • One row per comparable file (and per missing file/dir), columns: Status · Path · Message · Actions.
  • Path is the full relative path in a monospace font, so the hierarchy is readable without nesting.
  • Rows are sorted by path. Comparable files link to the side-by-side compare view as before.
  1. Fixed the slow loading (the main culprit)
  • The old code was roughly O(n²): generate_tree recursed, and for every entry it called Comparator.result(path) and result(path.parent). For directories result() recursively re-walked the entire subtree (with repeated iterdir() disk I/O) to aggregate a status — recomputed from scratch on each page load.
  • Now there's a single O(n) walk (collect()), and each file's status is an O(1) dict lookup. No per-directory aggregation, no parent re-checks. I dropped directory rows entirely since the full path already conveys structure.
  1. Live status updates (async-friendly)
  • Comparisons run in the background, so I added a lightweight /status JSON endpoint (Comparator.all_results() — a plain dict snapshot, no tree walk) that the page polls every 1.5s and patches the status badges + summary in place. No more reloading the page to see results land.
  1. Visual polish
  • Modern CSS: sticky header, sticky table head, zebra/hover rows, colored status badges (green/red/amber).
  • A toolbar with a path search box, filter buttons (All / Differences / Pending / Same), and summary chips (total / same / diff / pending counts) that update live.

@andiwand andiwand mentioned this pull request Jun 7, 2026
@andiwand andiwand merged commit 7709a67 into main Jun 7, 2026
6 checks passed
@andiwand andiwand deleted the switch-to-table-optimize-status branch June 7, 2026 14:19
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