From 405be9790a3f4b6a7a39537984dcf6d8836d1c4c Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 19 Apr 2026 13:06:21 -0400 Subject: [PATCH] feat(phase3): card editor accordion revamp -- type-contextual, SpiritToken support - Replace tab navigation with Bootstrap accordion (all sections open by default) - Type-contextual Stats section: ArchSpirit+Spirit+SpiritToken show combat/movement/ flags/genus; Terramorpha shows mode selector; Repentance/Instinct show RequiresLOS checkbox only with note about ArchSpirit LOS origin (Resolved Decision #6) - CanBeSacrificed flag hidden for ArchSpirit (Spirit and SpiritToken only) - Section completion badges: green check when Name filled / abilities JSON present / assets added - Abilities section badge shows constraint reminder for Repentance/Instinct - Replace _tabs string array with _openSections HashSet + ToggleSection helper - Remove stale EffectsJson/CardType branching in save logic (already done Phase 2) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../Components/Pages/Cards/CardEditor.razor | 1109 +++++++++-------- 1 file changed, 592 insertions(+), 517 deletions(-) diff --git a/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor b/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor index bd5ed56..66c7ead 100644 --- a/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor +++ b/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor @@ -48,543 +48,622 @@ else
Saved successfully.
} - - + +
- - @if (_activeTab == "Basic") - { -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - + + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+
- } - - else if (_activeTab == "Stats") - { - @if (_card.CardType is CardType.ArchSpirit or CardType.Spirit) + + @{ + bool isUnit = _card.CardType is CardType.ArchSpirit or CardType.Spirit or CardType.SpiritToken; + bool isTerramorpha = _card.CardType == CardType.Terramorpha; + bool isEffectCard = _card.CardType is CardType.Repentance or CardType.Instinct; + bool showStats = isUnit || isTerramorpha || isEffectCard; + } + @if (showStats) { -
- @if (_card.CardType == CardType.ArchSpirit) - { -
Channeling
-
- - -
-
- - -
-
- - -
-
- - - @if (_showPrevTierDropdown) +
+

+ +

+
+
+ + @if (isUnit) { - var filtered = FilteredPrevTierCards.ToList(); - @if (filtered.Count > 0) - { -
- @foreach (var c in filtered) - { - var cap = c; - + } +
} + } + @if (_card.PreviousTierId.HasValue) + { +
+ @_prevTierSearch + +
+ } +
+ } + + +
Combat
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + +
Movement
+
+ + +
+
+ + +
+ + +
Flags
+ @foreach (var flag in _unitFlags) + { + @* CanBeSacrificed: Spirit and SpiritToken only *@ + @if (flag.Label == "Can Be Sacrificed" && _card.CardType == CardType.ArchSpirit) + { + continue; + } +
+
+ + +
+
+ } + + +
Genus Tags
+
+ @if (_availableGenus.Count > 0) + { +
+ @foreach (var tag in _availableGenus) + { + var capturedTag = tag; +
+ + +
+ } +
+ } +
+ + +
+ @if (_selectedGenus.Count > 0) + { +
Selected: @string.Join(", ", _selectedGenus)
}
- } - } - @if (_card.PreviousTierId.HasValue) - { -
- @_prevTierSearch -
} -
- } - -
Combat
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
- -
Movement
-
- - -
-
- - -
- -
Flags
- @foreach (var flag in _unitFlags) - { -
-
- - -
-
- } - -
Genus Tags
-
- @if (_availableGenus.Count > 0) - { -
- @foreach (var tag in _availableGenus) - { - var capturedTag = tag; -
- - -
- } -
- } -
- - -
- @if (_selectedGenus.Count > 0) - { -
Selected: @string.Join(", ", _selectedGenus)
- } -
-
- } - else if (_card.CardType == CardType.Terramorpha) - { -
-
- - -
-
- } - else - { -

No additional stats for @_card.CardType cards.

- } - } - - - else if (_activeTab == "Abilities") - { -
- - @if (_card.CardType is CardType.Repentance or CardType.Instinct or CardType.Terramorpha) - { - Effects (Action[] array) for @_card.CardType cards. - } - else - { - Abilities (AbilityDefinition[] array) for @_card.CardType cards. - } - -
- - } - - - else if (_activeTab == "Assets") - { - -
-
3D Model Config
-
- - -
Null = 1.0 (no change)
-
-
- -
- - - @if (!string.IsNullOrWhiteSpace(_card.ModelTintColor)) - { - - } -
-
Multiplicative hex tint. Null = white (no tint).
-
-
- -
Static Assets
- - @if (_uploadError != null) - { -
@_uploadError
- } - -
- @foreach (var asset in _card.Assets) - { - var capturedAsset = asset; - var mvId = $"mv_{asset.Id:N}"; -
-
-
-
- @asset.AssetType - -
- - -
- - - @if (!string.IsNullOrEmpty(asset.CdnUrl)) - { - - - - } -
- - - - @if (asset.AssetType == CardAssetType.Model3D) - { -
-
- - -
-
- - - @if (!string.IsNullOrEmpty(asset.CdnUrl)) - { - - -
- @if (_assetAnimations.TryGetValue(asset.Id, out var anims) && anims.Count > 0) +
+
+ + - - @foreach (var anim in anims) - { - - } - + } - else - { - - } -
- } - } - - - @if (asset.AssetType == CardAssetType.Art2D && !string.IsNullOrEmpty(asset.CdnUrl)) - { - Art preview - } - -
- -
+
+ } + else if (isEffectCard) + { +

+ @_card.CardType cards have no unit stats. They are the ability itself — + the card is consumed on channeling and resolves its AbilitiesJson. +

+
+ +
- -
+ } +
- } -
-
- @foreach (var t in Enum.GetValues()) +
+ } + + +
+

