Skip to content

Fix flickering AI-tip input in label settings#830

Merged
backnotprop merged 1 commit into
backnotprop:mainfrom
j-token:bug/label-tip-input-flicker
May 31, 2026
Merged

Fix flickering AI-tip input in label settings#830
backnotprop merged 1 commit into
backnotprop:mainfrom
j-token:bug/label-tip-input-flicker

Conversation

@j-token
Copy link
Copy Markdown
Contributor

@j-token j-token commented May 31, 2026

TL;DR

The Settings > Labels AI-tip (lightbulb) input flickered intensely on open. Root cause: the open animation animated max-height (a layout property), which fed a layout loop inside the scroll viewport and restarted the animation ~40x/s. Switched the keyframe to opacity + transform (compositor-only), eliminating the flicker.

Background / Context

Each Quick Label row has a lightbulb ("Add AI instruction tip") that opens a tip editor sliding in below the row. The slide used a max-height: 0 -> 60px keyframe. Expected: a smooth one-time reveal. Actual: rapid, continuous flicker on every open (#829).

Observed problem

  • tip-slide-open animates max-height, a layout/reflow property, with no animation-fill-mode.
  • The keyframe end (60px) exceeds the input's natural height (~31px).
  • The editor sits inside an OverlayScrollbars viewport + flex min-h-0 container; animating its height feeds a layout loop that restarts the animation ~40x/second, jittering height between 8-31px.
  • Reporter-suggested causes (key={index} remount, unbatched setState, ResizeObserver loop, scroll-into-view churn) were measured and ruled out: 0 node remounts, 0 DOM/style mutations, 0 scroll events, 1 ResizeObserver fire.

Fix approach

Animate compositor-only properties (opacity + transform: translateY) instead of max-height. No layout property is animated, so the loop cannot form. The keyframe end state equals the element's natural rendered state, so no animation-fill-mode is needed. The parent row already has overflow-hidden, so the initial translateY(-4px) is clipped cleanly.

Modified files

  • packages/ui/components/Settings.tsxtip-slide-open keyframe (2 lines).

Verification criteria

Clicking the lightbulb opens the tip editor with no flicker; the editor settles at its natural height; typing, Enter-to-save, Esc-to-cancel, and toggling labels with/without tips all behave normally.

Test list

Verified on the live demo (share.plannotator.ai) by patching the page's keyframe in place with the fix CSS, in the real layout:

Metric (450ms window) Before (max-height) After (opacity+transform)
Animation restarts 17 0
Height reversals 10 0
Editor height 8<->31px jitter 31px stable

References

Closes #829

The "Add AI instruction tip" editor in Settings > Labels flickered
intensely on open. Its `tip-slide-open` keyframe animated `max-height`
(a layout property) to 60px -- larger than the input's natural height --
with no animation-fill-mode. Inside the OverlayScrollbars viewport and a
flex `min-h-0` container this formed a layout feedback loop that
restarted the animation ~40x/second, jittering the editor height.

Animate `opacity` and `transform` instead, so no layout property is
animated. Measured on the live demo, animation restarts and height
reversals dropped from ~17/10 to 0, with height stable at its natural
value.

Fixes backnotprop#829

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@j-token j-token marked this pull request as ready for review May 31, 2026 05:43
@backnotprop backnotprop merged commit 2a8eb9d into backnotprop:main May 31, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AI-instruction-tip (lightbulb) input glitches in Settings → Labels

2 participants