Add tablet and desktop plan manager (mocks 2c, 2d)
From 768 px up /plan renders the plan manager: "Week N · Plan" kicker, the week's dates, previous/next buttons and, on desktop, a "This week" pill; the sync status line; "Shopping list" and "Push to Calendar" unavailable with tooltips saying why (Features 17 and 16), and a working outlined "Rebuild week" that confirms over a plan pushed to Calendar; and a 7-column grid of day cards with washed photo, name, minutes, crock-pot start-by time, Regular / Side quest tag (Side quests on teal-200) and a swap icon that opens the existing swap sheet. Desktop adds the 290 px right panel: "Quest log · N | Regulars · N", the drag helper, rows with photo, name, difficulty and a 6-dot grip, and "Swipe more side quests". Tablet shows the Quest log as a chip strip under the grid. Dragging is presentational here; it lands in task 5c2842a8. The plan day now reads the photo and minutes the plan API already sends, and an optimistic swap carries them from the chosen dinner. Tag gains a neutral tone for "Regular". Maestro task 4657cba1-c709-420e-8b1e-18761e9e0e27. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,11 +13,12 @@ import type { PlanDay, Swap } from './api.ts'
|
||||
import { weekdayName } from './week.ts'
|
||||
import styles from './SwapSheet.module.css'
|
||||
|
||||
type Source = 'quest_log' | 'regulars'
|
||||
// Source is a list a dinner is swapped in from.
|
||||
export type Source = 'quest_log' | 'regulars'
|
||||
|
||||
const sourceNames: Record<Source, string> = { quest_log: 'Quest log', regulars: 'Regulars' }
|
||||
export const sourceNames: Record<Source, string> = { quest_log: 'Quest log', regulars: 'Regulars' }
|
||||
|
||||
const emptyLists: Record<Source, string> = {
|
||||
export const emptyLists: Record<Source, string> = {
|
||||
quest_log: 'Your Quest log is empty — swipe right on a Side quest to add one.',
|
||||
regulars: 'You have no Regulars yet.',
|
||||
}
|
||||
@@ -86,7 +87,12 @@ export function SwapSheet({ day, planned, onSwap, onClose }: SwapSheetProps) {
|
||||
onClick={
|
||||
already
|
||||
? undefined
|
||||
: () => onSwap({ date: day.date, dinner: { id: dinner.id, name: dinner.name }, fromQuestLog: source === 'quest_log' })
|
||||
: () =>
|
||||
onSwap({
|
||||
date: day.date,
|
||||
dinner: { id: dinner.id, name: dinner.name, photo_id: dinner.photo_id, minutes: dinner.minutes_total },
|
||||
fromQuestLog: source === 'quest_log',
|
||||
})
|
||||
}
|
||||
trailing={already && <Tag>Already this week</Tag>}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user