Skip to content

fix(client): card hover preview flicker with follow-cursor and delay#4407

Closed
kiannidev wants to merge 5 commits into
phase-rs:mainfrom
kiannidev:pr4-fix-hover-flicker
Closed

fix(client): card hover preview flicker with follow-cursor and delay#4407
kiannidev wants to merge 5 commits into
phase-rs:mainfrom
kiannidev:pr4-fix-hover-flicker

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Summary

  • When a deferred inspectObject(null) clear fires, keep the preview open if the cursor is still over a [data-card-hover] element
  • Fixes follow-cursor + hover-delay settings where layout shifts caused brief preview dismissal

Fixes #4377

Test plan

  • Added uiStore regression test for deferred clear suppression
  • Enable follow-cursor preview with 400ms delay and confirm hover stays stable

Model: Composer

Made with Cursor

@kiannidev
kiannidev requested a review from matthewevans as a code owner June 26, 2026 09:44

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the uiStore to prevent the card preview from being cleared when the cursor is still over a card tile (using [data-card-hover]) during a spurious mouseleave event. A corresponding unit test has been added to verify this behavior. The review feedback recommends using Vitest's fake timers instead of a real setTimeout in the test to avoid potential flakiness in CI environments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread client/src/stores/__tests__/uiStore.test.ts Outdated
@matthewevans

Copy link
Copy Markdown
Member

Maintainer sweep note: DEFER-FE. This PR touches frontend/client/UI surface, so I am leaving it for Matt's direct frontend handling under the sweep policy. No approval, label, enqueue, or merge from this automated maintainer sweep.

@kiannidev
kiannidev force-pushed the pr4-fix-hover-flicker branch from 1c981cc to 01e237f Compare June 26, 2026 10:25
@matthewevans

Copy link
Copy Markdown
Member

Maintainer sweep update: current head still touches frontend/client/UI surface, so this remains DEFER-FE for Matt's direct frontend handling. No approval, label, enqueue, or merge from this automated maintainer sweep.

@kiannidev
kiannidev force-pushed the pr4-fix-hover-flicker branch from 01e237f to e07fe3a Compare June 26, 2026 11:47
kiannidev and others added 2 commits June 26, 2026 13:52
Suppress deferred preview clears while the cursor remains over a
[data-card-hover] tile, fixing spurious mouseleave from layout shifts
(fixes phase-rs#4377).

Model: Composer
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace real setTimeout in uiStore test with vi.useFakeTimers per review
to avoid flaky CI timing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev
kiannidev force-pushed the pr4-fix-hover-flicker branch from e07fe3a to 2a61f33 Compare June 26, 2026 11:52
@matthewevans

Copy link
Copy Markdown
Member

Maintainer sweep update: current head 2a61f33e21320d3def1e8e45b630aae704c87efb still touches client UI store/tests. Per the frontend/client/UI sweep rule this remains DEFER-FE for Matt’s direct handling; no approval, label, enqueue, or merge from the sweep.

@matthewevans

Copy link
Copy Markdown
Member

@kiannidev please show a recording illustrating that the issue has been reoslved

@kiannidev

Copy link
Copy Markdown
Contributor Author
20260630_221334.mp4

@kiannidev

Copy link
Copy Markdown
Contributor Author

@matthewevans - I uploaded video to show how it is working

@matthewevans matthewevans added defer-fe Frontend/client/UI PR deferred to Matt's direct review bug Bug fix labels Jul 2, 2026
@matthewevans matthewevans self-assigned this Jul 8, 2026
# Conflicts:
#	client/src/stores/__tests__/uiStore.test.ts
@matthewevans matthewevans removed their assignment Jul 8, 2026
@matthewevans

Copy link
Copy Markdown
Member

Deferred by maintainer intake policy — not ignored.

This current head (a3564c77875dd97fe895bd2ec81a06afdca0fe04) was triaged as a frontend-only change (client/src/stores/__tests__/uiStore.test.ts, client/src/stores/uiStore.ts) by kiannidev. The local frontend-review allowlist does not include this author, so this route does not perform an implementation-diff review or approve the PR.

A maintainer must explicitly take this PR or add a local frontend-review exception before it can receive substantive review. The defer label is a routing marker only, not a verdict on the change.

Co-authored-by: kiannidev <156195510+kiannidev@users.noreply.github.com>
@matthewevans

Copy link
Copy Markdown
Member

Deferred by maintainer intake policy — not ignored.

This current head (249b46ab9cf87dfe787cdbaca031510df4157b76) was triaged as a frontend-only change (client/src/stores/__tests__/uiStore.test.ts, client/src/stores/uiStore.ts) by kiannidev. The local frontend-review allowlist does not include this author, so this route does not perform an implementation-diff review or approve the PR.

A maintainer must explicitly take this PR or add a local frontend-review exception before it can receive substantive review. The defer label is a routing marker only, not a verdict on the change.

@matthewevans

Copy link
Copy Markdown
Member

Superseded by #6239.

Current main merged #6239 at 11238f4760a4be8038724596689827625e71f662), and it closes the same issue, #4377. Its uiStore.inspectObjectupdate covers this stale-leave case plus the pending hover-delay path: it preserves the pending show through the 50 ms clear grace period, flushes it when the pointer remains over[data-card-hover]or[data-card-preview], and cancels it otherwise. client/src/stores/tests/uiStoreHoverLatency.test.ts` exercises both the delayed and already-open preview cases.

I merged current main into this head locally to classify the conflict. The sole conflict is this same uiStore clear branch; keeping #6239's broader implementation leaves no unique behavior from this PR to port. Closing this duplicate rather than pushing a redundant merge.

@matthewevans matthewevans removed their assignment Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix defer-fe Frontend/client/UI PR deferred to Matt's direct review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Card Hover Disappearing — Hover card preview disappears after a brief moment when settings are configured "follow curso…

2 participants