Commit Graph
64 Commits
Author SHA1 Message Date
robert 66f3cc1380 Adding Jenkinsfile to simplify my deployment. 2026-07-07 12:13:16 -04:00
robertandClaude Fable 5 995347d255 Fix white /logs page in firebase mode: emulate offset in adapter
The logs page white-screened when deployed against Firestore. LogsView
paginates with the neutral offset() constraint, which the server/sqlite
adapter pushes into SQL — but the firebase adapter's subscribeCollection
had no case for it and passed the raw {__type:'offset'} object through
to the SDK's query(), which throws on non-QueryConstraint values. The
throw fired inside useFirestoreCollection's effect on first render,
unmounting the whole tree. Dev never hit it because dev runs the server
adapter.

Fix: shared toSdkConstraints() translator in the firebase adapter,
used by getCollection and subscribeCollection. The client SDK has no
offset, so emulate it — widen limit to offset+limit and slice the
leading docs off the snapshot (same read cost as the admin SDK's
native offset, which also bills skipped docs). Unknown constraint
types are now dropped instead of passed through, so a future neutral
builder can't reintroduce the crash. This also fixes getCollection
silently skipping offset, which returned page 1 for every page.

Server/sqlite adapter unchanged; offset still runs in SQL. Two new
shared contract tests (offset pagination + offset past end) run
against both adapters and pass: firebase mock 33, live sqlite 40.

Also bump better-sqlite3 ^11.3.0 -> ^12.0.0: v11 fails to compile
against Node 26's V8 (GetPrototype removed), so server tests could
not run at all on Node 26. v12.11.1 builds clean; full server suite
passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 22:50:29 -04:00
robertandClaude Fable 5 6991375afc Move Crit button inline with HP controls; fix death save button icon alignment
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 22:13:31 -04:00
robertandClaude Sonnet 5 ec578eeef5 Bump to v0.4, document self-hosted backend in README
The rework-backend merge added an optional self-hosted Express/ws/SQLite
backend (npm workspaces, single-container Docker deployment) alongside
the existing Firebase default. Bump APP_VERSION and refresh README to
cover both storage modes and the new repo layout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 19:59:46 -04:00
robertandClaude Sonnet 5 c54fd88c32 fix(docker): copy workspace package.json files before npm install
npm workspaces needs shared/package.json and server/package.json present
at install time to link @ttrpg/shared, otherwise the build stage fails
with "Module not found: Error: Can't resolve '@ttrpg/shared'".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 19:40:23 -04:00
robertandClaude Sonnet 4.6 33b27775b4 Bump version to v0.3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 20:15:20 -04:00
robertandClaude Sonnet 4.6 d96d3a6cf2 Guard against undefined values in combat log undo payloads
Firestore rejects writes containing undefined values. The pause/resume
and end-combat undo snapshots read encounter fields that may not yet
exist in Firestore, so add ?? false / ?? null / ?? 0 fallbacks to
match the pattern already used in the start-combat undo path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 17:19:52 -04:00
robertandClaude Sonnet 4.6 439f48871e Fix mid-round activation causing participants to be skipped in round 2+
When a participant was activated mid-combat, computeTurnOrderAfterAddition
appended them to the end of turnOrderIds. The visual display sorted by
initiative (putting them at the top), but the turn pointer followed the
append order, making it look like the top-initiative participants were
skipped when the round wrapped.

Fix: at the round boundary in handleNextTurn, rebuild turnOrderIds from
all active participants sorted by initiative. Mid-round additions go last
in round 1 (standard D&D ruling), then slot into proper initiative order
from round 2 onwards. Also adds turnOrderIds to the next-turn undo snapshot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 16:57:08 -04:00
robertandClaude Sonnet 4.6 35990f588e Add per-entry undo buttons to combat log, bump to v0.2.5
Each logged action now stores a Firestore snapshot of the affected
encounter state. The /logs page shows an ↩ Undo button on any entry
with undo data; clicking it restores the encounter to its pre-action
state and marks the entry as rolled back (greyed out, strikethrough).

Covered actions: damage/heal, condition toggle, activate/deactivate,
add/remove participant, next turn, start/pause/resume/end combat.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 16:45:07 -04:00
robertandClaude Sonnet 4.6 b11fbe4715 Update README to reflect current feature set
Documents conditions list (now 22), combat log at /logs, hide player HP
toggle, inactive monster hiding, fullscreen button, and wake lock toggle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 11:59:36 -04:00
robertandClaude Sonnet 4.6 7b52480329 Add wake lock toggle to prevent screen sleep on player display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 11:56:11 -04:00
robertandClaude Sonnet 4.6 58cc588726 Add fullscreen button to player display view
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 11:53:56 -04:00
robertandClaude Sonnet 4.6 e200f59b7e Hide inactive monsters from player display view
Inactive monsters are now filtered out of the DisplayView so DMs can
pre-stage summoned/reserve monsters without spoiling them for players.
Inactive characters remain visible since their inactive state is
player-relevant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 14:39:59 -04:00
robert bb65709e26 Added shield to list of conditions. 2026-05-16 15:29:27 -04:00
robertandClaude Sonnet 4.6 33d831af54 Fix race condition causing permissions error on /display page
onAuthStateChanged fires with null before signInAnonymously completes,
causing DisplayView to query Firestore unauthenticated. Now only marks
auth ready when an actual user is present; auth failures are handled in
the catch block to avoid hanging the UI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 10:53:03 -04:00
robertandClaude Sonnet 4.6 4150267925 Add combat action log at /logs
Instruments 9 handlers (combat start/end/pause/resume, next turn,
participant add/remove/toggle, HP changes, conditions) to write
timestamped entries to a Firestore logs collection. New LogsView
at /logs shows entries newest-first with encounter context, and
includes a Clear Log button. Adds a View Logs link in the header.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 10:25:17 -04:00
robertandClaude Sonnet 4.6 e23cea205a Add HP toggle, new conditions, fix turn order sync bug
- Add DM toggle (default on) to hide player HP bars on player display;
  persisted in activeDisplay Firestore doc for real-time sync
- Add Alchemist Fire and Bardic Inspiration conditions; sort all
  conditions alphabetically
- Fix turn order skipping when participants are deleted, deactivated,
  or killed mid-combat: turnOrderIds was never updated, causing
  handleNextTurn to resolve currentIndex as -1 and snap back to the
  first participant. Now all mutation paths (delete, toggle active,
  HP death/resurrection) keep turnOrderIds in sync and advance the
  turn pointer correctly when the current participant is removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 10:00:17 -04:00
robert 6cd25dadaa Alchemist Fire and Bardic Inspiration conditions, sort alphabetically. 2026-05-16 09:37:11 -04:00
robert 90cfb36b56 Adds a 'Hide player HP' toggle in the Combat Controls panel (on by default) that suppresses health bars for player characters in the DisplayView. Setting is persisted in the activeDisplay Firestore doc so it survives page reloads and takes effect in real time on the player screen. 2026-05-16 09:30:35 -04:00
robert 7676751a5b Added weapon conditions 2026-04-26 17:12:29 -04:00
robert 16118dd958 Updated README.md and added CLAUDE.md 2026-04-26 11:42:22 -04:00
robert 33c93ab86b Added conditions. 2026-04-26 10:37:25 -04:00
robert 451151628c fixing build and nginx 2026-04-25 20:35:52 -04:00
robert 1e0df31cd4 More text improvements. 2026-04-25 20:25:34 -04:00
robert 3be9b0a921 Updated look of site. 2026-04-25 18:37:55 -04:00
robert 895fa06227 updated fix for adding combatants mid fight and added some death effects. 2025-12-13 19:15:26 -05:00
robert 82f45e60f0 Updated readme, and added a license. 2025-05-28 18:58:38 -04:00
robert 8cf3a49a76 Added collapsible Characters. 2025-05-28 14:58:54 -04:00
robert dda3453d79 version bump. 2025-05-28 12:23:10 -04:00
robert d754f8657c Added small counters in Campaign cards. 2025-05-28 12:15:01 -04:00
robert 9563ce7959 fixed player display on added participant to live encounter 2025-05-27 14:52:04 -04:00
robert 5f8602cd73 changed red color for monster display. 2025-05-27 11:15:32 -04:00
robert 788e3cd1a2 Tightened up the UI a bit. 2025-05-27 11:02:03 -04:00
robert 99a38bb75a Added NPC flag. 2025-05-27 10:51:29 -04:00
robert 893fe49ccb Code clean up and refactor. 2025-05-26 22:42:37 -04:00
robert 6adcd0f8e0 Adding random inits 2025-05-26 22:31:43 -04:00
robert d631545570 Added defautl HP values. 2025-05-26 21:48:28 -04:00
robert ad11bbc648 Fixed linting and pause button. 2025-05-26 21:34:37 -04:00
robert 785af983da Fixed the ability to add monsters while a fight is going. 2025-05-26 21:17:42 -04:00
robert 40a798514d updated readme 2025-05-26 11:15:25 -04:00
robert 42d70f0817 More readme cleanup. 2025-05-26 10:31:04 -04:00
robert c6cb37835f Added more images. 2025-05-26 10:14:57 -04:00
robert 4982ff4005 Added screenshots. 2025-05-26 10:09:18 -04:00
robert 69fd462bf5 added background to campain pill 2025-05-26 09:52:53 -04:00
robert e09739fc01 Removed UUIDs and added delete confirmation boxes. 2025-05-26 09:41:50 -04:00
robert a317038345 Added README.md 2025-05-26 09:33:12 -04:00
robert d27f7844a5 reverted the caraosel affect. Didn't like it. 2025-05-26 09:17:53 -04:00
robert 34e40ae769 more view changes. 2025-05-26 09:11:29 -04:00
robert 118804926f Changed view for more combatants. 2025-05-26 09:02:12 -04:00
robert f530d4303d Changed view for more than 7 combatants 2025-05-26 08:53:26 -04:00
robert d5b93ac66a refactor 2025-05-26 08:33:39 -04:00
robert d023da05a5 update text color 2025-05-26 08:18:13 -04:00
robert 085303fbab changing the player display button. 2025-05-26 07:59:05 -04:00
robert eb114910f8 cleaned up dm eyeball toggle 2025-05-26 07:50:24 -04:00
robert c7215bb503 Merge branch 'main' of code.draft13.com:robert/ttrpg-initiative-tracker 2025-05-26 07:23:29 -04:00
robert 91980c368f Changed .env.example 2025-05-26 07:18:55 -04:00
robert 962c0bd911 more slight changes. 2025-05-25 23:28:36 -04:00
robert bfb0f20a25 Things are working now. 2025-05-25 22:48:17 -04:00
robert 6d7f8b182c More work. 2025-05-25 22:21:45 -04:00
robert 290f3816c5 Merge branch 'main' of code.draft13.com:robert/ttrpg-initiative-tracker 2025-05-25 21:21:31 -04:00
robert 0772a3a9e6 More interations. 2025-05-25 21:19:22 -04:00
robert e388a13ceb added prompt file used to create scaffold app 2025-05-25 11:50:17 -04:00
robert 48bc3447b5 Added some more files. 2025-05-25 10:33:15 -04:00
robert 64717a36b0 Initial commit 2025-05-25 10:22:24 -04:00