Repository navigation
perf(ios): stop redrawing the model menu and buttons on every keystroke - #194235
vyctorbrzezowski merged 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR isolates draft-dependent editor and primary-control evaluation using the existing SwiftUI observation boundary. Example: Type “mount” in the iOS composer, then clear it.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides a focused, maintainer-supported performance improvement that current main still needs; no actionable correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared native chat composer consumes observable draft and session state and renders the editor, model controls, and Send/Stop/Talk actions for iOS and macOS. flowchart TD
A[Draft edits] --> B[Chat view model]
B --> C[Editor section]
B --> D[Primary controls section]
E[Session and catalog state] --> F[Model controls]
C --> G[Native composer]
D --> G
F --> G
Technical reviewBest possible solution: Keep draft reads inside the existing section boundaries while preserving the current editor and primary-control behavior. Do we have a high-confidence way to reproduce the issue? Current-main builders eagerly read draft-dependent state, and the supplied baseline regression records the resulting outer observation invalidation; this review executed no target code. Is this the best way to solve the issue? The smallest complete repair reuses ChatComposerSection at the two draft-reading subtrees, preserving existing state ownership and avoiding a cache or parallel rendering path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af9d6236b33f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +10, Tests +39. Total +49 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed November 16, 2026, 9:09 PM ET / November 17, 2026, 02:09 UTC (Revision 5). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
ca086cf to
6035937
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
6035937 to
a7ade8e
Compare
|
Maintainer review: the production fix remains unchanged and reuses the existing observation boundary. I simplified the test counter to Mutex and corrected import ordering. The retained native-app test proves parent isolation while the child continues to observe draft changes; the before/after below confirms typing, clearing and Talk/Send parity through the app. It is not a latency benchmark. The current body records the fresh iOS package-test limitation: unrelated tests use Process, which is unavailable on iOS; the product schemes have no test action. I have not represented those attempts as passing. Scoped format/lint and the independent source review pass; current-head CI remains required. composer-before-after.mp4@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ke (openclaw#194235) * fix(ios): avoid rebuilding clean composer controls on draft edits * test(ios): simplify composer invalidation probes --------- Co-authored-by: Vyctor H. Brzezowski <[email protected]>
What Problem This Solves
Editing a draft makes the clean chat composer observe draft changes outside the editor and primary controls, causing unnecessary parent work on each keystroke.
User Impact
Draft edits stay within the draft-dependent composer sections. The existing Send, Talk, placeholder, and model-picker layout is unchanged. This does not claim a measured typing-latency improvement.
Why This Change Was Made
Reuse the existing
ChatComposerSectionobservation boundary for the editor overlay and clean primary controls. No new state, renderer, or cache is introduced. The small wrappers are necessary observation boundaries.Evidence
Published author verification is recorded here; the maintainer update below identifies the current checks and remaining limitations.
empty_stringwarning at line 219 of the parity test.AI-assisted implementation and review.
Inspectable simulator artifacts
Mounted runtime proof
One additional simulator UI test passed (iPhone 17 Pro, iOS 27.2). Temporary instrumentation on the published source fix records the actual mounted composer, model-controls, editor, and primary-control evaluations. From the first nonempty editor event through deletion back to empty, the composer and model-controls each evaluated zero times; the editor and primary controls observed the draft changes. Startup/keyboard-focus evaluations precede that interval. SwiftUI coalesced some edits (editor lengths 1,4,5,4,3,2,0), so this is not a one-render-per-keystroke assertion.
XCTest and visually inspected screenshots verify empty Talk/no Send → “mount” with enabled Send/no Talk → cleared Talk/no Send. Synthetic fixture, not live gateway or device proof; no measured latency claim. Instrumentation is evidence-only and is not shipped.
Maintainer verification
Reviewed candidate:
bbe4a082ad69f85edfeac1b54ed517500051bb4f.The production fix is unchanged. The maintainer follow-up replaces the test-only lock/count wrapper with
Mutex, preserves both the parent-isolation and positive child-observation assertions, and sorts the imports. Scoped SwiftFormat and SwiftLint pass; an independent review found no actionable P0–P2 issue.The earlier native-app regression run executed and passed
ChatInputResponsivenessTestson this production source. That run temporarily included the shared test in the app test target; the temporary copy was removed. Fresh attempts to run the untouched package test target on iOS are disclosed separately: the package cannot compile unrelatedOpenClawClientCredentialStoreTestsuses ofProcess, and the product schemes have no test action. Those attempts did not execute this test. No source exclusions or new test transplant was used to hide that limitation; the new head still requires its normal CI.Maintainer before/after
These are retained recordings from the native iPhone simulator in this review, using the same isolated Gateway and synthetic conversation. Left: the two observation boundaries removed for the baseline. Right: the published production fix. Both show typing the same draft and clearing it, with the keyboard and Talk → Send → Talk transition preserved. Initial idle time was trimmed independently and the takes were paired at normal playback speed. The video demonstrates interaction parity, not a latency benchmark; the observation-count evidence above supports the reduced-work claim.
Clean comparison
Annotated comparison
Video
composer-before-after.mp4