Skip to content

fix(qa-lab): retain tab focus and scroll during polling - #155284

Merged
vincentkoc merged 5 commits into
mainfrom
fix/qa-lab-tab-navigation-retention-20260919
Sep 25, 2026
Merged

vincentkoc merged 5 commits into
mainfrom
fix/qa-lab-tab-navigation-retention-20260919

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

When polling replaces the QA Lab tab bar, keyboard focus disappears and an intentionally scrolled mobile tab bar snaps back to the start.

Why This Change Was Made

The render-state owner captures root-owned focus, navigation offset, and actual navigation width before DOM replacement. At the same width it restores focus before the saved offset. When width changes, it restores the offset first and lets the existing focus-reveal owner keep the selected control visible. No new observer, timer, or reveal algorithm.

The current correction preserves main's action, event-binding, and capture-key changes. It resolves the assertion-baseline merge conflict from 40 to 39 and keeps the navigation helper and regressions unchanged. Against d65bc76d60daaa16078748bd2f2a9c090564d2ee: production +42/-9, tests +554/-202, assertion baseline +1/-1. Shared test setup is extracted rather than duplicated.

User Impact

Polling retains focused tabs and navigation position. Native Tab still reveals the next control. Sidebar-width changes keep the focused tab visible, while focus elsewhere in the document is not stolen.

Evidence

Current reviewed head: bebbb53623872e0675c36ef3d0ddb9223f7f1cbf, tree 8ec081ed43e1bc7b4f814fc3a9b47557b954b0df, incorporating main 54b5f23b006ae917c8bb7903f5ee7dad6108ec25. The five QA Lab web files are byte-identical to the focused-proof correction 326616b1b9b28051d785c5d6ef42a1eb64fd57d4, tree f23d4cf7aa7aca73d0eaf024ef16b7fa761de44c.

Focused proof at that correction passed:

  • 71 selected tests, zero failures or skips: 18 navigation, 27 app, and 26 render/INERT cases.
  • 28 six-path checks and six guard tests.
  • Private QA build and QA Lab web build.
  • 16 real Chromium navigation cases with no page errors: all six desktop tabs, polling focus, drafts, outside focus, select deferral/blur, link-only controls, mobile keyboard scroll, and expanded/collapsed sidebar-width transitions.

At the current reviewed head, CI and Security passed. The native completed-hosted-evidence preparation gate accepted those results. Independent review, scoped autoreview, and the exact-head ClawSweeper review found no remaining actionable issue.

The separate protected AWS proof completed its build, checks, and selected tests successfully with remote command exit 0. Its publisher subsequently rejected the broker lifecycle receipt after release was accepted but cleanup remained pending. That publisher is failed, not a passing gate; landing uses the supported completed-CI route above. Cleanup settlement remains a separate follow-up.

The browser proof used the native QA Lab server with its embedded Gateway disabled. It does not claim Bun Gateway coverage; that is part of the separate current-main Bun campaign.

Retained Before/After Evidence

These five inspected captures belong to the earlier standalone navigation proof at 9ce782c423b21213bb76da40773d4a5bcfd8f927, run 35980458454. They are retained with their original provenance, not relabeled as new correction-head screenshots.

At 320px, baseline polling lost Chat focus and reset the offset from 208 to 0. The candidate retained focus and offset 208; native Tab then focused and revealed Results without changing the selected Chat view.

Pinned-main frontend after polling at 320px: navigation resets and Chat focus is lost

Standalone navigation candidate at 320px after polling: saved offset is retained

Standalone navigation candidate at 320px: native Tab focuses and reveals Results

At 705px, expanding the sidebar narrowed the tab bar from 704 to 425px while keeping Capture visible at offset 81. The reverse transition clamped the wider bar to zero.

Standalone navigation candidate at 705px: focused Capture remains visible with the expanded sidebar

Standalone navigation candidate at 705px: the wider Evidence Archive bar clamps to zero

Follow-ups

  • QA_LAB_MOBILE_CHAT_REFLOW: the cramped 320px transcript/composer is a separate unfinished change, not resolved by this navigation fix.
  • CONTROL_UI_ASSET_BUDGET: inherited asset-budget warnings from the earlier build remain separately tracked; a successful build is not a zero-warning claim.
  • CRABBOX_GATE_RELEASE_RECEIPT: reconcile the failed publisher's cleanup lifecycle before counting it as successful proof; do not weaken the release checks or relabel accepted release as completed cleanup.

@vincentkoc vincentkoc self-assigned this Sep 21, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 21, 2026 23:58
@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 25, 2026, 12:34 PM ET / 16:34 UTC (Revision 10).

ClawSweeper review

What this changes

The branch preserves keyboard focus and horizontal tab position across QA Lab dashboard redraws, adds navigation regression tests, and consolidates browser test setup.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep open for maintainer review. Current main still loses QA Lab tab focus and scroll position on redraw, and the proposed repair has credible browser evidence.

