Skip to content

Festival stage scheduling

A line check runs into a set’s buffer. Zoom to five minutes, trim it, and see every room and crew the act depends on.

  • Live events
  • Aurora Live
  • Summary rows
  • Minimap
  • Dependencies
  • Minute scale
  • Crosshair
  • Continuous zoom
  • Active areas
  • Row columns
  • Theming
  • Demo with synthetic data

Mission

0 of 3 steps done

Saturday, 6:25 PM: Saltwater Choir goes on in the Tent, but their line check ends only ten minutes before.

  1. Click Saltwater Choir’s set in the Tent. — To do

    The side panel shows the check, the buffer and the rooms; the related rows light up on the board.

  2. Switch to the 5-minute scale. — To do

    At 15 minutes the check could only end at 6:00 PM, which is shorter than the 20 minutes a line check needs.

  3. Drag the end of the line check back to 6:05 PM. — To do

    The red link turns neutral once 20 minutes are left. The check cannot start earlier: Northern Hum plays until 5:45 PM.

About 30 seconds. Steps tick off as you complete them.

Keyboard: focus the grid, then use arrow keys, Enter and Alt+arrows to move.

Aurora Live
StagesAurora Stage8,000Tent2,500Club600RoomsGreen room A14Green room B10Press room24CrewsAudio crew A6Audio crew B5Lighting crew8Stagehands12Lumen Arc60 minGlass OrchardLine check · 20 minGlass Orchard60 min · buffer 25 minNova TideHeadliner · 90 minNorthern Hum45 minSaltwater ChoirLine check · 30 minSaltwater Choirbuffer 10 minVelvet StaticLine check · 25 minVelvet Static50 min · buffer 20 minKilo BloomLine check · 30 minOra Lux60 minGlass Orchardon stage 6:30 PMNova Tideon stage 9:00 PMNorthern Humon stage 5:00 PMSaltwater Choiron stage 6:25 PMVelvet Staticon stage 8:00 PMOra Luxon stage 10:00 PMSaltwater ChoirInterviews · 25 minLumen ArcInterviews · 30 minNova TideInterviews · 30 minDay shift2 sets · 6hNight shift2 sets · 5hDay shift2 sets · 5hNight shift4 sets · 5h 30mShow call8 sets · 8hChangeoverLumen Arc → Glass OrchardChangeoverGlass Orchard → Nova TideStages live2 of 3 liveSaturday, October 244:30 PM4:45 PM5:00 PM5:15 PM5:30 PM5:45 PM6:00 PM6:15 PM6:30 PM6:45 PM7:00 PM7:15 PM7:30 PM7:45 PM8:00 PM8:15 PM8:30 PM8:45 PM9:00 PM9:15 PM9:30 PM9:45 PM10:00 PM10:15 PM10:30 PM

Preview of the first frameLive: the real Pro engine, running in your browserAbout 30 seconds. Steps tick off as you complete them. Keyboard: focus the grid, then use arrow keys, Enter and Alt+arrows to move.

The situation.

Aurora Live is a fictional one-day festival with three stages, two green rooms, a press room and four crews. The running order is published weeks ahead; what production still plans on the day are the line checks, squeezed between sets, each with a buffer before the act goes on.

In a spreadsheet five minutes disappear: a check that ends ten minutes before a set looks fine at hourly resolution. The board has to zoom down to the minute, keep each check connected to its set, refuse moves that make no sense (a check on another stage, a published set) and show which rooms and crews an act involves.

What you will do

You will open an act’s running sheet in the side panel, zoom to five-minute cells and trim a line check until its link to the set turns neutral.

Where the library ends and your application begins.

