feat(when): Someday chip in the When picker — files into the someday pile
Some checks failed
Build & Release APK / check (push) Has been cancelled
Build & Release APK / build (push) Has been cancelled

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01THT7qz2Nt5ibWULZ4nvfTa
This commit is contained in:
marcuspaico
2026-09-02 18:34:24 +10:00
parent eec9a431df
commit 1ff78418ec
2 changed files with 30 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
// Interactive date field: quick chips (Today / Tomorrow / Next week) plus an // Interactive date field: quick chips (Today / Tomorrow / Next week, plus an
// expandable month calendar. Pure RN views — identical on Android, iOS, web. // optional Someday) and an expandable month calendar. Pure RN views —
// identical on Android, iOS, web.
import { useMemo, useState } from "react"; import { useMemo, useState } from "react";
import { Pressable, StyleSheet, Text, View } from "react-native"; import { Pressable, StyleSheet, Text, View } from "react-native";
import { haptic } from "../lib/haptics"; import { haptic } from "../lib/haptics";
@@ -100,11 +101,14 @@ export default function DateField({
value, value,
onChange, onChange,
clearable, clearable,
someday,
}: { }: {
label?: string; label?: string;
value: string | null; value: string | null;
onChange: (v: string | null) => void; onChange: (v: string | null) => void;
clearable?: boolean; clearable?: boolean;
/** Offers a dateless "Someday" chip — the pile, not a day on the calendar. */
someday?: { active: boolean; onPress: () => void };
}) { }) {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const today = new Date(); const today = new Date();
@@ -134,6 +138,16 @@ export default function DateField({
}} }}
/> />
))} ))}
{someday && (
<OptionChip
label="Someday"
active={someday.active}
onPress={() => {
haptic.select();
someday.onPress();
}}
/>
)}
<OptionChip <OptionChip
label={value && !quick.some((q) => q.v === value) ? friendlyDate(value) : "Pick a date…"} label={value && !quick.some((q) => q.v === value) ? friendlyDate(value) : "Pick a date…"}
active={open} active={open}

View File

@@ -81,7 +81,20 @@ export default function TaskForm({
icon: "today", icon: "today",
placeholder: "When", placeholder: "When",
value: d.due_date ? friendlyDate(d.due_date) : null, value: d.due_date ? friendlyDate(d.due_date) : null,
panel: <DateField value={d.due_date} onChange={(due_date) => onChange({ due_date })} clearable />, panel: (
<DateField
value={d.due_date}
onChange={(due_date) => onChange({ due_date })}
clearable
someday={{
active: d.status === "someday",
onPress: () =>
d.status === "someday"
? onChange({ status: "next" })
: onChange({ status: "someday", due_date: null }),
}}
/>
),
onClear: () => onChange({ due_date: null }), onClear: () => onChange({ due_date: null }),
}, },
{ {