From 418f52bd3eef1680a0b42e98762d4a98a63b80bd Mon Sep 17 00:00:00 2001 From: Megan Schott Date: Fri, 3 Jul 2026 17:16:13 -0500 Subject: [PATCH] feat(web): Ask-Claude gets a free-text note + can add rides from the catalog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two upgrades to the /replan "Ask Claude" re-plan: - Free-text note box: type context before asking ("leaving by 5, skip water rides, add a couple headliners") — passed to Sonnet and weighted heavily. - Add rides: the prompt now includes the park's OTHER rides (not in the plan) with live waits, and Claude may propose ADDS (real catalog ride_ids only, validated server-side). Apply appends them via DDB's atomic list_append (no read-modify-write, no race), then sets the order (incl. added ids), then drops. The suggestion UI shows "+ Add: …". So Ask Claude can now re-sequence, drop, AND add — driven by the note. Tests: addRidesToSequence list_append shape + empty no-op. 52 web green. Co-Authored-By: Claude Opus 4.8 --- web/src/app/replan/AskClaude.tsx | 43 +++++++++++++++------ web/src/app/replan/actions.ts | 25 +++++++++++- web/src/lib/claude-replan.ts | 59 +++++++++++++++++++++++------ web/src/lib/dynamodb-writes.test.ts | 21 ++++++++++ web/src/lib/dynamodb-writes.ts | 31 +++++++++++++++ 5 files changed, 156 insertions(+), 23 deletions(-) diff --git a/web/src/app/replan/AskClaude.tsx b/web/src/app/replan/AskClaude.tsx index 8a72656..bb19ebb 100644 --- a/web/src/app/replan/AskClaude.tsx +++ b/web/src/app/replan/AskClaude.tsx @@ -25,26 +25,35 @@ export default function AskClaude({ }) { const [pending, start] = useTransition(); const [result, setResult] = useState(null); + const [note, setNote] = useState(""); const ask = () => { setResult(null); - start(async () => setResult(await askClaudeReplan(planId, trigger))); + start(async () => setResult(await askClaudeReplan(planId, trigger, note))); }; return (
-
-
-

Not sure what to do?

-

- Ask Claude for a take on the whole day. -

-
+
+

Not sure what to do?

+

+ Add anything Claude should know, then ask for a take on the day. +

+
+