From 312dc951565011d7620520c0f6f9a105a82423e8 Mon Sep 17 00:00:00 2001
From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
Date: Sun, 3 Mar 2024 10:32:35 -0600
Subject: [PATCH] More intelligent timeline scrolling (#10209)
* more intelligent timeline scrolling
* keep as div
---
web/package-lock.json | 14 +++++++++++++
web/package.json | 1 +
.../components/filter/ReviewFilterGroup.tsx | 4 ++--
web/src/components/timeline/EventSegment.tsx | 20 +++++++++----------
web/src/hooks/use-handle-dragging.ts | 10 +++++-----
web/src/views/events/EventView.tsx | 6 +++---
web/src/views/live/LiveDashboardView.tsx | 2 +-
7 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/web/package-lock.json b/web/package-lock.json
index fa86be074..b0ac58397 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -52,6 +52,7 @@
"react-transition-group": "^4.4.5",
"react-use-websocket": "^4.7.0",
"recoil": "^0.7.7",
+ "scroll-into-view-if-needed": "^3.1.0",
"sonner": "^1.4.0",
"sort-by": "^1.2.0",
"strftime": "^0.10.2",
@@ -3761,6 +3762,11 @@
"node": ">= 6"
}
},
+ "node_modules/compute-scroll-into-view": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.1.0.tgz",
+ "integrity": "sha512-rj8l8pD4bJ1nx+dAkMhV1xB5RuZEyVysfxJqB1pRchh1KVvwOv9b7CGB8ZfjTImVv2oF+sYMUkMZq6Na5Ftmbg=="
+ },
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -7213,6 +7219,14 @@
"loose-envify": "^1.1.0"
}
},
+ "node_modules/scroll-into-view-if-needed": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz",
+ "integrity": "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==",
+ "dependencies": {
+ "compute-scroll-into-view": "^3.0.2"
+ }
+ },
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
diff --git a/web/package.json b/web/package.json
index 8b11e7799..6c8a698c6 100644
--- a/web/package.json
+++ b/web/package.json
@@ -57,6 +57,7 @@
"react-transition-group": "^4.4.5",
"react-use-websocket": "^4.7.0",
"recoil": "^0.7.7",
+ "scroll-into-view-if-needed": "^3.1.0",
"sonner": "^1.4.0",
"sort-by": "^1.2.0",
"strftime": "^0.10.2",
diff --git a/web/src/components/filter/ReviewFilterGroup.tsx b/web/src/components/filter/ReviewFilterGroup.tsx
index bdce6bd58..6fb5c7d42 100644
--- a/web/src/components/filter/ReviewFilterGroup.tsx
+++ b/web/src/components/filter/ReviewFilterGroup.tsx
@@ -71,7 +71,7 @@ export default function ReviewFilterGroup({
);
return (
-
+
-