fix(apps): Notepad opens persisted docs; start-menu focus contract pinned (#32) - #38
Merged
Merged
Conversation
The open path never read the VFS: create() seeded the editor with the
welcome copy and only the click-driven reloadFromVfs() ever called
vfs.read. After a full page reload StorageVfs had already replayed the
snapshot (Files listed the document), yet a freshly opened Notes window
rendered seed text until the user clicked Reload — confirmed E2E
cross-engine on the previous deploy (PX-0099/PX-0108).
Opening now restores persisted content immediately when the
deterministic target document (/notes/note-N.txt) already exists. The
restore stands down if the user typed while stat/read were in flight,
so async loading can never clobber live edits; read errors keep the
seed text and stay on the Reload path's status reporting.
Regression test reproduces the defect through the real boot: write the
next note's document into the restored VFS, shell.open('notes'), assert
the editor value (red-checked against the unfixed tree). (#32)
…s shim Re-derived WEB-0035 defect B against the post-rewrite architecture: the opener-focus restore survived PR #31 reimplemented inline in main.ts (closeStartMenu captures the opener at open and hands focus back when dismissal leaves it stranded on body). Escape, toggle and click-outside closes all run through that path. Add the missing outside-click close-path regression to the smoke suite, following the established post-prune focus pattern (overlay mirrors are not reliably projected under happy-dom). Remove src/desktop/start-menu-keys.ts: the pre-rewrite keyboard shim wrapped shell.toggleStartMenu for the engine StartMenu entity and owned the old restore logic; PR #31 stopped installing it (was main.ts:324) leaving zero references while its header still claimed ownership of focus restoration — exactly the drift this module list warns about. roving-focus.ts stays: pure tested util, not tied to the dead wiring. (#32)
applyTheme rebuilds the WebOSTaskbar before closeStartMenu runs, so an opener captured while the menu was open is already disconnected at restore time and focus() on the detached node silently no-ops — Escape, outside click and launch dismissal all strand DOM focus on body after a theme switch (review F3, PR #31 leftover). Re-validate the captured opener at restore time: keep the immediate focus() while it is still connected, otherwise defer focus to the live bar's Start tile mirror one sync pass out — rebuilt mirrors are projected by the next a11y sync pass, not on scene.add. The deferred restore yields if anything else took focus meanwhile, matching the immediate path's contract. WebOSTaskbar gains a startButton accessor for the fallback target. The regression test drives applyTheme with a captured opener and pins focus on the rebuilt bar's Start mirror; verified red without the fix. webos#36
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.
PR body
Closes #32. Fixes #36 (theme-switch focus stranding).
create()seededWELCOME_TEXTand never read the VFS; opening now restores the persisted document (guard baseline committed, typed-during-flight stand-down, read errors stay on the Reload path). Red-checked smoke test included.start-menu-keys.tsshim removed with its own commit.closeStartMenure-validates the captured opener and defers to the rebuilt bar's Start-tile mirror when disconnected (mirrors project on the nextsyncA11ypass, verified against engine dist). Regression test red-checked.Review round complete: commit/message mismatch resolved via rebase; F2/F3 findings addressed or documented.
Gates: 187 pass / 0 fail (rebased on 91ea42c) · tsc clean · oxlint clean · oxfmt repo-wide · build OK.