#549 Let separations disjoin and unite: from or into any track, at a time, a moment, or their first or last
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#549
- pull request
- state:merged
Disjoins and unions for separations: when a separation splits off from another track, and when it joins one again. ## What it does **Disjoins.** Each separation can have a list of disjoins, at most one from each track. - **From:** the main timeline, or any other separation, earlier or later in the list. Separations are worked out in dependency order. A circle of disjoins is refused, and the dialog offers only sources that avoid one. - **When:** at an exact time; at a moment's time, which follows the moment as it moves; or at the separation's first moment, which follows its moments as they're added, moved or removed. - **Before it,** the events stay in the track they would otherwise be on. From it on, they move into the separation's track, which begins there with a curve from the source track's axis. **Unions** are the complement, also at most one into each track. - **Into:** the main timeline, or another separation. - **When:** at an exact time, at a moment's time, or at the separation's last moment. - **From a union on,** the separation's events are in the target track. If several unions have passed, the latest applies. If the target has itself united somewhere, the events follow on, and unions pointing at each other stop instead of looping. - **Drawing:** the separation's track ends at its earliest union and curves back into the target. For example, with separations A and B, A can disjoin from B at X and from the main timeline at Y. **Dialog.** Under each separation's tags, its disjoins and unions share one list. - Each is a card labelled **Disjoin** or **Union**, with what it leaves or joins and when, an **Edit** button and **×** to remove it. - The list scrolls past about four cards. - **+ Add a disjoin or union** opens a modal, and **Edit** opens the same modal. It has: - a **Kind** radio for Disjoin or Union, greyed out when that kind has no track left; - the track, labelled **From** or **Into**, offering only tracks that avoid a circle and aren't already used by that kind; - tabs for **Exact time** (with the date picker), **A moment** (opens the moment picker) and **Earliest moment** / **Latest moment**. - Removing a separation drops the cards that name it. **Bar label.** Each separation is named with its joins, such as `war (from main at 15; into main at 90 (its last moment))`. ## How A new filter, `{separations, track}`, carries the whole plan to every store, since an entity's track depends on its time. - **Core (`src/tags.ts`):** - `validateSeparations` checks the plan; - `separationOrder` sorts it by dependency and refuses circles; - `resolveSeparations` resolves each disjoin and union time against the document; - `separationTracks` places an entity. - **Server:** - views are built with the filter through the core; - the view cache is keyed by revision, so moved moments rebuild it. - **App, server and desktop timelines:** - moment times come from `moment` queries; - the first moment comes from a filtered events page; - the last comes from the last group with moments in a filtered overview, then paging from there. - **Desktop store (`Membership::Tracks`):** - mirrors the core; - resolves times in SQLite (`MIN`/`MAX` by tag for first/last); - keeps per-join "on or after" sets, with unions sorted by time. - **Saved forms:** - default views and stored tabs keep `{"separations": [...]}`, with `disjoins` and `unions`; - OpenAPI and `docs/tags.md` describe both. ## Screenshots War disjoins from the main timeline at 15 and unites back at its last moment. Trade disjoins at its first moment and unites into war at 55. (They're in the conversation; GitHub can't take local uploads from here.) ## Tests - **Unit:** - each disjoin and union kind; - disjoining from a later separation (the A/B case); - union chains, the latest union winning, and unions pointing at each other; - circles and validation errors; - default views and stored tabs. - **Browser:** the full suite passes,… https://github.com/openchronology/timeline-app/pull/549