Skip to content

fix(ui): keep newly created sessions above Show more - #123828

Merged
fuller-stack-dev merged 1 commit into
mainfrom
fix/sidebar-created-sort-v2
Aug 14, 2026
Merged

fuller-stack-dev merged 1 commit into
mainfrom
fix/sidebar-created-sort-v2

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where users sorting the Control UI sidebar by Created could have a newly created session hidden below Show more when that session was discovered through a refresh or another client.

Why This Change Was Made

The Created and People sort paths now use the gateway's authoritative creation timestamp. Timestamped sessions sort newest-first, while legacy rows without a timestamp retain their stable first-observed fallback order. Updated sorting and pinned-zone priority are unchanged.

User Impact

New sessions consistently appear at the top of their unpinned sidebar section, including sessions created from another client or process.

Evidence

  • Red browser reproduction on the unmodified base: the external session was absent from the first ten rows and hidden below Show more.
  • Green browser proof on the fix: the external session is first, the visible row count remains ten, and the oldest row moves below Show more.
  • node scripts/run-vitest.mjs run ui/src/components/app-sidebar-session-navigation-logic.test.ts ui/src/components/app-sidebar.test.ts — 278 passed.
  • OPENCLAW_E2E_WORKERS=1 pnpm test:ui:e2e -- ui/src/e2e/session-management.created-sort.e2e.test.ts — passed.
  • pnpm tsgo:ui — passed.
  • Focused Oxlint and format checks — passed.
  • Source-blind behavior validation: 6 relevant clauses passed, 0 failed; refresh/local-event convergence remained an evidence-only gap.
  • Commit-level autoreview: clean, no accepted/actionable findings.

AI-assisted: implementation, tests, proof capture, and review were performed with Codex/OpenClaw tooling.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 14, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review August 14, 2026 20:57
@fuller-stack-dev
fuller-stack-dev force-pushed the fix/sidebar-created-sort-v2 branch 2 times, most recently from 191383b to 1b7bf9d Compare August 14, 2026 21:17
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 5:33 PM ET / 21:33 UTC.

ClawSweeper review

What this changes

The PR changes Control UI sidebar sorting to use Gateway creation timestamps so newly discovered sessions remain above the Show more boundary.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-authored PR open for normal exact-head validation. The updated E2E addresses the prior synchronization finding, and the central comparator is the correct owner-boundary repair for refreshed sessions being hidden below the pagination boundary.

Priority: P2
Reviewed head: f42240f885b2a94c7861fa1a6b6e827862d9245b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused owner-boundary change and layered regression coverage address the prior review finding with no remaining correctness defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored Control UI PR is exempt from the external-contributor proof gate; it nevertheless adds a browser E2E with proof-capture hooks.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored Control UI PR is exempt from the external-contributor proof gate; it nevertheless adds a browser E2E with proof-capture hooks.
Evidence reviewed 7 items Current-main defect: Created mode orders rows only by first observation, so a session first seen in a later refresh remains after the initial ten rows despite being newer.
Authoritative timestamp contract: Gateway session rows expose optional numeric createdAt values; the patch uses that existing protocol field rather than inventing client state.
Canonical refresh path: A sessions.changed event schedules the canonical list refresh that supplies the updated row to the sidebar.
Findings None None.
Security None None.

How this fits together

The Control UI receives Gateway session rows, sorts them for the sidebar, then limits visible rows before Show more. The change affects which refreshed sessions appear immediately to the operator.

flowchart LR
  A[Gateway session rows] --> B[Session refresh event]
  B --> C[Canonical session list]
  C --> D[Sidebar sort mode]
  D --> E[Creation-time comparator]
  E --> F[Visible session rows]
  F --> G[Show more boundary]
Loading

Before merge

  • Resolve merge risk (P2) - Production code is net +27 lines for a bug fix; the shared comparator needs timestamp validation, legacy fallback, and deterministic ties, and moving this policy into the first-observation map would conflate it with explicit session promotion behavior.
  • Complete next step (P2) - The previous synchronization finding is addressed and no narrow automated repair remains; retain this protected maintainer PR for ordinary exact-head validation.
Agent review details

Security

None.

PR surface

Source +56, Tests +188. Total +244 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 62 6 +56
Tests 2 189 1 +188
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 251 7 +244

Review metrics

Metric Value Why it matters
Production versus test LOC production +33/-6 (net +27); tests/test support +218/-1 (net +217) The production growth is localized to one shared comparator; the remaining change is layered regression coverage.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/session-management.created-sort.e2e.test.ts, serialized state: ui/src/test-helpers/app-sidebar-cases/sessions.ts, unknown-data-model-change: ui/src/e2e/session-management.created-sort.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared comparator as the canonical ordering owner, preserve the legacy first-observed fallback, and proceed once required checks validate this exact head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the shared comparator as the canonical ordering owner, preserve the legacy first-observed fallback, and proceed once required checks validate this exact head.

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

Yes, source-reproducible: current main assigns a refreshed row a later first-observed index, which places it below ten existing rows; the updated E2E asserts the corrected rendered order. The scenario was not executed in this read-only review.

Is this the best way to solve the issue?

Yes. The shared sidebar comparator is the narrowest owner for Created and People secondary ordering; changing pagination or the refresh producer would retain an incorrect ordering policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9f125bcee017.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored Control UI PR is exempt from the external-contributor proof gate; it nevertheless adds a browser E2E with proof-capture hooks.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The change repairs a bounded Control UI ordering defect that can hide a newly created session until the operator expands the sidebar.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored Control UI PR is exempt from the external-contributor proof gate; it nevertheless adds a browser E2E with proof-capture hooks.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Blame assigns the sessionCreatedOrder recording that causes the stale refreshed-row order to this change. (role: introduced first-observation ordering state; confidence: high; commits: 84c2d6420637; files: ui/src/components/session-data-controller-events.ts, ui/src/components/app-sidebar-session-navigation-logic.ts)
  • Peter Steinberger: Recent history includes work on the sidebar session-data and navigation area adjacent to this ordering path. (role: recent session-list contributor; confidence: medium; commits: a7d61fc114a0, da7a2b4651ef; files: ui/src/components/session-data-controller-events.ts, ui/src/components/app-sidebar-session-navigation-logic.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-14T21:21:59.946Z sha 1b7bf9d2b3385dc3fbf86f9e0754fd35b3ad4599 :: found issues before merge. :: [P2] Wait for the refreshed sidebar rows

@fuller-stack-dev
fuller-stack-dev force-pushed the fix/sidebar-created-sort-v2 branch from 1b7bf9d to f42240f Compare August 14, 2026 21:28
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Addressed the P2 synchronization finding: the E2E now polls the exact refreshed sidebar key order before proof capture and assertion. Focused browser test, formatting, Oxlint, and commit-level autoreview are green on head f42240f.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 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 Aug 14, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 386b12b into main Aug 14, 2026
306 of 308 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/sidebar-created-sort-v2 branch August 14, 2026 21:44
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

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 P2 Normal backlog priority with limited blast radius. 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