ulysses/static
nubs 8746c9c0df
fix(documents): discard pending AI diff before switching active doc (#2484)
The document editor stores the AI-edit diff state (_diffModeActive,
_diffOldContent, _diffNewContent, _diffChunks) as a module-global
singleton bound to whatever document was active when the diff opened,
and every document shares one #doc-editor-textarea. When the active
document is switched while an unapproved diff is open, the stale diff
must be discarded first or a later exitDiffMode (tab switch /
Accept-Reject-All) flushes the old document's content into the new
active document and overwrites it (issue #2467).

Guard both paths that switch the active document for an AI update,
while activeDocId still points at the previously-active doc:
- handleDocUpdate(): a doc_update targeting a different document.
- streamDocOpen(): the AI streaming a NEW document — this runs first on
  that path, so a guard only in handleDocUpdate would fire too late and
  still overwrite the streamed document.

Both reuse the exact `if (_diffModeActive) exitDiffMode(true);` guard
switchToDoc() and enterDiffMode() already use.

Fixes #2467
2026-06-07 22:35:35 +02:00
..
fonts Odysseus v1.0 2026-05-31 23:58:26 +09:00
js fix(documents): discard pending AI diff before switching active doc (#2484) 2026-06-07 22:35:35 +02:00
lib Odysseus v1.0 2026-05-31 23:58:26 +09:00
app.js Improve edge-docked window behavior (#2779) 2026-06-05 17:07:08 +02:00
index.html fix(settings): correct Add User username placeholder (#3296) 2026-06-07 17:50:18 +02:00
login.html fix(login): keep inputs >=16px on touch so iOS doesn't zoom on focus (#1632) 2026-06-03 14:23:24 +09:00
manifest.json Odysseus v1.0 2026-05-31 23:58:26 +09:00
style.css feat(model-picker): add remove-from-recent button to Recent section rows (#2894) 2026-06-07 17:45:59 +02:00
sw.js fix(ui): modal drag + removed startDrag func (#2430) 2026-06-04 20:34:18 +02:00