feat(time): add campaign calendar display projection - #187
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
Cache: Disabled due to Reviews > Disable Cache setting 📝 WalkthroughWalkthroughAdds a display-only campaign calendar: Pydantic calendar models, engine projection (date and moon phases), optional seeding of calendar metadata, viewer-side projection into session/atlas surfaces, and UI rendering of a compact calendar detail (season + moon phase). ChangesCampaign Calendar Projection and Display
Sequence Diagram(s)sequenceDiagram
participant Engine as Engine (campaign_calendar.py)
participant Viewer as Viewer Server (viewer/server.py)
participant Frontend as Frontend (screen-map/table.jsx)
Engine->>Viewer: Snapshot includes Campaign.calendar (seeded)
Viewer->>Viewer: _openworlds_calendar_projection(snapshot) → compute date, moons
Viewer->>Frontend: session/atlas surface with calendar field
Frontend->>Frontend: derive calendarDetail (season + moon: phase)
Frontend->>Frontend: render calendar label in header/caption
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
Comment |
100yenadmin
marked this pull request as draft
May 26, 2026 16:04
100yenadmin
marked this pull request as ready for review
May 26, 2026 19:01
100yenadmin
force-pushed
the
openworlds/calendar-display
branch
from
May 26, 2026 19:01
0200599 to
b032432
Compare
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.
Summary
Adds a clean-room campaign calendar display layer for OpenWorlds Table and Atlas surfaces.
This is intentionally display-only:
Campaign.dayremains the canonical in-world day counter.Campaign.time_of_dayremains the tactical phase.Campaign.calendarmetadata can describe months, weekdays, seasons, and moon cycles.calendarread model and keeps/moveas the only player-intent write lane.Refs #176.
What Changed
CampaignCalendarCalendarMonthCalendarMoonservers/engine/campaign_calendar.py, a pure projection helper that mapsCampaign.dayplustime_of_dayinto a human date label, season, and moon phase.seed_world()now accepts optionalworld.calendarmetadata, but ignores malformed or empty calendar blocks so a decorative calendar can never block world startup./session-surfaceand/atlas-surfacenow include:dayLabelcalendar.availablecalendar.canonical_dayDay Nbehavior otherwise.Architecture Notes
This PR deliberately does not add calendar controls, time mutation APIs, event scheduling, real-time ticking, or browser-side state writes.
The date label is a projection, not authority. Consequences, travel, rests, strategic ticks, and campaign persistence continue to key off the engine-owned day counter. The viewer duplicates a small JSON-dict projection because it is a stdlib downstream reader and must not import the engine package at runtime.
External Research
Fantasy Calendar was evaluated as reference-only. Its useful concepts are static calendar metadata, date rendering, and deterministic moon phases. This PR does not vendor or port Fantasy Calendar code and does not add a runtime dependency.
Review Findings Squashed
world.calendarvalidation so malformed calendar metadata degrades instead of abortingseed_world().Day Nbehavior.Validation
Run from
/Volumes/LEXAR/repos/ClawDnD-calendar-display:Additional JSX smoke:
Rollback Plan
Revert this PR to remove the optional calendar metadata and viewer projection. Existing saves without
calendarare unaffected because all fields are additive and the oldDay Nfallback remains.Summary by CodeRabbit
New Features
Tests