Skip to content

v0.3.3: highlight folders by name (weak yellow)#56

Merged
VirusAlex merged 1 commit intomainfrom
feat/v033-dir-name-match
Apr 30, 2026
Merged

v0.3.3: highlight folders by name (weak yellow)#56
VirusAlex merged 1 commit intomainfrom
feat/v033-dir-name-match

Conversation

@VirusAlex
Copy link
Copy Markdown
Owner

Summary

Extends the v0.3.2 cross-panel match highlight to directories: a folder whose name appears in the OTHER panel's current view is tinted weak yellow. Files keep the v0.3.2 rules (green for name+size+mtime, yellow for name+size only).

Why name-only for dirs

  • mtime of a directory is non-recursive — it changes only when entries are added / removed in that exact directory, NOT when a file inside is edited. Two out-of-sync folders can share the same mtime; two in-sync folders can have different mtimes after a touch. Useless as a sync signal.
  • Recursive size needs a per-dir fs walk (/api/browse/stats); auto-firing it for every visible folder thrashes HDD seeks. Out of scope for the cheap auto-highlight.

So name-match is the strongest cheap signal we can offer for dirs. User opens both folders if they want to compare contents.

Implementation

  • Replaced the file-only fileMatch index with a typed pair {files, dirs} sharing one rebuild pass per panel
  • matchClass(side, e) branches on entry type — files keep v0.3.2 rules, dirs return yellow on name match
  • CSS unchanged — reuses .match-mtime-diff

Single-file change, JS only.

Test plan

  • CI green
  • Manual: navigate both panels into a parent dir where common subfolders exist; subfolder rows tint yellow
  • Manual: a subfolder with a unique name on one side stays untinted
  • Manual: file rows still get green / yellow per v0.3.2 rules

🤖 Generated with Claude Code

Extends the cross-panel match-highlight from v0.3.2 to dir entries: a folder
whose name appears in the OTHER panel's current view is tinted weak yellow.

Why name-only (and not name + recursive size + mtime):
- dir mtime is non-recursive — it changes only when entries are added /
  removed in that exact directory, NOT when a file inside it is edited. Two
  out-of-sync folders can share an mtime; two in-sync folders can have
  different mtimes after a touch. Useless as a sync signal.
- recursive size requires an fs walk per dir, which we already have via
  POST /api/browse/stats but auto-firing it for every visible folder thrashes
  HDD seeks. Out of scope for the cheap auto-highlight path.

Implementation: replaced the file-only fileMatch index with a typed pair
(files + dirs) sharing one rebuild pass. matchClass now branches on entry
type — files keep the green/yellow rule from v0.3.2, dirs return yellow on
name match, null otherwise. CSS unchanged: reuses .match-mtime-diff.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@VirusAlex VirusAlex merged commit fa06847 into main Apr 30, 2026
1 check passed
@VirusAlex VirusAlex deleted the feat/v033-dir-name-match branch April 30, 2026 19:35
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.

2 participants