Priority: P2
Reviewed head: bebbb53623872e0675c36ef3d0ddb9223f7f1cbf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct browser images and source continuity support the repair; the remaining gap is measured test-cost reporting.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after QA Lab browser screenshots show the baseline mobile reset and the candidate retaining navigation position and keyboard focus. The changed render-state helper is byte-identical from that candidate through the pinned head, and the dashboard entry point matches the focused-proof correction; the linked host proof workflow was cancelled, so its conclusion is not counted as a passing gate. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after QA Lab browser screenshots show the baseline mobile reset and the candidate retaining navigation position and keyboard focus. The changed render-state helper is byte-identical from that candidate through the pinned head, and the dashboard entry point matches the focused-proof correction; the linked host proof workflow was cancelled, so its conclusion is not counted as a passing gate. No stored-data contract changes.
Evidence reviewed 8 items Current main still has the defect: Current main replaces the dashboard DOM and restores focus only by element ID; tab buttons have no IDs, and the tab bar's scroll offset is not saved.
The existing navigation behavior has a different scope: The existing focus handler reveals a focused tab inside its scrollport, but cannot retain focus or scroll when a redraw replaces that scrollport.
Introduced repair: The pinned PR introduces root-scoped focus capture plus tab offset and width capture, then restores focus and scroll in an order that accommodates width changes.
Findings 1 actionable finding [P3] Record the browser suites' measured run cost
Security None None.

How this fits together

The QA Lab dashboard polls its local server and redraws the operator interface when state changes. The redraw replaces the tab bar, so keyboard focus and its horizontal position must be restored in the new DOM.

flowchart LR
  A[QA Lab server state] --> B[Dashboard poll]
  B --> C[Capture focus and tab position]
  C --> D[Redraw dashboard]
  D --> E[Restore focus and position]
  E --> F[Usable tab navigation]
Loading

Before merge

  • Record the browser suites' measured run cost (P3) - The new navigation suite and materially refactored runner suite add recurring CI work, but the current PR body reports test counts without the per-file one-worker wall time or CI seconds required by the repository's test policy. This cost item appeared in an earlier review and remains absent from the current body; add the measured figures before merge.
  • Complete next step (P2) - Add measured one-worker wall times and CI seconds for the new navigation suite and materially changed runner browser suite to the PR body.

Findings

  • [P3] Record the browser suites' measured run cost — extensions/qa-lab/web/src/app.navigation.browser.test.ts:6
Agent review details

Security

None.

PR surface

Source +33, Tests +352, Other 0. Total +385 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 42 9 +33
Tests 3 554 202 +352
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 6 597 212 +385

Review metrics

Metric Value Why it matters
Production versus test growth production +42/-9; tests and support +554/-202 Production growth is confined to redraw-state handling; the larger test change extracts shared setup and covers navigation behavior.

Technical review

Best possible solution:

Keep transient navigation state at the dashboard redraw boundary and let the existing focus handler reveal tabs after width changes.

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

Yes, with high confidence from current-main source and the supplied baseline browser capture: a changed poll replaces a focused, scrolled tab bar without retaining either state. I did not execute current main in this read-only review.

Is this the best way to solve the issue?

Yes. The redraw boundary owns the transient state, and the patch reuses the existing tab-reveal behavior rather than introducing another navigation mechanism.

Full review comments:

  • [P3] Record the browser suites' measured run cost — extensions/qa-lab/web/src/app.navigation.browser.test.ts:6
    The new navigation suite and materially refactored runner suite add recurring CI work, but the current PR body reports test counts without the per-file one-worker wall time or CI seconds required by the repository's test policy. This cost item appeared in an earlier review and remains absent from the current body; add the measured figures before merge.
    Confidence: 0.88

Overall correctness: patch is correct
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 368163b4c148.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a reproducible QA Lab operator-interface problem with limited product blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after QA Lab browser screenshots show the baseline mobile reset and the candidate retaining navigation position and keyboard focus. The changed render-state helper is byte-identical from that candidate through the pinned head, and the dashboard entry point matches the focused-proof correction; the linked host proof workflow was cancelled, so its conclusion is not counted as a passing gate. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after QA Lab browser screenshots show the baseline mobile reset and the candidate retaining navigation position and keyboard focus. The changed render-state helper is byte-identical from that candidate through the pinned head, and the dashboard entry point matches the focused-proof correction; the linked host proof workflow was cancelled, so its conclusion is not counted as a passing gate. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after QA Lab browser screenshots show the baseline mobile reset and the candidate retaining navigation position and keyboard focus. The changed render-state helper is byte-identical from that candidate through the pinned head, and the dashboard entry point matches the focused-proof correction; the linked host proof workflow was cancelled, so its conclusion is not counted as a passing gate. No stored-data contract changes.

Evidence

What I checked:

  • Current main still has the defect: Current main replaces the dashboard DOM and restores focus only by element ID; tab buttons have no IDs, and the tab bar's scroll offset is not saved. (extensions/qa-lab/web/src/app.ts:1619, 368163b4c148)
  • The existing navigation behavior has a different scope: The existing focus handler reveals a focused tab inside its scrollport, but cannot retain focus or scroll when a redraw replaces that scrollport. (extensions/qa-lab/web/src/ui-tab-navigation.ts:23, 54b5f23b006a)
  • Introduced repair: The pinned PR introduces root-scoped focus capture plus tab offset and width capture, then restores focus and scroll in an order that accommodates width changes. (extensions/qa-lab/web/src/ui-render-state.ts:1, bebbb5362387)
  • Proof continuity: The dashboard entry point has identical blob hashes at the focused-proof correction and pinned head; the render-state helper also has identical blob hashes at the earlier screenshot candidate, correction, and pinned head. (extensions/qa-lab/web/src/app.ts:1620, bebbb5362387)
  • Direct visual proof: Four prepared PR screenshots were inspected: they show the baseline mobile reset, the candidate's retained tab position, native keyboard focus on the next tab, and a focused tab after a sidebar width change. The images are attributed in the PR body to the earlier screenshot candidate; the fifth image mentioned there was not present in the prepared manifest. (9ce782c423b2)
  • Exact-head CI: The CI and Security Review workflows concluded successfully for the pinned PR head. The separately linked focused-proof host workflow concluded cancelled, so its workflow conclusion is not treated as a passing gate. (bebbb5362387)

Likely related people:

  • Vincent Koc: Raw commit bc41bb9 adds extensions/qa-lab/web/src/ui-tab-navigation.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bc41bb950b65; files: extensions/qa-lab/web/src/ui-tab-navigation.ts)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Add per-file one-worker wall times and CI seconds for the new and materially changed browser test suites.

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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-22T00:44:50.905Z sha 8a56460 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-24T07:22:14.608Z sha 8a56460 :: blocked before merge. :: none
  • reviewed 2026-09-24T10:18:38.096Z sha 9ce782c :: needs changes before merge. :: [P3] Record the navigation test's measured run cost
  • reviewed 2026-09-24T10:56:25.970Z sha 9ce782c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-25T05:32:47.718Z sha 9ce782c :: blocked before merge. :: none
  • reviewed 2026-09-25T13:08:01.254Z sha 326616b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-25T13:19:11.163Z sha 326616b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-25T15:47:38.996Z sha bebbb53 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 25, 2026
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits)
  feat(ui): listen to managed desktop audio in the panel (#157724)
  fix(ci): resume partially published preparation receipts (#158174)
  feat(release): one approval per release via an attested parent approval receipt (#157911)
  feat(desktop): advertise current managed desktop audio (#157723)
  fix(ui): retain delayed progress scroll gestures (#158153)
  refactor(ui): share sidebar mutation error feedback (#158173)
  test: await database verifier process lifecycle events (#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (#157722)
  refactor(gateway): split companion prompts and metadata fixtures (#158050)
  feat(desktop): isolate managed Linux application audio (#157720)
  fix(test): prepare catalog fixture modules before startup (#158157)
  fix: keep model pickers usable during provider sign-in (#158132)
  refactor(test): remove unused prompt scenario metadata (#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020)
  fix: bound stalled browser stream startup (#156323)
  fix(onnx): prevent worker fixture hangs after release (#158146)
  fix(models): preserve scoped provider discovery outcomes (#158139)
  fix(agents): report offline trash failures after agent delete (#158052)
  ...
@vincentkoc
vincentkoc merged commit 478cb42 into main Sep 25, 2026
110 checks passed
@vincentkoc
vincentkoc deleted the fix/qa-lab-tab-navigation-retention-20260919 branch September 25, 2026 16:36
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
)

* fix(qa-lab): retain tab focus and scroll during polling

* chore(qa-lab): merge main for tab navigation validation

* fix(qa-lab): keep focused tabs visible after layout changes

* fix(qa-lab): reconcile navigation retention with current app

* chore: refresh main for QA Lab navigation validation

* commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (194 commits)
  feat(ui): listen to managed desktop audio in the panel (openclaw#157724)
  fix(ci): resume partially published preparation receipts (openclaw#158174)
  feat(release): one approval per release via an attested parent approval receipt (openclaw#157911)
  feat(desktop): advertise current managed desktop audio (openclaw#157723)
  fix(ui): retain delayed progress scroll gestures (openclaw#158153)
  refactor(ui): share sidebar mutation error feedback (openclaw#158173)
  test: await database verifier process lifecycle events (openclaw#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (openclaw#157722)
  refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050)
  feat(desktop): isolate managed Linux application audio (openclaw#157720)
  fix(test): prepare catalog fixture modules before startup (openclaw#158157)
  fix: keep model pickers usable during provider sign-in (openclaw#158132)
  refactor(test): remove unused prompt scenario metadata (openclaw#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020)
  fix: bound stalled browser stream startup (openclaw#156323)
  fix(onnx): prevent worker fixture hangs after release (openclaw#158146)
  fix(models): preserve scoped provider discovery outcomes (openclaw#158139)
  fix(agents): report offline trash failures after agent delete (openclaw#158052)
  ...

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR 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: L 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