From da7299625c41f3fd503647d6daf97ee562f5e0d9 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 13 Dec 2025 21:25:02 -0800 Subject: [PATCH] misc type and style fixes --- src/lib/components/artifact/ArtifactEditPane.svelte | 2 +- src/lib/components/crew/CrewHeader.svelte | 2 +- src/lib/components/sidebar/SearchContent.svelte | 8 ++++++-- src/lib/components/ui/ModalBody.svelte | 1 + .../database/summons/sections/SummonUncapSection.svelte | 1 - src/lib/types/enums.ts | 4 ++-- src/routes/(app)/teams/new/+page.svelte | 4 ++-- vite.config.ts | 5 +++-- 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/lib/components/artifact/ArtifactEditPane.svelte b/src/lib/components/artifact/ArtifactEditPane.svelte index 6378699a..92199428 100644 --- a/src/lib/components/artifact/ArtifactEditPane.svelte +++ b/src/lib/components/artifact/ArtifactEditPane.svelte @@ -336,7 +336,7 @@ {:else} - + {/if} diff --git a/src/lib/components/crew/CrewHeader.svelte b/src/lib/components/crew/CrewHeader.svelte index 82f3fc00..65b900e3 100644 --- a/src/lib/components/crew/CrewHeader.svelte +++ b/src/lib/components/crew/CrewHeader.svelte @@ -56,7 +56,7 @@ .header-info { display: flex; flex-direction: column; - gap: spacing.$unit-half; + gap: spacing.$unit; } .title-row { diff --git a/src/lib/components/sidebar/SearchContent.svelte b/src/lib/components/sidebar/SearchContent.svelte index 8303aec1..6fc4d60c 100644 --- a/src/lib/components/sidebar/SearchContent.svelte +++ b/src/lib/components/sidebar/SearchContent.svelte @@ -207,8 +207,12 @@ const allItems = pages.flatMap((page) => page.results) const ids = new Set() for (const item of allItems) { - const entity = 'character' in item ? item.character : 'weapon' in item ? item.weapon : item.summon - if (entity.granblueId) { + // Type assertion needed because the query result type doesn't capture all variants + const anyItem = item as unknown as Record + const entity = (anyItem.character ?? anyItem.weapon ?? anyItem.summon) as + | { granblueId?: string } + | undefined + if (entity?.granblueId) { ids.add(String(entity.granblueId)) } } diff --git a/src/lib/components/ui/ModalBody.svelte b/src/lib/components/ui/ModalBody.svelte index 7f2d87c2..2c7874c2 100644 --- a/src/lib/components/ui/ModalBody.svelte +++ b/src/lib/components/ui/ModalBody.svelte @@ -19,6 +19,7 @@ .modal-body { padding: spacing.$unit-2x; + padding-bottom: spacing.$unit-3x; overflow-y: auto; flex: 1; } diff --git a/src/lib/features/database/summons/sections/SummonUncapSection.svelte b/src/lib/features/database/summons/sections/SummonUncapSection.svelte index b4eb973f..98ab9ceb 100644 --- a/src/lib/features/database/summons/sections/SummonUncapSection.svelte +++ b/src/lib/features/database/summons/sections/SummonUncapSection.svelte @@ -89,7 +89,6 @@ {flb} {ulb} {transcendence} - {subaura} editable={false} /> diff --git a/src/lib/types/enums.ts b/src/lib/types/enums.ts index 1393ead7..cadc7b12 100644 --- a/src/lib/types/enums.ts +++ b/src/lib/types/enums.ts @@ -88,7 +88,7 @@ export const CHARACTER_SERIES_NAMES: Record = { } export function getSeriesNames(series: number[]): string[] { - return series.map(s => CHARACTER_SERIES_NAMES[s]).filter(Boolean) + return series.map(s => CHARACTER_SERIES_NAMES[s]).filter((name): name is string => Boolean(name)) } // Weapon/Summon promotions (gacha pool membership) @@ -121,5 +121,5 @@ export const PROMOTION_NAMES: Record = { } export function getPromotionNames(promotions: number[]): string[] { - return promotions.map(p => PROMOTION_NAMES[p]).filter(Boolean) + return promotions.map(p => PROMOTION_NAMES[p]).filter((name): name is string => Boolean(name)) } \ No newline at end of file diff --git a/src/routes/(app)/teams/new/+page.svelte b/src/routes/(app)/teams/new/+page.svelte index a24a046c..e2ba441c 100644 --- a/src/routes/(app)/teams/new/+page.svelte +++ b/src/routes/(app)/teams/new/+page.svelte @@ -20,7 +20,7 @@ import { partyAdapter } from '$lib/api/adapters/party.adapter' import { transformSkillsToArray } from '$lib/utils/jobSkills' import { setContext } from 'svelte' - import type { SearchResult } from '$lib/api/adapters' + import type { AddItemResult } from '$lib/types/api/search' import { gridAdapter } from '$lib/api/adapters' import { getLocalId } from '$lib/utils/localId' import { storeEditKey } from '$lib/utils/editKeys' @@ -288,7 +288,7 @@ ) // Handle adding items from search - async function handleAddItems(items: SearchResult[]) { + async function handleAddItems(items: AddItemResult[]) { console.log('Adding items:', items, 'to tab:', activeTab) // Create party on first item if not already created diff --git a/vite.config.ts b/vite.config.ts index fc9574c3..c4868d37 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,8 +13,9 @@ export default defineConfig({ css: { preprocessorOptions: { scss: { - api: 'modern-compiler', - loadPaths: [fileURLToPath(new URL('./src', import.meta.url))] + // Modern compiler API for better Sass compatibility + // Type assertion needed as Vite types haven't been updated yet + ...(({ api: 'modern-compiler', loadPaths: [fileURLToPath(new URL('./src', import.meta.url))] }) as object) } } },