fix(scene-bar): keep scene tab close button under cursor on press - #2213
Open
linzhary wants to merge 3 commits into
Open
fix(scene-bar): keep scene tab close button under cursor on press#2213linzhary wants to merge 3 commits into
linzhary wants to merge 3 commits into
Conversation
The whole scene tab scales 0.985 around its center on :active (120ms), which drags the absolutely-positioned close button left by 0.015 x (width/2 - 15) px (~4-8px on typical scene tab widths). The mouseup hit-test then lands outside the button, so the click bubbles to the tab and activates it instead of closing it. SceneTab now measures the drift and exposes it as --scene-tab-close-shift; SceneBar.scss counter-translates the close button with the same 120ms easing as the tab scale, so the press animation is preserved and the button stays under the cursor. The close button is also pinned against the global motion baseline 1px drop on :active. only-child and prefers-reduced-motion paths keep the button at its base position. Verification: pnpm run type-check:web, sass compile; manual close-button verification in desktop dev. Fixes GCWing#2210
The theme color audit contract keeps FALLBACK_VAR_CONTRACTS empty, so var(--scene-tab-close-shift, 0px) was flagged as an uncontracted fallback usage. Declare --scene-tab-close-shift: 0px on the tab as the default and consume it without a fallback.
The appearance contract audit forbids the --scene-* CSS token family, so --scene-tab-close-shift was rejected in both files. Use the component-scoped name --bitfun-scene-tab-close-shift instead.
linzhary
force-pushed
the
fix/scene-tab-close-button-escape
branch
from
August 11, 2026 06:48
cee2327 to
566d461
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2210 — the top SceneBar scene tab close button sometimes fails to close and instead activates the tab.
Root cause: the whole scene tab scales
0.985around its center on:active(120ms). The close button is absolutely positioned (right: 6px) inside the tab, so the scale drags it left by0.015 × (width/2 − 15)px(≈4–8px on typical scene tab widths). The mouseup hit-test then lands outside the button, the click bubbles to the tab, and the tab is activated instead of closed. The escape is larger on wider tabs and timing-sensitive (releasing during the 120ms scale misses more often).Fix
SceneTab.tsx: measure the tab width and expose the close button's scale drift as--bitfun-scene-tab-close-shift.SceneBar.scss: on:active, counter-translate the close button with the same120ms cubic-bezier(0.23, 1, 0.32, 1)easing as the tab scale, so the press animation is fully preserved while the button stays under the cursor. The button is also pinned against the global motion baseline 1px drop on:active.:only-childandprefers-reduced-motionpaths keep the button at its base position.Verification
pnpm run type-check:webpasses.Note: this PR is AI-assisted; testing level: lightly tested.