SuperScheduler provides

  • Intraday timeline with the night hidden (business hours, Saturday included) and zoomLevels from hours to 15- and 5-minute cells, animated by control.zoom.animateTo.
  • Grouped rows with three rowHeaderColumns (name, capacity, next block) and per-resource emptyHeight for the group labels.
  • A frozen: 'top' summary row painted by onBeforeCellRender: one lane per stage, lit, striped or hatched for each time cell.
  • onBeforeTimeHeaderRender badges as header areas (doors, curfew, the show clock), separators for the same three times, and crosshairType: 'Full'.
  • Cards written in onBeforeEventRender (ticket, stripes, hatching), hover areas (visibility: 'Hover', action: 'None', onClick) that nudge a line check, and curved finish-to-start links.
  • Drag and resize snapped to the active cell, overlap prevention, refusals on the dragCard, conflictHighlight, createHistory undo/redo, keyboardMode: 'Full', the rows.selection API, eventHover cards (super-scheduler/react-render) and a themed context menu.
  • Under the board, the minimap of super-scheduler/minimap fed with the stage time per quarter hour over the open hours (a Float32Array series over a fixed range), a tone per quarter hour and translated labels; crew calls carry areas placed by time (start and end) for the sets they work.

This example’s code decides

  • Which blocks move (only line checks), on which stage, and how short a check may be.
  • The 20-minute buffer between a check and its set, when its link turns red, and which links are drawn (short buffers and the selected act, or all).
  • What each stage is doing in each cell (set, line check, changeover or dark), the show clock, and the strip that reads what is on air and what goes on next.
  • Which rooms and crews relate to an act, the act’s own run sheet in the side panel, and the legend that lights up one stage.
  • The cards' wording, the five-minute ruler of the drag verdict, the menu and hover actions (keep the buffer, shift a check by five minutes) and every label on this page.
  • Stage time per quarter hour (sets and line checks over the three stages’ time), the quarters where a buffer is short, the busiest quarter, and the sets each crew call works.

The code behind this demo.

These are the files this page runs, not a simplified copy. They compile against the public SuperScheduler Pro exports.

tsx.zip

The integration: zoom levels, hidden night hours, rowHeaderColumns, the frozen summary row, header badges and separators, the full crosshair, row highlighting through rows.selection, the hover card, the drag verdict, the context menu, the nudge areas, the crew calls’ areas placed by time, and the callbacks where the rules refuse a move or a resize.

/**
 * Aurora Live run sheet: stages, rooms and crews over one festival day, down to five minutes.
 *
 * Library: timeline with hidden night, zoom levels from hours to 5-minute cells, tree rows with
 * three row-header columns (rowHeaderColumns), a frozen summary row ("Stages live", frozen: 'top')
 * painted by onBeforeCellRender, time-header badges through onBeforeTimeHeaderRender areas,
 * separators for doors, curfew and the show clock, the full crosshair, row selection (related
 * rows), dependency links, drag/resize with overlap prevention and conflict highlighting, hover
 * areas on line checks, time-placed areas on crew calls (the sets they work), undo history, keyboard, the event hover card and the drag card
 * (super-scheduler/react-render), a context menu, and the skin (./tokens.css, ./festival.css).
 * Application: which blocks can move, the line-check buffer before each set, the shortest check,
 * which rows relate to an act, what each stage is doing per cell and what the cards say. Those
 * rules live in ./rules and run inside the callbacks below.
 */
