Repository navigation
feat(lab): Schedule writes dates in the provider's calendar - #9994
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: Schedule's calendar labels rely on the draft spec:AST-111 FR18, which is not current on main, where architecture:internationalization INV10 keeps built-in date displays Gregorian and leaves non-Gregorian component behavior to an owner decision. An engineering owner (the author may, as one) records approval by commenting /approve-spec followed by the full head commit SHA, or says this waits until AST-111 is current; the decision should also cover the two-month title ("Mehr - Aban 1405 AP"), naming a month by its middle day, and the bare "1" that starts a calendar month mid-row in the month view.
Needed whatever the decision:
monthLabelDateinpackages/lab/src/Schedule/shared.tsxcopies the middle-day rule from Core'sformatCalendarMonthLabel: move that choice into one exported Core helper, call it from both places, and delete the copy so Schedule's titles cannot drift from Calendar's heading.- The description says Schedule "renders exactly as before" without a provider calendar, but under
fa-IRa long timed event's accessible dates now change from Persian to Gregorian (correct under INV10): please say so, and add a test that pins it.
Smaller points: assert the development warning in the no-Temporal test, and drop formatWithPlainDate's unused _timezoneID parameter.
[Automated review]
| // that starts inside the month does not rename it. | ||
| function monthLabelDate(date: PlainDate, calendar: CalendarSystem): PlainDate { | ||
| const month = calendarMonthOf(calendar, date); | ||
| return plainDateAddDays(month.start, Math.floor(month.length / 2)); |
There was a problem hiding this comment.
This repeats the middle-day rule that Core's formatCalendarMonthLabel owns (packages/core/src/utils/calendarSystem.ts, plainDateAddDays(month.start, Math.floor(month.length / 2))). Could the date choice move into one exported helper in calendarSystem.ts, used by formatCalendarMonthLabel and re-exported from internal/calendar-system? Then Schedule's titles cannot drift from Calendar's heading.
| minute: '2-digit', | ||
| timeZone: timezoneID, | ||
| }).formatRange(new Date(event.start), new Date(event.end)); | ||
| return formatCalendarInstantRange( |
There was a problem hiding this comment.
Without a provider calendar, this now pins Gregorian where the base used the locale's default calendar. Under fa-IR a long event's accessible dates change from "۴ آبان … تا ۶ آبان …" to "۲۶ اکتبر … تا ۲۸ اکتبر …". That is right under INV10, but the description says nothing changes without a provider calendar. Please note it there and pin it with a test, for example formatEventDateTimeRange(event, 'UTC', 'fa-IR', 'gregory').
3a9bb8b to
bab4d52
Compare
656f8a5 to
dd1caaa
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: Schedule's calendar labels rely on the draft spec:AST-111 FR18, which is not current on main, where architecture:internationalization INV10 keeps built-in date displays Gregorian and leaves non-Gregorian component behavior to an owner decision. An engineering owner (the author may, as one) records approval by commenting /approve-spec followed by the full head commit SHA, or says this waits until AST-111 is current; the decision should also cover the two-month title ("Mehr - Aban 1405 AP"), naming a month by its middle day, and the bare "1" that starts a calendar month mid-row in the month view.
Needed whatever the decision:
monthLabelDateinpackages/lab/src/Schedule/shared.tsxcopies the middle-day rule from Core'sformatCalendarMonthLabel: move that choice into one exported Core helper, call it from both places, and delete the copy so Schedule's titles cannot drift from Calendar's heading.- The description says Schedule "renders exactly as before" without a provider calendar, but under
fa-IRa long timed event's accessible dates now change from Persian to Gregorian (correct under INV10): please say so, and add a test that pins it.
Smaller points: assert the development warning in the no-Temporal test, and drop formatWithPlainDate's unused _timezoneID parameter.
[Automated review]
bab4d52 to
0192de4
Compare
dd1caaa to
bc95697
Compare
|
/approve-spec bc95697 |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision. Schedule's calendar labels follow spec:AST-111 FR18, which is now on main but still a draft, while the current architecture:internationalization INV10 keeps built-in date formatters Gregorian and leaves non-Gregorian component behavior to an owner decision. An engineering owner (the author may, as one) records approval by commenting /approve-spec followed by the full head commit SHA, or says this waits until AST-111 and the matching INV10 update are current; the decision should also cover the two-month title ("Mehr - Aban 1405 AP"), naming a month by its middle day, and a calendar month that starts mid-row in the month view.
Optional cleanups:
- The description's evidence-gaps line about the development warning and the
fa-IRlong-event dates is out of date: the new tests cover both. isSameCalendarYear,formatMonthTitle,formatFullDate,formatWeekdayandformatDayNumberinshared.tsxkeep atimezoneIDparameter they no longer read.
[Automated review]
0192de4 to
6ebed8d
Compare
bc95697 to
74d61b9
Compare
6ebed8d to
396e07d
Compare
74d61b9 to
44d85a0
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision. Schedule's calendar labels follow spec:AST-111 FR18, which is on main but still a draft; the current architecture:internationalization INV10 and component:InternationalizationProvider FR10 name only Calendar as following the provider's calendar, and component:Schedule has no calendar clause. The earlier /approve-spec names a previous head; this head carries the same patch on the moved base branch, so it needs its own approval. An engineering owner (the author may, as one) records the decision by commenting /approve-spec followed by the full head commit SHA, or says this waits until AST-111 FR18 and the matching INV10 and provider FR10 wording are current; the decision should also cover the two-month title ("Mehr - Aban 1405 AP"), naming a month by its middle day, and a calendar month that starts mid-row in the month view.
Optional cleanup:
isSameCalendarYear,formatMonthTitle,formatFullDate,formatWeekdayandformatDayNumberinshared.tsxkeep atimezoneIDparameter they no longer read.
[Automated review]
44d85a0 to
e927b65
Compare
|
/approve-spec e927b65 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because its test workflow runs only once this pull request targets main (after #9639 lands).
Schedule's date labels follow the provider's calendar as an engineering owner approved for this head, and the tests and real-browser checks bear it out; without a provider calendar the only change is the documented Gregorian dates in a long event's accessible name. There are no blocking findings.
- When you retarget to
main, Core'spackage.jsonexports andscripts/sync-exports.jswill conflict with the entriesmainadded beside yours.
[Automated review]
Schedule's titles, day numbers, weekday and full-date labels, week ranges, and long event ranges use the calendar that Core's date components resolve. A Gregorian month that spans two calendar months is titled with both. Schedule still lays out and steps Gregorian days, weeks, and months. Lab reaches Core's calendar resolution and labels through the internal @astryxdesign/core/internal/calendar-system entry, which adds formatCalendarInstantRange for ranges. The provider docs name Schedule among the components that follow the calendar.
…elDay Core's formatCalendarMonthLabel and Schedule now share one rule for the day that names a calendar month. Schedule's long timed events get a test that their accessible dates stay Gregorian under fa-IR without a provider calendar, and the changeset says so. formatWithPlainDate drops its unused time-zone parameter.
A date label formats a PlainDate in the calendar, so it never reads a zone.
e927b65 to
e39bf2b
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision. Schedule's date labels follow spec:AST-111 FR18, which is still a draft on main, and no current record directs that behaviour or the title that names both calendar months a Gregorian month spans ("Mehr - Aban 1405 AP").
The earlier /approve-spec names the head before the rebase onto main, so it does not cover this head. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner; otherwise the change waits until FR18 is current on main.
There are no blocking findings, and without a provider calendar the only change is the disclosed Gregorian dates in a long event's accessible name.
[Automated review]
|
/approve-spec e39bf2b |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch | 249.5 kB (+12 B) · 22.3 kB CSS (0) | — | — · — · — |
| DateTimeInput | 177.0 kB (+9 B) · 17.2 kB CSS (0) | — | — · — · — |
| Calendar | 57.3 kB (+6 B) · 9.3 kB CSS (0) | — | — · — · — |
6 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DateRangeInput | 75.6 kB (+6 B) · 11.2 kB CSS (0) | — | — · — · — |
| lab/Schedule · Storybook | 63.5 kB (+4 B) · 3.9 kB CSS (0) | 4,802 (+52) | — · ✓ · ✓ |
| Timestamp | 22.9 kB (+1 B) · 8.9 kB CSS (0) | — | — · — · — |
| DateInput | 154.9 kB (0) · 15.5 kB CSS (0) | — | — · — · — |
| lab/Comments | 271.3 kB (0) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 266.2 kB (0) · 2.4 kB CSS (0) | — | — · — · — |
Package size: measured; main has no measurement of the merge base to compare yet.
API changes: cli +8 · ~1 · −0 (against the merge base's committed report)
Committed API report behind this build: cli 9 rows, core 3 rows; run pnpm api:report.
9 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./api · Types · type SearchResultEntry |
deprecated?: ComponentDeprecation | undefined |
import type {SearchResultEntry} from '@astryxdesign/cli/api'; const x: SearchResultEntry = {deprecated: …} |
| + | cli |
./authoring · Types · interface ComponentDeprecation |
interface ComponentDeprecation |
import type {ComponentDeprecation} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface MultiComponentDoc |
deprecated?: ComponentDeprecation |
import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {deprecated: …} |
| + | cli |
./authoring · Types · interface SingleComponentDoc |
deprecated?: ComponentDeprecation |
import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface ComponentBaseDoc |
deprecated?: ComponentDeprecation |
import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface SubComponentDoc |
deprecated?: ComponentDeprecation |
import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {deprecated: …} |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/doc' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/template' |
| ~ | cli |
./api · Functions · function search |
function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "hook" | "theme" | "doc" | undefined; limit?: number | undefined }) => Promise<SearchResponse> → function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "doc" | "theme" | "hook" | undefined; limit?: number | undefined }) => Promise<SearchResponse> |
import {search} from '@astryxdesign/cli/api'; search(…) |
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved. Schedule's date labels now follow the provider's calendar, and an engineering owner approved that behaviour (draft spec:AST-111 FR18) for this head with /approve-spec. CI has run on this head and passed.
There are no blocking findings: without a provider calendar every visible label stays Gregorian, and the one accessible-name change for long timed events under locales such as fa-IR is disclosed in the changeset.
[Automated review]
This implements the Schedule part of
spec:AST-111(approved in #9605) FR18.User need
An application that sets
calendar="persian"(orhebrew,buddhist, …) onInternationalizationProvidergets Persian dates inCalendar, Timestamp and PowerSearch (since #9639). A LabSchedulebeside them still titles its months and labels its days in Gregorian, so one screen names the same day in two calendars.Problem and solution fit
Calendarshows for the same day, also whereIntlandTemporaldisagree on a month start in the Chinese or Dangi calendar.calendarMonthLabelDay, the helperCalendar's month heading uses, so an era that starts inside the month does not rename it and the two cannot drift.@astryxdesign/core/internal/calendar-system. It re-exportsuseCalendarSystemand the calendar helperscalendarMonthOf,formatCalendarDateandformatCalendarDateToParts, plus two that this pull request adds to Core:formatCalendarInstantRangefor ranges, andcalendarMonthLabelDay, the day that names a calendar month, whichformatCalendarMonthLabelnow uses too. Schedule resolves the calendar through that hook, with the same rules and the same no-Temporalfallback asCalendar.Current specification
spec:AST-111FR18 (draft): Schedule date labels render in the provider's calendar. FR2 (component prop, then provider prop, thengregory; a locale never selects the calendar) and FR5 (the no-Temporalfallback) apply unchanged.spec:AST-017FR21: Core's./internal/*subpaths are reserved for Astryx's own packages and are outside the public API.architecture:internationalizationINV8–INV10.Public delta and caller burden
fa-IRorth-THthey read in the Persian or Buddhist calendar. They now follow the provider's calendar like every other label, so without a provider calendar they read Gregorian (spec:AST-111FR2: a locale never selects the calendar). The changeset discloses this.[chore]. Lab addstemporal-polyfillas a dev dependency for its tests.calendar. A calendar that needsTemporalneeds a polyfill where the runtime lacks it, as forCalendar.Design and alternatives
Schedule reads the calendar that Core's date components resolve, so a Schedule and a Calendar in one subtree show the same calendar and fall back together. Ranges format each end through the same labels as
Calendar; whereIntlandTemporalname different days at either end, the range writes both ends in full.Rejected: laying out and paging calendar months. Schedule's grids and values stay Gregorian; only its labels follow the calendar.
Evidence
Schedule.calendarSystems.test.tsx(40 cases): full-date, month-title, day-number, week-range, and long-event labels inpersian,hebrew, andbuddhist, each under English and its native locale; a month title across two calendar months, and across the 1989japaneseera change; the Gregorian month view underfa-IRwithout a provider calendar;iso8601titles and ranges written as Gregorian ones; the day view label; a long timed event's accessible label underfa-IRwithout a provider calendar, which writes Gregorian dates and not Persian ones; and, withoutTemporal, Gregorian labels forpersianwith the development warning asserted, andbuddhiststill working.calendarSystem.test.ts: a range whose ends differ betweenIntlandTemporalin the Chinese calendar is written in full at both ends; aniso8601range reads as a Gregorian one.internal/calendar-system.test.ts: the entry exports exactly the named helpers, includingcalendarMonthLabelDay, and the public i18n barrel does not export the hook.Scope
Testing
pnpm exec vitest run --maxWorkers=2over the test files this pull request changes and the tests beside its changed sources (Coreinternal,i18nandutils, and LabSchedule) plusdocPropLiterals.test.ts: 65 files, 1,091 of 1,092 tests pass on the previous head. The one failure,hitArea.test.ts"batches every pending control into one frame: all reads, then all writes", fails the same way on themaincommit the stack sits on (d23d1fe438).Schedule); the LabScheduletests pass on it: 6 files, 125 tests.tsc --noEmitis clean for core, lab, and charts (lab and charts after a fresh core build).pnpm check:knowledgeandpnpm check:changesetspass.node scripts/pre-review.mjs --base main: 805 authored lines.Writing rubric results
This pull request changes no knowledge record. It changes consumer docs only (
Schedule.doc.mjsand theInternationalizationProviderdocs and prop comment) and the changeset.