improvement(scheduled-tasks): move recurrence into modal body as a section#5054
Conversation
|
@greptile run |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Behavior fix: Turning Recurring off sets Prompt editor shared mirror/textarea classes switch from chip
Reviewed by Cursor Bugbot for commit 9964a5b. Configure here. |
Greptile SummaryThis PR refactors the scheduled-task modal's recurrence UI from a horizontal chip row in the footer to a vertical
Confidence Score: 5/5Safe to merge — the toggle logic is correct, previously reported bugs are fixed, and all changed CSS variables are defined. The recurrence toggle correctly caches and restores the last non-once cadence via a render-time ref write that is idempotent. handleFrequencyChange now clears cron: undefined on all non-custom branches, closing the stale-cron restore path. --text-subtle is defined in globals.css for both light and dark themes. The ChipModalSeparator export and loading.tsx import fix are mechanical and low-risk. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[TaskModal opens] --> B[ChipModalHeader]
B --> C[ChipModalPromptBody\nPromptEditor]
C --> D[RecurrenceSection]
D --> E{isRecurring?}
E -- No/once --> F[Switch OFF - preserves weekdays, end, cron]
E -- Yes --> G[Switch ON - restore lastRecurringFrequency ref]
G --> H[ChipModalField: Frequency]
G --> I[ChipModalField: Ends]
I -- on --> J[ChipModalField: End date]
I -- after --> K[ChipModalField: Number of runs]
D --> L[ChipModalFooter - date, time, Save, Delete]
Reviews (5): Last reviewed commit: "improvement(scheduled-tasks): compose ca..." | Re-trigger Greptile |
Greptile SummaryThis PR moves the recurrence controls from a chip-row in the modal footer into a dedicated
Confidence Score: 4/5Safe to merge; the custom-cron fix is correct and the UI restructure is clean. The one behaviour worth discussing before shipping is whether toggling the switch off then back on should restore a previously chosen weekly or monthly cadence, or intentionally default to daily. The custom-cron round-trip preservation works correctly. The only notable gap is that handleRecurringToggle unconditionally resets to daily for non-custom frequencies when the switch is turned back on, so a user who configured Weekly on Mon and toggled it off would get Daily instead of their original cadence restored. recurrence-section.tsx — specifically the toggle-ON branch of handleRecurringToggle and whether weekdays/frequency should be inferred from the preserved off-state shape for standard schedules. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User opens TaskModal] --> B[ChipModalHeader]
B --> C[ChipModalPromptBody\nPromptEditor]
C --> D[RecurrenceSection]
D --> E{isRecurring?}
E -- No --> F[Switch OFF\nfrequency: once\nshape preserved]
E -- Yes --> G[Switch ON\nFrequency ChipModalField]
G --> H[Ends ChipModalField]
H --> I{end.type?}
I -- on --> J[End date ChipDatePicker]
I -- after --> K[Number of runs input]
I -- never --> L[No sub-row]
D --> M[ChipModalFooter\nDate · Time · Delete?]
F -- toggle on --> N{recurrence.cron?}
N -- yes --> O[frequency: custom\nweekdays: empty]
N -- no --> P[frequency: daily\nweekdays: empty]
Reviews (2): Last reviewed commit: "improvement(scheduled-tasks): move recur..." | Re-trigger Greptile |
|
@greptile run |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9964a5b. Configure here.
…ction Replace the footer RecurrenceControl (a row of chip dropdowns) with a RecurrenceSection rendered between the prompt body and footer: a "Recurring" Switch toggles one-time vs repeat, and — once on — frequency and end (never, on a date, after N runs) are labeled ChipModalField rows aligned to the modal header/footer gutter. Toggling Recurring off now preserves the recurrence shape (cadence, end, and a passed-through custom cron) and only sets frequency: 'once', so toggling back on restores a conversationally-authored custom schedule instead of silently rewriting it to daily. Also restore the prompt editor's native scale (text-[15px], -0.015em tracking) so the editor reads the same in the chat input and the task modal body.
… from custom The Recurring toggle restores `frequency: 'custom'` when `recurrence.cron` is truthy, but switching the frequency dropdown away from custom kept the stale cron on the object — so editing a custom-cron task to Daily, then toggling Recurring off and back on, snapped it back to Custom and persisted the old cron. Clear `cron` in the non-custom frequency branches so it is present only while the cadence is genuinely custom (matching the type's "custom only" invariant), making the toggle's restore signal accurate. Also document the unreachable `once` branch in frequencyOptionFor as a type-exhaustiveness fallback (keeps the return type without a cast).
…rrence Toggling Recurring off collapsed frequency to 'once' but toggling back on forced 'daily' and cleared weekdays, so pausing a weekly/weekdays/monthly task and re-enabling it silently reset it to daily. Cache the last recurring cadence in a ref (written during render) and reinstate it on toggle-on, so a paused "Weekly on Mon" returns as weekly. This also subsumes the custom-cron restore — the ref remembers 'custom' across the one-time interval — so the toggle no longer special-cases cron.
… imports Replace the recurrence section's hand-rolled `h-px bg-[var(--border)]` divider with the canonical ChipModalSeparator (now exported from the chip-modal barrel) so the modal's hairline has a single source of truth. Also unify loading.tsx icon imports onto the @/components/emcn barrel.
9964a5b to
cf57926
Compare
|
Rebased onto @cursor review |
Summary
RecurrenceControl(a row of chip dropdowns) with aRecurrenceSectionrendered between the prompt body and footer — a "Recurring"Switchtoggles one-time vs. repeat, and once on, frequency and end (never / on a date / after N runs) are labeledChipModalFieldrows aligned to the modal header/footer gutter.customcron) and only setsfrequency: 'once', so toggling back on restores a conversationally-authoredcustomschedule rather than silently rewriting it todaily— honoring the documentedcustomround-trip invariant.text-[15px],-0.015emtracking) so the editor reads the same in the chat input and the task modal body.Type of Change
Testing
recurrenceunit suite passes (17 tests).tscclean for the changed files;biome checkclean (lint-staged ran on commit).Checklist