import {
  useCallback,
  useEffect,
  useMemo,
  useState,
  useSyncExternalStore,
  type RefObject,
} from 'react'
import { SuperScheduler } from 'super-scheduler'
import type {
  SchedulerBeforeTimeHeaderRenderArgs,
  SchedulerEventsChangeArgs,
} from 'super-scheduler'
import type { SchedulerHistory } from 'super-scheduler/history'
import { SuperSchedulerComponent, type SchedulerRenderProps } from 'super-scheduler/react-render'
import { format } from '~/i18n/format'
import { HOUR, MINUTE, parseCivil } from '../../scheduler/civil'
import { toneClass } from '../../scheduler/tones'
import { headerLabel, usesTwelveHours } from '../../scheduler/header-format'
import { createHeaderHook } from '../../scheduler/live-headers'
import { createEventMenu, type MenuEntry } from '../kit/context-menu'
import { formatClock } from '../kit/format'
import { useEventHover, type HoverCardModel } from '../kit/hover-card'
import { KEYS } from '../kit/keys'
import { useDropRefusal } from '../kit/use-drop-refusal'
import { createDragCard } from '../kit/verdict'
import { skinClass, skinMenuTheme } from '../registry'
import type { DemoCommon } from '../types'
import {
  CELL_WIDTH,
  GEOMETRY,
  LIVE_ROW,
  STAGE_TONES,
  actName,
  civilOf,
  isRowId,
  readSlotFields,
  slotLabel,
  toResources,
  type SlotEvent,
} from './adapter'
import { CLOSE_BUFFER } from './card-text'
import {
  cardClasses,
  createCardHtml,
  createLiveCell,
  headerMarkers,
  markerAreas,
  minuteLabel,
  rowHeaderHtml,
} from './board-html'
import {
  CURFEW,
  DOORS,
  FESTIVAL_DAY,
  INITIAL_VIEW_START,
  OPEN_HOURS,
  SHOW_CLOCK,
  type ActId,
  type RowId,
  type Slot,
} from './model'
import {
  BUFFER_NEEDED,
  actSlots,
  bufferFix,
  changeoverSets,
  checkTooShort,
  crewStages,
  isStage,
  moveProblem,
  nudgeCheck,
  setsDuring,
  type MoveProblem,
  type NudgeResult,
} from './rules'
import { bufferAt, bufferRuler, slotCard } from './slot-card'
import type { AuroraText, ZoomId } from './text'
import './tokens.css'
import './festival.css'

/** What the board asks the demo to do (context menu, keyboard). */
export type SlotAction = 'details' | 'keep-buffer' | 'earlier' | 'later' | 'go-check' | 'go-set'

/** Five-minute steps: the finest cell of the board. */
export const NUDGE_MINUTES = 5
const FIVE_MINUTES = 5 * MINUTE

export interface AuroraSchedulerProps {
  readonly events: SlotEvent[]
  readonly slots: readonly Slot[]
  /** Acts whose line check ends too close to their set. */
  readonly shortBuffers: readonly ActId[]
  /** Rows that relate to the act in the side panel (highlighted). */
  readonly relatedRows: readonly RowId[]
  readonly text: AuroraText
  readonly common: DemoCommon
  /** BCP 47 tag for labels, and the scheduler locale id. */
  readonly tag: string
  readonly schedulerLocale: string
  /** Level on mount. Later changes go through control.zoom so the view animates from where it is. */
  readonly initialZoom: ZoomId
  /** Every check-to-set link, or only those of the selected act and of short buffers. */
  readonly showAllLinks: boolean
  readonly selectedAct: ActId | null
  /** The slot shown in the side sheet: it gets the selection ring. */
  readonly selected: string | null
  readonly history: SchedulerHistory
  readonly controlRef: RefObject<SuperScheduler.Scheduler | null>
  readonly onEventsChange: (args: SchedulerEventsChangeArgs) => void
  readonly onSelect: (id: string) => void
  readonly onMoved: (id: string) => void
  readonly onResized: (id: string) => void
  readonly onRefused: (id: string, message: string) => void
  readonly onAction: (action: SlotAction, id: string) => void
  readonly onToggleLinks: () => void
  readonly onZoomLevel: (level: ZoomId) => void
}

const ZOOM_LEVELS: SuperScheduler.ZoomLevel[] = [
  {
    id: 'hours',
    properties: {
      scale: 'Hour',
      cellWidth: CELL_WIDTH.hours,
      timeHeaders: [{ groupBy: 'Day' }, { groupBy: 'Hour' }],
    },
  },
  {
    id: 'quarter',
    properties: {
      scale: 'CellDuration',
      cellDuration: 15,
      cellWidth: CELL_WIDTH.quarter,
      timeHeaders: [{ groupBy: 'Day' }, { groupBy: 'Cell' }],
    },
  },
  {
    id: 'five',
    properties: {
      scale: 'CellDuration',
      cellDuration: 5,
      cellWidth: CELL_WIDTH.five,
      timeHeaders: [{ groupBy: 'Hour' }, { groupBy: 'Cell' }],
    },
  },
]

const ZOOM_IDS: readonly ZoomId[] = ['hours', 'quarter', 'five']

