feat(*): Add evolution data and notes

This commit is contained in:
Josh Creek
2026-01-25 17:19:51 +00:00
parent 4f2fe5e333
commit 71cfbce7e3
7 changed files with 4247 additions and 14 deletions
@@ -56,6 +56,7 @@
}
updateCatchRecord('toggle');
}
</script>
<div
@@ -88,19 +89,11 @@
</div>
{/if}
<div class="bg-base-100 text-base-content rounded-lg p-4">
{#if pokedexEntry.evolutionInformation}
{#if pokedexEntry.evolutionInformation.trim().length > 0}
<div class="bg-base-100 text-base-content rounded-lg p-4">
<p><strong>How to evolve: </strong>{pokedexEntry.evolutionInformation}</p>
{:else}
<p>
<strong>How to evolve: </strong>Currently missing - can you
<a
href="https://github.com/jcreek/LivingDexTracker"
class="underline text-primary hover:text-secondary">help contribute</a
>?
</p>
{/if}
</div>
</div>
{/if}
</div>
{#if catchRecord}
@@ -231,6 +224,11 @@
</p>
</div>
{/if}
{#if pokedexEntry.notes}
<div class="bg-base-100 text-base-content rounded-lg p-4 mb-2">
<p><strong>Dex Notes:</strong> {pokedexEntry.notes}</p>
</div>
{/if}
</div>
</div>
+2
View File
@@ -17,6 +17,7 @@ export interface PokedexEntry {
regionToEvolveIn: string;
evolutionInformation: string;
catchInformation: Array<string | CatchInformationItem>;
notes: string;
// Note: Regional dex numbers stored in separate regional_dex_numbers table
}
@@ -33,6 +34,7 @@ export interface PokedexEntryDB {
regionToEvolveIn: string | null;
evolutionInformation: string | null;
catchInformation: string[] | null;
notes: string | null;
// Note: Regional dex numbers stored in separate regional_dex_numbers table
createdAt: string;
updatedAt: string;
@@ -25,7 +25,8 @@ class CombinedDataRepository {
gamesToCatchIn: entry.gamesToCatchIn || [],
regionToEvolveIn: entry.regionToEvolveIn || '',
evolutionInformation: entry.evolutionInformation || '',
catchInformation: entry.catchInformation || []
catchInformation: entry.catchInformation || [],
notes: entry.notes || ''
// Note: Regional dex numbers are stored in separate regional_dex_numbers table
};
}
@@ -53,7 +53,8 @@ class PokedexEntryRepository {
gamesToCatchIn: entry.gamesToCatchIn || [],
regionToEvolveIn: entry.regionToEvolveIn || '',
evolutionInformation: entry.evolutionInformation || '',
catchInformation: this.parseCatchInformation(entry.catchInformation)
catchInformation: this.parseCatchInformation(entry.catchInformation),
notes: entry.notes || ''
};
}
@@ -94,6 +95,7 @@ class PokedexEntryRepository {
if (data.catchInformation !== undefined) {
dbData.catchInformation = this.serializeCatchInformation(data.catchInformation);
}
if (data.notes !== undefined) dbData.notes = data.notes;
// Box placement is calculated dynamically - not stored in database
const { data: result, error } = await this.supabase
@@ -122,6 +124,7 @@ class PokedexEntryRepository {
if (data.catchInformation !== undefined) {
dbData.catchInformation = this.serializeCatchInformation(data.catchInformation);
}
if (data.notes !== undefined) dbData.notes = data.notes;
// Box placement is calculated dynamically - not stored in database
const { data: result, error } = await this.supabase