Skip to content

ios-native parity pass 2: chat, composer, and library - #1155

Merged
AnthonyRonning merged 20 commits into
codex-ios-native-swiftfrom
codex-ios-native-parity-2
Oct 14, 2026
Merged

AnthonyRonning merged 20 commits into
codex-ios-native-swiftfrom
codex-ios-native-parity-2

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Brings the native Swift chat, composer and library closer to Research while extending Mark’s existing components. Thinking choices are captured with queued turns, background refresh preserves account and run ownership, older-page loading retains the visible message position, and project detail shares the existing instructions and selection controls. The final changes also correct cancellation and polling recovery, declined image-paste fallback, legacy rendering publication, and library navigation/copy. A fresh direct send also starts a new queue session when the previous queue is empty, clearing a stale pause after Stop, reload or reconnect while preserving paused pending messages and edits.

Base: codex-ios-native-swift at 6baf139caf2d4c91b726274d2ab173a123996772. Research reference: 2f22d3375c4e420413e619a0b4be1b742532e2cd; R/ below means apps/maple-research/frontend/src/ at that commit. Final head: 7b986bbe2017a1cf19a38d8cc97f2157b5334f01. 20 signed commits (14 item commits and 6 review-fix commits), retaining the configured identity and OpenPGP signing.

Item Status and resulting behavior Research source
1 Done — catalog reasoning/budget metadata, supported thinking choices and Default fallback, account-scoped chatThinkingLevel persistence, effort captured at submission/queue admission, nested request encoding, native options row and non-default trigger label. Future effort strings remain decodable without becoming unsupported request choices. R/state/LocalStateContextDef.ts, R/services/chatThinkingLevel.ts, R/services/chatComposerQueue.ts, R/components/chat/ThinkingLevelSelector.tsx, R/components/UnifiedChat.tsx request construction.
2 Done — selected, visible foreground conversation polling at 2/5/10/15/20/30/60 seconds, completed-item cursor, active-stream skip, richer local checkpoint retention and bottom follow. A successful bootstrap poll repairs ordering and older-page pagination after an initial history failure, clearing only that recovered issue instance. Account/projection/deletion fences reject stale results. R/components/UnifiedChat.tsx:3103–3306,4910–4921, R/services/chatPollingPage.ts, existing native streaming merge helpers.
3 Done — first-20 recents refresh while the menu/sidebar is visible and foreground, plus conversation creation; server order wins while unchanged-title values and loaded older pages remain. Silent failures preserve feedback, and finished polling tasks release ownership so visibility can restart them. R/components/ChatHistoryList.tsx:288–342,476–487,1215–1225.
4 Done — legacy document JSON becomes a filename chip and selectable text preview with surrounding user text retained. Pending parsing has a loading state; publication must match the current text and account generation. R/components/markdown.tsx:530–702.
5 Done — query/URL/page/image titles and semantic icons, current status, failed expansion, pretty Input and safe Markdown Output with a link-preserving 150-character Show more/less preview. R/components/ToolActivityCard.tsx:194–315, R/services/chatToolPresentation.ts, R/services/toolPresentation.ts, R/utils/markdown.ts.
6 Done — native newline continues bullets/tasks/numbered lists, removes empty markers and skips fences, horizontal rules and marked composition. Correct marker matching and exact UTF16 replacements preserve dictation anchors; split-surrogate ranges fail closed. R/components/chatComposerListContinuation.ts, R/components/UnifiedChat.tsx:5659–5670.
7 Done — explicit native Paste routes image providers through the existing bounded importer. A declined image route can fall back to native text in the initiating editor, including mixed image/text paste during queue editing; replacement, retirement and composition fence late text results. The existing + → Paste image entry remains. R/components/UnifiedChat.tsx:3936–4070, R/utils/imagePaste.ts.
8 Done — backward user intent within 100 points loads older history with top progress and a retained item reading anchor. Item aliases survive tool-row regrouping; restoration resolves the current turn for lazy-stack materialization and corrects the visible item offset after layout. One additional physical gesture during a slow read can queue one bounded page. Initial/programmatic movement does not admit a page, and cancelled reads preserve feedback. R/components/UnifiedChat.tsx:3384–3783,5795–5803, R/components/chatHistoryPagination.ts.
9 Done — distinct account image/attachment budget copy, deletion-paused copy, five-second occurrence-fenced attachment/dictation feedback, and stored/streaming legacy thinking tags. Transcription failure remains visible with Retry after transient feedback expires. Source-matched preparation prevents stale legacy content or readiness receipts from publishing into a changed message. Generic rejection does not expose server bodies. R/components/UnifiedChat.tsx:266–268,3853–3870,3908–3923,5351–5354,5450–5453, R/components/markdown.tsx:195–259,704–767.
10 Done — running/unread indicators and accessibility on chat and collapsed project rows; account-owned completion state clears on an actual new run, selection/visibility, retirement and deletion, including project creation before a conversation ID exists. Unresolved response ownership retains the running indicator, matching Research’s ambiguous-failure settlement. R/components/ChatHistoryList.tsx:119–146,189–192,1251–1329,1476–1531, R/services/chatRuntimeStore.ts.
11 Done — project folder titles toggle expansion; the View project menu/accessibility action opens scoped detail. Detail provides shared selection controls and instructions preview/editor, library creation opens the new project, and returning to the library restores its query. Reopening detail clears stale selection. Chat membership creation keeps its existing behavior. R/components/ProjectDetailView.tsx:231–284,586–592,617–929, R/components/ChatHistoryList.tsx:972–989,1012–1019,1534–1578.
12 Done — read-only plan/usage/reset/credits summary in Settings’s Usage section, exact raw product-name handling, clamped rounded usage and localized reset ladder. The red/amber Settings attention badge remains in its icon; the visible title stays “Settings,” with accessible attention information. No pricing destination. R/components/CreditUsage.tsx, R/utils/dateFormat.ts, R/components/AccountMenu.tsx.
13 Done — mobile admin/member seat-mismatch notice with independent member/seat plurals in chat and compact library/project routes, retained in Custom Instructions and hidden on Settings. The notice reserves content space beneath navigation so it does not cover New chat or editor controls. The duplicate composer footnote is removed. No team-management action. R/components/team/TeamSeatMismatchAlert.tsx, R/utils/teamSeats.ts.
14 Done — rename/delete/bulk/instructions copy and unchanged-name validation through native forms and explicit Library-table interpolation/plurals. Project detail uses the named new-chat label, project-specific empty state, and the correct Delete/Delete project action labels. Obsolete Localizable entries are removed. R/components/RenameChatDialog.tsx, DeleteChatDialog.tsx, BulkDeleteDialog.tsx, ConversationProjectDialog.tsx, DeleteConversationProjectDialog.tsx, ProjectDetailView.tsx:86–165.

