Skip to content

fix(ui): hidden retained chat panes silently clear unread/attention for background sessions - #123247

Merged
steipete merged 3 commits into
mainfrom
codex/autoqa-hidden-pane-unread
Aug 14, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/autoqa-hidden-pane-unread

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

New activity in a recently viewed session never shows an unread badge. Since retained panes shipped (#121625), the chat page keeps up to 3 hidden session panes in the DOM (presented=false, inert). Every pane — hidden or not — keeps its sessions subscription alive, and applySessionsState marked the pane's selected session read unconditionally. So when a session you looked at earlier gets new activity (or an agentStatus attention note), its hidden pane instantly patches unread:false — the sidebar dot never sticks, the gateway read-patch also deletes agentStatus, and "Mark as unread" from the session menu self-reverts immediately.

Why This Change Was Made

Root cause is the missing presentation gate at the read-marking site. The sibling path applyActiveSessionBindings already gates on this.active && this.presented; applySessionsState's markSessionRead call predates retained panes and was never updated when hidden panes started keeping live subscriptions. One condition at the owner restores the invariant: only the pane the user is actually looking at may clear unread/attention state.

User Impact

Unread badges and attention indicators stick for background sessions until you actually open them. "Mark as unread" works on recently viewed sessions.

Evidence

  • Regression "does not clear unread from a hidden retained pane": drives applySessionsState with presented=false (no patch) then presented=true (patch fires) — fails pre-fix, passes post-fix.
  • Full chat page suite green: 2800 tests. Typecheck tsconfig.test.ui.json clean.
  • Autoreview (codex/gpt-5.6-sol, high): clean, 0.99.
  • Production LOC: +5/−1 (gate + comment); tests +41.

Found by the session list/roster lane of the web-UI QA campaign (severity-highest finding; default-path silent regression of the unread feature).

…s you are not viewing

Since retained panes (#121625) every pane — hidden or presented — keeps
its sessions subscription alive, and applySessionsState marked the
pane's selected session read unconditionally. New activity in a
recently-viewed session was cleared by its hidden pane instantly: the
sidebar unread dot never stuck, agentStatus attention was wiped by the
read patch, and "Mark as unread" self-reverted. Gate the read-marking
on this.presented, matching applyActiveSessionBindings.
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 13, 2026 15:50
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 13, 2026
@steipete steipete closed this Aug 13, 2026
@steipete steipete reopened this Aug 13, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 10:21 PM ET / August 14, 2026, 02:21 UTC.

ClawSweeper review

What this changes

The PR prevents hidden retained Control UI chat panes from clearing unread and attention state for sessions the user is not viewing.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer review: the patch targets a P1 session-state regression, but this review environment could not perform any read-only checkout inspection because its sandbox fails before commands execute. Likely related people: steipete (high-confidence retained-pane and read-marker history).

Priority: P1
Reviewed head: 04a163804193d320854b14536d869bdda8c5bee3

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The narrow patch and focused regression test are promising, but checkout inspection failure prevents a higher-confidence lifecycle verdict.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository-state context identifies the PR author as a member, so external-contributor real-behavior proof is not a gate; the provided CI and focused test claims remain supplemental evidence.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository-state context identifies the PR author as a member, so external-contributor real-behavior proof is not a gate; the provided CI and focused test claims remain supplemental evidence.
Evidence reviewed 4 items Proposed read-marker gate: The supplied PR diff changes the session-state projection so mark-as-read occurs only when the pane is presented, addressing the stated hidden-pane path.
Focused regression coverage: The supplied test drives the same pane with presented=false and then true, asserting that only the visible state sends the unread-clearing patch.
Exact-head CI context: The provided check summary reports successful UI, UI E2E, real-Gateway E2E, lint, type, dependency, and CI-gate checks for the PR head.
Findings None None.
Security None None.

How this fits together

The Control UI retains recent chat panes for quick switching while each pane receives live session updates. A visible pane may patch its selected session as read; that state drives sidebar unread and attention indicators.

flowchart LR
  A[Gateway session updates] --> B[Retained chat panes]
  B --> C[Pane presentation state]
  C --> D[Read-marker decision]
  D --> E[Session state patch]
  E --> F[Unread and attention indicators]
Loading

Before merge

  • Resolve merge risk (P1) - This changes when live session updates clear unread and attention state; exact-head inspection is still needed to confirm every genuine foreground activation continues to mark the session read.
  • Resolve merge risk (P1) - The sandbox failure prevented verification of the current branch lifecycle, scoped UI policy, related history, and matching maintainer notes.
  • Complete next step (P2) - A maintainer or functioning read-only review environment must verify the exact lifecycle before merge; the maintainer label also prevents automated cleanup.
Agent review details

Security

None.

PR surface

Source +5, Tests +40. Total +45 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 6 1 +5
Tests 1 40 0 +40
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 46 1 +45

Review metrics

Metric Value Why it matters
Production versus test delta production +4 net, tests +41 The proposed behavior change is small and has focused regression coverage, though the production lifecycle still needs exact-head verification.

Mantis proof suggestion

A short web UI chat proof would directly demonstrate the background unread-indicator behavior affected by this lifecycle change. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis web UI chat proof: verify that new activity in a retained background session keeps its unread indicator until that session is opened.

Merge-risk options

Maintainer options:

  1. Verify foreground lifecycle coverage (recommended)
    Inspect the exact PR head to confirm presentation transitions and active-session bindings still clear unread state for the pane the user opens.

Technical review

Best possible solution:

Preserve the presentation-owned read gate if exact-head lifecycle inspection confirms that foreground activation and visible-pane bindings still clear unread state through a canonical path.

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

No high-confidence independent reproduction is available in this review because the checkout sandbox rejected read-only commands before source or tests could be inspected; the provided diff contains a focused unit scenario.

Is this the best way to solve the issue?

Unclear: gating the read marker on presentation matches the stated invariant, but the exact foreground lifecycle and sibling paths could not be checked in the unavailable checkout.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 0d584aabfba7.

Labels

Label justifications:

  • P1: Background-session activity can silently lose the unread and attention signals users rely on in the default chat workflow.
  • merge-risk: 🚨 session-state: The PR changes the condition under which live session state clears unread and attention information.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository-state context identifies the PR author as a member, so external-contributor real-behavior proof is not a gate; the provided CI and focused test claims remain supplemental evidence.

Evidence

What I checked:

  • Proposed read-marker gate: The supplied PR diff changes the session-state projection so mark-as-read occurs only when the pane is presented, addressing the stated hidden-pane path. (ui/src/pages/chat/chat-pane-context.ts:105, 04a163804193)
  • Focused regression coverage: The supplied test drives the same pane with presented=false and then true, asserting that only the visible state sends the unread-clearing patch. (ui/src/pages/chat/chat-pane.read-marker.test.ts:92, 04a163804193)
  • Exact-head CI context: The provided check summary reports successful UI, UI E2E, real-Gateway E2E, lint, type, dependency, and CI-gate checks for the PR head. (04a163804193)
  • Checkout inspection failure: The read-only command sandbox returned bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted before reading repository files, so current-head lifecycle, scoped policy, history, and maintainer notes could not be independently inspected.

Likely related people:

  • steipete: The supplied related merged PR identifies this contributor as the author of the retained-pane lifecycle that this read-marker repair follows up. (role: introduced retained-pane behavior and recent area contributor; confidence: high; commits: 750d0dcd9e78, fc586c371436; files: ui/src/pages/chat/chat-pane-context.ts, ui/src/pages/chat/chat-pane.read-marker.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Re-run exact-head source and lifecycle review once the read-only sandbox can execute.
  • Optionally capture a redacted web UI chat proof showing a retained background session keeps its unread indicator until opened.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-13T20:13:32.913Z sha fc586c3 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T00:32:07.022Z sha fc586c3 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T01:26:07.768Z sha f27c12f :: needs maintainer review before merge. :: none

@steipete steipete closed this Aug 13, 2026
@steipete steipete reopened this Aug 13, 2026
@steipete
steipete merged commit eecf488 into main Aug 14, 2026
121 checks passed
@steipete
steipete deleted the codex/autoqa-hidden-pane-unread branch August 14, 2026 02:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
…s you are not viewing (openclaw#123247)

Since retained panes (openclaw#121625) every pane — hidden or presented — keeps
its sessions subscription alive, and applySessionsState marked the
pane's selected session read unconditionally. New activity in a
recently-viewed session was cleared by its hidden pane instantly: the
sidebar unread dot never stuck, agentStatus attention was wiped by the
read patch, and "Mark as unread" self-reverted. Gate the read-marking
on this.presented, matching applyActiveSessionBindings.
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 maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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