timescale.info
Sign inSign up

How OpenChronology was built

Every merged pull request of openchronology/timeline-app, its first week of commits and its releases; and before them the 2020 PureScript editor, from snapshots of its deleted repositories in the Wayback Machine. Written to this server through the HTTP API.

327 moments · 2020-03-09T00:15:08Z CE – 2026-11-02T20:11:21Z CE · by @athan · @athan

#93 · Keep dialog edits only on Save; hide Fit when there is nothing to fit

  • timeline-app
  • pull request

Closes #75 and #76. ## #75: only Save keeps a dialog's edits **Before:** - **Edits applied as you typed,** and were kept however the dialog closed. - **New duration:** added to the timeline *before* its dialog opened, so clicking outside left it on the timeline. - **New moment:** added as soon as anything was typed. Escape kept it too. **Now (choices confirmed in the session):** - **Only Save keeps.** Cancel, Escape, the × button, clicking outside, and opening another entity from the dialog all restore what the dialog opened with. - **Existing moments and durations** still preview on the timeline as you type, but nothing is kept unless saved. Browser drafts aren't stored during a preview (`previewing` gates `persistDraft`, including an already-scheduled save); Save or discarding stores the result. - **New moments and durations** stay in their dialog until Save adds them, as one undo step. For a new moment, the time cursor shows where Save will put it. The dialog says "Not on the timeline yet: Save adds it." A new duration has no Delete button. - **Deleting from a dialog** discards its unkept edits first, so undo restores the entity as it was opened. - **Safety:** reverts apply only within the timeline the dialog was opened in, so a dialog closed by loading another timeline never touches the new one. Undo while a dialog previews removes the preview as one step. ## #76: no Fit when there's nothing to fit - **Empty timeline:** the toolbar's **Fit all**, the empty state's **Fit the timeline** and the context menu's **Fit all** are hidden, and the empty state says "This timeline has no moments yet." (The offline file keeps its "Import a timeline or add your first event.") - **Durations only:** Fit now also covers durations held in the page, so a timeline with only durations shows the buttons and Fit brings its durations into view. ## Tests - **`moment-dialog-browser.mjs`:** - ×, Escape and clicking outside discard edits that were shown on the timeline, and Save keeps them; - a new moment isn't counted until Save, and Escape leaves nothing; - a new duration isn't drawn while its dialog is open, and Cancel, clicking outside and Escape all leave nothing; - clicking outside an existing duration reverts its edits; - an empty timeline hides both Fit buttons and the menu item and shows the new text; - a durations-only timeline fits its durations. - **Shared helper:** `closeMomentDetails` now presses **Save** when edits are under way (otherwise ×), keeping the intent of the many existing "edit, then close" steps. A new `dismissMomentDetails` closes without keeping. - **Updated steps:** those that relied on eager adds or ×-keeps (`browser`, `selection`, `issues`, `drafts`, `offline`, `desktop-cache`) and the status text ("Shown on the timeline…"). - **Locally in `mcr.microsoft.com/playwright:v1.58.2-noble`:** `test/browser.mjs` passes on chromium, firefox and webkit; `offline-browser.mjs` on chromium and firefox; `npm test` (225) and `typecheck` pass. The moment-dialog step that failed on `main` in that container now passes; it was the eager-duration assertion this PR replaces.

Sources

Open #93 · Keep dialog edits only on Save; hide Fit when there is nothing to fit in the timeline