Hand the timeline's date comparison off to the Comparison plugin - #339
Open
sandesh-sp wants to merge 1 commit into
Open
Hand the timeline's date comparison off to the Comparison plugin#339sandesh-sp wants to merge 1 commit into
sandesh-sp wants to merge 1 commit into
Conversation
The "Compare date" action announces 'plugin:comparison:startWithDates' on the bus instead of calling anything: the timeline knows the Comparison plugin only by the name of that event, so a mission without the plugin is one where nobody listens rather than one where the timeline breaks. DateSelector grows the pieces an embedding layout needs to reuse it — an appended className, placeholder wording for a date the user has not picked yet, and an optional onCompareClick that draws the action and its divider only when a handler is given. The picker also reads and writes UTC throughout. MMGIS stores every instant in UTC, so a viewer west of Greenwich was seeing and committing the wrong day; the specs pin the process timezone to America/Los_Angeles so a local-time regression cannot pass on a UTC CI host. The date selector and popover carry their own stylesheets rather than living in Timeline.css, and mmgisAPI exposes the timeline's start, end, and current instants for tools that need the window without owning it.
sandesh-sp
marked this pull request as ready for review
August 26, 2026 15:00
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.
Summary
Timeline-side groundwork for comparing two dates on the map. The timeline's Compare date action becomes real,
DateSelectorbecomes reusable outside the timeline header, and the picker is corrected to work in UTC.What's here
Compare hand-off. Clicking Compare date announces
plugin:comparison:startWithDateson the mmgisAPI bus. The timeline knows the Comparison plugin only by the name of that event — a mission that doesn't load the plugin is one where nobody listens, not one where the timeline breaks.DateSelectorbecomes embeddable. Three additions let another layout reuse the component as-is:className— appended to the root, so an embedder can position itplaceholder— wording shown in place of a formatted date, so a date the user hasn't picked yet reads as an invitation while the calendar still opens aroundselectedDateonCompareClick— the Compare date action and its divider are drawn only when a handler is suppliedUTC correctness. MMGIS stores every instant in UTC, but the picker was formatting and parsing in local time. A viewer west of Greenwich saw — and committed — the wrong day. Every
moment(...)inDateSelectorandDayCalendaris nowmoment.utc(...).Stylesheet split.
DateSelector.cssandFloatingPopover.cssmove out ofTimeline.cssand are imported by the components that own them, so the pieces travel with their directories.lib/css-imports.d.tsdeclares plain.cssimports, mirroring thescss-imports.d.tsother plugins' libs carry.Timeline window on the bus.
mmgisGetTimeStart/mmgisGetTimeEnd/mmgisGetTimeCurrentexpose the timeline's window to tools that need to read it without owning it.Tests
src/essence/Tools/Timeline/__tests__/— 10 cases, 2 files:DateSelector.spec.tsxpins the process timezone toAmerica/Los_Angelesbefore importing the component. On a UTC CI host, local and UTC formatting are identical and a local-time regression would pass; under this zone it surfaces as a wrong day or a shifted clock.TimelineAdapter.spec.tsxcovers that the action is offered and that clicking it puts the event on the bus.Notes for review
This is the timeline half only. The map-side comparison work — side-by-side layout and per-side date pins — lives on
feat/compare-tool-coreand lands separately; nothing here depends on it. The emitted event has no listener until that branch merges, which is the intended failure mode.