Hardware Return sends on iPhone; software Return and Shift-Return insert a newline, following the native specification. Empty-draft submission is ignored. Clipboard providers are read sequentially to retain the existing temporary-memory budget. A cross-app multi-provider authorization failure was not reproduced, so no speculative eager provider loading was added. The catalog’s required mandatory Boolean follows the published contract.

Conversation and recents polls serialize their reads and begin the next delay afterward, so request duration adds to the nominal interval. The existing native recents query uses pinned=false; Research fetches unassigned rows and removes pinned rows when rendering. The existing ChatDetail storage-owner remount race is corrected by recomputing visibility through AppEnvironment’s registry. Preparation receipts are tied to the current rendered item/result/turn; obsolete detached parsing can finish in memory, but stale publication is rejected.

Navigation/CompactMenuNavigation.swift is unchanged. The diff stays within apps/maple-ios/ and sdk/swift/. Bundle identity, URL schemes, xcconfig values, signing entitlements, Info.plist, workflows, CI scripts, flakes, StoreKit, guest/team settings, verification, billing/API pages and document attachment features remain outside this change. Local runtime configuration is ignored and generated from allowlisted public endpoints. Final diff: 79 files; 7,559 additions and 552 deletions (8,111 changed lines). All 14 items remain together, without file moves or unrelated refactors.