+ + } + @if (_card.CardType is CardType.Repentance or CardType.Instinct) + { + Exactly one · Active or Triggered + } + +

+
+
+
-
Animation Bindings
- - - - @foreach (var anim in _card.AnimationBindings) - { - var capturedAnim = anim; - - - - - - - - - - - } - -
ActionGLB Track NameAnimation CDN URLCast Sound URLImpact Sound URLAIUpload
- - - - - - - - - - -
- -
-
- - - -
- + +
+

+ +

+
+
-
Unit Sound Effects
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - + +
+
3D Model Config
+
+ + +
Null = 1.0 (no change)
+
+
+ +
+ + + @if (!string.IsNullOrWhiteSpace(_card.ModelTintColor)) + { + + } +
+
Multiplicative hex tint. Null = white (no tint).
+
+
+ +
Static Assets
+ + @if (_uploadError != null) + { +
@_uploadError
+ } + +
+ @foreach (var asset in _card.Assets) + { + var capturedAsset = asset; + var mvId = $"mv_{asset.Id:N}"; +
+
+
+
+ @asset.AssetType + +
+ +
+ + + @if (!string.IsNullOrEmpty(asset.CdnUrl)) + { + + + + } +
+ + + @if (asset.AssetType == CardAssetType.Model3D) + { +
+
+ + +
+
+ + + @if (!string.IsNullOrEmpty(asset.CdnUrl)) + { + + +
+ @if (_assetAnimations.TryGetValue(asset.Id, out var anims) && anims.Count > 0) + { + + } + else + { + + } +
+ } + } + + @if (asset.AssetType == CardAssetType.Art2D && !string.IsNullOrEmpty(asset.CdnUrl)) + { + Art preview + } + +
+ + +
+ +
+
+
+ } +
+
+ @foreach (var t in Enum.GetValues()) + { + + } +
+
+
+ +
Animation Bindings
+ + + + + + + + + + + + + + + @foreach (var anim in _card.AnimationBindings) + { + var capturedAnim = anim; + + + + + + + + + + + } + +
ActionGLB Track NameAnimation CDN URLCast Sound URLImpact Sound URLAIUpload
+ + + + + + + + + + +
+ +
+
+ + + +
+ + +
Unit Sound Effects
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
- } + +
} @@ -673,7 +752,7 @@ else } - +