Keep segment loads out of the forecast change log

Baseline and reference loads are segment construction, not forecasting.
Listing them beside the adjustments buries what the log is actually for --
on version 29 that is four load entries against however many adjustments --
and offers an undo next to them that would silently gut the version.

They are managed in the Baseline view instead, which is where they can be
edited in place and their date ranges seen. Filtered in the dialog rather
than in the route, since Baseline.jsx and the ledger's tag lookup both read
the same endpoint and do want every entry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul Trowbridge 2026-09-16 23:26:32 -04:00
parent e0e097d31a
commit ad02aba8fb

View File

@ -1163,7 +1163,11 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio
setLogLoading(true) setLogLoading(true)
try { try {
const data = await fetch(`/api/versions/${versionId}/log`).then(r => r.json()) const data = await fetch(`/api/versions/${versionId}/log`).then(r => r.json())
setLogEntries(data) // Baseline and reference loads are segment construction, not forecasting.
// They are managed in the Baseline view, where they can be edited in place
// and their date ranges seen; listing them here only buries the adjustments
// this log is for -- and offers an undo that would silently gut the version.
setLogEntries(data.filter(e => !['baseline', 'reference'].includes(e.operation)))
} catch (err) { } catch (err) {
flash(err.message, 'error') flash(err.message, 'error')
} finally { } finally {