Animate ColorPicker open/close & KeyPicker text swap (+ ColorPicker resize/DPI fixes) - #9
Open
corradedied wants to merge 3 commits into
Open
Animate ColorPicker open/close & KeyPicker text swap (+ ColorPicker resize/DPI fixes)#9corradedied wants to merge 3 commits into
corradedied wants to merge 3 commits into
Conversation
Added FuzzyScore/NormalizeSearch/MatchesSearch, a VSCode-style fuzzy matcher (exact substring still scores best, falls back to in-order non-consecutive char matching), and swapped it in for the old Text:lower():find(Search, 1, true) checks in CheckDepbox and ApplySearchToTab. Tabs, Groupboxes, and Tabbox sub-tabs now carry Name/Description; if a container's own name matches Search, its children are pulled in automatically instead of needing to match individually. Dropdown search now scores entries with the same fuzzy matcher and sorts by score (ties keep original order) instead of leaving filtered results unordered. Exact substring matching meant anything short of typing a setting's name correctly returned zero results, making the search bar mostly useless for anything but exact recall. This gets it closer to how search works in most modern UIs.
- Condense fuzzy-sort comment to one line, drop "VSCode-style" wording - Inline GroupboxMatches assignment as suggested - Trim Fuzzy Search header to a single comment line No logic changes.
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
Gives ColorPicker an open/close animation consistent with Dropdown/KeyPicker,
adds a text wipe to KeyPicker's key-name label, and fixes three long-standing
ColorPicker resize/DPI bugs that were discovered along the way.
Changes
1. Animation flag scaffolding
Added
ColorPicker,Input,Buttonto bothAnimationstables(
Librarydefaults andTemplates.Window.Animations), plus matching*TransitionInfoconstants next to the existing ones. All default tofalse. Nothing reads these yet outside of step 2, and existing lookups(
Library.Animations[AnimationType],SetAnimations) are alreadyuntyped/generic, so this is pure plumbing — no other call sites needed
changes.
2. ColorPicker open animation
ColorMenu'sAddContextMenucall now passes"ColorPicker"as theAnimationTypearg, so it reuses the exactAnimated()/OpenCloseTweenlogic Dropdown and KeyPicker already share. One call-site change; gated
behind
Animations.ColorPicker(off by default).3. KeyPicker text wipe
Added a wipe-out/wipe-in transition for the
"..."⇄ key-name swap,gated behind the existing
Animations.KeyPickerflag:KeyPicker:Display(non-slide-overflow branch): when the flag is onand the display text actually changed, it tweens
TextTransparencyto 1, swaps
Text/Sizeat the midpoint, then tweens back towhatever transparency it was at before the swap — captured live
rather than hardcoded, since hover already animates
TextTransparency(0.4 idle / 0 hovered) independently and we don'twant the wipe to fight or snap against that.
WipeTweenupvalue (alongside the existingSlideForwardTween/SlideBackTweenpattern) tracks the in-flighttween so rapid text changes (e.g. cycling modifiers while held)
cancel the previous wipe instead of stacking.
the same synchronous set as before.
"..."handling(
if IsForButton and SlideOverflow then ... else ... end) into asingle
KeyPicker:Display("...")call, sinceDisplayalreadybranches on
IsForButton/SlideOverflowinternally. Both paths nowfunnel through
Display, so the"..."swap and the modifier-holdupdate both get the wipe for free.
Reviewer note: this rides the same
Animations.KeyPickerboolean asthe step-2 menu open/close animation, but it's a separate mechanism
(
TextTransparencytween on the label vs.Menu.Sizetween on thedropdown). Toggling the flag turns both on/off together even though
nothing else connects them — worth deciding whether that's fine
long-term or should eventually split into its own flag.
Misc fixes (found/fixed while in this code)
AnchorPoint(1,0)/Size 1,1(fullfooter height) — too big and top-anchored. Now
AnchorPoint(1,1),positioned at
(1, -CornerRadius/4, 0.95, 0), sized0.8scale —closer to the true bottom-right corner without overlapping the footer
divider or bleeding into the rounded background corner.
FooterBackgroundalso gainedClipsDescendants = trueso the handlecan't visually spill past the footer edge.
ColorMenu.Menuis anAutomaticSize.YScrollingFramedriven by aUIListLayout. Dragging the resizehandle updated the color map's size every frame but left the
container's height to recompute automatically — which isn't
synchronous with the child-size change, so it lags a frame. Since
it's a
ScrollingFrame, it clips anything outside that stale bound:content growing past the old boundary got cut off, and the footer
(last in layout order) got pushed outside the visible area until
extra dragging forced a recompute. Fixed by measuring the real
overhead once per drag, switching
AutomaticSizeoff, and settingboth width and height on
Menu.Sizeexplicitly every frame —restored to
AutomaticSize.Ywhen the drag ends.Menu.AbsoluteSize.Yis alreadyDPI-scaled (there's a
UIScaleunderMenu), but it was beingwritten back into
Size, which gets scaled by that sameUIScaleagain on render — double-applying DPIScale. At 100% that's a no-op,
which is exactly why it only showed up above 100%: the open tween
overshot taller than the real content and left a gap until
AutomaticSizere-clamped it. Fixed by dividing byLibrary.DPIScalebefore using it as a
Sizeoffset. This lives in the sharedAddContextMenufunction, so it was silently affecting any animatedauto-sizing menu, not just ColorPicker.
(
ClampToViewportcompared logical map sizes against real screenpixels without dividing by DPI scale), which under-restricted how far
the picker could be dragged above 100% DPI.
Why
The animation flags/tween were requested to bring ColorPicker and
KeyPicker's text swap in line with the existing Dropdown/KeyPicker
open-close polish. The resize/DPI fixes were found incidentally while
working in the same block of code and are small enough to ship in the
same PR rather than opening three more for one file region.
Testing
Animations.ColorPicker/Animations.KeyPickeronand off, confirm both animated and instant paths look right.
confirm no clipping/lag and no blank gap on open.
(no stacked/racing tweens).