diff --git a/bench.esy.lock/index.json b/bench.esy.lock/index.json index 3425dbaf76..47a3f13ae1 100644 --- a/bench.esy.lock/index.json +++ b/bench.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "f2039603bdd86090b1c9853b02994890", + "checksum": "8c03b53f14b1c0cfa49f91784aeb80b7", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "isolinear@github:revery-ui/isolinear#53fc4eb@d41d8cd9", "@revery/timber@2.0.0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#b43852b@d41d8cd9": { - "id": "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9": { + "id": "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#b43852b", + "version": "github:revery-ui/revery#4d2dae6", "source": { "type": "install", - "source": [ "github:revery-ui/revery#b43852b" ] + "source": [ "github:revery-ui/revery#4d2dae6" ] }, "overrides": [], "dependencies": [ @@ -995,7 +995,7 @@ "overrides": [ "bench.json" ], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#a9cb168@d41d8cd9", - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "reperf@1.5.0@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", diff --git a/esy.lock/index.json b/esy.lock/index.json index e70c3474f4..c7d76a883c 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "f2039603bdd86090b1c9853b02994890", + "checksum": "8c03b53f14b1c0cfa49f91784aeb80b7", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "isolinear@github:revery-ui/isolinear#53fc4eb@d41d8cd9", "@revery/timber@2.0.0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#b43852b@d41d8cd9": { - "id": "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9": { + "id": "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#b43852b", + "version": "github:revery-ui/revery#4d2dae6", "source": { "type": "install", - "source": [ "github:revery-ui/revery#b43852b" ] + "source": [ "github:revery-ui/revery#4d2dae6" ] }, "overrides": [], "dependencies": [ @@ -995,7 +995,7 @@ "overrides": [], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#a9cb168@d41d8cd9", - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", "reasonFuzz@github:CrossR/reasonFuzz#1ad6f5d@d41d8cd9", diff --git a/integration_test/lib/Oni_IntegrationTestLib.re b/integration_test/lib/Oni_IntegrationTestLib.re index ebe9a5b321..2c74d09085 100644 --- a/integration_test/lib/Oni_IntegrationTestLib.re +++ b/integration_test/lib/Oni_IntegrationTestLib.re @@ -166,6 +166,7 @@ let runTest = let _: unit => unit = Revery.Tick.interval( + ~name="Integration Test Ticker", _ => { let state = currentState^; Revery.Utility.HeadlessWindow.render( diff --git a/integrationtest.esy.lock/index.json b/integrationtest.esy.lock/index.json index 153ff2615d..ca02303056 100644 --- a/integrationtest.esy.lock/index.json +++ b/integrationtest.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "f2039603bdd86090b1c9853b02994890", + "checksum": "8c03b53f14b1c0cfa49f91784aeb80b7", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "isolinear@github:revery-ui/isolinear#53fc4eb@d41d8cd9", "@revery/timber@2.0.0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#b43852b@d41d8cd9": { - "id": "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9": { + "id": "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#b43852b", + "version": "github:revery-ui/revery#4d2dae6", "source": { "type": "install", - "source": [ "github:revery-ui/revery#b43852b" ] + "source": [ "github:revery-ui/revery#4d2dae6" ] }, "overrides": [], "dependencies": [ @@ -995,7 +995,7 @@ "overrides": [ "integrationtest.json" ], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#a9cb168@d41d8cd9", - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", "reasonFuzz@github:CrossR/reasonFuzz#1ad6f5d@d41d8cd9", diff --git a/package.json b/package.json index b29803714d..d2d1b12d2a 100644 --- a/package.json +++ b/package.json @@ -256,7 +256,7 @@ "revery-terminal": "*" }, "resolutions": { - "revery": "revery-ui/revery#b43852b", + "revery": "revery-ui/revery#4d2dae6", "esy-skia": "revery-ui/esy-skia#60e0260", "rench": "bryphe/rench#a976fe5", "reasonFuzz": "CrossR/reasonFuzz#1ad6f5d", diff --git a/release.esy.lock/index.json b/release.esy.lock/index.json index f1f39bc257..f1cd65c625 100644 --- a/release.esy.lock/index.json +++ b/release.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "f2039603bdd86090b1c9853b02994890", + "checksum": "8c03b53f14b1c0cfa49f91784aeb80b7", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "isolinear@github:revery-ui/isolinear#53fc4eb@d41d8cd9", "@revery/timber@2.0.0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#b43852b@d41d8cd9": { - "id": "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9": { + "id": "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#b43852b", + "version": "github:revery-ui/revery#4d2dae6", "source": { "type": "install", - "source": [ "github:revery-ui/revery#b43852b" ] + "source": [ "github:revery-ui/revery#4d2dae6" ] }, "overrides": [], "dependencies": [ @@ -995,7 +995,7 @@ "overrides": [ "release.json" ], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#a9cb168@d41d8cd9", - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", "reasonFuzz@github:CrossR/reasonFuzz#1ad6f5d@d41d8cd9", diff --git a/src/Components/BusyBar.re b/src/Components/BusyBar.re index 88e4658826..df06e6c5a7 100644 --- a/src/Components/BusyBar.re +++ b/src/Components/BusyBar.re @@ -27,9 +27,14 @@ module Animations = { }; let%component make = (~visible: bool, ~theme, ()) => { - let%hook opacity = Hooks.transition(visible ? 1.0 : 0.0); + let%hook opacity = + Hooks.transition(~name="BusyBar Opacity Transition", visible ? 1.0 : 0.0); let%hook (time, _, _) = - Hooks.animation(~active=opacity >= 0.2, Animations.motion); + Hooks.animation( + ~name="BusyBar Animation", + ~active=opacity >= 0.2, + Animations.motion, + ); let%hook (width, setWidth) = Hooks.state(0); diff --git a/src/Components/Button.re b/src/Components/Button.re index 92cf3b5d6a..e928202472 100644 --- a/src/Components/Button.re +++ b/src/Components/Button.re @@ -57,12 +57,14 @@ let%component make = let%hook background = CustomHooks.colorTransition( + ~name="Button Color Transition", ~duration=Animations.backgroundTransitionDuration, background, ); let%hook yOffset = Hooks.transition( + ~name="Button Lift Transition", ~duration=Animations.liftTransitionDuration, isHovered ? (-2.0) : 0.0, ); diff --git a/src/Components/CustomHooks.re b/src/Components/CustomHooks.re index 13f066f73d..67bd3fa048 100644 --- a/src/Components/CustomHooks.re +++ b/src/Components/CustomHooks.re @@ -6,6 +6,7 @@ let colorTransition = ~duration=Time.seconds(1), ~delay as delayDuration=Time.zero, ~easing=Easing.linear, + ~name, target, ) => { let%hook ((start, stop), setTarget) = Hooks.state((target, target)); @@ -21,7 +22,8 @@ let colorTransition = |> map(gradient) ); - let%hook (current, _animationState, resetTimer) = Hooks.animation(anim); + let%hook (current, _animationState, resetTimer) = + Hooks.animation(~name, anim); let%hook () = Hooks.effect( @@ -36,10 +38,10 @@ let colorTransition = current; }; -let useExpiration = (~equals=(==), ~expireAfter, items) => { +let useExpiration = (~name, ~equals=(==), ~expireAfter, items) => { let%hook (active, setActive) = Hooks.state([]); let%hook expired = Hooks.ref([]); - let%hook (time, _reset) = Hooks.timer(~active=active != [], ()); + let%hook (time, _reset) = Hooks.timer(~name, ~active=active != [], ()); let (stillActive, freshlyExpired) = List.partition( diff --git a/src/Components/InputText/View.re b/src/Components/InputText/View.re index a88cf07ab3..23cf1940b0 100644 --- a/src/Components/InputText/View.re +++ b/src/Components/InputText/View.re @@ -36,7 +36,11 @@ module Cursor = { Hooks.effect(OnMountAndIf((!=), isFocused), () => if (isFocused) { let clear = - Tick.interval(time => dispatch(Tick(time)), Time.ms(16)); + Tick.interval( + ~name="Input Text Cursor Interval", + time => dispatch(Tick(time)), + Time.ms(16), + ); Some(() => {clear()}); } else { None; diff --git a/src/Components/KeyDisplayer.re b/src/Components/KeyDisplayer.re index 8cefe86c34..a9403c43f8 100644 --- a/src/Components/KeyDisplayer.re +++ b/src/Components/KeyDisplayer.re @@ -162,6 +162,7 @@ let%component make = (~model, ~uiFont, ~top=?, ~left=?, ~right=?, ~bottom=?, ()) => { let%hook activeGroups = CustomHooks.useExpiration( + ~name="KeyDisplayer Expirer", ~equals=(a, b) => a.id == b.id, ~expireAfter=Time.ms(int_of_float(Constants.duration *. 1000.)), model.groups, diff --git a/src/Components/Tooltip.re b/src/Components/Tooltip.re index 7e3ab3e879..77888cbc8f 100644 --- a/src/Components/Tooltip.re +++ b/src/Components/Tooltip.re @@ -84,6 +84,7 @@ module Overlay: { | Some(tooltip) => clearTimeout := Tick.timeout( + ~name="Tooltip Timeout", () => internalSetTooltip^(_ => Some(tooltip)), Constants.delay, ) diff --git a/src/Components/VimList/Component_VimList.re b/src/Components/VimList/Component_VimList.re index 920e24995d..0adf85e059 100644 --- a/src/Components/VimList/Component_VimList.re +++ b/src/Components/VimList/Component_VimList.re @@ -834,6 +834,7 @@ module View = { let ((scrollY, _setScrollYImmediately), hooks) = Hooks.spring( + ~name="VimList Scroll Spring", ~target=model.scrollY, ~restThreshold=10., ~enabled=isScrollAnimated, diff --git a/src/Core/Codicon.re b/src/Core/Codicon.re index 1249685fa6..827e129603 100644 --- a/src/Core/Codicon.re +++ b/src/Core/Codicon.re @@ -847,7 +847,11 @@ module Animation = { let%component make = (~spin=false, ~icon, ~fontSize=15., ~color, ()) => { let%hook (rotation, _animationState, _reset) = - Hooks.animation(Animation.rotation, ~active=spin); + Hooks.animation( + ~name="Codicon Spinner", + Animation.rotation, + ~active=spin, + ); { disposeTick := Some( Revery.Tick.interval( + ~name="Ripgrep - Processing Ticker", _ => if (!Job.isComplete(job^)) { job := Job.tick(job^); diff --git a/src/Core/Utility/FunEx.re b/src/Core/Utility/FunEx.re index 81719fe968..75470ff1f6 100644 --- a/src/Core/Utility/FunEx.re +++ b/src/Core/Utility/FunEx.re @@ -2,40 +2,3 @@ let tap = (f, x) => { f(x); x; }; - -type throttleState('a) = - | NothingWaiting - | Collecting - | Throttling({latest: 'a}); - -let throttle = - (~leading=true, ~trailing=true, ~timeout=Revery.Tick.timeout, ~time, f) => { - let throttleState = ref(NothingWaiting); - - let finish = () => { - switch (throttleState^) { - | NothingWaiting => () // This shouldn't really happen.. - | Collecting => () // We queued up, but there weren't any further calls - nothing to do - | Throttling({latest}) => - if (trailing) { - f(latest); - } - }; - - throttleState := NothingWaiting; - }; - - v => { - switch (throttleState^) { - // Nothing is waiting... execute immediately, start timer, collect - | NothingWaiting => - if (leading) { - f(v); - }; - let _: unit => unit = timeout(finish, time); - throttleState := Collecting; - | Collecting - | Throttling(_) => throttleState := Throttling({latest: v}) - }; - }; -}; diff --git a/src/Feature/Editor/CursorView.re b/src/Feature/Editor/CursorView.re index 753b29e5fc..dc4f15c81c 100644 --- a/src/Feature/Editor/CursorView.re +++ b/src/Feature/Editor/CursorView.re @@ -48,6 +48,7 @@ let%component make = let%hook y = Hooks.transitionf( + ~name="Cursor Y Transition", ~active=animatedCursor, ~duration=durationFunc, ~delay, @@ -57,6 +58,7 @@ let%component make = ); let%hook x = Hooks.transitionf( + ~name="Cursor X Transition", ~active=animatedCursor, ~delay, ~duration=durationFunc, diff --git a/src/Feature/Editor/EditorSurface.re b/src/Feature/Editor/EditorSurface.re index 27ab61e8c0..8690af984f 100644 --- a/src/Feature/Editor/EditorSurface.re +++ b/src/Feature/Editor/EditorSurface.re @@ -254,6 +254,7 @@ let%component make = let%hook (scrollY, _setScrollYImmediately) = Hooks.spring( + ~name="Editor ScrollY Spring", ~target=Editor.scrollY(editor), ~restThreshold=10., ~enabled=smoothScroll && isScrollAnimated, @@ -261,6 +262,7 @@ let%component make = ); let%hook (scrollX, _setScrollXImmediately) = Hooks.spring( + ~name="Editor ScrollX Spring", ~target=Editor.scrollX(editor), ~restThreshold=10., ~enabled=smoothScroll && isScrollAnimated, diff --git a/src/Feature/Editor/SurfaceView.re b/src/Feature/Editor/SurfaceView.re index dbfd9b0c8e..00e6d2ce14 100644 --- a/src/Feature/Editor/SurfaceView.re +++ b/src/Feature/Editor/SurfaceView.re @@ -69,7 +69,7 @@ let%component make = let%hook hoverTimerActive = React.Hooks.ref(false); let%hook lastMousePosition = React.Hooks.ref(None); let%hook (hoverTimer, resetHoverTimer) = - Hooks.timer(~active=hoverTimerActive^, ()); + Hooks.timer(~name="Mouse Hover Timer", ~active=hoverTimerActive^, ()); let lineCount = editor |> Editor.totalViewLines; let indentation = Buffer.getIndentation(buffer); diff --git a/src/Feature/Editor/YankHighlights.re b/src/Feature/Editor/YankHighlights.re index 7425a16623..17264ce8ef 100644 --- a/src/Feature/Editor/YankHighlights.re +++ b/src/Feature/Editor/YankHighlights.re @@ -35,7 +35,11 @@ let%component make = (~config, ~pixelRanges: list(PixelRange.t), ()) => { let duration = EditorConfiguration.yankHighlightDuration.get(config); let%hook (opacity, _animationState, _reset) = - Hooks.animation(Animations.fadeIn(~duration), ~active=true); + Hooks.animation( + ~name="Yank Highlights Animation", + Animations.fadeIn(~duration), + ~active=true, + ); let bg = EditorConfiguration.yankHighlightColor.get(config); diff --git a/src/Feature/Notification/Feature_Notification.re b/src/Feature/Notification/Feature_Notification.re index 1401c022aa..55e56eefcb 100644 --- a/src/Feature/Notification/Feature_Notification.re +++ b/src/Feature/Notification/Feature_Notification.re @@ -169,7 +169,11 @@ module View = { let%component make = (~model, ~background, ~foreground, ~font: UiFont.t, ()) => { let%hook (yOffset, _animationState, _reset) = - Hooks.animation(Animations.sequence, ~active=true); + Hooks.animation( + ~name="Notification Animation", + Animations.sequence, + ~active=true, + ); let icon = () => ; diff --git a/src/Feature/Pane/Feature_Pane.re b/src/Feature/Pane/Feature_Pane.re index defce86dea..5b65433231 100644 --- a/src/Feature/Pane/Feature_Pane.re +++ b/src/Feature/Pane/Feature_Pane.re @@ -651,6 +651,7 @@ module View = { && Feature_Configuration.GlobalConfiguration.animation.get(config); let%hook (springHeight, _setHeightImmediately) = Hooks.spring( + ~name="Pane Open Spring", ~target=float(targetHeight), ~restThreshold=10., ~enabled=animationEnabled, diff --git a/src/Feature/StatusBar/Feature_StatusBar.re b/src/Feature/StatusBar/Feature_StatusBar.re index b650fc5f33..8f5fc3d19e 100644 --- a/src/Feature/StatusBar/Feature_StatusBar.re +++ b/src/Feature/StatusBar/Feature_StatusBar.re @@ -327,9 +327,17 @@ module ModeIndicator = { let foreground = Colors.Oni.foregroundFor(mode).from(theme); let%hook background = - CustomHooks.colorTransition(~duration=transitionDuration, background); + CustomHooks.colorTransition( + ~name="Mode Background Transition", + ~duration=transitionDuration, + background, + ); let%hook foreground = - CustomHooks.colorTransition(~duration=transitionDuration, foreground); + CustomHooks.colorTransition( + ~name="Mode Foreground Transition", + ~duration=transitionDuration, + foreground, + ); { let%hook activeNotifications = CustomHooks.useExpiration( + ~name="StatusBar Notification Expirer", ~expireAfter=Feature_Notification.View.Popup.Animations.totalDuration, ~equals=(a, b) => Feature_Notification.(a.id == b.id), (notifications :> list(Feature_Notification.notification)), @@ -393,17 +402,22 @@ module View = { let%hook background = CustomHooks.colorTransition( + ~name="StatusBar Background Color Transition", ~duration=Feature_Notification.View.Popup.Animations.transitionDuration, background, ); let%hook foreground = CustomHooks.colorTransition( + ~name="StatusBar Foreground Color Transition", ~duration=Feature_Notification.View.Popup.Animations.transitionDuration, foreground, ); let%hook (yOffset, _animationState, _reset) = - Hooks.animation(transitionAnimation); + Hooks.animation( + ~name="StatusBar Transition Animation", + transitionAnimation, + ); let defaultForeground = Colors.StatusBar.foreground.from(theme); diff --git a/src/Store/FilterSubscription.re b/src/Store/FilterSubscription.re index 08c92ce749..2a2c9a2b69 100644 --- a/src/Store/FilterSubscription.re +++ b/src/Store/FilterSubscription.re @@ -51,6 +51,7 @@ module Make = (JobConfig: Oni_Model.FilterJob.Config) => { let disposeTick = Revery.Tick.interval( + ~name="FilterSubscription Tick", _ => switch (Hashtbl.find_opt(jobs, id)) { | Some({job, _} as state) when !Job.isComplete(job) => diff --git a/src/Store/StoreThread.re b/src/Store/StoreThread.re index 0e063d6154..5219124c8b 100644 --- a/src/Store/StoreThread.re +++ b/src/Store/StoreThread.re @@ -507,7 +507,11 @@ let start = setIconTheme("vs-seti"); let _: unit => unit = - Revery.Tick.interval(_ => runEffects(), Revery.Time.zero); + Revery.Tick.interval( + ~name="Store: Run Effects", + _ => runEffects(), + Revery.Time.zero, + ); (dispatch, runEffects); }; diff --git a/src/UI/Dock.re b/src/UI/Dock.re index 3bf3c6ee22..d90bb254c2 100644 --- a/src/UI/Dock.re +++ b/src/UI/Dock.re @@ -94,7 +94,11 @@ module Notification = { }; let%hook (scale, _state, _reset) = - Hooks.animation(Animations.appear, ~active=true); + Hooks.animation( + ~name="Notification Appear", + Animations.appear, + ~active=true, + ); inner ; @@ -177,7 +181,8 @@ let%component make = ~font: UiFont.t, (), ) => { - let%hook (offsetX, _animationState, _reset) = Hooks.animation(animation); + let%hook (offsetX, _animationState, _reset) = + Hooks.animation(~name="Dock Notification Animation", animation); let isSidebarVisible = it => Feature_SideBar.isVisible(it, sideBar); diff --git a/src/UI/QuickmenuView.re b/src/UI/QuickmenuView.re index 8214ed2913..d2a9ede79e 100644 --- a/src/UI/QuickmenuView.re +++ b/src/UI/QuickmenuView.re @@ -76,7 +76,7 @@ let%component busyBar = (~theme, ()) => { |> ease(Easing.easeInOut) |> repeat |> tween(0., 1.) - |> Hooks.animation + |> Hooks.animation(~name="QuickMenu busyBar") ); let indicator = () => { diff --git a/src/UI/SideBarView.re b/src/UI/SideBarView.re index 8f7f5e732e..ff63f56224 100644 --- a/src/UI/SideBarView.re +++ b/src/UI/SideBarView.re @@ -59,7 +59,11 @@ let%component make = (~config, ~theme, ~state: State.t, ~dispatch, ()) => { let State.{sideBar, uiFont: font, _} = state; let%hook (transition, _animationState, _reset) = - Hooks.animation(animation, ~active=true); + Hooks.animation( + ~name="SideBar transition animation", + animation, + ~active=true, + ); let title = switch (sideBar |> selected) { diff --git a/src/UI/WelcomeView.re b/src/UI/WelcomeView.re index 7dfe465ea2..51013f903d 100644 --- a/src/UI/WelcomeView.re +++ b/src/UI/WelcomeView.re @@ -113,7 +113,7 @@ let cmdOrCtrl = let%component make = (~theme, ~uiFont: UiFont.t, ~editorFont, ()) => { let%hook (transition, _animationState, _reset) = - Hooks.animation(animation, ~active=true); + Hooks.animation(~name="WelcomeView transition", animation, ~active=true); diff --git a/src/bin_editor/Oni2_editor.re b/src/bin_editor/Oni2_editor.re index 7455836663..14fd12dd73 100644 --- a/src/bin_editor/Oni2_editor.re +++ b/src/bin_editor/Oni2_editor.re @@ -315,7 +315,8 @@ switch (eff) { setTitle(currentTitle); }; }; - let _: unit => unit = Tick.interval(tick, Time.zero); + let _: unit => unit = + Tick.interval(~name="Oni2_Editor Apploop", tick, Time.zero); let getZoom = () => { Window.getZoom(window); diff --git a/test.esy.lock/index.json b/test.esy.lock/index.json index 62c0449d65..328d0349a7 100644 --- a/test.esy.lock/index.json +++ b/test.esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "13126547c803c174af38110d85a2fecd", + "checksum": "fefe4f1d805ce57509c6a117327f150d", "root": "Oni2@link-dev:./package.json", "node": { "yarn-pkg-config@github:esy-ocaml/yarn-pkg-config#db3a0b63883606dd57c54a7158d560d6cba8cd79@d41d8cd9": { @@ -118,7 +118,7 @@ }, "overrides": [], "dependencies": [ - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "isolinear@github:revery-ui/isolinear#53fc4eb@d41d8cd9", "@revery/timber@2.0.0@d41d8cd9", "@revery/esy-libvterm@1.0.3@d41d8cd9", @@ -126,13 +126,13 @@ ], "devDependencies": [] }, - "revery@github:revery-ui/revery#b43852b@d41d8cd9": { - "id": "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9": { + "id": "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "name": "revery", - "version": "github:revery-ui/revery#b43852b", + "version": "github:revery-ui/revery#4d2dae6", "source": { "type": "install", - "source": [ "github:revery-ui/revery#b43852b" ] + "source": [ "github:revery-ui/revery#4d2dae6" ] }, "overrides": [], "dependencies": [ @@ -995,7 +995,7 @@ "overrides": [ "test.json" ], "dependencies": [ "revery-terminal@github:revery-ui/revery-terminal#a9cb168@d41d8cd9", - "revery@github:revery-ui/revery#b43852b@d41d8cd9", + "revery@github:revery-ui/revery#4d2dae6@d41d8cd9", "rench@github:bryphe/rench#a976fe5@d41d8cd9", "refmterr@3.3.2@d41d8cd9", "reasonFuzz@github:CrossR/reasonFuzz#1ad6f5d@d41d8cd9", diff --git a/test/Core/Utility/FunExTest.re b/test/Core/Utility/FunExTest.re deleted file mode 100644 index 2aadb4acf2..0000000000 --- a/test/Core/Utility/FunExTest.re +++ /dev/null @@ -1,119 +0,0 @@ -open TestFramework; - -open Revery; -open Oni_Core.Utility; - -describe("FunEx", ({describe, _}) => { - describe("throttle", ({test, describe, _}) => { - let setup = (~leading=true, ~trailing=true, ()) => { - let time: ref(Time.t) = ref(Time.zero); - module TestTick = - Revery.Internal.Tick.Make({ - let time = () => time^; - }); - - let setTime = timeFloat => { - time := Time.ofFloatSeconds(timeFloat); - TestTick.pump(); - }; - - let throttle = - FunEx.throttle( - ~leading, - ~trailing, - ~timeout=TestTick.timeout, - ~time=Time.seconds(1), - ); - (setTime, throttle); - }; - - describe("leading=false", ({test, _}) => { - test( - "leading edge does not get fired, only trailing edge", ({expect, _}) => { - let (setTime, throttle) = setup(~leading=false, ()); - - let calls = ref([]); - let f = v => calls := [v, ...calls^]; - - let throttledF = throttle(f); - throttledF(1); - - // Because leading is off, first call shouldn't get dispatched yet - expect.equal([], calls^); - - throttledF(2); - - // Increment 1 second + 1 millisecond - setTime(1.001); - - expect.equal([2], calls^); - }) - }); - - describe("trailing=false", ({test, _}) => { - test( - "trailing edge does not get fired, only leading edge", ({expect, _}) => { - let (setTime, throttle) = setup(~trailing=false, ()); - - let calls = ref([]); - let f = v => calls := [v, ...calls^]; - - let throttledF = throttle(f); - throttledF(1); - - expect.equal([1], calls^); - - throttledF(2); - - // Increment 1 second + 1 millisecond - setTime(1.001); - - // Because trailing is off, the [2] shouldn't have gotten dispatched - expect.equal([1], calls^); - }) - }); - - test("call once, let time expire, call again", ({expect, _}) => { - let (setTime, throttle) = setup(); - - let calls = ref([]); - let f = v => calls := [v, ...calls^]; - - let throttledF = throttle(f); - throttledF(1); - - expect.equal([1], calls^); - - // Increment 1 second + 1 millisecond - setTime(1.001); - - throttledF(2); - expect.equal([2, 1], calls^); - }); - - test( - "call a bunch of times, only first and last should get called", - ({expect, _}) => { - let (setTime, throttle) = setup(); - - let calls = ref([]); - let f = v => calls := [v, ...calls^]; - - let throttledF = throttle(f); - throttledF(1); - throttledF(2); - throttledF(3); - throttledF(4); - - expect.equal([1], calls^); - - // Increment 1 second + 1 millisecond - setTime(1.001); - - expect.equal([4, 1], calls^); - - throttledF(5); - expect.equal([5, 4, 1], calls^); - }); - }) -});