/**
 * Time headers: the shared Intl labels, except at five minutes where the hour sits above and the
 * minutes (":05") below, so 26 px cells stay readable. The upper row carries the run sheet's
 * badges (doors, the show clock, curfew) as areas placed inside the cell that holds them.
 */
function festivalHeaders(
  tag: string,
  text: AuroraText,
): (args: SchedulerBeforeTimeHeaderRenderArgs) => void {
  const shared = createHeaderHook(tag)
  const markers = headerMarkers(text, tag)
  return (args) => {
    const start = args.header.start.getTime()
    const end = args.header.end.getTime()
    // The cell's own span tells the level (control.cellDuration lags during an animated zoom and
    // keeps its last value on the hour level).
    const span = end - start
    if (args.header.level !== 0 && span === FIVE_MINUTES) args.header.html = minuteLabel(start)
    else if (args.header.level === 0 && span === HOUR)
      args.header.html = SuperScheduler.Util.escapeHtml(headerLabel(start, 'hour', tag, 'group'))
    else shared(args)
    if (args.header.level === 0) args.header.areas = markerAreas(markers, start, end)
  }
}

/** The label of a five-minute nudge in the menu: the new time, or why it cannot happen. */
export function nudgeLabel(
  direction: 'earlier' | 'later',
  result: NudgeResult,
  text: AuroraText,
  tag: string,
): string {
  if (result.ok) return format(text.actions[direction], { time: formatClock(result.start, tag) })
  const reason =
    result.reason === 'closed'
      ? text.actions.closed
      : format(text.actions.blockedBy, {
          name:
            result.other.act === undefined
              ? slotLabel(result.other, text)
              : actName(result.other.act),
        })
  return format(direction === 'earlier' ? text.actions.earlierBlocked : text.actions.laterBlocked, {
    reason,
  })
}

