Skip to content

Commit e11c923

Browse files
committed
fix(ci): satisfy biome lint
- Merge the two preview.error locale blocks so the last one stops shadowing title/body/copyError (noDuplicateObjectKeys) - DesignCardPreview: cacheKey(id, updatedAt) instead of cacheKey(design) so the useEffect dep list matches the capture (useExhaustiveDependencies) - Auto-apply biome --write: formatter nits in PreviewPane/provider-settings + replace delete operator in onboarding-ipc
1 parent f021e9f commit e11c923

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

apps/desktop/src/main/onboarding-ipc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ async function runUpdateProvider(input: UpdateProviderInput): Promise<Onboarding
660660
// a string level means "set it". Handle separately from the spread above
661661
// because the `...undefined ? {} : {...}` pattern can't express "delete".
662662
if (input.reasoningLevel === null) {
663-
delete updated.reasoningLevel;
663+
updated.reasoningLevel = undefined;
664664
} else if (input.reasoningLevel !== undefined) {
665665
updated.reasoningLevel = input.reasoningLevel;
666666
}

apps/desktop/src/main/provider-settings.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ export function toProviderRows(
131131
// codex-* providers are treated as no-auth / IP-gated by default —
132132
// absent secret is a legitimate state, not a "missing key" warning.
133133
hasKey: ref !== undefined || provider.startsWith('codex-'),
134-
...(entry?.reasoningLevel !== undefined
135-
? { reasoningLevel: entry.reasoningLevel }
136-
: {}),
134+
...(entry?.reasoningLevel !== undefined ? { reasoningLevel: entry.reasoningLevel } : {}),
137135
...(rowError !== undefined ? { error: rowError } : {}),
138136
});
139137
}

apps/desktop/src/renderer/src/components/PreviewPane.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,7 @@ export function PreviewPane({ onPickStarter }: PreviewPaneProps) {
404404
// or chat history), the preview IS coming — we're just waiting on the IPC
405405
// round-trip for the snapshot. Show a skeleton instead of the new-design
406406
// welcome screen so users don't read the transient state as "load failed".
407-
const currentDesign = currentDesignId
408-
? designs.find((d) => d.id === currentDesignId)
409-
: undefined;
407+
const currentDesign = currentDesignId ? designs.find((d) => d.id === currentDesignId) : undefined;
410408
const designHasContent =
411409
currentDesign !== undefined &&
412410
((currentDesign.thumbnailText !== null && currentDesign.thumbnailText.length > 0) ||

apps/desktop/src/renderer/src/views/hub/DesignCardPreview.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ const LS_PREFIX = 'designCardPreview:';
5151
const LS_MAX_CHARS = 300_000; // ~ 300 KB per entry ceiling; skip caching huge HTML
5252
const LS_MAX_ENTRIES = 40;
5353

54-
function cacheKey(d: Design): string {
55-
return `${d.id}:${d.updatedAt}`;
54+
function cacheKey(id: string, updatedAt: string): string {
55+
return `${id}:${updatedAt}`;
5656
}
5757

5858
function readCache(key: string): string | null {
@@ -104,7 +104,9 @@ function pruneOldestCacheEntriesIfNeeded(): void {
104104
}
105105

106106
export function DesignCardPreview({ design }: DesignCardPreviewProps) {
107-
const [html, setHtml] = useState<string | null>(() => readCache(cacheKey(design)));
107+
const [html, setHtml] = useState<string | null>(() =>
108+
readCache(cacheKey(design.id, design.updatedAt)),
109+
);
108110
const [failed, setFailed] = useState(false);
109111
const [visible, setVisible] = useState(false);
110112
const [scale, setScale] = useState(0.22);
@@ -166,7 +168,7 @@ export function DesignCardPreview({ design }: DesignCardPreviewProps) {
166168

167169
useEffect(() => {
168170
if (!visible) return;
169-
const key = cacheKey(design);
171+
const key = cacheKey(design.id, design.updatedAt);
170172
const cached = readCache(key);
171173
if (cached !== null) {
172174
setHtml(cached);

0 commit comments

Comments
 (0)