Two inherited behaviors remain deferred:

  • The per-message image-count guard rejects the whole selection beyond 10 images; Research keeps the remaining slots. That admission policy and generic per-message copy existed on Mark’s base. The account-wide 640-image/256 MiB messages added here are separate.
  • The shared project model loads 100 entries per page, while Research detail loads 20 and its sidebar owns separate loading. This change preserves shared folder paging rather than changing its behavior through the detail-copy work.

The usage summary lives in Settings under Usage, keeping the sidebar focused on chat navigation and search. Its billing-derived values, localization, clamped percentage and reset-date behavior follow Research; its placement follows the intended native layout. Plan refresh and team-seat attention remain in their existing account-owned paths.

Final Settings placement validation for 7b986bbe2017a1cf19a38d8cc97f2157b5334f01:

  • Strict formatting/lint passed; the unfiltered app suite passed 597/598 in 74 suites, with only the known unchanged Vision OCR .nilError. Source log: /tmp/ios-parity-pass2-settings-usage-app-gate.log.
  • Release device/simulator package compilation, canonical unsigned PR simulator build, and Local build-for-testing passed. Logs: /tmp/ios-parity-pass2-settings-usage-{cross-build,simulator-build,runtime-build}.log.
  • 4/4 native checks passed on iPhone and 4/4 on iPad, both exiting successfully. The placement test uses the shipping SettingsView and checks sidebar absence, Usage heading/plan/percent/reset/credit balance/read-only semantics, and existing Library/Project/Instructions seat-notice geometry. Existing Settings refresh, plan-date/preference copy and retained-menu pagination tests also run. Results: /tmp/ios-parity-pass2-settings-usage-ui-{phone,ipad}.{log,xcresult}.
  • Final committed bytes match the frozen eight-file placement source manifest, all 20 local signatures verify, and GitHub verifies the two new follow-up signatures. Queue/runtime and SDK source are unchanged from the gates below. The exact updated Local artifact is installed on the human smoke phone; metadata: /tmp/ios-parity-pass2-settings-usage-human-smoke-ready.json. The checkout is clean and all source paths remain within the two allowed directories.

Queue correction validation at ab09f25f451c1c04b0bddbffc6361a7bd3444bd3:

  • Reproduced the reported second-queue failure before the fix after three separate transitions: real Stop with no waiting items, chat reload and offline/reconnect. Each left the follow-up queued without the next POST. The bug is inherited from Mark’s base; the production fix is three lines in the admitted direct-send transition.
  • Focused queue suite: 19/19 tests passed, including the three reproduction paths, original queued UUID/durable dispatch/newer composer preservation, explicit Resume for staged messages after Stop, working edits, and rejected admission. Four added tests cover nine parameterized scenarios. Logs: /tmp/ios-parity-pass2-empty-queue-baseline-2.log and /tmp/ios-parity-pass2-empty-queue-fixed-2.log.
  • Canonical strict formatting and unfiltered app suite: 597/598 passed in 74 suites. The only failure is the same unchanged Vision OCR .nilError below. Log: /tmp/ios-parity-pass2-queue-app-gate.log.
  • Release package compilation for arm64 device and simulator, canonical unsigned PR simulator build, and Local simulator build-for-testing passed. Logs: /tmp/ios-parity-pass2-queue-cross-build.log, /tmp/ios-parity-pass2-queue-simulator-build.log and /tmp/ios-parity-pass2-queue-runtime-build.log.
  • Native queue tests: 5/5 on iPhone and 5/5 on iPad, both exiting successfully. Three new cases each run two complete queue sessions across process restart, reconnect or real Stop; two retained interruption cases verify that waiting work still needs explicit Resume. They use production runtime, protected storage, composer and queue review with injected services. Results: /tmp/ios-parity-pass2-queue-ui-phone.{log,xcresult} and /tmp/ios-parity-pass2-queue-ui-ipad.{log,xcresult}.
  • The updated Local bundle was installed in place on the human smoke phone 8EF68006-89EB-4225-938C-8D207B4506DF, retaining its account/storage. Executable and Info.plist bytes were verified against the tested artifact; the phone was reopened on a fresh chat for human smoke. Metadata: /tmp/ios-parity-pass2-queue-human-smoke-ready.json. This observation and human smoke are separate from injected-service tests; no fresh production-provider claim is made.
  • Committed bytes match the frozen five-file queue correction source manifest; the queue commit signature verifies locally. The SDK bytes are unchanged from the 122/122 gate below. Generated Xcode lockfile drift is restored and the checkout is clean.

