Skip to content

fix(examples): pin the two plugin-calendar catalog entries onto their own events (#4627) - #4667

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-4627-calendar-example-dates
Aug 15, 2026
Merged

fix(examples): pin the two plugin-calendar catalog entries onto their own events (#4627)#4667
yinlianghui merged 1 commit into
mainfrom
claude/issue-4627-calendar-example-dates

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#4627

calendar-view paints its month/week window around currentDate, which defaults to today. Both plugin-calendar catalog entries author their events in a fixed past month, so the two tiles whose whole point is to demonstrate events on a calendar drew a correct-but-empty grid — and would have done so on every future day.

The choice: authored currentDate, not relative-to-today dates

The card left this open between two mechanisms and asked for the choice to be stated. Relative-to-today dates are not available, so currentDate is the option, not merely the preferred one:

  • The catalog ships static JSON that must stay copy-pasteableexamples/schema-catalog/src/types.ts says so in as many words ("Kept separate from the schema JSON so the raw schemas remain copy-pasteable into user projects").
  • Nothing in the pipeline or the renderer substitutes date tokens. The renderer maps each record through a plain new Date(record[startField]) (packages/plugin-calendar/src/calendar-view-renderer.tsx), and there is no {{now}} / offset-token language anywhere in examples/schema-catalog/** or packages/plugin-calendar/** — grepped, zero hits.
  • Supplying one would mean either inventing a runtime token language on the renderer (a contract change far past an example-data card) or baking dates in at build time, which turns the shipped entry into a generated artifact and destroys the copy-pasteable property this card is required to protect.

currentDate costs none of that. It is a declared registry input on calendar-viewtype: 'string', "ISO date string for initial calendar date" — and since #4452 / PR #4484 the renderer parses that documented ISO string into the Date the component's prop type declares, at the boundary (resolveAuthoredCurrentDate). So the spelling authored here is exactly the spelling the input documents, and the two entries now double as the worked example of a real, declared, working key. The result is deterministic forever rather than dependent on the day the gallery is opened.

Values, chosen mid-window so no timezone can shift the view out of range:

entrycurrentDatewindow it pinsevents
month-view-calendar2026-05-15T12:00:00.000Z42-cell grid, Sun Apr 26 → Sat Jun 6 2026all 3, incl. the Jun 4–6 "Conference" in the trailing row
week-view-calendar2026-05-27T12:00:00.000ZSun May 24 → Sat May 30 2026all 4

The events themselves are untouched — the card's shape is to pin the view onto the events, and the existing curated data already forms one coherent month and one coherent week.

The exemptions are removed, not reworded

catalog-gallery-render.test.tsx named both entries in AUTHORED_TEXT_EXEMPT, lifting the authored-title control with "date window" as the measured reason. That reason no longer holds, so both entries are removed from the table — which is now empty — and each now carries the full control: every authored title must be on screen. The file's header tables and the two prose references to this card are updated to match.

Verification — all at 715ba9ae6 (final commit, clean tree)

  • pnpm exec vitest run examples/schema-catalog8 files, 1576 tests passed. Re-run after the final commit on a clean tree; both sha and dirty-count captured in the same command.
  • Both entries confirmed running under both controls (--reporter=verbose), not silently skipped:
    ✓ plugin-calendar/month-view-calendar renders without a red tile
    ✓ plugin-calendar/week-view-calendar renders without a red tile
    ✓ plugin-calendar/month-view-calendar puts its authored content on screen
    ✓ plugin-calendar/week-view-calendar puts its authored content on screen
    
  • Reverse verification, direction predicted before running (red — the titles leave the window): with the exemptions removed and currentDate ablated from both entries, exactly the two authored-content cases fail, naming every authored title —
    × plugin-calendar/month-view-calendar puts its authored content on screen
    AssertionError: expected [ 'Team Meeting', …(2) ] to deeply equal []
    × plugin-calendar/week-view-calendar puts its authored content on screen
    AssertionError: expected [ 'Standup', 'Sprint Planning', …(2) ] to deeply equal []
    
    Ablation applied and restored from the commit (git checkout of the branch, scoped to the two entry paths), never the shared stash.
  • pnpm --filter @object-ui/example-schema-catalog regenerate:checksrc/index.ts is up to date (423 entries). Contents-only entry edits, so no index regeneration is owed (PR fix(examples,scripts): regenerating the schema catalog stops discarding curated metadata #4637's model); no titles or descriptions changed, so catalog-meta.json is untouched.
  • pnpm exec tsc -p examples/schema-catalog/tsconfig.test.json --noEmit — exit 0.
  • pnpm --filter @object-ui/example-schema-catalog lint — 0 errors (2 pre-existing warnings, in src/index.ts and vitest.config.ts, both untouched here).
  • node scripts/check-control-bytes.mjsOK (scanned 4191 tracked text file(s); skipped 85 binary).

Changeset

None owed, per the gate's own output:

Compared the working tree with 8871c1463 (merge-base with origin/main): 3 file(s) changed,
0 of them under the src/ of a package the release covers, 0 under a package changesets
ignores, 0 changeset(s) added.
✅ No source of a released package changed in this range, so no changeset is owed.

Note for triage — the card's "2024" is imprecise, the premise is not

The issue title and body say the entries author "fixed 2024 event dates". On origin/main they author 2026-05/06 dates. The substantive premise is unaffected and was confirmed directly: those dates sit outside the window painted around today either way, which is exactly what the ablation above re-measures. Only the year in the filing's prose was off; nothing about the defect or its fix changes.


Generated by Claude Code

… own events (#4627)
`calendar-view` paints the month/week window around `currentDate`, which
defaults to today. Both `plugin-calendar` catalog entries author events in a
fixed past month, so the two tiles whose whole point is to demonstrate events
on a calendar drew a correct-but-empty grid, and would have done so on every
future day.
Both entries now author `currentDate` — the registry input `calendar-view`
declares as an ISO date string, parsed to a `Date` at the renderer boundary
since #4452 — pinning each view onto its own events. Relative-to-today dates
were the alternative and are not available: the catalog ships static JSON that
must stay copy-pasteable, and nothing in the pipeline or the renderer
substitutes date tokens.
`catalog-gallery-render.test.tsx`'s two `AUTHORED_TEXT_EXEMPT` entries are
removed rather than reworded: both entries now carry the authored-content
control, and the table is empty.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnQd8iMMUwXQEV1crFmQiQ
@vercel

vercelBot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredAug 15, 2026 6:08am

Request Review

@yinlianghui
yinlianghui marked this pull request as ready for review August 15, 2026 06:31
@yinlianghui
yinlianghui added this pull request to the merge queueAug 15, 2026
Merged via the queue into main with commit aab597dAug 15, 2026
19 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-4627-calendar-example-dates branch August 15, 2026 06:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs gallery: the two plugin-calendar entries author fixed 2024 event dates, so calendar-view renders an empty grid

2 participants

@yinlianghui@claude