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.proficiencies') }}
+
+ {{ form.proficiencies || $t('campaigns.character-sheet.empty-proficiencies') }}
+
+
+
+
+
+
+
{{ $t('campaigns.character-sheet.inventory') }}
+
+
+
+ {{ $t('campaigns.character-sheet.carried-weight') }}
+ {{ carriedWeight.toFixed(1) }} / {{ carryingCapacity }} lb
+
+
+
+
+
+
+
+
+ {{ $t('campaigns.character-sheet.traits') }}
+
+ {{ form.traits || $t('campaigns.character-sheet.empty-traits') }}
+
+
+
+
+
+ {{ $t('campaigns.character-sheet.spells') }}
+
+ {{ form.spells || $t('campaigns.character-sheet.empty-spells') }}
+
+
-
- {{ $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.proficiencies') }}
-
- {{ form.proficiencies || $t('campaigns.character-sheet.empty-proficiencies') }}
-
-
-
- {{ $t('campaigns.character-sheet.traits') }}
-
- {{ form.traits || $t('campaigns.character-sheet.empty-traits') }}
-
-
-
- {{ $t('campaigns.character-sheet.spells') }}
-
- {{ form.spells || $t('campaigns.character-sheet.empty-spells') }}
-
-
-
-
-
{{ $t('campaigns.character-sheet.inventory') }}
-
-
-
- {{ $t('campaigns.character-sheet.carried-weight') }}
- {{ carriedWeight.toFixed(1) }} / {{ carryingCapacity }} lb
-
-
-
-
-
+
+
@@ -325,7 +358,27 @@ async function saveSheet() {
.sheet-button.primary { background: var(--color-link); color: var(--color-background); border-color: var(--color-link); }
.sheet-button:disabled { opacity: .55; cursor: wait; }
.sheet-button.compact { padding: 5px 9px; font-size: 12px; }
-.sheet-grid { display: grid; grid-template-columns: minmax(200px, 34%) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto; gap: 11px; align-items: start; }
+.sheet-grid { display: grid; grid-template-columns: minmax(200px, 34%) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 11px; align-items: start; }
+.sheet-layout { display: flex; align-items: flex-start; gap: 10px; }
+.sheet-content { flex: 1 1 auto; min-width: 0; }
+.sheet-tab-body { display: block; }
+.sheet-tabs { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; align-self: flex-start; }
+.sheet-tab {
+ text-align: left;
+ padding: 9px 14px 9px 11px;
+ border: 1px solid var(--color-border);
+ border-left-width: 3px;
+ border-radius: 0 9px 9px 0;
+ background: var(--color-background-soft);
+ color: var(--color-text);
+ font: 13px MrEavesRemake;
+ letter-spacing: .02em;
+ white-space: nowrap;
+ cursor: pointer;
+ transition: background .15s ease, border-color .15s ease, color .15s ease;
+}
+.sheet-tab:hover { background: var(--color-button-hover); }
+.sheet-tab.active { background: var(--color-background-light); color: var(--color-link); border-left-color: var(--color-link); box-shadow: 0 3px 12px var(--color-window-shadow); }
.sheet-panel { min-width: 0; padding: 13px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-background-light); box-shadow: 0 3px 12px var(--color-window-shadow); }
.sheet-panel h2 { margin: 0 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--color-border); font: 17px MrEavesRemake; letter-spacing: .03em; }
.sheet-panel h3 { margin: 13px 0 7px; font: 14px MrEavesRemake; }
@@ -340,9 +393,7 @@ async function saveSheet() {
.portrait-controls button:disabled { opacity: .55; cursor: wait; }
.photo-input { display: none; }
.abilities-panel { grid-column: 2 / -1; grid-row: 1; }
-.combat-panel { grid-column: 2; grid-row: 2; }
-.traits-panel { grid-column: 3; grid-row: 2; }
-.spells-panel { grid-column: 2 / -1; grid-row: 3; }
+.combat-panel { grid-column: 2 / -1; grid-row: 2; }
.ability-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.ability-card { min-height: 83px; padding: 8px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-background-soft); }
.ability-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; opacity: .75; }
@@ -369,7 +420,6 @@ textarea { resize: vertical; width: 100%; min-height: 88px; font-size: 12px; }
.weight-summary strong { white-space: nowrap; }
.weight-track { height: 5px; margin-bottom: 10px; overflow: hidden; border-radius: 999px; background: var(--color-background-soft); }
.weight-fill { height: 100%; border-radius: inherit; background: var(--color-link); transition: width .2s ease; }
-.inventory-panel { grid-column: 2 / -1; grid-row: 4; }
.inventory-table-wrap { overflow-x: auto; }
.inventory-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inventory-table th { padding: 6px 7px; text-align: left; font-weight: 600; opacity: .7; }
@@ -383,17 +433,17 @@ textarea { resize: vertical; width: 100%; min-height: 88px; font-size: 12px; }
.sheet-error { padding: 7px 10px; margin-bottom: 10px; border-radius: 6px; color: var(--color-red); background: var(--color-background-soft); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
- .sheet-grid { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
- .sheet-portrait { grid-column: 1 / -1; grid-row: auto; }
- .abilities-panel { grid-column: 1 / -1; grid-row: auto; }
- .combat-panel, .traits-panel { grid-column: auto; grid-row: auto; }
- .spells-panel, .inventory-panel { grid-column: 1 / -1; grid-row: auto; }
+ .sheet-grid { grid-template-columns: 1fr; grid-template-rows: none; }
+ .sheet-portrait, .abilities-panel, .combat-panel { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 520px) {
.sheet-body { padding: 10px; }
.sheet-hero { align-items: flex-start; flex-wrap: wrap; }
.sheet-actions { margin-left: auto; }
- .sheet-grid { grid-template-columns: 1fr; }
.ability-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
+ .sheet-layout { flex-direction: column; }
+ .sheet-tabs { flex-direction: row; flex-wrap: wrap; order: -1; }
+ .sheet-tab { flex: 1 1 auto; text-align: center; border-radius: 7px; border-left-width: 1px; border-top-width: 3px; }
+ .sheet-tab.active { border-left-color: var(--color-border); border-top-color: var(--color-link); }
}
diff --git a/frontend/i18n/locales/ca/campaigns.json b/frontend/i18n/locales/ca/campaigns.json
index 4be14125..33097529 100644
--- a/frontend/i18n/locales/ca/campaigns.json
+++ b/frontend/i18n/locales/ca/campaigns.json
@@ -105,6 +105,7 @@
},
"character-sheet": {
"title": "Fitxa de personatge", "name": "Nom del personatge", "class": "Classe", "subclass": "Subclasse", "unset-class": "Classe sense definir",
+ "tabs": { "abilities": "Característiques", "inventory": "Inventari", "traits": "Trets", "spells": "Conjurs" },
"level": "Nivell", "species": "Espècie", "unset-species": "Espècie sense definir", "edit": "Edita la fitxa", "cancel": "Cancel·la",
"saving": "Desant...", "save": "Desa la fitxa", "save-error": "No s'ha pogut desar aquesta fitxa de personatge.", "photo": "Foto", "upload-photo": "Pujar foto", "change-photo": "Canviar foto", "remove-photo": "Treure foto", "uploading-photo": "Pujant...", "photo-error": "No s'ha pogut pujar aquesta foto.", "ability-scores": "Característiques", "proficiency-bonus": "Bonificador de competència",
"combat": "Combat", "armor-class": "Classe d'armadura", "speed": "Velocitat", "proficiencies": "Competències",
diff --git a/frontend/i18n/locales/en/campaigns.json b/frontend/i18n/locales/en/campaigns.json
index 7d6fb874..05c6508c 100644
--- a/frontend/i18n/locales/en/campaigns.json
+++ b/frontend/i18n/locales/en/campaigns.json
@@ -109,6 +109,7 @@
},
"character-sheet": {
"title": "Character Sheet", "name": "Character name", "class": "Class", "subclass": "Subclass", "unset-class": "Class not set",
+ "tabs": { "abilities": "Ability Scores", "inventory": "Inventory", "traits": "Traits", "spells": "Spells" },
"level": "Level", "species": "Species", "unset-species": "Species not set", "edit": "Edit sheet", "cancel": "Cancel",
"saving": "Saving...", "save": "Save sheet", "save-error": "Unable to save this character sheet.",
"photo": "Photo", "upload-photo": "Upload photo", "change-photo": "Change photo", "remove-photo": "Remove photo",
diff --git a/frontend/i18n/locales/es/campaigns.json b/frontend/i18n/locales/es/campaigns.json
index beb246f8..e87cf653 100644
--- a/frontend/i18n/locales/es/campaigns.json
+++ b/frontend/i18n/locales/es/campaigns.json
@@ -105,6 +105,7 @@
},
"character-sheet": {
"title": "Hoja de personaje", "name": "Nombre del personaje", "class": "Clase", "subclass": "Subclase", "unset-class": "Clase sin definir",
+ "tabs": { "abilities": "Características", "inventory": "Inventario", "traits": "Rasgos", "spells": "Conjuros" },
"level": "Nivel", "species": "Especie", "unset-species": "Especie sin definir", "edit": "Editar hoja", "cancel": "Cancelar",
"saving": "Guardando...", "save": "Guardar hoja", "save-error": "No se pudo guardar esta hoja de personaje.", "photo": "Foto", "upload-photo": "Subir foto", "change-photo": "Cambiar foto", "remove-photo": "Quitar foto", "uploading-photo": "Subiendo...", "photo-error": "No se pudo subir esta foto.", "ability-scores": "Características", "proficiency-bonus": "Bonificador por competencia",
"combat": "Combate", "armor-class": "Clase de armadura", "speed": "Velocidad", "proficiencies": "Competencias",
diff --git a/tests/character-sheet-tabs.test.js b/tests/character-sheet-tabs.test.js
new file mode 100644
index 00000000..d73faf68
--- /dev/null
+++ b/tests/character-sheet-tabs.test.js
@@ -0,0 +1,89 @@
+// Tests for Syndria98/dragonroll#55: the character sheet splits its contents across bookmarks down
+// the right edge (ability scores, inventory, traits, spells) instead of stacking every panel on one
+// long page.
+//
+// The repository root installs no dependencies, so the window wiring is read from the sources the way
+// tests/item-sheet-window.test.js and tests/settings-window.test.js do it.
+//
+// Run with `npm test` from the repository root, or `node --test tests/`.
+
+const { test } = require("node:test");
+const assert = require("node:assert/strict");
+const fs = require("node:fs");
+const path = require("node:path");
+
+const read = (...parts) => fs.readFileSync(path.join(__dirname, "..", ...parts), "utf8");
+
+const sheetSource = read("frontend", "app", "components", "windows", "CharacterSheetWindow.vue");
+const script = /