#553 Separate by an entity's relationships beside separations by tags
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#553
- pull request
- state:merged
Separations by an entity's relationships, either **related** (its direct links) or **all connected** (any chain of links), now sit in the list of separations beside tag separations, instead of replacing them (#552). This is stacked on #551; I'll retarget it to `main` once #551 merges. ## What it does - **One kind of separation:** a separation is `{tags}` or `{related, depth}`. - Both kinds take disjoins and unions. - For a relationship separation, "first" and "last" moment are the earliest and latest moments in the entity's set. - **Made and changed only in the entity's details:** - **Separate related** or **Separate all connected** adds a separation beside those shown. - When one is shown, the details offer the other depth instead, and **Stop separating** removes it. - While separated, the details use the entity's own ID, not its track's (` : `). That made the related list empty before. - **Separate dialog:** it lists one as a read-only card ("Related to “Alpha”"), with **Remove** and its disjoins and unions, but no tags to edit. The note that separating by tags replaces the relationship separation is gone. - **Bar label:** - one alone reads as before ("Separated: related to | Alpha"); - several read like `related to “Alpha” · related to “Charlie” · war`; - track titles read "Related to Alpha" or "Connected to Alpha". - **Views and default views keep them.** - A lone one is still written as `{related, depth}`; mixed with tag separations, they're written as `{separations}`. - Stored tabs keep `{tracks, titles}` and read the old relationship form. - When a timeline opens in a view whose entity is gone, that separation is dropped. If nothing is left, the timeline opens whole, as before. - **Shift or scale these…:** - offered for tag separations, or for one relationship separation alone; - hidden when they mix, since it can't select both at once. ## How - **Core** (`src/tags.ts`): - `SeparationTrack` is a union, and `validateSeparations` accepts either kind; - `separationMatch` resolves a separation's entities (tags, or the related set by breadth-first search); - `separationTracks(separations, key, tags, time)` matches by key or tags; - `boundMomentTime` and `disjoinTime` take the match. - **Server:** builds track views through the core, so nothing changes there. - **App:** - the app's `Separation` is always `{tracks, resolved?, titles?}`; - `startSeparation` picks plain filters when they say it all (tags, or one entity's set) and `{separations, track}` otherwise; - on server timelines, first and last moments are read with the separation's own filter. - **Desktop store:** - `SeparationMatch::{Tags, Members}`; - a relationship separation's set comes from the file's `relationships` table; - first and last moments come from its moments' IDs. - **OpenAPI:** `SeparationTracks` items are `tags`, or `related` with `depth`. ## Tests - **Unit:** - relationship separations alone, mixed with tags, disjoining from a tag separation at their first moment, uniting at their last; - a missing entity, and validation; - default view forms and `sameSeparation`; - stored tabs, old and new forms. - **Rust:** related and connected sets, and a mix with a disjoin at the first moment. - **Browser:** - with Alpha's set shown, Charlie's is added from its details; - the dialog lists both read-only, and a tag separation is added there; - Alpha is switched to all connected, then stopped. The full suite passes. - **`npm test`:** passes apart from `contents.test.mjs`, which fails locally on untracked folders. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/553
Related
Open #553 Separate by an entity's relationships beside separations by tags in the timeline