Skip to content

Commit 27e3762

Browse files
committed
fix(gui): clear react-doctor warnings on dense workspaces
1 parent 904e670 commit 27e3762

3 files changed

Lines changed: 2 additions & 24 deletions

File tree

gui/src/components/storage-workspace/StorageWorkspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function StorageWorkspace({ report, locale }: StorageWorkspacePro
7070
const [selectedKey, setSelectedKey] = useState<string | null>(null);
7171

7272
const sortedBuckets = useMemo(
73-
() => [...report.buckets].sort((a, b) => b.bytes - a.bytes),
73+
() => report.buckets.toSorted((a, b) => b.bytes - a.bytes),
7474
[report.buckets],
7575
);
7676
const selected = sortedBuckets.find(b => b.key === selectedKey) ?? null;

gui/src/pages/api-keys-panels.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function EndpointUrl({ url }: { url: string }) {
2121
hintKey="api.copyUrlHint"
2222
copiedKey="api.urlCopied"
2323
className="api-endpoint-url-btn"
24-
as="button"
2524
>
2625
<code className="api-code api-code-inline api-endpoint-url">{url}</code>
2726
</CopyOnClickTip>
@@ -33,15 +32,12 @@ function CopyOnClickTip({
3332
hintKey,
3433
copiedKey,
3534
className,
36-
as = "button",
3735
children,
3836
}: {
3937
text: string;
4038
hintKey: "api.copyUrlHint" | "api.copyExampleHint";
4139
copiedKey: "api.urlCopied" | "api.exampleCopied";
4240
className: string;
43-
/** `div` for flow children like <pre> (invalid inside <button>). */
44-
as?: "button" | "div";
4541
children: ReactNode;
4642
}) {
4743
const { t } = useI18n();
@@ -127,26 +123,11 @@ function CopyOnClickTip({
127123
},
128124
onKeyDown: (event: { key: string; preventDefault: () => void }) => {
129125
if (event.key === "Escape") closeTip();
130-
if (as === "div" && (event.key === "Enter" || event.key === " ")) {
131-
event.preventDefault();
132-
void copyText();
133-
}
134126
},
135127
"aria-label": t(hintKey),
136128
"aria-describedby": showTip ? tipId : undefined,
137129
};
138130

139-
if (as === "div") {
140-
return (
141-
<>
142-
<div {...shared} role="button" tabIndex={0}>
143-
{children}
144-
</div>
145-
{tip}
146-
</>
147-
);
148-
}
149-
150131
return (
151132
<>
152133
<button type="button" {...shared}>
@@ -164,9 +145,8 @@ function CopyableExample({ text }: { text: string }) {
164145
hintKey="api.copyExampleHint"
165146
copiedKey="api.exampleCopied"
166147
className="api-example-copy-btn"
167-
as="div"
168148
>
169-
<pre className="api-code api-example-pre">{text}</pre>
149+
<code className="api-code api-example-pre">{text}</code>
170150
</CopyOnClickTip>
171151
);
172152
}

gui/src/pages/models-shared.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ export const THREAD_OPTION_SET = new Set(THREAD_OPTIONS);
6565
export const PAGE = 60; // rows rendered per provider before a "show more"
6666

6767
export const COLLAPSED_KEY_V2 = "ocx-models-collapsed:v2";
68-
export const COLLAPSED_KEY_V1 = "ocx-models-collapsed:v1";
69-
export const COLLAPSED_KEY_LEGACY = "ocx-models-collapsed";
7068
export const COMBOS_OPEN_KEY_V1 = "ocx-models-combos-open:v1";
7169
export const COMBOS_OPEN_KEY_LEGACY = "ocx-models-combos-open";
7270

0 commit comments

Comments
 (0)