Skip to content

Commit de42243

Browse files
committed
Removed some code comments
1 parent 80562a9 commit de42243

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

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

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
import { Portal } from "@radix-ui/react-portal";
21
import { useFetcher, useNavigate } from "@remix-run/react";
2+
import { AnimatePresence, motion } from "framer-motion";
33
import { useEffect, useRef, useState } from "react";
44
import { AISparkleIcon } from "~/assets/icons/AISparkleIcon";
55
import { Input } from "~/components/primitives/Input";
6+
import { Popover, PopoverContent, PopoverTrigger } from "~/components/primitives/Popover";
67
import { ShortcutKey } from "~/components/primitives/ShortcutKey";
78
import { Spinner } from "~/components/primitives/Spinner";
89
import { useEnvironment } from "~/hooks/useEnvironment";
910
import { useOrganization } from "~/hooks/useOrganizations";
1011
import { useProject } from "~/hooks/useProject";
11-
import { useSearchParams } from "~/hooks/useSearchParam";
12+
import { cn } from "~/utils/cn";
1213
import { objectToSearchParams } from "~/utils/searchParams";
1314
import { type TaskRunListSearchFilters } from "./RunFilters";
14-
import { cn } from "~/utils/cn";
15-
import { motion, AnimatePresence } from "framer-motion";
16-
import { Popover, PopoverContent, PopoverTrigger } from "~/components/primitives/Popover";
1715

1816
type AIFilterResult =
1917
| {
@@ -39,33 +37,19 @@ export function AIFilterInput() {
3937

4038
useEffect(() => {
4139
if (fetcher.data?.success && fetcher.state === "loading") {
42-
// Clear the input after successful application
4340
setText("");
44-
// Ensure focus is removed after successful submission
4541
setIsFocused(false);
4642

4743
const searchParams = objectToSearchParams(fetcher.data.filters);
4844
if (!searchParams) {
4945
return;
5046
}
5147

52-
console.log("AI filter success", {
53-
data: fetcher.data,
54-
searchParams: searchParams.toString(),
55-
});
56-
5748
navigate(`${location.pathname}?${searchParams.toString()}`, { replace: true });
5849

59-
//focus the input again
6050
if (inputRef.current) {
6151
inputRef.current.focus();
6252
}
63-
64-
// TODO: Show success message with explanation
65-
console.log(`AI applied filters: ${fetcher.data.explanation}`);
66-
} else if (fetcher.data?.success === false) {
67-
// TODO: Show error with suggestions
68-
console.error(fetcher.data.error, fetcher.data.suggestions);
6953
}
7054
}, [fetcher.data, navigate]);
7155

@@ -126,7 +110,6 @@ export function AIFilterInput() {
126110
}}
127111
onFocus={() => setIsFocused(true)}
128112
onBlur={() => {
129-
// Only blur if the text is empty or we're not loading
130113
if (text.length === 0 || !isLoading) {
131114
setIsFocused(false);
132115
}

0 commit comments

Comments
 (0)