Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions resources/js/components/ThemePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import {
setProperty,
} from '../utils/theme';

import { FIELD_DEFS } from '../fields';
import { themeFields } from '../fields';

// ── Page props ────────────────────────────────────────────────────────────────

Expand Down Expand Up @@ -172,10 +172,10 @@ async function selectTheme(id: string): Promise<void> {
// ── Fields with values ────────────────────────────────────────────────────────

const fields = reactive<FieldState[]>(
FIELD_DEFS.map((f) => ({ ...f, value: '' })),
themeFields().map((f) => ({ ...f, value: '' })),
);

const uniqueGroups = FIELD_DEFS.filter((f) => f.group)
const uniqueGroups = themeFields().filter((f) => f.group)
.map((f) => f.group!)
.filter((g, i, arr) => arr.findIndex((x) => x.name === g.name) === i);
Comment on lines 174 to 180

Copilot AI Apr 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

themeFields() is invoked twice during setup (for fields and uniqueGroups), which regenerates the full field definition list twice. Consider calling themeFields() once (e.g., const fieldDefs = themeFields()) and reusing it for both to avoid duplicate work and keep any per-call object instances consistent.

Copilot uses AI. Check for mistakes.

Expand Down Expand Up @@ -811,10 +811,10 @@ const dialogCommandOpen = ref(false);
</Teleport>

<!-- Sheet — DialogPortal inside SheetContent handles its own teleport to body -->
<Sheet v-model:open="sheetOpen">
<Sheet v-model:open="sheetOpen" :modal="false">
<SheetContent
side="right"
class="flex flex-col gap-0 p-0 shadow-2xl sm:w-110 sm:max-w-none [&>button:last-child]:hidden"
class="flex flex-col gap-0 p-0 shadow-2xl sm:w-105 sm:max-w-none [&>button:last-child]:hidden"
overlay-class="bg-black/5 blur-sm"
>
<TooltipProvider>
Expand Down
Loading
Loading