Skip to content

refactor(ui): use native async state for session sharing - #180316

Merged
steipete merged 2 commits into
mainfrom
refactor/solid2-chat-sharing
Oct 22, 2026
Merged

steipete merged 2 commits into
mainfrom
refactor/solid2-chat-sharing

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Whole-scope CHAT-D census, a52e2aa0ffdb → 16cc26aa0609. Raw cleanup/owner APIs include named exceptions; unlanded families remain counted.

Family Files Production LOC I1 I2 raw I3 I4 I5 I6 I7 raw I8 I9 I10 raw
attachments 34 4225 0 4 2 0 1 0 0 0 0 0
automations 7 1670 0 0 0 1 0 0 0 0 0 0
cards 10 2148 0 0 0 2 0 0 0 0 0 0
context 2 542 0 1 0 0 0 0 0 0 0 0
details 18 4848 0 0 0 0 0 1 0 0 0 0
header-navigation 12 4139 → 4138 0 0 0 0 0 1 0 0 0 0
indicators-other 65 7899 0 1 1 1 0 0 0 0 0 3
media_previews 23 3652 0 2 2 1 1 1 0 0 0 0
panels_files_sidebar 24 6299 0 2 2 3 0 1 0 0 0 0
publication 3 843 0 0 1 1 0 0 0 0 0 0
pull_request_ci 10 2338 0 0 0 0 0 0 0 0 0 0
questions 13 2529 0 0 0 0 1 0 0 0 0 0
review_diff 17 4051 0 1 1 0 0 1 0 0 0 0
sharing 6 1955 → 2098 0 0 1 → 0 1 → 0 0 0 0 0 0 0
sidebar 10 3399 0 0 0 1 0 0 0 0 0 0
source_previews 1 144 0 0 0 0 0 0 0 0 0 0
tools 7 1552 0 0 0 0 0 0 0 0 0 0
workspace 16 4853 0 0 0 0 0 1 0 0 0 0

Total files: 278; production LOC: 57086 → 57228.
I1–I10: 0, 11, 10 → 9, 11 → 10, 3, 6, 0, 0, 0, 3.

I1–I10 track handler binding, cleanup, async reads, pending processes, component loaders, copied structured state, component construction, context wrappers, useful Reveal boundaries, and owner-escape APIs. Counts cover immutable source, including retained owner and foreign-DOM exceptions; they are not defect counts. This PR removes the sharing family's I3 and I4 sites.

What Problem This Solves

Session sharing still presented membership reads and mutations through manual pending branches, and an old operation could keep replacement-session controls busy until its request settled.

User Impact

Desktop, compact, and mobile sharing retain their menus, search, permissions, confirmations, and inline failures. Refreshes retain the visible members and search, and a replacement session can become usable without waiting for the old operation.

Why This Change Was Made

The pane remains the sole owner of synchronous admission, authorization, confirmation, writes, publication, and reconciliation. Its membership read exposes a completion receipt consumed by narrow Solid Loading slots with latest and isPending. One shared native action presents an already-admitted operation and scoped optimistic busy state, using the existing header-mutation retirement signal across hide, reconnect, teardown, and same-key session replacement.

The read receipt resolves after success, failure, or retirement. Expected read failures remain in the existing owner-held inline error state, so it deliberately does not create a second Errored error owner. Only busy state is optimistic: the pane already publishes and reloads actual membership/public-share data. No optimistic membership data is introduced, so there is no separate affects/refresh reconciliation or additional RPC.

Evidence

  • A readiness regression fails on the immutable base: an unresolved read with the legacy loading flag clear incorrectly renders “No paired people found.”
  • The built synthetic browser capture passes for desktop and mobile: one held membership read and one rejected write each, retained member DOM, disabled busy controls, inline failure, and no browser page errors.
  • UI typecheck, focused lint, formatting, and diff checks pass. Both isolated review passes are clean, including the final test that awaits the real owner operation after releasing the old refresh before asserting no stale navigation.
  • The first PR CI run exercised the new tests and exposed four assertion failures: three selectors differed from existing English labels, and the membership assertion ran before native action settlement. The test-only follow-up uses the existing labels and waits for the same membership control to become available, retaining exact-once admission, focus, busy, and stale-session assertions. Its isolated P0–P2 review, focused lint, and formatting checks pass.
  • The final focused local run passes both repaired files: 20/20 tests, including mounted same-key successor retirement and public confirmation/focus behavior. The canonical dispatcher took 1,394.62 seconds, dominated by transforms; earlier direct attempts reached their 120-second no-output startup guard. No timeout or runtime guard was changed. Exact-head ci:full run 39728409700 passes: 38 successful jobs and 27 skipped, including all UI unit, browser E2E, and real-Gateway shards.
  • Pinned Knip 6.40.0 production analysis exits 1 on base and head. Every head finding matches the immutable base: 13 unused files, 16 unused-export groups, and 6 unused-exported-type groups, all outside sharing. The base additionally reports an unused eslint dependency in tools/solid-lint; there are no head-only findings.

