Skip to content

refactor: move chat queued-overlay construction to shared and adopt in mobile#616

Merged
gbasin merged 1 commit into
masterfrom
refactor/shared-queued-overlays
Jul 19, 2026
Merged

refactor: move chat queued-overlay construction to shared and adopt in mobile#616
gbasin merged 1 commit into
masterfrom
refactor/shared-queued-overlays

Conversation

@gbasin

@gbasin gbasin commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Final consolidation from the 2026-07-19 dead-code audit (docs/archive/notes/2026-07-19-dead-code-audit.md).

web/src/chatQueuedOverlays.tsshared/src/chatQueuedOverlays.ts (git-tracked rename); mobile's ChatProvider drops its ~85-line inline near-copies and calls the shared constructors. Web importers now pull from @atrium/surface-client. Net −51 LOC, and the drift-prone duplicate is gone.

Deliberate union reconciliation (each platform gains the other's improvements):

  • optimistic spawn sessions: web gains repos/githubIdentityMode/agentProfileVersionId + the multi-repo repo/branch fallback (mobile already had them)
  • optimistic spawn messages: mobile gains sessionTask + attachments (web already had them)
  • voice pending messages: web's semantics everywhere (voiceFileId = voice.fileId ?? attachments[0].id, waveform key omitted when empty) — verified equivalent against both VoiceMessage renderers and timeline.ts parseVoice
  • moved test gained assertions pinning each union behavior + a new multi-repo fallback case

Flagged follow-ups (pre-existing, untouched): mobile's live send() has a third inline pending-message copy; mobile applyQueuedOp lacks web's session.steer thread-overlay branch.

Validation: lint, web+mobile typecheck, centaur-client build, shared 465 / web / mobile unit suites green on the rebased base (post-#615). Gating on CI e2e per the audit-train protocol (#610/#611/#613/#615).

…n mobile

web/src/chatQueuedOverlays.ts moves to shared/src/chatQueuedOverlays.ts;
mobile's ChatProvider drops its inline pendingMessageFromSendPayload /
pendingSpawnFromPayload near-copies and calls the shared constructors.
The drifted optional-field behaviors are reconciled to the union, so each
platform gains the other's improvements:

- optimistic spawn sessions now carry repos/githubIdentityMode/
  agentProfileVersionId and the multi-repo repo/branch fallback on web
  (mobile already had them)
- optimistic spawn messages now carry sessionTask + attachments on mobile
  (web already had them)
- voice pending messages use web's semantics everywhere (voiceFileId =
  voice.fileId ?? attachments[0].id; waveform key omitted when empty) —
  verified equivalent against both platforms' VoiceMessage renderers and
  the canonical timeline.ts parseVoice wire shape

Known follow-ups (out of scope, pre-existing): mobile's live send() builds
a third inline pending message; mobile applyQueuedOp lacks web's
session.steer thread-overlay branch.

Consolidation verified in the 2026-07-19 dead-code audit;
see docs/archive/notes/2026-07-19-dead-code-audit.md.

Validation: lint, web+mobile typecheck, centaur-client build, shared 465 /
web / mobile unit suites green on the rebased base — gating on CI e2e.
@gbasin
gbasin enabled auto-merge July 19, 2026 21:45
@gbasin
gbasin added this pull request to the merge queue Jul 19, 2026
Merged via the queue into master with commit 0f0a7c3 Jul 19, 2026
18 checks passed
@gbasin
gbasin deleted the refactor/shared-queued-overlays branch July 19, 2026 21:57
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