Earlier full parity validation at 669ec24c1da10b798b3eb0982fbfc6ac9386da8e:

  • Swift SDK gate/release build: 122/122 tests in 17 suites passed; SDK release build passed. The follow-up modifies app files only, so the tested SDK bytes are unchanged.
  • Canonical unfiltered app gate and formatting: 593/594 tests in 74 suites passed; strict formatting/lint passed. The known untouched-base Vision .nilError in ImageScreenshotTests.denseScreenshotActuallyDownscalesToTheBoundedLosslessWireImage is preserved; its implementation and test are unchanged.
  • Canonical simulator, Local runtime and device/simulator release builds: Canonical unsigned PR simulator build and the Local build-for-testing passed. Release package builds for arm64 device and simulator passed with warnings as errors. All ran against the final candidate app source.
  • Owned iPhone native evidence: The initial 18-test battery passed 16 cases and exposed both new boundary cases. After correcting lazy materialization, the 7-test phone viewport rerun passed 7/7, including both boundaries within 3 points, retained-menu pagination, idle polling and streaming. The final affected notice/navigation rerun: 1/1 passed on the final source through the real compact host, including Library → Project → Custom Instructions → Back → Settings. The retained-menu test also passed after the notice placement change. Screenshots confirm no overlap and the preserved Settings badge. These are separate runs. The initial Xcode result-finalization hang required interruption after all cases finished; its log/results are preserved. Logs/results: /tmp/ios-parity-pass2-r2-ui-phone-1.{log,xcresult}, /tmp/ios-parity-pass2-r2-ui-phone-anchors-2.{log,xcresult}, and /tmp/ios-parity-pass2-r2-ui-phone-settings-6.{log,xcresult}.
  • Owned iPad native evidence, including retained-menu pagination and actual system-window resize: The broad 19-test suite passed before the final notice-layout correction. The final affected library/navigation rerun: 8/8 passed on the final source (seven library cases and retained-menu pagination). The account fixture uses the existing compact controller and an owned lease, matching shipping navigation; exact no-overlap assertions cover Library, Project and Custom Instructions before Settings. The broad run measured an actual system-window resize of 834×1210 → 395×783 (origin 220,156) → 834×1210 points, retaining the same draft, paused queue and owners; both mid-turn boundaries kept the position within 3 points. Results: /tmp/ios-parity-pass2-r2-ui-ipad-1.{log,xcresult} and /tmp/ios-parity-pass2-r2-ui-ipad-library-4.{log,xcresult}. The final rerun covers Library → Project → Custom Instructions → Settings and preserves the original frame assertions.
  • Linked Local stack smoke: The linked Local stack smoke passed at the prior reviewed head bb50b31; this follow-up does not claim a fresh live-provider smoke. Its regression runs use production components with injected services.
  • Prior committed bytes/signatures/scope at that head: All 18 signatures verify locally, and GitHub verifies all four new signatures. The four follow-up commits preserve the tested worktree; final committed bytes match the frozen 30-file correction source manifest, and the checkout is clean. All changed paths remain within apps/maple-ios/ and sdk/swift/; navigation-controller source is unchanged.

