Skip to content

handle missing gracefully#13

Merged
andiwand merged 2 commits into
mainfrom
handle-missing
Jun 7, 2026
Merged

handle missing gracefully#13
andiwand merged 2 commits into
mainfrom
handle-missing

Conversation

@andiwand
Copy link
Copy Markdown
Member

@andiwand andiwand commented Jun 7, 2026

collect() — missing files are now comparable: True, so they render as clickable links into the compare view (keeping their missing in reference (A) / missing in monitored (B) message and different status). Missing directories stay non-linkable, since there's no single file to open.

/file/<variant>/<path> — when the file is absent on the requested side, it serves a small centered "file missing in reference (A)/monitored (B)" placeholder page instead of a raw 404, so the iframe shows something meaningful while the other side renders normally.

/image_diff — returns 404 when either side is missing (nothing to diff), so the diff strip's just doesn't render instead of crashing on to_url's FileNotFoundError.

So now for a missing file you get:

  • The existing side viewable in the compare view, the other side showing a "missing" placeholder.
  • The ▶ / update ref button working for files present in monitored-but-not-reference (copies B→A, creating it). For the reverse (present in reference, missing in monitored) update-ref correctly 404s, since there's no monitored source to copy.

/update_ref needed no change — it already copied B→A and 404'd on a missing source. All 3 tests still pass.


Added a collect_one_sided() helper in root() that walks a directory present on only one side and emits one row per comparable file inside it (recursing into nested subdirectories), each marked missing in monitored (B) / missing in reference (A) with a different status. The old single opaque "directory missing" row is gone.

So if only_a_dir/ exists only in the reference, you now get:

  • only_a_dir/p.html → linked, "missing in monitored (B)"
  • only_a_dir/nested/q.html → linked, "missing in monitored (B)"

Each row behaves like any other missing file:

  • Viewable in the compare view (present side renders, other side shows the "file missing" placeholder).
  • Copyable via update-ref where a monitored source exists (B→A), creating the file/dirs as needed (shutil.copy2 plus update_ref's existing copytree path handle parent creation).

blocked by #12

@andiwand andiwand merged commit db8a778 into main Jun 7, 2026
6 checks passed
@andiwand andiwand deleted the handle-missing branch June 7, 2026 14:27
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