Repository navigation
refactor(ui): retire grandfathered oversized chat modules - #133751
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 31, 2026 03:02
steipete
force-pushed
the
claude/chat-surface-refactor
branch
2 times, most recently
from
August 31, 2026 06:15
856fd73 to
96899a5
Compare
Retire the four grandfathered oxlint max-lines suppressions by splitting chat-history, tool-stream, composer-persistence, and chat-tool-cards into concept-owned modules; regenerate the boot manifest; adopt the upstream message-visibility extraction and 800-message page limit from the rebase.
The tool-stream split left a type-import cycle (preamble -> status -> tool-stream). The shared host/event/status types move to tool-stream-contract.ts, the lane's import-light leaf, and every importer references the contract directly — no re-export barrel.
All consumers import the constant from its owner outbox-store-codec; the composer-persistence compat re-export lost its last importer.
steipete
force-pushed
the
claude/chat-surface-refactor
branch
from
August 31, 2026 06:32
96899a5 to
cab0562
Compare
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Sep 1, 2026
…33751) * refactor(ui): split oversized chat modules Retire the four grandfathered oxlint max-lines suppressions by splitting chat-history, tool-stream, composer-persistence, and chat-tool-cards into concept-owned modules; regenerate the boot manifest; adopt the upstream message-visibility extraction and 800-message page limit from the rebase. * refactor(ui): simplify chat display and subscription logic * test(ui): consolidate sender presentation coverage * refactor(ui): extract the tool-stream leaf contract The tool-stream split left a type-import cycle (preamble -> status -> tool-stream). The shared host/event/status types move to tool-stream-contract.ts, the lane's import-light leaf, and every importer references the contract directly — no re-export barrel. * refactor(ui): trim imports orphaned by the tool-stream contract move * test(ui): point restored composer-lane tests at the split history modules * refactor(ui): drop the dead interrupted-settings re-export All consumers import the constant from its owner outbox-store-codec; the composer-persistence compat re-export lost its last importer.
This was referenced Oct 16, 2026
This was referenced Oct 27, 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
The chat surface carried four grandfathered
oxlint-disable lnproduction files — [chat-history.ts] at 2,221 lines, [tool-stream.ts] at 1,209, [composer-persistence.ts] at 1,111, and [chat-tool-cards.ts] at 1,060 — plus accumulated duplication: state fields re-declared locally that already live on theChatStatecontract, hand-rolled record guards where the canonicalrecord-coercehelper belongs, single-use wrapper functions, duplicated tool-card predicates, and near-duplicate sender-presentation test cases from the recent forwarded-message campaign.Why This Change Was Made
Three lanes, zero behavior change:
Lane 1 — retire the suppressions. All four files split along concept boundaries into 14 new modules (history: actions/branches/hydration/request/snapshot/state/stream/subscription; tool-stream: status/preamble; composer: session-store/queue-store; tool-cards: content/command-highlight). All 18 resulting files sit under the 700-line cap with no suppressions; the four
oxlint-disable lnmarkers, their baseline entries, and the composer export-ignore entry are deleted. History request fencing, staged prefetch, subscription ownership, and hydration-ordering comments moved with their owning logic. The boot manifest was regenerated (pnpm ui:boot-manifest:gen); no[INEFFECTIVE_DYNAMIC_IMPORT]warnings.Lane 2 — simplify. Removed the locally re-declared subscription state fields (they live on
chat-state-contract.ts), replaced a hand-rolled block filter in heartbeat display with the canonicalasOptionalObjectRecordguard (traced case-equivalent for all five block shapes), swapped a localnormalizeSubscriptionKeyfornormalizeNullableString(identical trim/empty/non-string semantics), and deleted redundant patch/subscription wrappers and duplicated tool-card predicates. Assertion-safety baseline shrank by one more allowance.Lane 3 — test consolidation. Table-drove six near-duplicate sender-presentation cases across
message-normalizer.sender-label.test.tsandchat-message.test.ts, keeping distinct failure names and behavior coverage. Full splits of the 10k-line test files remain deliberately deferred.User Impact
None visible — internal restructuring. The production LOC delta is net +132 (+4,061/−3,929): the growth is module imports, types, and explicit ownership boundaries purchased by retiring four suppressed oversized files — the named justification is the ownership-boundary structure itself. Tests net −11.
Evidence
node scripts/run-vitest.mjs ui/src/pages/chat ui/src/lib/chat— 4,426 tests passing (207 files).node scripts/check-changed.mjs— fully green, proving the suppression removals hold (format, tsgo lanes, lint stripes incl. max-lines, dead-export scan, assertion ratchet, import cycles).pnpm build— clean, no ineffective-dynamic-import warnings;node scripts/ui.js build— all budgets green, startup JS gzip 345,579 B (1.8 KB under the enforcement limit).normalizeNullableStringsemantics matched against the deleted local helper; removed state fields confirmed present onchat-state-contract.ts:70-71.