-
Notifications
You must be signed in to change notification settings - Fork 3.7k
improvement(scheduled-tasks): render prompt chips in task details and align weekday picker #5159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8d74e35
improvement(scheduled-tasks): render prompt chips in task details and…
waleedlatif1 f56d9da
improvement(scheduled-tasks): extract shared CalendarDayCell for the …
waleedlatif1 67f9de3
fix(scheduled-tasks): remount task details on occurrence switch
waleedlatif1 94a2bb1
improvement(rich-md-editor): make read-only PromptEditor fully displa…
waleedlatif1 203e308
fix(scheduled-tasks): seed task contexts instead of clobbering auto-m…
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
apps/sim/components/emcn/components/calendar/calendar-day-cell.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| 'use client' | ||
|
|
||
| import { type ButtonHTMLAttributes, forwardRef, type ReactNode } from 'react' | ||
| import { chipVariants } from '@/components/emcn/components/chip/chip' | ||
| import { cn } from '@/lib/core/utils/cn' | ||
|
|
||
| export interface CalendarDayCellProps | ||
| extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> { | ||
| /** Strong `primary` fill — the selected calendar day or an active weekday toggle. */ | ||
| selected?: boolean | ||
| /** The `border` shadow-ring marking today. Ignored while `selected`. */ | ||
| today?: boolean | ||
| /** | ||
| * Fills the container width (the weekday-toggle row) instead of the fixed | ||
| * 30px square used by the calendar's month grid. | ||
| */ | ||
| fullWidth?: boolean | ||
| children: ReactNode | ||
| } | ||
|
|
||
| /** | ||
| * The single day pill shared by the {@link Calendar} month grid and any | ||
| * chip-aligned day toggle (e.g. the scheduled-task weekly "Repeat on" row). | ||
| * Built from `chipVariants` so the chrome — height, radius, centered glyph, | ||
| * `primary` selected fill, `border` today ring — lives in one place and the | ||
| * row of weekday toggles reads as a sibling of the date picker rather than a | ||
| * separate control. | ||
| * | ||
| * @example | ||
| * <CalendarDayCell selected={isSelected} today={isToday} onClick={pick}>{day}</CalendarDayCell> | ||
| * | ||
| * @example | ||
| * // Weekday toggle: fill the column, drive selection with `aria-pressed`. | ||
| * <CalendarDayCell selected={on} fullWidth aria-pressed={on} aria-label='Monday' onClick={toggle}>M</CalendarDayCell> | ||
| */ | ||
| export const CalendarDayCell = forwardRef<HTMLButtonElement, CalendarDayCellProps>( | ||
| function CalendarDayCell( | ||
| { selected = false, today = false, fullWidth = false, className, children, type, ...props }, | ||
| ref | ||
| ) { | ||
| return ( | ||
| <button | ||
| ref={ref} | ||
| type={type ?? 'button'} | ||
| className={cn( | ||
| chipVariants({ | ||
| variant: selected ? 'primary' : today ? 'border' : undefined, | ||
| flush: true, | ||
| }), | ||
| 'justify-center p-0', | ||
| fullWidth ? 'h-[30px] w-full' : 'size-[30px]', | ||
| !selected && 'text-[var(--text-body)]', | ||
| className | ||
| )} | ||
| {...props} | ||
| > | ||
| {children} | ||
| </button> | ||
| ) | ||
| } | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.