Layer time can be open-ended ("now") and granularity-aware - #337
Open
BhattaraiSijan wants to merge 5 commits into
Open
Layer time can be open-ended ("now") and granularity-aware#337BhattaraiSijan wants to merge 5 commits into
BhattaraiSijan wants to merge 5 commits into
Conversation
…uration offsets) A layer's dataStartTime/dataEndTime may now be a policy re-evaluated at load instead of a fixed timestamp, so configs for growing collections never go stale. One pure resolver evaluates 'now' and 'now +/- <ISO duration>'; per veda-ui the result is the raw current moment, never rounded. Unparseable values resolve to null so consumers keep their fallbacks. Spec'd with an injected clock. Mechanism half of #332.
The per-layer timeline bar previously hand-parsed data times with an inline 'now' special case for the end only. It now resolves both ends through the time-policy resolver, so open-ended and offset policies render correctly on either end and reach the current moment on every load. The bus layer-config type documents the policy vocabulary plus the carried granularity/periodicity facts (interval, isPeriodic). Completes #332's visible half.
BhattaraiSijan
marked this pull request as ready for review
August 26, 2026 20:14
The Data Start/End Time field descriptions said ISO 8601 datetime only, so an admin had no way to discover that now, or now offset by an ISO 8601 duration, is a legal value. The tile and vector layer forms both say so now. Description text only; no behaviour change. Completes #332's documentation criterion.
slesaad
reviewed
Aug 26, 2026
Nothing in this PR writes or reads either field;
The now / now ± duration vocabulary is a core-owned meaning of dataStartTime/dataEndTime. Core resolves it at call time behind one provider; the Timeline plugin reads dates and no longer imports a resolver. The Layers tool's set-to-extent action goes through the same path, which it previously did not (a 'now' produced NaN there).
BhattaraiSijan
force-pushed
the
feat/open-ended-layer-time
branch
from
August 28, 2026 19:38
e7760a4 to
111be6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #332 (part of epic #331)
Summary
Time-enabled layers could only declare fixed data start/end timestamps — but for growing collections the end is unknowable at authoring time, so every config went stale the day after it was written. A layer's
dataStartTime/dataEndTimemay now be a policy re-evaluated on demand:now, ornow ± <ISO-8601 duration>(now - P1D,now + P5D). Concrete datetimes behave exactly as before.Per veda-ui (our semantics standard),
nowresolves to the raw current moment — never rounded.Core owns this vocabulary. The config keeps what the author wrote; core resolves it behind one provider,
layers:getTemporalExtent, which answers{ start, end }as plain ISO datetimes (ornull) — for one layer by id, or for all layers keyed by UUID, in the same call shapes aslayers:getCogCapabilitiesandlayers:getBounds. It resolves at the moment of asking, so an open-endednowis always fresh. A plugin never sees a policy string and never imports a resolver.Granularity (
interval) and periodicity (isPeriodic) were originally declared on the bus contract here as carried facts. Nothing in this PR writes or reads them, so they land with #338's VEDA source instead, which is what actually produces them. Thetimeblock's index signature already allows both, so no consumer is blocked in the meantime.Commits
nullfor anything unparseable so consumers keep their fallbacks and a bad value can never break the UI. Calendar-safe offset math (months/years via UTC date components, not milliseconds).'now'special case on the end only; both ends now resolve.Basics/TimeControl_/layerTimePolicy.ts, beside the mission-level time parser;Layers_registerslayers:getTemporalExtent; the Timeline reads extents from it instead of resolving;_shared/time/is removed with no re-export. The Layers tool's "set global time to layer extent" action goes through the same path — it previously didnew Date("now")and producedNaNfor a policy value.Testing
nowdraws its timeline bar reaching the current date (screenshot in Layer time can be open-ended ("now") and granularity-aware #332), while a closed-extent layer's bar correctly stops at its real end — and thenowconfig needs no edits, ever.Mission-level time (
initialstart/initialend) keeps its existing seconds-offset syntax; unifying it with ISO durations is possible future work.🤖 Generated with Claude Code