From 34821aa487e03c23cb377609b86372880b6101aa Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 3 Dec 2025 17:54:18 -0800 Subject: [PATCH] split artifact pane into detail and edit views - CollectionArtifactDetailPane: read-only view with Edit button in header - CollectionArtifactEditPane: editable form pushed onto pane stack - ArtifactSkillDisplay: new read-only skill display component --- .../artifact/ArtifactSkillDisplay.svelte | 98 +++++++++ .../CollectionArtifactDetailPane.svelte | 199 ++++++++++++++++++ .../CollectionArtifactEditPane.svelte | 102 +++++++++ .../collection/CollectionArtifactPane.svelte | 157 -------------- .../collection/artifacts/+page.svelte | 4 +- 5 files changed, 401 insertions(+), 159 deletions(-) create mode 100644 src/lib/components/artifact/ArtifactSkillDisplay.svelte create mode 100644 src/lib/components/collection/CollectionArtifactDetailPane.svelte create mode 100644 src/lib/components/collection/CollectionArtifactEditPane.svelte delete mode 100644 src/lib/components/collection/CollectionArtifactPane.svelte diff --git a/src/lib/components/artifact/ArtifactSkillDisplay.svelte b/src/lib/components/artifact/ArtifactSkillDisplay.svelte new file mode 100644 index 00000000..6134d09a --- /dev/null +++ b/src/lib/components/artifact/ArtifactSkillDisplay.svelte @@ -0,0 +1,98 @@ + + + + +
+
+ Skill {slot} + Lv.{skill.level} +
+
+ {modifierName} + + {isNegative ? '−' : '+'}{skill.strength}{suffix} + +
+
+ + diff --git a/src/lib/components/collection/CollectionArtifactDetailPane.svelte b/src/lib/components/collection/CollectionArtifactDetailPane.svelte new file mode 100644 index 00000000..034d2220 --- /dev/null +++ b/src/lib/components/collection/CollectionArtifactDetailPane.svelte @@ -0,0 +1,199 @@ + + + + +
+ +
+
+ {displayName} +
+

{displayName}

+ {#if artifact.nickname} +

"{artifact.nickname}"

+ {/if} +
+ + +
+ + + + + + + + + + + + {#if isQuirk} + + {/if} + + + {#if hasSkills} + +
+ {#each skills as skill, index} + {#if skill} + + {/if} + {/each} +
+
+ {/if} + + +
+ +
+
+
+ +
+ + diff --git a/src/lib/components/collection/CollectionArtifactEditPane.svelte b/src/lib/components/collection/CollectionArtifactEditPane.svelte new file mode 100644 index 00000000..de30e1eb --- /dev/null +++ b/src/lib/components/collection/CollectionArtifactEditPane.svelte @@ -0,0 +1,102 @@ + + + + +
+ +
+ +
+ + + +
+ + diff --git a/src/lib/components/collection/CollectionArtifactPane.svelte b/src/lib/components/collection/CollectionArtifactPane.svelte deleted file mode 100644 index 2b216a0c..00000000 --- a/src/lib/components/collection/CollectionArtifactPane.svelte +++ /dev/null @@ -1,157 +0,0 @@ - - - - -
- -
-
- {displayName} -
-

{displayName}

- {#if artifact.nickname} -

"{artifact.nickname}"

- {/if} -
- - -
- -
- - - {#if isOwner} - - {/if} -
- - diff --git a/src/routes/(app)/[username]/collection/artifacts/+page.svelte b/src/routes/(app)/[username]/collection/artifacts/+page.svelte index 26f310e7..9d8075e5 100644 --- a/src/routes/(app)/[username]/collection/artifacts/+page.svelte +++ b/src/routes/(app)/[username]/collection/artifacts/+page.svelte @@ -3,7 +3,7 @@ import type { CollectionArtifact } from '$lib/types/api/artifact' import { createInfiniteQuery } from '@tanstack/svelte-query' import { artifactQueries } from '$lib/api/queries/artifact.queries' - import CollectionArtifactPane from '$lib/components/collection/CollectionArtifactPane.svelte' + import CollectionArtifactDetailPane from '$lib/components/collection/CollectionArtifactDetailPane.svelte' import CollectionArtifactCard from '$lib/components/collection/CollectionArtifactCard.svelte' import CollectionArtifactRow from '$lib/components/collection/CollectionArtifactRow.svelte' import Icon from '$lib/components/Icon.svelte' @@ -76,7 +76,7 @@ ? artifact.artifact.name : artifact.artifact?.name?.en || 'Artifact' - sidebar.openWithComponent(artifactName, CollectionArtifactPane, { + sidebar.openWithComponent(artifactName, CollectionArtifactDetailPane, { artifact, isOwner: data.isOwner, onClose: () => sidebar.close()