Skip to content

plugin-calendar: calendar-view's allowCreate input is declared but inert — the handler it would drive is built and never passed #4454

Description

@yinlianghui

Observation-class, found while reading calendar-view-renderer.tsx for #4433. Nothing a user hits as a failure — the button simply never appears — so this carries finding and no pm:queue.

What is declared

packages/plugin-calendar/src/calendar-view-renderer.tsx registers the input:

{ name: 'allowCreate', type: 'boolean', label: 'Allow Create',
  defaultValue: false,
  description: 'Allow creating events by clicking on dates' }

and defaultProps sets allowCreate: false.

What consumes it

Nothing, on either side of the boundary:

  • CalendarViewProps does not declare allowCreate, so the value rides the {...props} spread into CalendarView and is dropped there.

  • The renderer builds the handler the flag would gate —

    const handleAddClick = () => { onAction?.({ type: 'create', payload: {} }); };
    

    — and never passes it. CalendarView renders its "New event" button behind {onAddClick && …}, so on the SDUI path that button never exists and handleAddClick is unreachable dead code.

So the two halves of one feature are both present and never introduced to each other: an authorable key with no read site, and a handler with no caller.

Why it is filed and not fixed

Wiring onAddClick={handleAddClick} when allowCreate is true is a two-line change, but it turns a dormant declaration into a live capability that dispatches a create action — a capability question (does anything consume { type: 'create' } from this widget today?), not a bug fix, and outside #4433's scope. The alternative disposition is retirement: drop the input and the dead handler if nothing pulls on them. ADR-0049's enforce-or-remove framing applies either way — the current state, declared-but-unenforced, is the one state that should not persist.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions