Skip to content

Preserve native shopping context and isolate streaming card updates - #18

Merged
ChanTso merged 3 commits into
mainfrom
codex/client-depth
Sep 11, 2026
Merged

ChanTso merged 3 commits into
mainfrom
codex/client-depth

Conversation

@ChanTso

@ChanTso ChanTso commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Catalog searches, product details and transaction refreshes previously shared too much lifetime. A late detail response could reopen a dismissed product, while navigating to the assistant lost the selected SKU. Both native clients now cancel superseded requests, preserve the consultation return context and catalog state, and poll an existing reservation only while its screen is visible in the foreground. An accepted write followed by a failed refresh is reported separately from an unconfirmed write.

SwiftUI gives immutable message segments their own equality boundary so text growth can reuse unchanged cards. Finalization and same-slot replacements still update native controls. Card presence crosses the Kotlin/Swift boundary as a Boolean; content uses the existing JSON string representation. Release builds select the Release Kotlin/Native framework.

Validation:

  • iOS Debug: 21 tests passed, including actual-window catalog/tab/layout and partial/final/replacement screenshots, visually inspected. Request ordering, cancellation, selected SKU return and write/refresh distinction have regression coverage.
  • Android: 15 JVM tests and 5 emulator interaction tests passed; APK build and lint passed. Shared JVM: 8 tests passed after the interop change.
  • Release mixed replay: 60 history messages, 240 four-character deltas, partial/final product and comparison cards, one frame every 20 ms; one discarded warmup and three measured iterations. Baseline 78d612a0dce4e53a3f545f84f70496ec6960cf9e to final 7df07c6ba7a4f14b9ca74869ddd33e79991f2df5: mean elapsed 5.369 to 5.380 seconds, process CPU 1.777 to 1.848 seconds, peak physical memory 139114 to 111965 kB. CPU and elapsed time did not improve; the lower memory observation is local to this workload, not a frame-rate or general speed claim.
  • Independent read-only review found no blocking behavior, ownership or secret issue. Full CI is the merge gate. Python, Web and CityBuddy behavior was not changed.

The catalog test uses SwiftUI ID navigation, actual content offset and screenshots; it does not claim physical touch or OS suspension coverage. Mixed replay uses URLProtocol, without TCP/TLS, model or business service. Measurements include history restore, native byte handling, KMP, SwiftUI, completion polling and final image capture. Fixed pacing dominates elapsed time. SwiftUI Instruments is unavailable on Simulator, and a separate Time Profiler capture failed to finish; neither provides frame or call-count evidence.

The new card-state regression caught a Debug-only nested Kotlin JSON bridging crash in the initial instrumentation guard. It was fixed using the scalar presence getter; the complete suite and final Release replay were rerun. Raw XCTest outputs and screenshots were retained, without discarding unsuccessful diagnostics.

@ChanTso
ChanTso merged commit bb3c355 into main Sep 11, 2026
4 checks passed
@ChanTso
ChanTso deleted the codex/client-depth branch September 11, 2026 19:43
Sign up for free to 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