Runtime fixtures exercise production components with injected services on owned iPhone 0C7E271E-EFE3-4D02-A317-09E3CD57F814 and iPad B2096BF9-D6BC-47D0-98DB-9FA56A45587C simulators using the Local profile (cloud.opensecret.maple.native.dev, 0.1.0/build 8). Exact bundle: /Users/admin/workspaces/ios-parity-pass2/apps/maple-ios/.build/xcode-local/Build/Products/Local-iphonesimulator/Maple.app. Public endpoints: API http://127.0.0.1:31714, billing :36972, flags :41248, browser auth :35694; public client UUID ba5a14b5-d915-47b1-b7b1-afda52bc5fc6. Xcode 26.5/17F42 and iOS 26.5/23F77. The manual phone 8EF68006-89EB-4225-938C-8D207B4506DF and unrelated devices are preserved. Hosted auth, production inference/billing lifecycle, distribution and physical camera/microphone behavior remain untested. OCR hardware testing remains deferred.

Separately, owned probes of Xcode 26.5 clang were confirmed to hang: the owned clang -v -E -dM -isysroot …iPhoneSimulator26.5.sdk -x c -c /dev/null subprocess repeatedly stayed asleep. After verifying each parent belonged to this checkout’s Local/PR build, only that stalled probe was terminated; the builds then passed. Evidence is in the runtime-build and canonical simulator-build logs. No build flags, CI scripts or toolchains were changed. These compiler diagnostics are recorded separately from the source-specific gate and native results above.

The requested verbatim gate tails are included below.

scripts/ci/sdk-swift.sh

✔ Test cancelledRefreshCallerKeepsSharedRotationAliveForOtherCallers() passed after 0.063 seconds.
✔ Suite CredentialAuthorityTests passed after 0.070 seconds.
✔ Test sseHandlesEveryByteSplitAndWithholdsTerminalUntilEOF() passed after 0.073 seconds.
✔ Test untrustedHTTPFailuresAreSanitized(_:) with 5 test cases passed after 0.113 seconds.
✔ Suite PCRHistoryHTTPTests passed after 0.120 seconds.
✔ Test run with 122 tests in 17 suites passed after 0.121 seconds.

apps/maple-ios/scripts/build.sh unit

✔ Test unicodeSafetySplitKeepsComposedCharactersAndBoundsProviderCharacters() passed after 1.449 seconds.
✔ Test replacingARequestCannotReuseItsOldCompletionAfterReturningToTheSameText() passed after 1.480 seconds.
✔ Suite MessageRenderModelTests passed after 1.484 seconds.
✔ Test limitsRejectRatherThanTruncateText() passed after 1.864 seconds.
✔ Suite SpeechTextPlannerTests passed after 1.872 seconds.
✘ Test run with 598 tests in 74 suites failed after 1.873 seconds with 1 issue.

scripts/ci/ios-native.sh simulator-build


** BUILD SUCCEEDED **

Gate environment: Pinned nix develop --no-update-lock-file .#applewithDEVELOPER_DIR=/Applications/Xcode_26.5.app/Contents/Developer, Xcode 26.5/17F42. Commits use the documented MAPLE_HOOK_SKIP=1 after the explicit gates because the VM hook wrapper selects the Command Line Tools SDK. Generated Textual lockfile drift is restored; no dependency change is included. Follow-up refactoring, account surfaces, documents, IAP and lane/identity work remain separate work.

@AnthonyRonning
AnthonyRonning marked this pull request as ready for review October 14, 2026 18:59
@AnthonyRonning
AnthonyRonning merged commit 71a6e50 into codex-ios-native-swift Oct 14, 2026
@AnthonyRonning
AnthonyRonning deleted the codex-ios-native-parity-2 branch November 3, 2026 20:40
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