Repository navigation
fix(ui): recover failed lazy surfaces - #126409
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 19, 2026 19:13
Contributor
Author
|
Land-ready evidence for exact head 6a73b0398daf843ef8bc2cc509744af670f0096f:
Known proof gaps: none. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 20, 2026
This was referenced Aug 26, 2026
This was referenced Oct 16, 2026
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.
What Problem This Solves
Fixes an issue where opening an optional Control UI surface could leave users on a permanent mascot/loading state—or silently do nothing—when its hashed custom-element module failed to load. Standalone terminal, desktop, dashboard, and approval views could stall; command-palette, debug, approvals, and other non-session panel actions could disappear without an outcome.
Why This Change Was Made
Optional custom-element loading previously owned only pending/defined state: rejected imports were logged and then discarded. This change makes loading and failure explicit, gives users visible Retry and Close actions, and records the exact shell action in a closed sessionStorage event descriptor so it can be replayed after the existing bounded reachable-document reload. Focused document URLs keep their own intent. Close fences late replay, context reset abandons it, and an ordinary document reload preserves it.
Chromium pins a failed hashed module URL for the document lifetime, so Retry deliberately uses the existing reachable-document reload owner. There is no gateway/version compatibility fallback and no alternate import path. The obsolete manual
control-ui-sharedchunk grouping was removed, reducing startup requests while keeping the new lifecycle below the existing byte budget.Optional shell loading was introduced by b395dfc in #106243; later focused-document reuse carried that lifecycle forward.
User Impact
A failed optional UI module now ends in a visible, actionable state. Users can retry through a safe document reload and return to the exact intended surface, or close the failed action without a delayed replay reopening it.
Evidence
Before: the command-palette action disappears and leaves only the mascot/home surface, with no error or recovery action.
Failure: the real hashed import error is visible with Retry and Close.
Recovered: Retry reloads the document and reopens the original command palette without another user action.
Recovery recording:
recovery.webm
Production/tooling LOC: +494/-170 (net +324). Tests/test support: +703/-155 (net +548). The production growth is the missing explicit load/error lifecycle, durable reload-action ownership, and visible Retry/Close behavior; the old promise-only/error-swallowing paths and obsolete manual chunk grouping were deleted.
Validation on the committed bytes:
pnpm test:ui: 710 files passed; 10,061 passed, 1 skipped.node scripts/check-changed.mjs: passed after the assertion fix.pnpm ui:i18n:verify: passed; keys=5,421, raw-copy baseline=79.pnpm ui:build: passed. Startup JS is 10 requests and 345,196 B gzip (337.1 KiB), below the unchanged 345,485 B (337.4 KiB) limit.node scripts/run-vitest.mjs ui/src/e2e/lazy-custom-element-recovery.e2e.test.ts: 4/4 passed against the production bundle in Chromium with a mocked Gateway. The test intercepts the actual hashed terminal, desktop, dashboard, and command-palette chunks: the first chunk request is aborted, the first HEAD probe returns 503, Retry succeeds on the next HEAD, the document reloads, the second chunk request succeeds, and the original action replays.git diff --check: passed.isOptionalElementDefined(...)guard after replay. Broad UI and panel tests remain green.AI-assisted: yes. The maintainer reviewed, understands, and owns the change.