#67 Fix: redo after undo showed a server moment twice
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#67
- pull request
- state:merged
On a **server** timeline, if you edit a moment, undo, then redo, the edited moment counts as a *new* moment: the event count reads 1,001 of 1,000, and it shows as "2 moments" beside the server's own copy. This lasts until you save. Saving still writes the right data, because changes are keyed by ID. **Cause:** - Undo puts the saved moment back, so `RemoteWorkspace` drops the change. - With the dialog closed, the next render's `evict()` drops the moment and its saved original, since nothing references it. - Redo then `put`s the edit with no known original, so it's recorded as an addition (no `before`), and the overlay doesn't hide the server's copy. Durations have the same eviction path. **Fix:** - `evict()` takes the moments and durations the undo/redo history still refers to, and keeps them loaded with their originals. - The editor passes them from `history` and `future`. **Tests:** - `test/remote-cache.test.mjs` replays load → edit → undo → evict → redo. With the history retained, the redo keeps its `before`; without it, the old behaviour shows up as an addition. - End to end on the platform (Next.js + PostgreSQL, Chromium), via the UI benchmark harness: after redo the count stays 1,000 with one renamed marker, and saving stores 1,000 rows. - Unit tests pass (200), and the Chromium browser suite passes. Found while building the UI benchmarks for #51. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ti36soiZpKdSxKfvQLEcfY https://github.com/openchronology/timeline-app/pull/67
Related
- #51 thorough ui benchmarks verifying user interaction within thresholds defined by systems benchmarks
- #70 UI interaction benchmarks against the capacity budgets (browser and platform)
- #71 CI: cache vcpkg sources and builds for desktop packages
- Merge pull request #67 from openchronology/fix/redo-server-edits
- Cache vcpkg sources and builds for the desktop packages
Open #67 Fix: redo after undo showed a server moment twice in the timeline