From 139822f8a5b218008162b82bd953bb55a7e7e0d0 Mon Sep 17 00:00:00 2001 From: Philip Guzman Date: Wed, 1 Jul 2026 16:03:28 -0700 Subject: [PATCH] Fix recovery layout and interactive assets --- serato_doctor/web.py | 5 ++++- serato_doctor/webui/index.html | 21 +++++++++++---------- serato_doctor/webui/layout-fixes.css | 9 +++++++++ tests/test_web.py | 8 +++++++- 4 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 serato_doctor/webui/layout-fixes.css diff --git a/serato_doctor/web.py b/serato_doctor/web.py index 57b1918..3646af8 100644 --- a/serato_doctor/web.py +++ b/serato_doctor/web.py @@ -6,6 +6,7 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from importlib import resources from pathlib import Path from typing import Iterable, Optional +from urllib.parse import urlsplit from serato_doctor.crate_parser import load_library_crates from serato_doctor.database_parser import parse_database @@ -31,6 +32,7 @@ STATIC_FILES = { "/": ("index.html", "text/html; charset=utf-8"), "/app.css": ("app.css", "text/css; charset=utf-8"), "/recovery.css": ("recovery.css", "text/css; charset=utf-8"), + "/layout-fixes.css": ("layout-fixes.css", "text/css; charset=utf-8"), "/app.js": ("app.js", "text/javascript; charset=utf-8"), } @@ -296,7 +298,7 @@ def backup_history(serato: Path) -> dict: class SeratoDoctorHandler(BaseHTTPRequestHandler): def do_GET(self) -> None: - asset = STATIC_FILES.get(self.path) + asset = STATIC_FILES.get(urlsplit(self.path).path) if asset is None: self._json_response(404, {"error": "Not found"}) return @@ -308,6 +310,7 @@ class SeratoDoctorHandler(BaseHTTPRequestHandler): ) self.send_response(200) self.send_header("Content-Type", content_type) + self.send_header("Cache-Control", "no-store") self.send_header("Content-Length", str(len(content))) self.end_headers() self.wfile.write(content) diff --git a/serato_doctor/webui/index.html b/serato_doctor/webui/index.html index e14f3c0..8975ec4 100644 --- a/serato_doctor/webui/index.html +++ b/serato_doctor/webui/index.html @@ -5,8 +5,9 @@ Serato Doctor - - + + +
@@ -57,13 +58,6 @@ -
-

Safety net

Backup recovery

-

Review every repair snapshot saved for this Serato library. Older backups remain available after restarting Serato Doctor.

-
Enter your Serato folder above, then check backups.
-
-
- + +
+

Safety net

Backup recovery

+

Repair backups appear here automatically before any duplicate is consolidated. Review saved snapshots, disk usage, and restore history.

+
Analyze your library, then choose a duplicate to preview its automatic backup.
+
+
- + diff --git a/serato_doctor/webui/layout-fixes.css b/serato_doctor/webui/layout-fixes.css new file mode 100644 index 0000000..d121363 --- /dev/null +++ b/serato_doctor/webui/layout-fixes.css @@ -0,0 +1,9 @@ +.recovery-panel { + margin-top: 42px; +} + +@media (max-width: 680px) { + .recovery-panel { + margin-top: 28px; + } +} diff --git a/tests/test_web.py b/tests/test_web.py index 417a52b..8574a8c 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -40,7 +40,13 @@ def test_web_analysis_rejects_missing_folders(tmp_path): def test_web_static_assets_are_declared_and_packaged(): asset_root = Path(__file__).parents[1] / "serato_doctor" / "webui" - assert set(STATIC_FILES) == {"/", "/app.css", "/recovery.css", "/app.js"} + assert set(STATIC_FILES) == { + "/", + "/app.css", + "/recovery.css", + "/layout-fixes.css", + "/app.js", + } assert all((asset_root / filename).is_file() for filename, _ in STATIC_FILES.values()) html = (asset_root / "index.html").read_text(encoding="utf-8") assert "Missing tracks in Serato" in html