Skip to content

fix(ios): keep sidebar pins and sessions visible during reconnect - #208682

Merged
vyctorbrzezowski merged 3 commits into
mainfrom
fix/ios-sidebar-cold-4fa0837e
Nov 30, 2026
Merged

vyctorbrzezowski merged 3 commits into
mainfrom
fix/ios-sidebar-cold-4fa0837e

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

When you return to the open iOS app, the sidebar can lose your pins and briefly replace its Pinned and Sessions lists with loading bars.

User Impact

The loaded sessions stay visible, with personal pins in their existing order, while the app reconnects. If the refresh takes longer than half a second, a small spinner appears at the right of the Sessions heading. Rows remain tappable. The spinner disappears when the refresh finishes; a failed refresh keeps the old rows without a warning. Cold startup and the offline cache are unchanged.

Why This Change Was Made

A new socket does not mean a different viewer. The sidebar can reuse the list already in memory for the same Gateway, agent, and account without storing another copy. When the default agent is temporarily unavailable during reconnect, the sidebar can still show the confirmed list; that display state cannot authorize a chat send.

Evidence

  • iPhone 17 simulator, 14 synthetic conversations, and a paired, isolated Gateway. The app kept the same process when returning from the background in both recordings. Before, Atlas and Notes disappeared and loading bars flashed. After, Atlas and Notes stayed pinned in that order in all 183 frames from the settled sidebar through reconnection.
  • The reconnect XCTest failed on the base. Local autoreview (P2, reconnect candidate against the base below) reported one finding: an incomplete live refresh replaced the confirmed Atlas row with Travel. The extended test reproduced that failure and passed after both refresh paths started using the same rule. It also checks that switching Gateway, agent, or viewer invalidates the retained list.
  • Base: 16b04e24a41e. Final tested commit: d3eaf0207ff0. The recording shows the original reconnect fix, before the delayed indicator was added. The screenshots below show the indicator on the updated app.
  • Two focused tests passed: one covers the retained pins and sessions; the other controls the 500 ms deadline and checks visibility before the deadline, after it, and on completion. The indicator stops when the sessions arrive, even if pin preferences are still pending. A failed refresh keeps the previous rows without a warning.

Sessions refresh on iPhone 17

Waiting for the Gateway After the reply
A small spinner at the right of Sessions; Atlas and Notes stay pinned The spinner is gone and the same rows remain in place

Annotated comparison

Before After
Loading bars replace the session rows Atlas and Notes stay pinned in the same order

Clean comparison

Before After
Sidebar during reconnect before the fix Sidebar at the same point after the fix

Reconnect recording

The side-by-side replay starts after the app returns to the foreground. The last two seconds hold the same instant from each recording so the loading bars are easy to see.

ios-sidebar-reconnect.mp4

@clawsweeper

clawsweeper Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
Pull request received.

@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 30, 2026
@clawsweeper

clawsweeper Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR retains loaded iOS sidebar sessions and personal pins during reconnects and gives the header an opaque background.

Example: Return to the running iOS app with Atlas and Notes pinned.

  • Before: Pins disappear and loading bars briefly replace the session lists.
  • After: Atlas and Notes remain pinned in order while the same Gateway, agent, and viewer reconnect.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A worthwhile, focused repair with inspected product screenshots and targeted regression coverage; broader iOS validation is not established by the completed CI checks.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after simulator images support the stated paired-Gateway reconnect and header fixes; the full recording and its 183-frame continuity claim were not independently inspected, and final partial-response coverage is reported XCTest evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Returning to the running app briefly hides saved pins and sessions, and scrolling lets a row show through the agent header.
Reason: This maintainer-authored repair restores navigation continuity with a focused change to the existing sidebar lifecycle.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a source-confirmed reconnect bug, and no blocking defect was found.

Reviewed head: 465e9282439b62984fc6a0576fa0aa55132721f4

Before merge

None.

Findings

None.

Agent review details

How this fits together

The iOS sidebar combines Gateway session rosters and personal pin preferences into navigation rows, with cached sessions available offline.

flowchart TD
  A[Gateway connection and viewer] --> B[NodeAppModel]
  C[Session roster and pin preferences] --> B
  B --> D[Sidebar owner identity]
  D --> E[RootSidebarModel retained roster]
  E --> F[RootSidebar session rows]
  B --> F
Loading

Technical review

Best possible solution:

Retain confirmed sidebar data within the existing models for the same Gateway, agent, and viewer, while preserving cold-start loading and existing send routing.

Do we have a high-confidence way to reproduce the issue?

Current main clears personal pins on connection transitions and ties loaded-list readiness to the connection generation; the supplied simulator comparisons show the resulting reconnect flicker.

Is this the best way to solve the issue?

The change repairs the existing presentation owners without adding persistent storage or changing routing, and shares partial-roster rejection across both refresh paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a62a1471842a.

Provenance checked

  • Cold-start sidebar readiness changes intended behavior with a stated reason (7a5083c: Wait for roster and personal placements together so cached conversations do not jump between sections during initial loading.)
  • Personal pin preferences keeps the original intent (995d9bd: Project personal saved placements onto the shared session roster instead of using session-wide pin metadata.)
  • Gateway connection phases keeps the original intent (20a8d6d: Centralize connection state and preserve sticky pauses rather than letting separate reconnect paths disagree.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Raw commit 7a5083c adds apps/ios/Sources/RootSidebarModel.swift:356 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7a5083c5b417; files: apps/ios/Sources/RootSidebarModel.swift)
  • Marvinthebored: Raw commit c0f1ba6 adds apps/ios/Sources/RootSidebarModel.swift:316 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c0f1ba6ba443; files: apps/ios/Sources/RootSidebarModel.swift)

PR surface

Source +81, Tests +57. Total +138 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 100 19 +81
Tests 1 57 0 +57
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 157 19 +138

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 29, 2026, 8:06 PM ET / November 30, 2026, 01:06 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant