Skip to content

fix: keep public conversations steady during live refresh - #173181

Merged
roboclaw-bot merged 1 commit into
mainfrom
fix/public-reader-scroll-refresh
Oct 15, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
fix/public-reader-scroll-refresh

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes public conversations losing the reader’s place and failing to follow new messages when the live view refreshes, with no quick way back to the top or latest message.

User Impact

Readers can jump to Top or Latest, refresh without reloading, and keep reading older messages without being pulled away. Updates follow only when the reader is at the conversation’s end, including short conversations and late-loading layout changes. Public-sharing permissions and revocation remain unchanged.

Why This Change Was Made

The public reader owns scroll intent and preserves a visible message anchor plus expanded tool steps across live-page rollover. Canonical and legacy public links now share conditional in-place refresh, catch up after visibility/reconnection, and show recoverable refresh failures while leaving readable content intact. No JavaScript still has a readable document and refresh fallback; earlier pages remain still.

Requested by @vincentkoc.

Work sessions

Evidence

Before

Public reader before: no persistent navigation

After

Public reader after: persistent Top, Latest, and Refresh now controls

  • Four new behavior regressions fail against the original inline reader script. Focused reader/render/login tests pass: 46 tests, 3 files, 20.36 seconds wall time (Vitest 7.60 seconds). CI workflow elapsed: 1,018 seconds (not a per-file test benchmark).

  • Chromium with the shipped CSP: Top/Latest, new-message follow, late layout, page-rollover reading anchor, in-place refresh, and 375px light layout passed with no script errors. Synthetic public content only.

  • Targeted lint, formatting, production typecheck, and changed-test gateway type graph pass (type graph 19.9 seconds). Fresh independent P0–P2 review is clean after repairing the short-conversation finding, covered by initial-view and explicit-Latest regressions.

  • Broader HTTP proof was interrupted during expensive fixture compilation before test execution; it is not claimed as passing. PR CI supplies broad coverage.

  • Completed CI run: success at the exact reviewed head; 35 successful jobs and 27 skipped, no failures.

@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M labels Oct 15, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 15, 2026 14:03
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 15, 2026 14:12
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR adds public-conversation navigation controls and preserves reading position during in-place refresh.

Example: A reader scrolls back in /chat/main/topic while new messages arrive.

  • Before: Refresh replaces the conversation without preserving the visible message or expanded tool steps.
  • After: The reader restores a visible item anchor and expanded steps, and offers Top, Latest, and Refresh now controls.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused work with inspected visual evidence and behavioral harness coverage, but the item-identity defect prevents merge.
Proof confidence 🦐 gold shrimp (3/6) Collaborator-authored PR is outside the ordinary contributor proof gate; inspected before/after screenshots establish the navigation addition, while browser refresh scenarios are reported in prose and supported by the generated-script harness.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Public readers lose their place or fail to follow new messages when the conversation refreshes.
Reason: Maintainer-authored direction addresses a concrete existing usability defect through the existing owner.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this PR addresses a current public-reader problem, but identical tool groups share an identity and can restore the wrong reading position.

Priority: P2
Reviewed head: 5e2ae7123a0a85e7f35b6b1d09c22faf64ff4ab2

Before merge

  • Give separate tool groups distinct stable identities (P2) - Tool entries never set entry.key, so this fallback hashes only their rendered HTML. A conversation containing two read example.ts groups separated by narration therefore assigns both the same data-public-item, even when their source messages have different IDs. If only the second group is expanded, the next successful refresh opens both because expansion restoration uses a Set of these keys. If the second group is the visible anchor, the subsequent .find() selects the first group and scrolls the reader back to it. Derive a distinct, stable group identity from its originating transcript entry or tool call, and cover repeated identical groups during refresh and rollover.

Findings

  • [P2] Give separate tool groups distinct stable identities — src/gateway/control-ui-public-session-render.ts:311-314

Tests

  • Missing end-to-end proof: The supplied screenshots do not exercise refresh with repeated identical tool groups; that scenario needs coverage with the identity repair.
Agent review details

How this fits together

The Gateway renders publication-filtered transcripts into public HTML; its inline browser script polls the same URL and updates the readable document.

flowchart TD
  A[Public conversation URL] --> B[Gateway publication checks]
  B --> C[Transcript projection]
  C --> D[Public HTML renderer]
  D --> E[Browser reader]
  E --> F[Conditional refresh request]
  F --> B
Loading

Technical review

Best possible solution:

Keep the existing reader owner and give each tool group an opaque, distinct identity that remains stable across refresh and page rollover.

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

Current main visibly lacks scroll restoration in its refresh implementation, and source inspection establishes the introduced duplicate-tool identity failure; no runtime reproduction was performed.

Is this the best way to solve the issue?

Extending the existing renderer is appropriate, but item identity must come from distinct transcript origins rather than rendered tool summaries.

Full review comments:

  • [P2] Give separate tool groups distinct stable identities — src/gateway/control-ui-public-session-render.ts:311-314
    Tool entries never set entry.key, so this fallback hashes only their rendered HTML. A conversation containing two read example.ts groups separated by narration therefore assigns both the same data-public-item, even when their source messages have different IDs. If only the second group is expanded, the next successful refresh opens both because expansion restoration uses a Set of these keys. If the second group is the visible anchor, the subsequent .find() selects the first group and scrolls the reader back to it. Derive a distinct, stable group identity from its originating transcript entry or tool call, and cover repeated identical groups during refresh and rollover.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Conditional refresh and main-element replacement keeps the original intent (8787ee0: Provide anonymous live public documents without operator sockets, with conditional polling and publication checks.)
  • Unavailable-page handling keeps the original intent (47cbd73: Avoid showing denial before the protected login probe resolves while immediately handling confirmed revocation in an open reader.)
  • Legacy refresh and shared page script changes intended behavior with a stated reason (45ec7dc: Share the public page script and presentation while retaining the existing legacy reload behavior.)
  • Tool-group rendering keeps the original intent (2500d81: Expose bounded tool summaries as collapsed steps while keeping tool-result text private.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/gateway/control-ui-public-session-refresh.test.ts src/gateway/control-ui-public-session-render.test.ts src/gateway/control-ui-public-session-entry.test.ts --maxWorkers=1
  • Verify the repeated-tool regression fails on the reviewed head and passes after repair.
  • In a browser, expand and anchor the second of two identical tool groups, refresh with new content, and verify only that group stays expanded and in place.
  • git diff --check

What I checked:

PR surface

Source +58, Tests +142, Docs +4. Total +204 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 72 14 +58
Tests 3 204 62 +142
Docs 1 6 2 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 282 78 +204

Labels

Label changes:

  • add P2: Reading-position and expansion errors affect public conversation usability without blocking access or changing stored data.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Reading-position and expansion errors affect public conversation usability without blocking access or changing stored data.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • 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 15, 2026, 10:19 AM ET / 14:19 UTC.

@roboclaw-bot
roboclaw-bot merged commit 9e21a6a into main Oct 15, 2026
198 checks passed
@roboclaw-bot
roboclaw-bot deleted the fix/public-reader-scroll-refresh branch October 15, 2026 14:21
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash auto-merge.

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

Labels

docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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