The production build and strict exact-base comparison pass with no violations or warnings. Both use fixed release metadata, disabled build cache, and the same toolchain. The saved precommit build diff exactly matches commit dcdae4e67f574a152e601ab16d3dab989cde4a05; all 11 source blobs are verified. The follow-up commit 16cc26aa060923fcc842f92f32e06d54fa14cfbc only adjusts two test files; all eight production blobs remain identical, so the same build and inspected screenshots apply.

Gzip bytes Immutable base a52e2aa0ffdb This change Delta
Startup JavaScript 325,036 325,033 -3
Chat boot JavaScript 1,441,970 1,442,636 +666
New Session boot JavaScript 1,019,759 1,019,757 -2
Startup CSS 40,904 40,904 0

The exact base is within the enforced caps, so the conditional over-cap no-growth exception is not used. This change touches 11 files (+523/-168).

Before and after

Synthetic desktop and mobile fixtures, dark theme, fixed time/model, reduced motion.

State Before After
Desktop membership read pending Desktop pending before Desktop pending after
Desktop rejected membership write Desktop failure before Desktop failure after
Mobile membership read pending Mobile pending before Mobile pending after
Mobile rejected membership write Mobile failure before Mobile failure after

Open overlap checked: #180136 changes participation-permission labels and #180292 adds public-link QR codes. Those unlanded features are not included here.

Keep membership refresh rows and sharing controls tied to pane-owned read receipts and admitted operations. Retire pending presentation before a same-key successor publishes, preserving synchronous authorization and the existing inline error owner.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 22, 2026 04:53
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T04:53:43.429130Z dcdae4e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 22, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR uses Solid async readiness and scoped actions to present session-sharing reads and mutations.

Example: A user searches for Alice in compact Sharing while membership refreshes.

  • Before: Loading removes member rows, and a replacement result resets the search.
  • After: The existing rows and search remain visible while controls show their busy state.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The production approach is coherent and has browser evidence, but introduced test failures leave the changed contracts without a passing exact-head UI gate.
Proof confidence 🐚 platinum hermit (4/6) The ordinary contributor proof gate is waived for this maintainer-authored PR; inspected built-browser desktop captures show pending membership and rejected-write presentation, while mobile image inspection was limited by scratch writes failing.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Sharing refreshes can disrupt member presentation and search, while pending operations need to retire when their session is replaced.
Reason: The maintainer-authored direction consolidates presentation across three surfaces without moving authority or changing stored data, configuration, or protocol.

Merge readiness

⛔ Needs changes before merge - 3 items remain

Keep this PR open: the refactor preserves pane ownership and improves pending presentation, but three test defects currently fail the UI checks.

Priority: P2
Reviewed head: dcdae4e67f574a152e601ab16d3dab989cde4a05

Before merge

  • Match the rendered Read-only name in both replacement tests (P2) - The new replacement tests query /Read only/ here and at line 215, but the canonical label renders “Read-only”. Exact-head checks-ui (2/3) shows both tests failing while the expected replacement button is present and selected, so neither reaches its remaining stale-navigation assertions. Use the actual accessible name in both queries.
  • Select the Search button using its actual accessible label (P2) - The new desktop regression requires the exact attribute aria-label="Search people", while the existing English catalog and renderer produce “Search people…”. The selector returns null and .click() throws in checks-ui (1/3), before refresh retention or recovery is exercised. Match the rendered label or use a role/name query that accommodates the ellipsis.
  • Await action readiness before advancing the mobile fixture (P2) - Adding presentation.busy() changes the existing Public/member test's completion boundary: resolving confirmation.promise and awaiting one microtask does not settle the enclosing Solid action. The fixture advances and clicks membership while its control remains unavailable; exact-head CI records zero member calls at line 296. Update this consumer test to await the visible enabled state after cancellation and each completed action before clicking the next control, preserving the production busy guard.

Findings

  • [P2] Match the rendered Read-only name in both replacement tests — ui/src/pages/chat/components/chat-session-sharing-mobile.test.tsx:149
  • [P2] Select the Search button using its actual accessible label — ui/src/pages/chat/components/chat-session-sharing.test.tsx:301
  • [P2] Await action readiness before advancing the mobile fixture — ui/src/pages/chat/components/chat-session-sharing-mobile.test.tsx:268-270

Tests

  • Missing end-to-end proof: The readiness red-on-base result is reported, but the added regression suites have no passing exact-head result because their selectors and action-settlement sequence currently fail.
Agent review details

How this fits together

The Control UI sharing surfaces consume pane-owned session and membership facts, invoke existing authorized pane operations, and display readiness, outcomes, and errors.

flowchart LR
  A[Sharing controls] --> B[Shared Solid presentation]
  B --> C[Pane admission and authorization]
  C --> D[Gateway sharing methods]
  D --> E[Pane reconciliation]
  E --> B
  F[Session lifecycle] --> B
Loading

Technical review

Best possible solution:

Retain the pane-owned operations and shared presentation, correct the test selectors, and await visible action settlement before subsequent fixture interactions.

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

Source shows compact sharing removing rows during loading and resetting search when the result changes; exact-head CI independently demonstrates the reported test failures.

Is this the best way to solve the issue?

The shared presentation follows the existing Solid recipe while keeping synchronous admission, authorization, writes, and reconciliation with their current owner.

Full review comments:

  • [P2] Match the rendered Read-only name in both replacement tests — ui/src/pages/chat/components/chat-session-sharing-mobile.test.tsx:149
    The new replacement tests query /Read only/ here and at line 215, but the canonical label renders “Read-only”. Exact-head checks-ui (2/3) shows both tests failing while the expected replacement button is present and selected, so neither reaches its remaining stale-navigation assertions. Use the actual accessible name in both queries.
    Confidence: 1
  • [P2] Select the Search button using its actual accessible label — ui/src/pages/chat/components/chat-session-sharing.test.tsx:301
    The new desktop regression requires the exact attribute aria-label="Search people", while the existing English catalog and renderer produce “Search people…”. The selector returns null and .click() throws in checks-ui (1/3), before refresh retention or recovery is exercised. Match the rendered label or use a role/name query that accommodates the ellipsis.
    Confidence: 1
  • [P2] Await action readiness before advancing the mobile fixture — ui/src/pages/chat/components/chat-session-sharing-mobile.test.tsx:268-270
    Adding presentation.busy() changes the existing Public/member test's completion boundary: resolving confirmation.promise and awaiting one microtask does not settle the enclosing Solid action. The fixture advances and clicks membership while its control remains unavailable; exact-head CI records zero member calls at line 296. Update this consumer test to await the visible enabled state after cancellation and each completed action before clicking the next control, preserving the production busy guard.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/chat/components/chat-session-sharing-mobile.test.tsx --maxWorkers=1
  • pnpm test ui/src/pages/chat/components/chat-session-sharing.test.tsx --maxWorkers=1
  • pnpm test ui/src/pages/chat/chat-pane-sharing.test.ts --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 48307ec adds ui/src/pages/chat/chat-pane-sharing-actions.ts:72 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 48307ec958b0; files: ui/src/pages/chat/chat-pane-sharing-actions.ts)
  • Vyctor H. Brzezowski: Raw commit fb7cd93 adds ui/src/pages/chat/components/chat-session-sharing-mobile-adapter.tsx:123 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fb7cd9305667; files: ui/src/pages/chat/components/chat-session-sharing-mobile-adapter.tsx)

PR surface

Source +170, Tests +184. Total +354 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 326 156 +170
Tests 3 196 12 +184
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 522 168 +354

Review metrics

Metric Value Why it matters
Production versus test LOC Production +326/-156; tests +196/-12 Production growth introduces one shared action presentation and readiness boundaries across desktop, compact, and mobile; the tests target distinct readiness, stale-result, and settlement failures.

Labels

Label changes:

  • add P2: This is a bounded sharing presentation improvement with concrete, focused test repairs blocking its current CI.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a bounded sharing presentation improvement with concrete, focused test repairs blocking its current CI.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 follows the weaker of proof and patch quality; ✨ 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 October 22, 2026, 1:10 AM ET / 05:10 UTC.

@steipete
steipete merged commit 88baa37 into main Oct 22, 2026
103 of 105 checks passed
@steipete
steipete deleted the refactor/solid2-chat-sharing branch October 22, 2026 05:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…0316)

* refactor(ui): use native async presentation for session sharing

Keep membership refresh rows and sharing controls tied to pane-owned read receipts and admitted operations. Retire pending presentation before a same-key successor publishes, preserving synchronous authorization and the existing inline error owner.

* test(ui): align sharing assertions with native settlement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant