Skip to content

Commit 21cf00e

Browse files
committed
Coderabbit improvements
1 parent a870e86 commit 21cf00e

11 files changed

Lines changed: 26 additions & 26 deletions

File tree

apps/webapp/app/components/metrics/ModelsFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function ModelsDropdown({
152152
{m.model}
153153
</SelectItem>
154154
))}
155-
{filtered.length === 0 && <SelectItem disabled className="text-text-bright">No models found</SelectItem>}
155+
{filtered.length === 0 && <SelectItem disabled>No models found</SelectItem>}
156156
</SelectList>
157157
</SelectPopover>
158158
</SelectProvider>

apps/webapp/app/components/metrics/ScopeFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function ScopeFilter({ shortcut, value, onValueChange }: ScopeFilterProps
5959
<Ariakit.TooltipAnchor
6060
render={
6161
<Ariakit.Select
62-
ref={triggerRef as any}
62+
ref={triggerRef}
6363
render={<div className="group cursor-pointer focus-custom" />}
6464
/>
6565
}

apps/webapp/app/components/navigation/DashboardDialogs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Form, useNavigation } from "@remix-run/react";
33
import { motion } from "framer-motion";
44
import { ArrowUpCircleIcon } from "@heroicons/react/24/outline";
55
import { PlusIcon } from "@heroicons/react/20/solid";
6-
import { useEffect, useRef, useState } from "react";
7-
import { type ShortcutDefinition, useShortcutKeys } from "~/hooks/useShortcutKeys";
6+
import { useEffect, useState } from "react";
7+
import { type ShortcutDefinition } from "~/hooks/useShortcutKeys";
88
import { type MatchedOrganization, useDashboardLimits } from "~/hooks/useOrganizations";
99
import { useCurrentPlan } from "~/routes/_app.orgs.$organizationSlug/route";
1010
import { Feedback } from "~/components/Feedback";

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ export function SearchInput({
100100
button={
101101
<button
102102
type="button"
103-
onPointerDown={(e) => {
104-
e.preventDefault();
105-
handleClear();
106-
}}
103+
onMouseDown={(e) => e.preventDefault()}
104+
onClick={() => handleClear()}
107105
className="flex size-4.5 items-center justify-center rounded-[2px] border border-text-dimmed/40 text-text-dimmed transition hover:bg-charcoal-600 hover:text-text-bright"
108106
>
109107
<XMarkIcon className="size-3" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export function SelectTrigger({
357357
</Ariakit.TooltipAnchor>
358358
{showTooltip && (
359359
<Ariakit.Tooltip
360-
disabled={shortcut === undefined}
360+
disabled={!tooltipTitle && !shortcut}
361361
className="z-40 cursor-default rounded border border-charcoal-700 bg-background-bright px-2 py-1.5 text-xs"
362362
>
363363
<div className="flex items-center gap-2">

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,8 @@ export function AIFilterInput() {
143143
button={
144144
<button
145145
type="button"
146-
onPointerDown={(e) => {
147-
e.preventDefault();
148-
setText("");
149-
}}
146+
onMouseDown={(e) => e.preventDefault()}
147+
onClick={() => setText("")}
150148
className="flex size-4.5 items-center justify-center rounded-[2px] border border-text-dimmed/40 text-text-dimmed transition hover:bg-charcoal-600 hover:text-text-bright"
151149
>
152150
<XMarkIcon className="size-3" />

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,8 @@ function PermanentStatusFilter() {
180180
<Ariakit.TooltipProvider timeout={200}>
181181
<Ariakit.TooltipAnchor
182182
render={
183-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
184183
<Ariakit.Select
185-
ref={triggerRef as any}
184+
ref={triggerRef}
186185
render={<div className="group cursor-pointer focus-custom" />}
187186
/>
188187
}
@@ -229,7 +228,7 @@ function PermanentStatusFilter() {
229228

230229
function validateBatchId(value: string): string | undefined {
231230
if (!value.startsWith("batch_")) return "Batch IDs start with 'batch_'";
232-
if (value.length !== 27 && value.length !== 31) return "Batch IDs are 27/32 characters long";
231+
if (value.length !== 27 && value.length !== 31) return "Batch IDs are 27 or 31 characters long";
233232
}
234233

235234
function BatchIdDropdown(
@@ -271,9 +270,8 @@ function PermanentBatchIdFilter() {
271270
<Ariakit.TooltipProvider timeout={200}>
272271
<Ariakit.TooltipAnchor
273272
render={
274-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
275273
<Ariakit.Select
276-
ref={triggerRef as any}
274+
ref={triggerRef}
277275
render={<div className="group cursor-pointer focus-custom" />}
278276
/>
279277
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,8 @@ function RootOnlyToggle({ defaultValue }: { defaultValue: boolean }) {
15171517
onCheckedChange={(checked) => {
15181518
replace({
15191519
rootOnly: checked ? "true" : "false",
1520+
cursor: undefined,
1521+
direction: undefined,
15201522
});
15211523
}}
15221524
/>
@@ -1533,7 +1535,7 @@ function RootOnlyToggle({ defaultValue }: { defaultValue: boolean }) {
15331535

15341536
function validateRunId(value: string): string | undefined {
15351537
if (!value.startsWith("run_")) return "Run IDs start with 'run_'";
1536-
if (value.length !== 25 && value.length !== 29) return "Run IDs are 25/30 characters long";
1538+
if (value.length !== 25 && value.length !== 29) return "Run IDs are 25 or 29 characters long";
15371539
}
15381540

15391541
function RunIdDropdown(
@@ -1638,7 +1640,7 @@ function AppliedBatchIdFilter() {
16381640
}
16391641

16401642
function validateScheduleId(value: string): string | undefined {
1641-
if (!value.startsWith("sched")) return "Schedule IDs start with 'sched_'";
1643+
if (!value.startsWith("sched_")) return "Schedule IDs start with 'sched_'";
16421644
if (value.length !== 27) return "Schedule IDs are 27 characters long";
16431645
}
16441646

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ export function IdFilterDropdown({
10371037
if (open) setInputValue(currentValue);
10381038
}
10391039

1040-
const apply = useCallback(() => {
1040+
const apply = () => {
10411041
clearSearchValue();
10421042
replace({
10431043
cursor: undefined,
@@ -1046,7 +1046,7 @@ export function IdFilterDropdown({
10461046
});
10471047

10481048
setOpen(false);
1049-
}, [inputValue, replace, paramKey]);
1049+
};
10501050

10511051
const error = inputValue ? validate?.(inputValue) : undefined;
10521052

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ export function WaitpointTokenFilters(props: WaitpointTokenFiltersProps) {
6969
searchParams.has("statuses") ||
7070
searchParams.has("tags") ||
7171
searchParams.has("id") ||
72-
searchParams.has("idempotencyKey");
72+
searchParams.has("idempotencyKey") ||
73+
searchParams.has("period") ||
74+
searchParams.has("from") ||
75+
searchParams.has("to");
7376

7477
return (
7578
<div className="flex flex-row flex-wrap items-center gap-1.5">
@@ -300,7 +303,7 @@ function TagsDropdown({
300303
return true;
301304
}}
302305
>
303-
{!(filtered.length === 0 && fetcher.state !== "loading") && (
306+
{!(filtered.length === 0 && fetcher.state !== "loading" && searchValue === "") && (
304307
<ComboBox
305308
value={searchValue}
306309
render={(props) => (

0 commit comments

Comments
 (0)