SNR calculator: signalFromSB calibration was 4750× too small (0.001 vs ~4.75
at SB=21). Calibration is now derived consistently from the sky background
constants: C[filter] = sky_e_s[filter] / 10^((21 - 21.5) / 2.5). Also made
it filter-aware so narrowband filters use their own reference. Replaced the
broken 500+/billions display with a proper per-filter result or a
'too faint for this setup' message when signal ≈ 0.
Score weights: 'Best score tonight' sort now accepts score_alt/fov/time/moon
query params (0.0–1.0, server-side normalised to sum=1). Frontend adds a
⚙ weights button next to the sort dropdown that reveals 4 sliders showing
effective %, persisted to localStorage. Weights default to 40/30/20/10.
Selected filter: clicking a filter pill in the Filters tab now highlights the
row (bg + amber outline on the pill + ▶ marker) so it's clear which filter
the SNR calculator and workflow card are showing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add shared Arc<Semaphore> (1 permit) through main → AppState and jobs.
All heavy operations (catalog refresh, rebuild, nightly recompute,
factory reset) now serialise: a second trigger returns "already_running"
instead of spawning a parallel task that fights over the SQLite WAL lock.
- Scheduled nightly job acquires the semaphore too, so it waits rather
than stomping on a manual rebuild triggered at startup.
- Replace 90 × precompute_lightweight calls (90 separate transactions,
horizon fetched 90 times) with precompute_next_90_nights: one bulk
SELECT to find missing dates, horizon fetched once, all inserts in a
single transaction. Eliminates the 1–5s per-INSERT lock waits seen
when multiple jobs were competing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Factory reset endpoint clears computed tables (catalog, nightly_cache,
tonight, weather_cache), VACUUMs the DB, then rebuilds in background.
Preserves all user data (imaging_log, gallery, phd2_logs, horizon).
- Catalog rebuild now fetches data BEFORE touching the DB — network
failures no longer leave the catalog empty. DELETE + INSERT wrapped
in a single transaction via replace_catalog() so a mid-write failure
rolls back and old data is preserved.
- Added nightly_cache indexes and bumped pool to 10 connections with
30s acquire timeout to prevent exhaustion during rebuilds.
- Settings page: factory reset button with inline confirmation dialog.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The seasonal peak subquery used a correlated SELECT inside a GROUP BY,
causing a full nightly_cache scan per object (210-270s for 14k objects).
Replaced with a simple MAX() GROUP BY — now instant.
Also added three indexes on nightly_cache(night_date) that were missing
and causing all dashboard queries to run 2+ second full table scans.
Replaced 🔴 emoji in night mode buttons with CSS circles.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>