More modifications to the character sheet #64

Closed
opened 2026-10-15 13:41:09 +00:00 by Syndria98 · 4 comments
Owner
  • Make that the sheet tabs are displayed at the border of the window, so that they are outside.
  • Move the armor class and speed under the image. Also move there the proficency bonus and the initiative bonus. Also display there the hit points and a hit dice as bars.
- Make that the sheet tabs are displayed at the border of the window, so that they are outside. - Move the armor class and speed under the image. Also move there the proficency bonus and the initiative bonus. Also display there the hit points and a hit dice as bars.
Syndria98 added the ai-ready label 2026-10-15 13:41:09 +00:00
Agent added the working label 2026-10-15 14:31:01 +00:00
Collaborator

Now let me make the backend changes (the sheet needs places to keep hit points and hit dice):

Now let me make the backend changes (the sheet needs places to keep hit points and hit dice):
Collaborator

Now the styles:

Now the styles:
Collaborator

I've implemented both changes. Here's what landed:

Tabs on the window border

frontend/app/components/windows/CharacterSheetWindow.vue

  • The <nav class="sheet-tabs"> left the sheet body and is now a child of the window wrapper, mounted on the frame: position: absolute; left: 100% against the right border, so the bookmarks hang off the edge of the window like real tabs and stay put while the sheet body scrolls underneath.
  • The sheet opens narrower (TAB_RAIL_WIDTH) so the rail has room inside the viewport; below 760px the rail folds into a horizontal strip inside the frame, where there is nothing to overflow into.
  • The dead .sheet-layout / .sheet-content wrappers went away with it.

Everything consulted at a glance, under the image

  • A new .vitals-panel sits directly under the portrait in its own .character-column: armor class and speed (moved out of the old combat panel), plus the proficiency bonus (moved out of the ability scores panel) and the initiative bonus, in a 2×2 block.
  • Hit points and hit dice are drawn as bars there — current / max read out over a track that fills to the percentage of its maximum (red for hit points, the accent for hit dice), and both halves are editable inputs in edit mode.
  • The old combat panel is what its removal left of it: proficiencies-panel, heading + text.
  • Initiative is the dexterity modifier (the same formatting the ability cards use); no per-character initiative bonus exists yet, so none is invented.

Backend, so the bars are not decoration

  • Actor gained hitPoints { current, max } and hitDice { current, max } (defaults 10/10 and 1/1). /actor/update takes both through a small barPool helper: half a pair keeps the half it did not send, and current never passes the maximum it ends up with.
  • A character that predates the fields starts on one hit die per level. Foundry sync is untouched, so its Object.assign never resets the pools — note that the module does not carry Foundry's own hit points over; say the word if you want that mapped too.
  • initiative, hit-points, max-hit-points, hit-dice, max-hit-dice added to en, es and ca.

Tests

  • New tests/character-sheet-portrait-column.test.js (9 tests): rail mounted on the frame outside the body, the four readouts under the portrait and gone from where they were, both bars bound to their own clamped percentage, initiative from the DEX modifier, pool defaults from the level, model + route clamping, locales.
  • tests/character-sheet-tabs.test.js updated for the new rail placement and the renamed panel; its other assertions are untouched.

npm test here: 202 pass, 25 fail — those same 25 (folder, map pins, tokens, item window stub-loading tests) fail on the base commit too in this checkout; my change adds no failures and no new ones among them.

I've implemented both changes. Here's what landed: ## Tabs on the window border `frontend/app/components/windows/CharacterSheetWindow.vue` - The `<nav class="sheet-tabs">` left the sheet body and is now a child of the window wrapper, mounted on the frame: `position: absolute; left: 100%` against the right border, so the bookmarks hang off the edge of the window like real tabs and stay put while the sheet body scrolls underneath. - The sheet opens narrower (`TAB_RAIL_WIDTH`) so the rail has room inside the viewport; below 760px the rail folds into a horizontal strip inside the frame, where there is nothing to overflow into. - The dead `.sheet-layout` / `.sheet-content` wrappers went away with it. ## Everything consulted at a glance, under the image - A new `.vitals-panel` sits directly under the portrait in its own `.character-column`: armor class and speed (moved out of the old combat panel), plus the proficiency bonus (moved out of the ability scores panel) and the initiative bonus, in a 2×2 block. - Hit points and hit dice are drawn as bars there — `current / max` read out over a track that fills to the percentage of its maximum (red for hit points, the accent for hit dice), and both halves are editable inputs in edit mode. - The old combat panel is what its removal left of it: `proficiencies-panel`, heading + text. - Initiative is the dexterity modifier (the same formatting the ability cards use); no per-character initiative bonus exists yet, so none is invented. ## Backend, so the bars are not decoration - `Actor` gained `hitPoints { current, max }` and `hitDice { current, max }` (defaults 10/10 and 1/1). `/actor/update` takes both through a small `barPool` helper: half a pair keeps the half it did not send, and `current` never passes the maximum it ends up with. - A character that predates the fields starts on one hit die per level. Foundry sync is untouched, so its `Object.assign` never resets the pools — note that the module does not carry Foundry's own hit points over; say the word if you want that mapped too. - `initiative`, `hit-points`, `max-hit-points`, `hit-dice`, `max-hit-dice` added to `en`, `es` and `ca`. ## Tests - New `tests/character-sheet-portrait-column.test.js` (9 tests): rail mounted on the frame outside the body, the four readouts under the portrait and gone from where they were, both bars bound to their own clamped percentage, initiative from the DEX modifier, pool defaults from the level, model + route clamping, locales. - `tests/character-sheet-tabs.test.js` updated for the new rail placement and the renamed panel; its other assertions are untouched. `npm test` here: **202 pass, 25 fail** — those same 25 (`folder`, `map pins`, `tokens`, `item window` stub-loading tests) fail on the base commit too in this checkout; my change adds no failures and no new ones among them.
Collaborator

Implementation is ready for review: #70

Implementation is ready for review: https://git.aranroig.com/Syndria98/dragonroll/pulls/70
Agent added help wanted and removed working labels 2026-10-15 15:01:36 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Syndria98/dragonroll#64