Skip to content

refactor(web): drop draft context setters for setLocalDraft#2349

Merged
tyler-dane merged 2 commits into
mainfrom
refactor/drop-draft-context-setters
Jul 24, 2026
Merged

refactor(web): drop draft context setters for setLocalDraft#2349
tyler-dane merged 2 commits into
mainfrom
refactor/drop-draft-context-setters

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Summary

  • Week draft actions now expose setLocalDraft (the local portal draft setter).
  • DraftContext no longer publishes the internal setters bag; DraftProvider keeps setters private to actions/effects.
  • Draft.tsx and WeekInteractionCoordinator call actions.setLocalDraft instead of setters.setDraft.

Simplicity

Net reduction: context value dropped an entire setters surface; tests stopped stubbing empty setters. Hook complexity stayed flat — no new useEffect/useRef/useState. setLocalDraft is a named alias of the existing setDraft dispatch so the public action matches intent without wrapping behavior.

Manual Testing Steps

  • In Week view, click an event to open the form → draft overlay and sidebar stay in sync while editing the title.
  • Right-click → Edit → form and draft overlay show that event.
  • Drag a saved event while its form was open, then release with a move → form reopens on the updated times (local + store draft restored).
  • Arrow-nudge a create draft while the form is open → times stay moved.

Test plan

  • bun test:web focused Draft/MainGrid/shortcuts suites (53 pass)
  • bun run type-check:web-tests + web app tsc --noEmit
  • bun lint

Made with Cursor

tyler-dane and others added 2 commits July 23, 2026 21:16
Expose setLocalDraft on Week draft actions and remove the public
setters bag from DraftContext so callers no longer reach into local state.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tyler-dane
tyler-dane merged commit f0447fc into main Jul 24, 2026
19 checks passed
@tyler-dane
tyler-dane deleted the refactor/drop-draft-context-setters branch July 24, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant