fix: prevent sidebar selection paint flicker#881
Conversation
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/pages/layout/sidebar-items.tsx, packages/app/src/pages/layout/sidebar.css)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 59 minutes and 57 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors the sidebar session row styling by moving highlight logic from Tailwind classes to CSS pseudo-elements, allowing for instant active state updates while preserving smooth hover transitions. A new E2E test was added to verify these visual changes. The review feedback suggests replacing page.waitForTimeout() in the test with a more deterministic approach, such as waiting for a requestAnimationFrame, to prevent potential flakiness.
Perf delta summaryComparator: pass
|
Bump the desktop Electron package version to v2026.5.25 for the release train. Included release-readiness checks: - Local app and desktop Electron typechecks passed. - Focused UI component tests for grouped tool-call summaries passed. - PR CI passed, including app/ui/opencode/desktop units, typecheck, CodeQL, desktop smoke, and e2e-artifacts. - Computer Use manual E2E covered new session creation, an actual execute-command tool call, right-panel tabs and collapse, #880 sidebar/right-panel toggle affordances, and pinned session drag reordering. This release includes the current dev branch work through #880 and the later fixes #881 and #883.
Summary
data-switch-paintis present so the target row cannot stack selected + hover paint before the router-applied active class arrives.sidebar.cssso background paint and status paint follow the same contract.chosenClassno longer dims rows during ordinary clicks; only the actual fallback drag preview gets drag-specific styling.Why
Fixes #879.
The first follow-up still flickered in the user's R2 recording. Frame-by-frame sampling showed the clicked target row briefly painted darker and then settled lighter after selection. The target row had already been marked for switch paint, but the later hover selector still enabled the animated hover layer on top of the instant selected layer.
The concrete R2 cascade bug was:
[data-switch-paint]::after { opacity: 0 }tried to suppress hover paint during a switch;:hoverinteraction selector set the hover layer back toopacity: 1for a not-yet-active target row;The user's R3 recording showed a second, separate flash. Frame-by-frame analysis showed the row content and right-side action dimming together for a frame on mouse down. A minimal SortableJS probe confirmed that
chosenClassis applied on ordinarymousedown, before a drag is confirmed. Our.pw-drag-chosen { opacity: 0.35 }therefore dimmed normal clicks.This change keeps normal hover/focus/menu animation, makes switching a higher-priority paint state, and separates SortableJS states by meaning:
chosenClass: pointer is down, but a drag may not happen; no dimming.ghostClass: in-list placeholder during actual drag.dragClass/ fallback clone: actual moving drag preview.Related Issue
Fixes #879
Human Review Status
Pending
Review Focus
Please focus on the session row paint contract in
sidebar.cssand the SortableJS state styling:switching > selected > interaction > idleshould stay centralized and non-stacking.NewSessionItemis intentionally not included because the confirmed repro path is switching between existing session rows, and it does not share the right-side status/action crossfade involved in this issue.Risk Notes
Low risk. The change is scoped to
pawwork-session-rowpaint, SortableJS row state styling, and a temporary click-switch marker. Routing, session persistence, and drag data flow are unchanged.Skipped conditional checklist items:
How To Verify
Note: an earlier attempt to run two Playwright commands in parallel caused
ERR_CONNECTION_REFUSEDfrom dev-server port contention insidebar-session-links.spec.ts; rerunning that suite alone passed.Screenshots or Recordings
Visible UI was checked with local snap grids:
docs/design/preview/screenshots/sidebar.pngdocs/design/preview/screenshots/sidebar-pinned.pngManual Electron verification was also completed by @Astro-Han on the PR worktree after
origin/devwas merged into the branch.Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.