feat: auto-save and restore session state (#135)

- Save and restore chat messages, XML snapshots, session ID, and diagram XML to localStorage
- Restore diagram when DrawIO becomes ready (using new onLoad callback)
- Change close protection default to false since auto-save handles persistence
- Clear localStorage when clearing chat
- Handle edge cases: undefined edit fields, empty chartXML, missing access code header
This commit is contained in:
Dayuan Jiang
2025-12-07 01:39:09 +09:00
committed by GitHub
parent 8b578a456e
commit b1bc1a6dc6
5 changed files with 223 additions and 18 deletions

View File

@@ -467,7 +467,9 @@ export function replaceXMLParts(
i,
i + searchLines.length,
)
const normalizedCandidate = normalizeWs(candidateLines.join(" "))
const normalizedCandidate = normalizeWs(
candidateLines.join(" "),
)
if (normalizedCandidate === normalizedSearch) {
matchStartLine = i