fix(02): remove custom ViewToolbar; use Schedule-X built-in header

- Remove <ViewToolbar> render and its import from CalendarShell
- Remove createCalendarControlsPlugin import, useState instance, and plugin
  array entry (calendar-controls only served the custom toolbar)
- Delete ViewToolbar.tsx (no longer referenced anywhere)
- Remove calendar-controls mock from CalendarShell.test.tsx
- CSS audit confirmed no rules hide Schedule-X weekday-name row; no CSS changes needed
- All four views (day/week/month-grid/month-agenda) remain; Schedule-X's native
  header exposes them in its own view switcher
This commit is contained in:
Lucas Berger
2026-06-05 14:54:40 -04:00
parent 1f0b9546a8
commit d240657059
3 changed files with 5 additions and 236 deletions
+5 -9
View File
@@ -14,10 +14,12 @@
* - Event popover: driven exclusively by Zustand openEventId via onEventClick → standalone
* EventDetailPopover; createEventModalPlugin and customComponents.eventModal are NOT used
* - Threat T-02d-01: all event fields are plain-text JSX children — no raw HTML injection
* - Navigation: Schedule-X's built-in header is the sole navigation bar (Today/‹›/view switcher
* + weekday-name row). The custom ViewToolbar and calendar-controls plugin have been removed.
*
* Layout:
* - Phone (≤767px): AppNav top bar → ViewToolbar → calendar grid (primary focal point)
* - Tablet/Desktop (≥768px): AppNav left sidebar (240px) + main area (ViewToolbar + grid)
* - Phone (≤767px): AppNav top bar → Schedule-X (header + grid)
* - Tablet/Desktop (≥768px): AppNav left sidebar (240px) + main area (Schedule-X header + grid)
*
* State branches:
* isLoading (initial) → SkeletonCalendar
@@ -37,7 +39,6 @@ import {
type CalendarType,
} from '@schedule-x/calendar'
import { createEventsServicePlugin } from '@schedule-x/events-service'
import { createCalendarControlsPlugin } from '@schedule-x/calendar-controls'
import { fetchMe, fetchEvents } from '../api/client.js'
import { hydrateEvents } from '../lib/hydrateEvents.js'
@@ -45,7 +46,6 @@ import { buildCalendarConfig, SX_FIRST_DAY_OF_WEEK } from '../lib/calendarConfig
import { useCalendarStore } from '../store/calendarStore.js'
import { EventDetailPopover } from './EventDetailPopover.js'
import { AppNav } from './AppNav.js'
import { ViewToolbar } from './ViewToolbar.js'
import { ColorLegend } from './ColorLegend.js'
import { SkeletonCalendar } from './SkeletonCalendar.js'
import { EmptyState } from './EmptyState.js'
@@ -96,7 +96,6 @@ export function CalendarShell() {
// Create plugins once (stable across renders)
const eventsService = useState(() => createEventsServicePlugin())[0]
const calendarControls = useState(() => createCalendarControlsPlugin())[0]
// Build members list from /api/me for AppNav + ColorLegend
const members = useMemo(() => {
@@ -148,7 +147,7 @@ export function CalendarShell() {
},
},
},
[eventsService, calendarControls],
[eventsService],
)
// Sync TanStack Query result into Schedule-X eventsService (Pitfall 4 guard)
@@ -205,9 +204,6 @@ export function CalendarShell() {
overflow: 'hidden',
}}
>
{/* ViewToolbar */}
<ViewToolbar controls={calendarControls} />
{/* Main calendar area */}
<div style={{ flex: 1, minHeight: 0, position: 'relative', overflow: 'hidden' }}>
{isInitialLoading ? (