Replace Calendaria and Simple Calendar with Chronicle's own calendar - #166
Merged
Merged
Conversation
The module no longer talks to third-party calendar modules; Chronicle's own calendar inside Foundry replaces them. CalendarSync keeps Chronicle's calendar state, the calendar.* WebSocket routing and the guarded date push for that calendar to use. The Sync Calendar editor, its scene button and menu, the setup wizard's calendar step and the dashboard's Foundry-date comparison go with the integrations. Notes those modules left in a world are still never pushed to Chronicle as entities. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn
keyxmakerx
force-pushed
the
claude/foundry-calendar-sync-ayr0rv
branch
from
October 4, 2026 06:25
d9de1c3 to
58656f0
Compare
A date bar at the top centre shows Chronicle's date, time, season, weather and moons, tinted by the hour; clicking it opens a month view with Chronicle's events. The GM moves the date with step arrows or Set date and adds events, all written to Chronicle. Players see the same bar without controls, drawn from a snapshot the GM's client builds from Chronicle's players-audience reads, so only what players may see reaches them. Day and leap maths is a port of Chronicle's own calendar code, checked against it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn
10 of 11 tasks
… toggles A single failed month read no longer publishes an empty event list to players; turning sync or calendar sync off hides the bar on every client at once; Escape no longer swallows a dialog's own Escape; a month whose events failed to load is retried when reopened. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn
Rebuilt to the second mockup's recommended picks. The date bar is now a thin strip over a small live sky (stars, snow or rain from Chronicle's weather, resting when the person steps away) that anyone can drag or shrink to a round clock, kept per person. The month view shows each day's sky and weather up to today, read from Chronicle's new day-weather route (players get it through the players-audience snapshot), and lists the month's events. The GM's arrows step an hour; Set date and Add event stay in the month. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn
Nothing shows on the table by default; the strip is a per-person setting. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn
Each person can lock the strip so it can't be dragged by accident; the lock is saved with their spot, per client. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn
A Calendar button next to the Notebook opens Chronicle's calendar page in a frame, over the player's notes grant; size and place are kept per player. Clicking the strip's date opens it, falling back to the small month view when the player isn't connected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: none
Security implication: removes a path where a player's calendar-module note could reach Chronicle under the GM's key. The calendar window uses the player's own notes grant, not the GM's key. The players' strip is built only from Chronicle's players-audience reads, copied field by field, and shows nothing when Chronicle doesn't confirm it filtered for players.
Consumer-verified: Chronicle #1084:
readViewer/playersAudienceand the"audience"echo (internal/plugins/syncapi/calendar_api_handler.go);calendar.RegisterAppRoutesand thecalendarembed mode (internal/plugins/calendar/routes.go,internal/widgets/notes/app_grants_handler.go,static/js/notes_embed.js).Foundry compatibility: written for v12–v14 (ApplicationV2 window like the notebook; DialogV2 with the V1 fallback). Not yet run in a live world; see the test plan.
Mockup: Sign-offs card "Mockup v4: our real calendar inside Foundry", approved (Chronicle's own page; optional strip). Small differences are on the card "Calendar in Foundry: small differences", which this PR waits on.
What this changes
Before: the module synced Chronicle's date and notes with the Calendaria or Simple Calendar Foundry modules, and needed one of them installed.
After: neither module is used. A Calendar button next to the Notebook opens Chronicle's own calendar page in a Foundry window, as each person sees it on the site: the moving sky, day weather, moons, eras and events, with Chronicle's editing for the GM. The window can be moved and resized, and keeps its size and place per player. An optional thin strip (off until each person turns it on) shows the date, time and weather over a tiny sky. It can be dragged, locked in place or shrunk to a clock. Clicking its date opens the calendar window.
How
player-notebook.mjs:CalendarWindow(ApplicationV2) frames/embed/campaigns/:id/notes/calendarthrough the sameFrameHostand grant as the notebook.openCalendarWindowconnects first when needed. Size and place go in the client settingcalendarWindowPlace._scene-controls.mjs: Calendar button for everyone when the world is connected.calendar-sync.mjskeeps Chronicle's calendar, date, world state and nearby events. On the GM's client it publishes thecalendarSnapshotworld setting from?audience=playersreads for the strip; players hold no key.calendar-bar.mjs: the strip (drag, lock, shrink, mini sky that rests after 20 s idle), plus the small month view as a fallback for a player who isn't connected._calendar-view-model.mjs(pure helpers,buildPlayerSnapshot) and_chronicle-caldate.mjs(Chronicle's day and leap maths, with a parity test).Load-bearing lines:
buildPlayerSnapshotdrops moons, era, events and day weather unless the answers echo"audience":"players".publishPlayerSnapshotkeeps the last snapshot when a read fails (404 excepted) and saves only on change.pushDatereturns whether Chronicle took the date.isCalendarNoteJournalstill skips notes the old calendar modules left in a world.Honest deviations:
Why
Key Maker: Chronicle brings its own notes and its own calendar into Foundry; Calendaria and Simple Calendar are both removed; the full calendar comes first and the strip is optional.
Test plan
node --test tools/test-*.mjs: 1174 tests, 1172 pass, 0 fail, 2 skipped (need CHRONICLE_DIR)CHRONICLE_DIR=../Chronicle node --test tools/test-chronicle-caldate.mjs: 2 passnode tools/check-package-descriptor.mjs: OKTenet self-check
.ai.md, TESTING.md, API-CONTRACT.md updated🤖 Generated with Claude Code
https://claude.ai/code/session_01UexL55BkZcztyC1eezXKfn