feat(scheduled-tasks): replace the schedules table with calendar views#4979
feat(scheduled-tasks): replace the schedules table with calendar views#4979emir-karabeg wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@greptile run |
PR SummaryMedium Risk Overview Resource shell changes: emcn: Product copy renames Mothership/Copilot to Sim (agent) and Chat (surface) across landing, docs, settings, blocks, APIs, and constitution; minor label fixes (e.g. incident.io). Removes the Mod+E “clear notifications” global command from workspace permissions. Reviewed by Cursor Bugbot for commit cdb3ae4. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cdb3ae4. Configure here.
| if (onSubmit) onSubmit(draft) | ||
| else logger.info('Scheduled task draft captured (not persisted this phase)', draft) | ||
| close() | ||
| } |
There was a problem hiding this comment.
Modal form not reset on close
Medium Severity
Closing the create modal does not clear local prompt, launchDate, or launchTime. Reopening from the header keeps the same React key (none), so cancelled or submitted drafts reappear in the form.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit cdb3ae4. Configure here.
|
|
||
| const next = useCallback(() => setAnchor((current) => advanceAnchor(current, scope, 1)), [scope]) | ||
| const prev = useCallback(() => setAnchor((current) => advanceAnchor(current, scope, -1)), [scope]) | ||
| const goToday = useCallback(() => setAnchor(new Date()), []) |
There was a problem hiding this comment.
Today highlight uses stale date
Medium Severity
today is fixed at hook mount while goToday sets anchor to the current time. After midnight or a long session, Today navigation and isToday styling can disagree because the grid still compares days against the old today value.
Reviewed by Cursor Bugbot for commit cdb3ae4. Configure here.
Greptile SummaryThis PR replaces the scheduled-tasks table with a Google Calendar–style month/week/day calendar, fixes
Confidence Score: 5/5Safe to merge — no functional regressions found in the calendar logic, modal fix, or task management stub. The calendar grid derivation is pure and backed by 12 passing unit tests. The InsideModal / DropdownMenu modal-upgrade fix is narrowly scoped and correctly leaves page-level menus untouched. The today poll in useCalendar correctly addresses the midnight-rollover issue raised in the previous review round. The task modal's submit guard (prompt non-empty AND launch time in the future) is validated at both render time and click time. No data loss, no broken auth paths, and no regressions in the shared Resource shell or emcn primitives were identified. The empty-state regression in files.tsx (and knowledge/[id]/base.tsx) noted in the prior review round — blank table body on no-results filter — remains open; consumers of the simplified Resource.Table that relied on emptyMessage should wire their own empty state. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CalendarToolbar
participant ScheduleCalendar
participant useCalendar
participant TimeGrid/MonthGrid
participant TaskModal
participant useScheduledTasks
User->>CalendarToolbar: Click Today
CalendarToolbar->>ScheduleCalendar: handleToday()
ScheduleCalendar->>useCalendar: goToday() setAnchor(new Date())
ScheduleCalendar->>ScheduleCalendar: setScrollSignal(+1)
ScheduleCalendar->>TimeGrid/MonthGrid: Smooth scroll to current time
User->>TimeGrid/MonthGrid: Click hour slot
TimeGrid/MonthGrid->>ScheduleCalendar: onSelectSlot(date, 14:00)
ScheduleCalendar->>useCalendar: selectSlot(date, time)
useCalendar-->>TaskModal: "open=true, slot={date, time}"
User->>TaskModal: Type prompt, adjust date/time, click Schedule
TaskModal->>useScheduledTasks: onSubmit(draft) addTask(draft)
TaskModal->>useCalendar: closeCreate()
User->>TimeGrid/MonthGrid: Right-click event chip
TimeGrid/MonthGrid->>ScheduledTasks: onTaskContextMenu(task, e)
ScheduledTasks->>TaskContextMenu: Show context menu
User->>TaskContextMenu: Click Delete
TaskContextMenu->>ScheduledTasks: setIsConfirmDeleteOpen(true)
User->>ChipConfirmModal: Confirm
ChipConfirmModal->>useScheduledTasks: deleteTask(id)
Reviews (3): Last reviewed commit: "feat(emcn): view-only field primitives +..." | Re-trigger Greptile |
Greptile SummaryThis PR replaces the scheduled-tasks table with a three-scope calendar (month/week/day), adds a
Confidence Score: 4/5Safe to merge for the calendar UI and modal-dropdown fix; the The apps/sim/app/workspace/[workspaceId]/scheduled-tasks/hooks/use-calendar.ts (stale Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ScheduledTasks
participant useCalendar
participant ScheduleCalendar
participant CreateTaskModal
User->>ScheduledTasks: mount
ScheduledTasks->>useCalendar: "init (scope=week, anchor=now, today=now frozen)"
useCalendar-->>ScheduledTasks: state
ScheduledTasks->>ScheduleCalendar: render(scope, anchor, today)
User->>ScheduleCalendar: click time slot
ScheduleCalendar->>ScheduledTasks: onSelectSlot(date, time)
ScheduledTasks->>useCalendar: selectSlot(date, time)
useCalendar-->>ScheduledTasks: "selectedSlot set, isCreateOpen=true"
ScheduledTasks->>CreateTaskModal: "open=true, slot"
User->>CreateTaskModal: fill prompt, click Schedule
CreateTaskModal->>CreateTaskModal: logger.info stub, no persistence
CreateTaskModal-->>ScheduledTasks: onOpenChange(false)
ScheduledTasks->>useCalendar: closeCreate()
User->>ScheduleCalendar: click Today
ScheduleCalendar->>ScheduledTasks: onToday()
ScheduledTasks->>useCalendar: "goToday sets anchor=new Date()"
ScheduleCalendar->>ScheduleCalendar: scrollSignal++ scrollTo(timeToOffset(now))
|
|
@greptile run |
…dcrumbs - Resource.Table: remove internal sorting (defaultSort/sortValues) and the emptyMessage state — rows render in the order given, chrome always paints - Resource: root is now the positioning context for overlays; consumers (files, tables, knowledge, document) wrap detail views in <Resource> instead of hand-rolled divs - ResourceHeader: root titles no longer truncate during initial layout; LocationFocusVeil gates the portal on mount to fix a hydration mismatch - Toasts: drop the StackDismiss ring and stack countdown — each toast runs its own timer; remove the Mod+E clear-notifications command; align toast typography and icons with chip chrome - Breadcrumbs: use the canonical '…' placeholder while names load - incident.io: fix display name and catalog slug (with redirect) - Add dev:capped / dev:full:capped scripts with a 4GB heap cap
Add month/time calendar views for scheduled tasks with toolbar, event chips, and a create-task modal, backed by calendar-grid and schedule-events utils (with tests) and a use-calendar hook. Replace the old schedule-modal/context-menu flow. Rename the "Mothership" agent to "Sim" and the chat surface to "Chat" across landing copy, constitution, block metadata, API error messages, and copilot/data-drain internals. Drop unused workspace route layouts.
A non-modal DropdownMenu portals outside an open dialog's react-remove-scroll subtree, so its content cannot be wheel-scrolled (e.g. the time picker in the scheduled-task create modal). ModalContent now marks its subtree via an InsideModal context, and the emcn DropdownMenu root upgrades itself to modal inside dialogs so it mounts its own scroll lock and focus scope; page-level menus keep their consumer-chosen modality. Also stretch the create-task modal's date/time chip controls to full width and drop the dead EDGE_GUTTER constant left behind by the equal-tracks calendar layout.
…ck, smooth Today scroll - useCalendar: today was frozen at mount, so after midnight the isToday column highlight and the current-time indicator stayed on the previous day. today is now state refreshed by a sleep-resilient minute poll that only re-renders when the calendar day actually changes - CreateTaskModal: the stub submit closed silently, reading as false success; it now shows an info toast that the task was not created - ScheduleCalendar: Today presses scroll smoothly as an orientation cue; mount and scope switches keep instant positioning
- ChipCopyInput (canonical view-only copy field), ChipTimePicker, ChipModalField type='copy', ChipTextarea viewOnly; new border chip variant and shared chipPrimaryFillTokens - migrate ~40 consumers off disabled inputs and the deleted CopyableValueField; ChipConfirmModal description->text and secondaryActions[] API sweep - scheduled-tasks: rename create-task-modal to task-modal, add task-details-modal + task-context-menu, useScheduledTasks hook - home: extract prompt-editor (usePromptEditor) out of user-input
cd2d467 to
cb9fb71
Compare


Summary
cronExpression, so one-time persistence lands in a follow-up. The grid components already accepteventsByDay/eventsByHourprops so rendering real schedules as events only touches the container latercalendar-grid.ts,schedule-events.ts, 12 tests); view state lives in auseCalendarhook, components follow the one-folder-per-component convention with barrelsDropdownMenuinside dialogs: a non-modal menu portals outside the dialog'sreact-remove-scrollsubtree so its content can't be wheel-scrolled.ModalContentnow marks its subtree via anInsideModalcontext and the menu root upgrades itself to modal inside dialogs; page-level menus keep their consumer-chosen modality. (Depends on the singleton dedupe shipped in fix(deps): dedupe radix focus-scope/dismissable-layer so in-modal dropdowns open #4977)Resourceshell simplifications:Resource.Tabledrops internal sorting and empty-state handling, the root becomes the overlay positioning context, toasts run independent timers with chip-aligned typography, breadcrumbs use the canonical…loading placeholderType of Change
Testing
bunx vitest runon the scheduled-tasks utils — 12/12 passing (grid derivation, anchor advancement, labels, event bucketing)bunx tsc --noEmitclean; biome clean on all touched filesChecklist