Skip to content

Commit 42d5f67

Browse files
committed
Small code rabbit improvements
1 parent 21cf00e commit 42d5f67

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

apps/webapp/app/components/primitives/SearchInput.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { MagnifyingGlassIcon, XMarkIcon } from "@heroicons/react/20/solid";
22
import { motion } from "framer-motion";
3-
import { useCallback, useEffect, useRef, useState } from "react";
3+
import { useEffect, useRef, useState } from "react";
44
import { Input } from "~/components/primitives/Input";
55
import { ShortcutKey } from "~/components/primitives/ShortcutKey";
66
import { SimpleTooltip } from "~/components/primitives/Tooltip";
@@ -38,19 +38,19 @@ export function SearchInput({
3838
}
3939
}, [value, text, isFocused, paramName]);
4040

41-
const handleSubmit = useCallback(() => {
41+
const handleSubmit = () => {
4242
const resetValues = Object.fromEntries(resetParams.map((p) => [p, undefined]));
4343
if (text.trim()) {
4444
replace({ [paramName]: text.trim(), ...resetValues });
4545
} else {
4646
del([paramName, ...resetParams]);
4747
}
48-
}, [text, replace, del, resetParams, paramName]);
48+
};
4949

50-
const handleClear = useCallback(() => {
50+
const handleClear = () => {
5151
setText("");
5252
del([paramName, ...resetParams]);
53-
}, [del, resetParams, paramName]);
53+
};
5454

5555
return (
5656
<div className="flex items-center gap-1">

apps/webapp/app/components/runs/v3/BatchFilters.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ type BatchFiltersProps = {
6969
export function BatchFilters(props: BatchFiltersProps) {
7070
const location = useOptimisticLocation();
7171
const searchParams = new URLSearchParams(location.search);
72-
const hasFilters = searchParams.has("statuses") || searchParams.has("id");
72+
const hasFilters =
73+
searchParams.has("statuses") ||
74+
searchParams.has("id") ||
75+
searchParams.has("period") ||
76+
searchParams.has("from") ||
77+
searchParams.has("to");
7378

7479
return (
7580
<div className="flex flex-row flex-wrap items-center gap-1.5">

0 commit comments

Comments
 (0)