From 8d74e35082603d08129be097ef4c3abe9483f147 Mon Sep 17 00:00:00 2001 From: waleed Date: Sat, 20 Jun 2026 15:58:06 -0700 Subject: [PATCH 1/5] improvement(scheduled-tasks): render prompt chips in task details and 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. --- .../prompt-editor/prompt-editor.tsx | 66 ++++++++++------- .../task-details-modal/task-details-modal.tsx | 72 ++++++++++++++----- .../task-modal/recurrence-section.tsx | 28 ++++++-- 3 files changed, 116 insertions(+), 50 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.tsx index b2633d28841..73f749641ea 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.tsx @@ -27,6 +27,14 @@ export interface PromptEditorProps extends PromptEditorKeyPolicy { placeholder?: string /** Focuses the editor (caret at end) on mount. */ autoFocus?: boolean + /** + * Renders the editor as a non-editable display surface: the textarea becomes + * `readOnly` (so the chip overlay still paints `@`-mention / `/`-skill chips + * and the text stays selectable/copyable) and the caret-anchored resource and + * skill menus are not mounted. Use for read-only records — e.g. a finished + * scheduled task — where the prompt should render with chips but not be edited. + */ + readOnly?: boolean /** * Layout/sizing only — a height cap (`max-h-[200px]`) or fill (`flex-1`) * for the scroll container. The text chrome is owned by the editor. @@ -56,6 +64,7 @@ export function PromptEditor({ editor, placeholder, autoFocus = false, + readOnly = false, className, 'aria-label': ariaLabel, onSubmit, @@ -73,7 +82,7 @@ export function PromptEditor({ }, [value, textareaRef]) useEffect(() => { - if (autoFocus) editor.focusAtEnd() + if (autoFocus && !readOnly) editor.focusAtEnd() // eslint-disable-next-line react-hooks/exhaustive-deps -- mount-only focus }, []) @@ -167,13 +176,16 @@ export function PromptEditor({