Skip to content

fix(ui-react): harden chat async and lazy fallbacks - #489

Merged
Astro-Han merged 7 commits into
mainfrom
codex/react-async-lazy-boundaries
Jul 4, 2026
Merged

fix(ui-react): harden chat async and lazy fallbacks#489
Astro-Han merged 7 commits into
mainfrom
codex/react-async-lazy-boundaries

Conversation

@Astro-Han

@Astro-HanAstro-Han commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep chat model switching and session row actions rejection-safe by catching delegated action failures locally while their AppShell owners keep visible toast feedback
  • give visible lazy chunks compact loading fallbacks, while keeping ArtifactPane lazy loading hidden until the pane itself can prove live artifacts or a current-session list error
  • add/adjust renderer contracts for chat async boundaries, lazy fallback ownership, ArtifactPane hidden default, and the existing voice microphone permission probe rejection boundary

Scope

Part of #477.

Async scope in this PR is intentionally limited to:

  • chat model switcher pending chrome
  • sidebar session row action pending chrome

Voice Settings is not changed in production here. Its microphone permission probe already catches navigator.permissions.query() rejection and returns unknown; this PR adds a contract for that existing boundary.

User-visible impact is limited to compact loading placeholders for surfaces that are already supposed to be visible. ArtifactPane now preserves the existing default-hidden product contract while its lazy chunk loads.

Verification

  • RED: lazy fallback contract failed while ArtifactPaneFallback rendered a fake .maka-artifact-pane
  • RED: async boundary contract failed while model switcher and session row actions depended on the shared swallow-errors helper
  • GREEN: npm run -w @maka/desktop test (1727 passed)
  • GREEN: npm run -w @maka/desktop build:renderer (passes; existing Vite large chunk warning remains)
  • GREEN: npm --workspace @maka/ui run build && npm run -w @maka/desktop build:main && node --test dist/main/__tests__/renderer-async-boundaries-contract.test.js dist/main/__tests__/session-sticky-model-contract.test.js dist/main/__tests__/session-row-actions-fail-soft-contract.test.js
  • GREEN: npm run -w @maka/desktop build:main && node --test dist/main/__tests__/renderer-lazy-fallback-contract.test.js
  • GREEN: npm run -w @maka/desktop build:main && node --test dist/main/__tests__/voice-capture-smoke-contract.test.js
  • KNOWN FAIL: npm run -w @maka/ui test still fails in existing chat-primitives footer-action / lineage-badge pixel merge assertions; those files are untouched by this PR

Commit Split

  • fix(ui-react): catch model switcher rejection
  • fix(ui-react): catch session row action rejection
  • fix(ui-react): add shell lazy fallbacks
  • fix(ui-react): add module lazy fallbacks
  • fix(ui-react): keep artifact pane lazy fallback hidden
  • refactor(ui-react): inline async pending cleanup
  • test(ui-react): pin voice permission probe rejection

@Astro-HanAstro-Han changed the title fix(ui-react): harden async and lazy boundariesfix(ui-react): harden chat async and lazy fallbacksJul 3, 2026
@Astro-Han

Copy link
Copy Markdown
ContributorAuthor

Review response pushed.

Refs #477.

Changes:

  • Removed ArtifactPaneFallback; ArtifactPane Suspense is back to fallback={null} so the generated-file pane stays hidden until ArtifactPane itself has live artifact/list-error evidence.
  • Reworked lazy fallback contract into visible-surface whitelist semantics: Settings/Browser/modules may reserve loading chrome; ArtifactPane must stay hidden without an explicit visibility gate.
  • Removed the shared runAsyncActionBoundary swallow-errors helper; model switcher and session row pending cleanup now catch locally and rely on their AppShell action owners for visible toast feedback.
  • Added a voice Settings contract confirming microphone permission probe rejection degrades to unknown; no voice production change in this PR.

Verification:

  • npm run -w @maka/desktop test passed (1727 tests)
  • npm run -w @maka/desktop build:renderer passed, with existing Vite large chunk warning
  • npm run -w @maka/ui test still fails on existing chat-primitives footer-action / lineage-badge pixel merge assertions; those files are untouched here

@Astro-Han
Astro-Han merged commit 226f31a into mainJul 4, 2026
@Astro-Han
Astro-Han deleted the codex/react-async-lazy-boundaries branch July 4, 2026 05:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Astro-Han