circagraph
Sign inSign up

openchronology/timeline-app on GitHub

The OpenChronology repository on GitHub, mirrored by och-import-github: issues and pull requests as durations (ongoing while open), what happened to them as moments, plus releases, milestones, commits and branches. The Branches view shows the most recently active branches each in a track of its own.

Source: https://github.com/openchronology/timeline-app

3,131 moments · 2026-10-05 CE 20:21:49 UTC – 2026-11-16 CE 12:10:45 UTC · by @athan · @athan

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

–

  • github
  • github/openchronology/timeline-app
  • github/openchronology/timeline-app#93
  • pull request
  • state:merged

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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/93

Related

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

#93 Keep dialog edits only on Save; hide Fit when there is…