export function AuroraScheduler(props: AuroraSchedulerProps) {
  const {
    events,
    slots,
    shortBuffers,
    relatedRows,
    selectedAct,
    selected,
    text,
    common,
    tag,
    schedulerLocale,
    initialZoom,
    showAllLinks,
    history,
    controlRef,
  } = props
  const {
    onEventsChange,
    onSelect,
    onMoved,
    onResized,
    onRefused,
    onAction,
    onToggleLinks,
    onZoomLevel,
  } = props

  const resources = useMemo(() => toResources(text), [text])
  // Phones keep the name column only; capacity and the next block are in the cards and the panel.
  const compact = useNarrowScreen()
  const rowHeaderColumns = useMemo<SuperScheduler.RowHeaderColumnData[]>(
    () => [
      { title: text.columns.name, width: compact ? 150 : GEOMETRY.rowHeader.name },
      {
        title: text.columns.capacity,
        width: GEOMETRY.rowHeader.capacity,
        toolTip: text.columns.capacityTip,
        hidden: compact,
      },
      {
        title: text.columns.next,
        width: GEOMETRY.rowHeader.next,
        toolTip: text.columns.nextTip,
        hidden: compact,
      },
    ],
    [text, compact],
  )
  // Header labels follow the active level. An animated zoom renders the new level's headers before
  // control.cellDuration reports it, so the hook is rebuilt (headers repainted) once a zoom lands.
  const [headerHook, setHeaderHook] = useState(() => festivalHeaders(tag, text))

  // Doors and curfew are fixed lines of the day; the show clock is the run sheet's "now".
  const separators = useMemo<SuperScheduler.SeparatorData[]>(
    () => [
      {
        location: DOORS,
        cssClass: 'al-sep al-sep--doors',
        layer: 'BelowEvents',
        width: 1,
        toolTip: text.markers.doors,
      },
      {
        location: CURFEW,
        cssClass: 'al-sep al-sep--curfew',
        layer: 'BelowEvents',
        width: 1,
        toolTip: text.markers.curfew,
      },
      {
        location: SHOW_CLOCK,
        cssClass: 'al-sep al-sep--clock',
        layer: 'AboveEvents',
        width: 2,
        toolTip: text.markers.onAir,
      },
    ],
    [text],
  )

  // What the grid paints, rebuilt when the plan changes and cached inside.
  const paint = useMemo(() => {
    const context = { slots, text, tag }
    return {
      card: createCardHtml(context),
      row: rowHeaderHtml(context),
      live: createLiveCell(slots, text),
    }
  }, [slots, text, tag])

  // A refused drop (wrong stage, published set, short check, overlap) is said on release.
  const refusal = useDropRefusal(onRefused)

  // Each act's line check leads to its set: a finish-to-start link, red when the buffer is short.
  // Morning checks would cross a whole stage row, so by default only the selected act and the
  // short buffers show theirs.
  const links = useMemo<SuperScheduler.LinkData[]>(() => {
    const short = new Set(shortBuffers)
    return slots.flatMap((check) => {
      const set =
        check.kind === 'check'
          ? slots.find((slot) => slot.kind === 'set' && slot.act === check.act)
          : undefined
      if (set === undefined || check.act === undefined) return []
      if (!showAllLinks && !short.has(check.act) && check.act !== selectedAct) return []
      return [
        {
          id: `${check.act}-buffer`,
          from: check.id,
          to: set.id,
          type: 'FinishToStart' as const,
          ...(short.has(check.act) ? { cssClass: 'ss-link--late' } : {}),
        },
      ]
    })
  }, [slots, shortBuffers, showAllLinks, selectedAct])

  // Hover card: buffer, rooms and crews of the act, or what a crew block sits between.
  const card = useCallback(
    (event: SuperScheduler.Event): HoverCardModel | null => {
      const slot = slots.find((candidate) => candidate.id === String(event.id()))
      return slot === undefined ? null : slotCard(slot, slots, text, common, tag)
    },
    [slots, text, common, tag],
  )
  const { eventHover, closeHover, suppressHover } = useEventHover(card)

  // Drag verdict: clock times (one festival day), the stage rules, and for line checks the
  // buffer they would leave, drawn as five-minute pips so it reads at the finest zoom.
  const dragCard = useMemo<SuperScheduler.DragCardOptions>(() => {
    const pattern = usesTwelveHours(tag) ? 'h:mm tt' : 'HH:mm'
    const sets = new Map(
      slots.flatMap((slot) =>
        slot.kind === 'set' && slot.act !== undefined ? [[slot.act, slot]] : [],
      ),
    )
    const checkOf = (id: SuperScheduler.EventId | null) =>
      slots.find((slot) => slot.id === String(id) && slot.kind === 'check')
    const base = createDragCard({
      tag,
      common,
      rowName: (id) => (isRowId(id) ? text.rows[id] : null),
      warn: (info) => {
        const check = checkOf(info.eventId)
        const set = check?.act === undefined ? undefined : sets.get(check.act)
        if (check?.act === undefined || set === undefined) return null
        const minutes = bufferAt(set.start, info.end.getTime())
        return minutes >= BUFFER_NEEDED
          ? null
          : format(text.card.early, {
              minutes,
              act: actName(check.act),
              needed: BUFFER_NEEDED,
            })
      },
    })
    return {
      ...base,
      markerFormat: pattern,
      html: (info) => {
        const html = base.html?.(info) ?? null
        const check = checkOf(info.eventId)
        const set = check?.act === undefined ? undefined : sets.get(check.act)
        if (html === null || check === undefined || set === undefined) return html
        if (String(info.resource) !== check.row || info.forbidden || info.overlapping) return html
        // A check hours before its set needs no ruler; near the set it shows the buffer left.
        const minutes = bufferAt(set.start, info.end.getTime())
        if (minutes > CLOSE_BUFFER) return html
        // The ruler goes inside the verdict, after its pills and before the reason line.
        const ruler = bufferRuler(minutes, text)
        const reason = html.indexOf('<div class="ss-vd__reason">')
        return reason === -1
          ? `${html.slice(0, -'</div>'.length)}${ruler}</div>`
          : `${html.slice(0, reason)}${ruler}${html.slice(reason)}`
      },
    }
  }, [slots, text, common, tag])

  // Context menu: rebuilt when the plan changes, so its labels name the real consequence.
  const contextMenu = useMemo(
    () =>
      createEventMenu({
        theme: skinMenuTheme('festival-stages'),
        title: (event) => format(common.kit.menuTitle, { name: event.text() }),
        onOpenChange: (open) => suppressHover(open),
        entries: (event) => {
          const id = String(event.id())
          const slot = slots.find((candidate) => candidate.id === id)
          if (slot === undefined) return []
          const entries: MenuEntry[] = [
            {
              label: common.kit.openDetails,
              icon: 'details',
              keys: KEYS.details,
              run: () => onAction('details', id),
            },
          ]
          const act = slot.act
          if (act !== undefined && (slot.kind === 'set' || slot.kind === 'check')) {
            const fix = bufferFix(act, slots)
            if (fix !== null)
              entries.push({
                label: format(text.actions.keepBuffer, {
                  needed: BUFFER_NEEDED,
                  time: formatClock(fix.end, tag),
                }),
                icon: 'slot',
                primary: true,
                run: () => onAction('keep-buffer', id),
              })
          }
          if (slot.kind === 'check') {
            const earlier = nudgeCheck(slot, slots, -NUDGE_MINUTES)
            const later = nudgeCheck(slot, slots, NUDGE_MINUTES)
            entries.push(
              'separator',
              {
                label: nudgeLabel('earlier', earlier, text, tag),
                icon: 'after',
                disabled: !earlier.ok,
                run: () => onAction('earlier', id),
              },
              {
                label: nudgeLabel('later', later, text, tag),
                icon: 'after',
                disabled: !later.ok,
                run: () => onAction('later', id),
              },
            )
          } else if (slot.kind === 'set' && act !== undefined) {
            const check = actSlots(act, slots).check
            if (check !== undefined)
              entries.push('separator', {
                label: `${text.actions.goToCheck} · ${formatClock(check.start, tag)}`,
                icon: 'focus',
                run: () => onAction('go-check', id),
              })
          } else {
            // Rooms and crews follow the running order: the menu leads to the set that decides.
            const next =
              slot.kind === 'changeover'
                ? changeoverSets(slot, slots).after
                : act === undefined
                  ? undefined
                  : actSlots(act, slots).set
            if (next?.act !== undefined)
              entries.push('separator', {
                label: `${format(text.actions.goToAct, { act: actName(next.act) })} · ${formatClock(next.start, tag)}`,
                icon: 'focus',
                run: () => onAction('go-set', id),
              })
          }
          entries.push('separator', {
            label: showAllLinks ? text.actions.hideLinks : text.actions.showLinks,
            icon: 'link',
            run: onToggleLinks,
          })
          return entries
        },
      }),
    [slots, showAllLinks, common, text, tag, onAction, onToggleLinks, suppressHover],
  )

  const config = useMemo<SchedulerRenderProps>(() => {
    const short = new Set<string>(shortBuffers)
    const related = new Set<string>(relatedRows)
    const problemText = (problem: MoveProblem) =>
      problem === 'published'
        ? text.rules.published
        : problem === 'follows'
          ? text.rules.follows
          : text.rules.wrongStage
    const overlapText = (conflicts: readonly SuperScheduler.Event[]) => {
      const first = conflicts[0]
      return first === undefined ? null : format(common.kit.overlaps, { name: first.text() })
    }
    const byId = new Map(slots.map((slot) => [slot.id, slot]))
    // Hover buttons of a line check: five minutes earlier or later, named by their result.
    const nudgeAreas = (slot: Slot): SuperScheduler.AreaData[] =>
      (['earlier', 'later'] as const).map((direction, index) => {
        const result = nudgeCheck(
          slot,
          slots,
          direction === 'earlier' ? -NUDGE_MINUTES : NUDGE_MINUTES,
        )
        const label = nudgeLabel(direction, result, text, tag)
        return {
          right: index === 0 ? 30 : 4,
          top: 4,
          width: 24,
          height: 18,
          visibility: 'Hover',
          action: 'None',
          cssClass: `al-nudge${result.ok ? '' : ' al-nudge--off'}`,
          html: `<span aria-hidden="true">${direction === 'earlier' ? '−5' : '+5'}</span>`,
          toolTip: label,
          onClick: () => {
            if (result.ok) onAction(direction, slot.id)
            else onRefused(slot.id, label)
          },
        }
      })

    // A crew call shows when its stages are lit: one segment per set it works, placed by time (the
    // library positions areas from `start` and `end`) in that stage's light.
    const shiftAreas = (slot: Slot): SuperScheduler.AreaData[] =>
      setsDuring(slot, slots).flatMap((set) =>
        set.act === undefined || !isStage(set.row)
          ? []
          : [
              {
                // The set, clipped to the call.
                start: parseCivil(set.start) > parseCivil(slot.start) ? set.start : slot.start,
                end: parseCivil(set.end) < parseCivil(slot.end) ? set.end : slot.end,
                // One lane per stage the crew works, stacked along the foot.
                bottom: 1 + 2 * Math.max(0, crewStages(slot.row).indexOf(set.row)),
                height: 2,
                nonFloating: true,
                cssClass: `al-call ${toneClass(STAGE_TONES[set.row])}`,
                toolTip: `${actName(set.act)} · ${formatClock(set.start, tag)}`,
              },
            ],
      )

    return {
      locale: schedulerLocale,
      startDate: FESTIVAL_DAY,
      days: 1,
      zoomLevels: ZOOM_LEVELS,
      zoom: initialZoom,
      zoomPosition: 'left',
      // The site opens at noon: the morning stays hidden. A Saturday is a working day here.
      businessBeginsHour: OPEN_HOURS.begin,
      businessEndsHour: OPEN_HOURS.end,
      businessWeekends: true,
      showNonBusiness: false,
      useEventBoxes: 'Never',
      height: '100%',
      cssClass: `al-board ${skinClass('festival-stages')}`,
      treeEnabled: true,
      treePreventParentUsage: true,
      rowHeaderColumns,
      rowHeaderWidthAutoFit: false,
      eventHeight: GEOMETRY.eventHeight,
      rowMarginTop: GEOMETRY.rowMargin,
      rowMarginBottom: GEOMETRY.rowMargin,
      crosshairType: 'Full',
      separators,
      allowEventOverlap: false,
      conflictHighlight: true,
      linkLayer: 'Below',
      timeRangeSelectedHandling: 'Disabled',
      durationBarVisible: false,
      showToolTip: false,
      keyboardEnabled: true,
      keyboardTarget: 'component',
      keyboardMode: 'Full',
      history,
      controlRef,
      onEventsChange,

      onBeforeTimeHeaderRender: headerHook,

      onBeforeRowHeaderRender: (args) => {
        const id = String(args.row.id)
        const html = paint.row(id)
        if (html === null) return
        const [name, capacity, next] = args.row.columns
        if (name !== undefined) name.html = html.name
        if (capacity !== undefined) capacity.html = html.capacity
        if (next !== undefined) next.html = html.next
        args.row.cssClass =
          id === LIVE_ROW
            ? 'al-row--live'
            : args.row.data.children !== undefined
              ? 'al-row--group'
              : ''
      },

      // The frozen row sums up the stages per cell; the selected act's rows are tinted (their
      // headers come from rows.selection).
      onBeforeCellRender: (args) => {
        const cell = args.cell
        if (cell.resource === LIVE_ROW) {
          const live = paint.live(cell.start.getTime(), cell.end.getTime())
          cell.properties.html = live.html
          cell.properties.cssClass = `al-live-cell al-live-cell--${live.count}`
          return
        }
        if (related.has(String(cell.resource))) cell.properties.cssClass = 'al-related'
      },

      onBeforeEventRender: (args) => {
        const fields = readSlotFields(args.data)
        const id = String(args.data.id)
        const known = byId.get(id)
        if (fields === null || known === undefined) return
        // The control may hold newer times than React (a drop lands before onEventsChange).
        const slot: Slot = {
          ...known,
          start: civilOf(args.data.start),
          end: civilOf(args.data.end),
        }
        args.data.html = paint.card(slot)
        let classes = cardClasses(slot)
        if (fields.kind === 'set' && fields.act !== undefined && short.has(fields.act))
          classes += ' ss-ev--late'
        if (id === selected) classes += ' al-ev--selected'
        args.data.cssClass = classes
        if (fields.kind === 'check') args.data.areas = nudgeAreas(slot)
        else if (fields.kind === 'shift') args.data.areas = shiftAreas(slot)
      },

      // Only line checks move, and only on their act's stage; overlap is refused by the library.
      onEventMoving: (args) => {
        const id = String(args.e.id())
        const fields = readSlotFields(args.e.data)
        const problem = fields === null ? null : moveProblem(fields, String(args.resource))
        if (problem !== null) {
          const message = problemText(problem)
          args.allowed = false
          args.message = message
          refusal.track(id, message)
          return
        }
        refusal.track(id, overlapText(args.conflicts))
      },

      // Final check before the commit (also covers keyboard moves).
      onEventMove: (args) => {
        const fields = readSlotFields(args.e.data)
        const problem = fields === null ? null : moveProblem(fields, String(args.newResource))
        if (problem !== null) {
          args.preventDefault()
          refusal.clear()
          onRefused(String(args.e.id()), problemText(problem))
        }
      },

      onEventResizing: (args) => {
        const id = String(args.e.id())
        if (checkTooShort(args.start.value, args.end.value)) {
          args.allowed = false
          args.message = text.rules.tooShort
          refusal.track(id, text.rules.tooShort)
          return
        }
        refusal.track(id, overlapText(args.conflicts))
      },

      onEventResize: (args) => {
        if (checkTooShort(args.newStart.value, args.newEnd.value)) {
          args.preventDefault()
          refusal.clear()
          onRefused(String(args.e.id()), text.rules.tooShort)
        }
      },

      onEventMoved: (args) => {
        refusal.clear()
        onMoved(String(args.e.id()))
      },
      onEventResized: (args) => {
        refusal.clear()
        onResized(String(args.e.id()))
      },
      // A click (or Enter) docks the slot into the side sheet; the hover card steps aside.
      onEventClick: (args) => {
        closeHover()
        onSelect(String(args.e.id()))
      },

      onZoom: (args) => {
        if (args.phase !== 'end') return
        setHeaderHook(() => festivalHeaders(tag, text))
        const level = ZOOM_IDS[args.level]
        if (level !== undefined) onZoomLevel(level)
      },
    }
  }, [
    history,
    controlRef,
    slots,
    shortBuffers,
    relatedRows,
    selected,
    rowHeaderColumns,
    separators,
    paint,
    common,
    refusal,
    closeHover,
    onAction,
    onEventsChange,
    onMoved,
    onRefused,
    onResized,
    onSelect,
    onZoomLevel,
    schedulerLocale,
    headerHook,
    tag,
    text,
    initialZoom,
  ])

  // Highlighted rows are the control's row selection, driven by the act in the side panel.
  useEffect(() => {
    const control = controlRef.current
    if (control === null || control.disposed()) return
    control.rows.selection.clear()
    for (const id of relatedRows) {
      const row = control.rows.find(id)
      if (row !== null) control.rows.selection.add(row)
    }
  }, [controlRef, relatedRows])

  // Imperative and once: a scroll prop would be re-applied on every update.
  useEffect(() => {
    controlRef.current?.scrollTo(INITIAL_VIEW_START, false, 'left')
  }, [controlRef])

  return (
    <SuperSchedulerComponent
      {...config}
      resources={resources}
      events={events}
      links={links}
      eventHover={eventHover}
      dragCard={dragCard}
      contextMenu={contextMenu}
    />
  )
}

const NARROW = '(max-width: 639px)'

/** True on phone-sized screens (the stage is then too narrow for three header columns). */
function useNarrowScreen(): boolean {
  return useSyncExternalStore(
    (notify) => {
      const query = window.matchMedia(NARROW)
      query.addEventListener('change', notify)
      return () => query.removeEventListener('change', notify)
    },
    () => window.matchMedia(NARROW).matches,
    () => false,
  )
}

The archive contains this example’s files and a README. It does not include SuperScheduler Pro or any download key.