Skip to content

Commit b90df10

Browse files
committed
chore(calendar-web): move openspec change into package directory
1 parent 74b1d76 commit b90df10

5 files changed

Lines changed: 112 additions & 78 deletions

File tree

packages/pluggableWidgets/calendar-web/openspec/changes/add-calendar-year-view/design.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,16 @@ YearViewController.getComponent()
181181
-**Custom modal with events:** Breaks calendar metaphor
182182
-**Direct to day view:** Fastest path to event details
183183

184+
**Refinement (implemented): configurable, enabled-constrained target.** The shipped code
185+
uses RBC's `onDrillDown(date, targetView)` (not `onNavigate`+`onView`) so the target is
186+
validated against the calendar's enabled views. The target is author-configurable via the
187+
top-level `yearDayClickView` enum (day/week/work_week/month/agenda, default day), resolved
188+
in `CalendarPropsBuilder.resolveDayClickView()` against a single-source `getEnabledViewNames()`.
189+
If the chosen target isn't enabled, drill-down is **disabled** — day cells render
190+
non-interactive (no role/tabIndex/handlers, aria-label retained) — rather than
191+
force-registering a hidden Day view the author never enabled. This removes the earlier
192+
`day: … || yearEnabled` phantom-registration in `buildVisibleViews()`.
193+
184194
### D6: Responsive Layout Strategy
185195

186196
**Decision:** CSS Grid with media queries: 4 cols (desktop) → 2 cols (tablet) → 1 col (mobile).

packages/pluggableWidgets/calendar-web/openspec/changes/add-calendar-year-view/proposal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Users need a year-at-a-glance view to see events across all 12 months simultaneo
77
- Add **Year View** to the Calendar widget, available in both Standard and Custom view modes
88
- Render a 12-month grid (4×3 layout) showing all months of the selected year
99
- Display event indicators (dots) on days that have events, without showing full event details
10-
- Enable day-cell click navigation: clicking any day switches to day view for that date
10+
- Enable day-cell click navigation: clicking a day switches to an author-configured target view (day/week/work_week/month/agenda, default day) for that date, constrained to enabled views — if the target isn't enabled, day cells are non-interactive and clicking does nothing (no view is force-registered on the author's behalf)
1111
- Add "Year" button to toolbar for view switching
1212
- Support previous/next year navigation and "today" button to jump to current year
1313
- Maintain responsive design: 4 columns (desktop), 2 columns (tablet), 1 column (mobile)
@@ -17,7 +17,7 @@ Users need a year-at-a-glance view to see events across all 12 months simultaneo
1717

1818
### New Capabilities
1919

20-
- `calendar-year-view`: Year view rendering with 12-month grid, event indicators, day-click navigation, and year-based navigation (previous/next/today)
20+
- `calendar-year-view`: Year view rendering with 12-month grid, event indicators, configurable day-click navigation (target view constrained to enabled views, otherwise disabled), and year-based navigation (previous/next/today)
2121

2222
### Modified Capabilities
2323

@@ -27,7 +27,7 @@ Users need a year-at-a-glance view to see events across all 12 months simultaneo
2727

2828
**Code Changes:**
2929

30-
- **XML Configuration** (`Calendar.xml`): Add "year" enum value to `defaultViewStandard`, `defaultViewCustom`, and toolbar `itemType` properties
30+
- **XML Configuration** (`Calendar.xml`): Add "year" enum value to `defaultViewStandard`, `defaultViewCustom`, and toolbar `itemType` properties; add top-level `yearDayClickView` enum (day/week/work_week/month/agenda) controlling the day-click target
3131
- **Type Definitions** (`CalendarProps.d.ts`): Auto-generated types will include "year" in view enums
3232
- **View Registration** (`CalendarPropsBuilder.ts`): Update `buildVisibleViews()` to include year view component, update type unions
3333
- **Toolbar** (`Toolbar.tsx`): Add "year" to `ResolvedToolbarItem` type and render logic

packages/pluggableWidgets/calendar-web/openspec/changes/add-calendar-year-view/specs/calendar-view-switching/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ When switching to or from year view, the calendar SHALL maintain appropriate dat
4949

5050
#### Scenario: Switching from year view after clicking a day
5151

52-
- **WHEN** user clicks a day in year view (which navigates to day view)
53-
- **THEN** day view displays the clicked date
52+
- **WHEN** user clicks a day in year view AND the configured day-click target view is enabled
53+
- **THEN** the configured target view displays the clicked date
5454

5555
#### Scenario: Switching from year view via toolbar button
5656

packages/pluggableWidgets/calendar-web/openspec/changes/add-calendar-year-view/specs/calendar-year-view/spec.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,29 @@ Days with events SHALL display a single dot indicator, regardless of the number
7272
- **WHEN** an event is marked as all-day
7373
- **THEN** the event is considered to occur on each calendar day from start date to end date (inclusive) and dots are displayed accordingly
7474

75-
### Requirement: Day click navigates to day view
75+
### Requirement: Day click navigates to the configured target view
7676

77-
Clicking a day cell SHALL navigate the calendar to day view for the selected date.
77+
Clicking a day cell SHALL navigate the calendar to the author-configured day-click target view (via the `yearDayClickView` property) for the selected date, PROVIDED that target view is enabled. The target choices are day, week, work_week, month, and agenda; the default is day. If the configured target view is not among the calendar's enabled views, day-click SHALL be disabled: day cells are rendered as non-interactive (no button role, tab stop, click, or keyboard handler) while retaining their aria-label, and no navigation occurs.
7878

7979
#### Scenario: User clicks a day in the current month
8080

81-
- **WHEN** user clicks a day cell representing a date in the current month
82-
- **THEN** the calendar switches to day view AND displays the selected date
81+
- **WHEN** the configured target view is enabled AND user clicks a day cell representing a date in the current month
82+
- **THEN** the calendar switches to the configured target view AND displays the selected date
8383

8484
#### Scenario: User clicks a leading day from previous month
8585

86-
- **WHEN** user clicks a gray day cell from the previous month
87-
- **THEN** the calendar switches to day view AND displays the selected date from the previous month
86+
- **WHEN** the configured target view is enabled AND user clicks a gray day cell from the previous month
87+
- **THEN** the calendar switches to the configured target view AND displays the selected date from the previous month
8888

8989
#### Scenario: User clicks a trailing day from next month
9090

91-
- **WHEN** user clicks a gray day cell from the next month
92-
- **THEN** the calendar switches to day view AND displays the selected date from the next month
91+
- **WHEN** the configured target view is enabled AND user clicks a gray day cell from the next month
92+
- **THEN** the calendar switches to the configured target view AND displays the selected date from the next month
93+
94+
#### Scenario: Configured target view is not enabled
95+
96+
- **WHEN** the configured day-click target view is not one of the calendar's enabled views
97+
- **THEN** day cells are non-interactive AND clicking a day does nothing (no view registered on the author's behalf)
9398

9499
### Requirement: Today indicator highlights current day
95100

@@ -169,8 +174,8 @@ Day cells SHALL be keyboard-accessible for users who navigate without a mouse.
169174

170175
#### Scenario: Enter or Space key activates day cell
171176

172-
- **WHEN** user presses Enter or Space while a day cell is focused
173-
- **THEN** the calendar navigates to day view for that date (same as clicking)
177+
- **WHEN** the configured target view is enabled AND user presses Enter or Space while a day cell is focused
178+
- **THEN** the calendar navigates to the configured target view for that date (same as clicking)
174179

175180
### Requirement: Screen reader support
176181

0 commit comments

Comments
 (0)