Repository navigation
fix(studio): colour compare holds and beat drags survive a sealed preview taking the keyboard - #9108
Conversation
… no longer dropped The sealed frame taking keyboard focus blurs Studio's window, and the held gesture cancel read that as the person leaving the window. A blur whose focus went into a frame on the page now leaves the press held.
…view taking the keyboard A focus move into a frame on the page blurs the window though the person never left it. The held-gesture cancel, both hold-to-compare buttons and the beat drag now ask one shared helper before releasing on a window blur.
Edit accuracy: accurate 275 (base branch 273), smooth 44 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 269375a. The change itself is right; it needs a rebase onto main before it can merge.
Requesting changes: merged with today's main, useHeldGestureCancel.ts declares focusMovedIntoAFrameOnThePage twice. #9107 landed on main as a squash, with the helper as a local function in that file. This branch still carries #9107's original commit and then moves the helper to utils/focusMovedIntoAFrame.ts. Git merges the two without a conflict, so GitHub shows the PR as mergeable, but the result keeps both. I built the merge tree of main and this head (git merge-tree); the file starts:
import { focusMovedIntoAFrameOnThePage } from "../../utils/focusMovedIntoAFrame";
function focusMovedIntoAFrameOnThePage(): boolean {That is an import clashing with a local declaration, so Studio's type check fails on the merged result. Rebase onto main (dropping the #9107 commit) so the local function is removed in this diff, and I approve.
"Studio and player captures" is also red at this head; please check it on the rebased head.
The rest, read in full as changed (source files; tests by name and by the body's list):
- The helper is the one from #9107, unchanged, now shared.
- All four blur releases (
useHeldGestureCancel, both colour compare buttons,BeatStrip) ask it first, and each removes the same listener it added (releaseOnBlur/cancelBeatDragOnBlur), so nothing is left attached. - Pointer up, pointer cancel, Escape, hidden tab and the buttons' own
onBlurstill release. fails without the fix:is in the body and names its tests.
Not run: tests or type checks (no installed packages on this box); the merge tree above is the one thing I built.
Need: yes · Size: small · Reuse: one helper for four gestures · Simpler: no · Structure: sound
Risk: low once rebased.
— Rames
Main has #9107 as a squash with the helper local to useHeldGestureCancel.ts; this branch moves it to utils/focusMovedIntoAFrame.ts, so the merge drops the local copy that would otherwise sit beside the import.
|
Thanks, confirmed: merged with main, Fixed in 2a0b77c, a merge of main rather than a rebase, so the commits already pushed stay as they are. The merge removes the local copy #9107 left in At 2a0b77c: "Studio and player captures" fails because the diff touches |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 2a0b77c (re-review of my change request at 269375a).
Prior point, resolved. useHeldGestureCancel.ts now only imports focusMovedIntoAFrameOnThePage from utils/focusMovedIntoAFrame.ts; the local declaration is gone and the helper has one definition, used by the four callers. A trial merge with current main is clean.
Still holding on one thing: the "Studio and player captures" check is red at this head, and it is caused by this PR. The diff touches .tsx files, so the check wants a ## Before and a ## After section, each with an image or video, in the description or in one comment by the author. The current comment has neither heading. No code change is needed; I will approve once that check is green.
What I checked: the PR's own change against main is the same 8 files as before (150 added, 12 removed); compared with the head I reviewed, the only differences are the helper declaration removed here and the lines main already carries. Read useHeldGestureCancel.ts and focusMovedIntoAFrame.ts whole at this head; the other six files as hunks, unchanged from my earlier read. I did not run the tests (no dependencies installed on my machine); the other checks were still pending when I looked.
Need: yes · Size: fine · Reuse: yes, one shared helper · Simpler: no · Structure: good
Risk: low.
— Rames
|
Captures for the red "Studio and player captures" check, at 2a0b77c. Sealed preview, a repo-style fixture with one image graded with the VHS preset. "Hold to show original" is held down throughout. Then focus moves into the preview frame, as it does when the sealed preview takes the keyboard after a save. Each shot is taken after that focus move, with the button still held. Beforemain at 90522c4: the window's blur released the held compare, so the graded image is back while the button is still down. AfterThis PR: the hold survives the focus move, and the original image stays until the button is let go. |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 2a0b77c. Same head as my earlier review, so no code changed. The only thing I held on was the "Studio and player captures" check, which this PR turned red; it is green now and the Before/After captures are posted. 61 checks pass, none fail. Nothing re-run locally. My earlier read of the code stands.
Need: yes · Size: unchanged · Reuse: unchanged · Simpler: no · Structure: unchanged
Risk: none new since the last review.
— Rames


What
A hold-to-compare in the colour grading panel and a beat drag on the timeline are no longer released when a sealed preview takes the keyboard mid-gesture. #9107 fixed the same thing for a drag on the canvas. This moves its check into one shared helper and has every gesture that ends on a window
blurask it first.Why
A sealed preview's frame takes keyboard focus after a save, which blurs Studio's window although the person never left the page. Every gesture that ended on a window
blurread that as the person leaving. In #9107 that dropped a canvas drag; the same focus move landing during a held compare button or a beat drag released those too. Sealed must behave as unsealed, where the preview never takes focus.Related work
Stacked on #9107; review that first.
How
utils/focusMovedIntoAFrame.ts:focusMovedIntoAFrameOnThePage, moved out ofuseHeldGestureCancel.ts. It follows the focused element through open shadow roots, since the preview's frame sits inside the player's.useHeldGestureCancel.ts,propertyPanelColorGradingSection.tsx,propertyPanelFlatColorGradingAccessory.tsxandBeatStrip.tsxeach release on a windowbluronly when that returns false. Their other releases (pointer up, pointer cancel, Escape, a hidden tab) are unchanged.useTimelineShiftModifier.ts) resets on a windowblur, which stays right when focus moves into the frame: the frame then gets the key up.onBluris left alone. A pointer hold never focuses the button, and a held Space must end when focus leaves, since its key up goes elsewhere.Test plan
fails without the fix: "keeps a drag when focus moves into a frame on the page" (
packages/studio/src/player/components/BeatStrip.test.tsx), "keeps a hold when focus moves into a frame on the page" (packages/studio/src/components/editor/propertyPanelFlatColorGradingSection.test.tsx) and "keeps a hold when focus moves into a frame on the page, and ends it when the window goes" (packages/studio/src/components/editor/propertyPanelColorGradingSection.test.tsx), with fix(studio): a drag pressed as a sealed preview takes the keyboard is no longer dropped #9107's canvas test. With the helper forced to the old answer, all four fail. With it forced to the opposite answer, "cancels without mutation when the window loses focus" (new,BeatStrip.test.tsx), "releases an active hold when the window loses focus mid-hold" and the canvas blur tests fail, so a real window blur still cancels.BeatStrip, both colour grading tests,gestureHoldsPreviewReload,useSealedCanvasKeys.sealed,DomEditOverlay,editorGesturesExports,shiftDragAxisLock,selectionHandlesRideTheBox,sealedRawDragStep,PropertyPanelandTimeline.readOnlytests: 240 of 240, 3 runs in a row.tsc --noEmitinpackages/studio: exit 0.Not run: a bench case for these two gestures; the edit accuracy bench has none.
Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug
No visible change
The sealed preview is not on by default. In a sealed preview, a compare hold or a beat drag now lasts until it is let go, as it does unsealed.