Skip to content

refactor(ui): share chat import recovery lifecycle - #180998

Merged
steipete merged 1 commit into
mainfrom
solid2/w-deslop-final-chat
Oct 22, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-deslop-final-chat

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

HTML previews and question cards duplicate the same lazy-import failure and retry lifecycle.

User Impact

No user-visible change. Loading, retry, stale-build recovery, source replacement, retained preview frames, question focus, tags, classes, and lazy import timing stay the same.

Why This Change Was Made

Both callers now use one chat-local import boundary. Each still supplies its own source identity, loading view, and connection check: preview recovery follows file/content identity and its retry button; questions follow request identity and the native card host. Only the failed recovery subtree is keyed, so successful content keeps its lifetime.

Production LOC in the affected files: 237 → 202 (−35). Tests are unchanged (403 → 403 across the two loading suites). No new dependency or startup import. This is a source consolidation, not a CPU-speedup claim.

Evidence

Acceptance rule set before measurement: same-machine base/head production builds; no boot-surface growth beyond 64 B build variance; preserve request counts and one startup CSS request. Base: 3a2f16623c12b9daafa100bbf198016d6a399cf4.

Proof Result
UI typecheck (pnpm tsgo:ui) Passed
Preview + question loading suites, one worker 2 files / 2 tests passed; real lazy imports, retries, stale recovery cancellation, request replacement, frame retention and focus
Touched-file lint/format and diff check Passed
Control UI controller guard Passed; no baseline changes
Solid refactor counts (three touched production files) createMemo 4 → 2; onSettled 2 → 1; createEffect, onCleanup, untrack, direct listeners, DOM queries, flush, and owner APIs all 0 → 0
Production build and strict base comparison Passed
Startup JS gzip / requests 315,944 → 315,939 B (−5 B), 7 → 7
Chat boot JS gzip / requests 1,417,424 → 1,417,471 B (+47 B, within 64 B build variance), 24 → 24
New Session boot JS gzip / requests 953,883 → 953,872 B (−11 B), 19 → 19
Startup CSS 41,145 → 41,145 B; 1 → 1 request
Production Knip No chat findings; existing findings outside scope
Independent review Completed before commit
Broad chat performance/retention/UI/Gateway proof ci:full requested

No visual changes; the existing loading suites verify the retained DOM behavior.

Scope census

Before this PR, chat contains 165,513 production TypeScript/TSX lines (171,617 including CSS), plus 207,617 test/support lines. Scoped jscpd found 21 exact production clone pairs / 202 duplicated lines. The large one-caller helpers examined own real lifecycle, authority, or derivation behavior. No dead chat exports or flags were proven. The other verified production family above approximately 20 removable lines is rail JSX prop typing (#181010, −22 lines); duplicated attachment-test setup is addressed in #181002 (−37 test lines). Together the three focused PRs remove 57 production and 37 test lines. The census does not justify forcing a 3% production deletion through behavior changes or formatting.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T21:25:53.222266Z 0209ad1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 21:33
@steipete
steipete merged commit bc485f7 into main Oct 22, 2026
120 of 122 checks passed
@steipete
steipete deleted the solid2/w-deslop-final-chat branch October 22, 2026 21:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant