improvement(scheduled-tasks): render prompt chips in task details and align weekday picker#5159
Conversation
… align weekday picker The read-only task-details modal dumped the stored prompt into a plain textarea, so a previously entered prompt showed raw `@Gmail` / `/skill` text instead of the chips the editor renders while composing. Reuse the home `PromptEditor` in a new read-only mode (textarea becomes `readOnly`, caret-anchored menus unmount, the chip overlay still paints) seeded with the task's prompt and contexts, so the record renders mention/skill chips identically to the create/edit modal. Also realign the weekly "Repeat on" day picker: instead of a stretched segmented bar with a faint `active` surface, render a seven-column grid of day cells that reuse the calendar's exact day-cell grammar (`primary` fill when on, bare `--text-body` when off) so it reads as a one-row sibling of the date picker.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Weekly Repeat on in the task recurrence UI switches from stretched Reviewed by Cursor Bugbot for commit 203e308. Configure here. |
…weekday picker Pull the calendar's day pill into one CalendarDayCell component (the single source of the day-pill chrome: primary fill when selected, the border ring on today, fixed 30px square or full-width). The calendar grid and the weekly "Repeat on" toggles now both render it, so the call sites are props-only (no re-derived chipVariants classes) and the two surfaces stay visually identical by construction.
The read-only details editor seeds its prompt + mention contexts on mount only. Selecting a different finished task while the modal stays open swapped the Status/run-time fields but left the editor on the first task's prompt. Key the content by the occurrence id so each task gets a fresh mount.
|
@greptile review |
|
@cursor review |
Greptile SummaryThis PR adds two polish items to the scheduled-tasks feature: a
Confidence Score: 5/5Safe to merge — both changes are additive and well-scoped, with no mutations to existing read/write editor paths or data persistence logic. The read-only flag is carefully gated at every relevant interaction point (autoFocus, handleSurfaceClick, onChange, onKeyDown, onPaste, onCut, onSelect, onMouseUp, and the two floating menus). The initialContexts seeding correctly seeds before the mount chipify pass to avoid clobbering auto-registered integration/skill contexts. The CalendarDayCell extraction is a pure refactor with no behavior change. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant TaskDetailsModal
participant TaskDetailsContent
participant usePromptEditor
participant useContextManagement
participant PromptEditor
User->>TaskDetailsModal: clicks finished/running task
TaskDetailsModal->>TaskDetailsContent: "mount (key=task.id)"
TaskDetailsContent->>usePromptEditor: "{ workspaceId, initialValue: task.prompt, initialContexts: task.contexts }"
usePromptEditor->>useContextManagement: "{ message, initialContexts }"
useContextManagement-->>usePromptEditor: selectedContexts (seeded with resource contexts)
Note over usePromptEditor: mount chipify effect merges integration @-mentions and /skills
usePromptEditor-->>TaskDetailsContent: editor instance
TaskDetailsContent->>PromptEditor: "editor={editor} readOnly"
Note over PromptEditor: textarea readOnly=true, handlers disabled, menus not mounted, chip overlay paints
PromptEditor-->>User: "renders chips for @mentions and /skills"
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant TaskDetailsModal
participant TaskDetailsContent
participant usePromptEditor
participant useContextManagement
participant PromptEditor
User->>TaskDetailsModal: clicks finished/running task
TaskDetailsModal->>TaskDetailsContent: "mount (key=task.id)"
TaskDetailsContent->>usePromptEditor: "{ workspaceId, initialValue: task.prompt, initialContexts: task.contexts }"
usePromptEditor->>useContextManagement: "{ message, initialContexts }"
useContextManagement-->>usePromptEditor: selectedContexts (seeded with resource contexts)
Note over usePromptEditor: mount chipify effect merges integration @-mentions and /skills
usePromptEditor-->>TaskDetailsContent: editor instance
TaskDetailsContent->>PromptEditor: "editor={editor} readOnly"
Note over PromptEditor: textarea readOnly=true, handlers disabled, menus not mounted, chip overlay paints
PromptEditor-->>User: "renders chips for @mentions and /skills"
Reviews (4): Last reviewed commit: "fix(scheduled-tasks): seed task contexts..." | Re-trigger Greptile |
…y-only Greptile P2: a padding click on the read-only editor still focused the non-editable textarea, which can read as editable. Gate the surface-click focus on `!readOnly`, and drop the blinking caret (`caret-transparent` + `cursor-default`) in read-only mode. Text stays selectable for copy.
|
Addressed the Greptile P2 ( |
|
@greptile review |
|
@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 94a2bb1. Configure here.
…entions Cursor (Medium): the mount-only `setContexts(task.contexts)` replaced the editor's context list AFTER the chipify pass had already registered the prompt's integration `@`-mentions and `/`-skills, so a task with any stored resource context lost its integration/skill chip overlay. Thread an `initialContexts` option through `usePromptEditor` (into the context manager's existing `initialContexts` seed) and seed the task's stored contexts there. The mount chipify pass then MERGES integration and skill contexts on top of the seed (deduped), so the overlay renders the full set — resources from the seed, integrations/skills from the text.
|
@greptile review |
|
@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 203e308. Configure here.
What
Two scheduled-tasks polish items:
1. Task details modal renders mention/skill chips
The read-only task details modal (shown for running/finished tasks) dumped the stored prompt into a plain
ChipModalField type='textarea', so a previously entered prompt showed raw@Gmail//deploy-workflowtext — even though the create/edit modal renders those as chips while composing.Fix: reuse the home
PromptEditorin a new read-only mode and seed it with the task'sprompt+contexts, exactly like the edit modal already does. The prompt now renders mention/skill chips when you reopen a task.readOnlyprop onPromptEditor: the textarea becomesreadOnly(text stays selectable/copyable), the caret-anchored resource/skill menus don't mount, and the chip overlay still paints. No new rendering path — same engine, display-only.TaskDetailsModalsplits out an innerTaskDetailsContentmounted only while a task is shown, so the editor's mention-data queries don't fire on page load (mirrorsTaskModalContent).@-mentions and/-skills chipify from the seeded text alone; resource chips (@file,@table) restore from the task's storedcontexts.2. Weekly "Repeat on" day picker alignment
The weekday selector was a stretched segmented bar with a faint
activesurface for selected days. Re-rendered it as a seven-column grid of day cells that reuse the calendar's exact day-cell grammar (primaryfill when on, bare--text-bodywhen off) so it reads as a one-row sibling of the date picker rather than a separate control.Testing
bunx tsc --noEmit— cleanbiome check— cleanbun run check:api-validation— passed