Conversation
Persist catalog and editor route state per session, transfer it on preview conversion, compose workspace load hashes on reopen/recovery, and reopen clean sessions after update restart when a save target exists.
The renderer used to take the saved view as soon as it asked for it, so a restore that had to wait for the glyph catalog lost the payload. Split the IPC into peek and consume so the renderer consumes only after restoring. Also stop recording open sessions on every quit, which reopened documents after a normal quit; record them only when restarting to install an update and clear them if the restart is cancelled. Skip the pre-reopen view flush for a crashed renderer, which cannot answer it and stalled crash recovery.
The route guard peeked at the saved view in the main process, and the next capture rewrote it after the restore consumed it, so the guard deferred forever and the editor never opened. Track the restore in the renderer, restore only once, and publish the opened glyph even when an effect rerun supersedes the request. Capture no longer overwrites a pending route with an empty one before the catalog has loaded.
The window was presented once the catalog painted its first frame, but the catalog only paints on Home, so a window loading straight onto an editor route stayed hidden.
Preview Save As, crashed-renderer reopen, and relaunch recovery each land on the last editor route. The conversion test opens glyph C because the converted fixture cannot open glyphs whose second layer references a dropped source. Relaunch recovery needs an unsaved edit to run at all.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
view-resume.json, and restore it after preview conversion, crash or error reopen, relaunch recovery, and update restart.Issue
Refs #492
Not closed by this PR: the Home fallback when a glyph cannot be remapped and the update-restart reopen are covered by unit tests only, with no E2E.
Follow-up found while testing: #493 (glyphs with extra UFO layers fail to open after Save as Shift).
Testing
Passed:
pnpm test(1231 desktop tests)pnpm typecheck,pnpm --filter @shift/desktop lint:check,pnpm format:checkpnpm test:e2e:platform e2e/document-crash.spec.ts e2e/document-lifecycle.spec.ts e2e/document-recovery.spec.ts e2e/home.spec.ts e2e/glyph-grid.spec.ts e2e/application-quit.spec.ts --repeat-each=2: 99 passed, 1 failed. Run on a branch that also contained fix(desktop): keep New and Open commands enabled without active windows #491; unit tests and typecheck were rerun on this branch. The E2E specs were not rerun on this exact head--grep "preview canvas clicks explain" --repeat-each=6. It looks like a load flake; I did not find a root cause.New E2E: Save As restores the editor route after preview conversion; a crashed renderer reopens on the last editor route; relaunch recovery restores the last editor route.
Not run:
visualandgpuE2E projects.GlyphGrid.tsxchanged, soe2e/home.spec.tsande2e/glyph-grid.spec.tsare relevant.--repeat-each=10flake runs on the new specs.