From 2add9e7cb838eebac2def5c83b9012480b1be9b3 Mon Sep 17 00:00:00 2001 From: Gitea OpenCode Agent Date: Thu, 15 Oct 2026 13:26:16 +0000 Subject: [PATCH] Fix issue #55: Split character sheet in tabs --- .../windows/CharacterSheetWindow.vue | 258 +++++++++++------- frontend/i18n/locales/ca/campaigns.json | 1 + frontend/i18n/locales/en/campaigns.json | 1 + frontend/i18n/locales/es/campaigns.json | 1 + tests/character-sheet-tabs.test.js | 89 ++++++ 5 files changed, 246 insertions(+), 104 deletions(-) create mode 100644 tests/character-sheet-tabs.test.js diff --git a/frontend/app/components/windows/CharacterSheetWindow.vue b/frontend/app/components/windows/CharacterSheetWindow.vue index 78e1c5a3..91b6467e 100644 --- a/frontend/app/components/windows/CharacterSheetWindow.vue +++ b/frontend/app/components/windows/CharacterSheetWindow.vue @@ -24,6 +24,16 @@ const abilityStats = [ { key: 'int', label: 'INT' }, { key: 'wis', label: 'WIS' }, { key: 'cha', label: 'CHA' } ]; +// Les pestanyes del lateral dret reparteixen la fitxa: característiques i combat, +// inventari, trets i conjurs. Són pestanyes de marcadors, no una pàgina nova. +const tabs = [ + { key: 'abilities', label: 'campaigns.character-sheet.tabs.abilities' }, + { key: 'inventory', label: 'campaigns.character-sheet.tabs.inventory' }, + { key: 'traits', label: 'campaigns.character-sheet.tabs.traits' }, + { key: 'spells', label: 'campaigns.character-sheet.tabs.spells' } +]; +const activeTab = ref('abilities'); + function normalizeActor(actor) { return { name: actor?.name ?? '', @@ -207,101 +217,124 @@ async function saveSheet() {
{{ error }}
-
-
- - -
- - -
- +
+
+
+
+ + +
+ + +
+ +
+ +
+

{{ $t('campaigns.character-sheet.ability-scores') }}

+
+
+ {{ stat.label }} + + {{ form.abilityScores[stat.key] }} + {{ abilityModifier(form.abilityScores[stat.key]) }} +
+
+
+ {{ $t('campaigns.character-sheet.proficiency-bonus') }} + +{{ proficiencyBonus }} +
+
+ +
+

{{ $t('campaigns.character-sheet.combat') }}

+
+
+ {{ $t('campaigns.character-sheet.armor-class') }} + + {{ form.armorClass }} +
+
+ {{ $t('campaigns.character-sheet.speed') }} + + {{ form.speed }} ft +
+
+

{{ $t('campaigns.character-sheet.proficiencies') }}

+