Commit 1bc459d
feat(chef-b): Phase 2 — consolidated prompt, auto-expand textarea, one-tap suggestion chips (#391)
* feat(chef-b): consolidate prompt copy, auto-expand textarea, suggestion chips
Phase 2 of the Chef ₿ UX redesign.
Prompt copy
- Removed the three-line stack ("What's cooking? Tell me what
you're craving…" + "Pro Kitchen feature." + the textarea
label). Kept only the textarea label "What are you in the
mood for?".
- Folded the Phase 5 PRO KITCHEN badge in next to the H1 since
it was a 1-line change tied to the copy consolidation — small
orange-tint pill (bg-primary/10 text-primary border-primary/30)
that replaces the standalone sub-line.
Textarea auto-expand
- rows="2" baseline; `.auto-grow` adds min-height: 6.5rem (~2
rows + scan-pill gutter) and max-height: 14rem (~6 rows) with
overflow-y:auto past that.
- New `autoSizePrompt()` does `style.height = scrollHeight`
after a tick (so chip taps, scan auto-fill, and
ingredient add/remove all flow through the same path as user
typing).
- Reactive `$: promptInput, autoSizePrompt()` is the single
source of truth — `on:input` removed, manual calls in handlers
not needed.
- Scan pill still docked bottom-right inside the textarea.
Suggestion chips
- Six one-tap prompt seeds beneath the textarea: Cozy
vegetarian, 30-min dinner, Use what's in my fridge,
High-protein lunch, Kid-friendly, Pantry only.
- Tapping a chip replaces the textarea contents, focuses, and
parks the cursor at the end so the user can keep typing to
refine.
- Real `<button>` elements, tab-reachable, Enter/Space activates
natively, orange focus-visible ring.
- Built as a local `.suggestion-chip` pattern on this page; not
extracted to a shared Chip component per the brief — the
existing detected-ingredients chips are close but not identical
and we'll consolidate later if it earns its keep.
- Disabled while a generation is in flight.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(chef-b): chips fire generation directly (one-tap presets)
Tapping a suggestion chip now fires `/api/zappy` immediately with
the chip's label as the prompt — one tap, not two. The textarea
is left alone so chips and the custom input stay separate
affordances: one-tap presets vs. write-your-own.
- `generateRecipe(mode, promptOverride?)` now accepts an optional
prompt override so the same code path serves both Cook It (uses
promptInput) and chip firing (uses the chip label). Body sent
to the API is identical to a Cook It request.
- New `fireChip(text)` wraps the call in a try/finally that
toggles a `tappedChip` marker — visible to the template so the
active chip can render a small spinner inline next to its label
while the request is in flight.
- All chips + Cook It + Surprise Me are disabled while
`status === 'generating'`. The tapped chip keeps a higher
opacity than the others so it's clear which one fired.
- On error, the existing errorMessage flow surfaces it and the
tappedChip marker resets — chip returns to idle.
Removed the old `applyChip` (which filled the textarea + focused
it). The reactive `$: promptInput, autoSizePrompt()` still
handles auto-grow for the textarea — no longer needed for chips
since chips don't write to promptInput anymore.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* style(chef-b): expand chip presets + add Nourish program group
Regular chips
- Dropped "Use what's in my fridge" — the Scan pill in the
textarea now covers that flow directly.
- Moved "High-protein lunch" out of the regular row into the
Nourish group below (as "High protein").
- Added four popular + healthy presets: Mediterranean dinner,
One-pot meal, Sheet pan dinner, Hearty salad.
Nourish program group
- New section below the regular chips with a small leaf-prefix
label ("Nourish program") and three chips: High protein, Gut
health, Real food.
- Each chip carries a small green leaf next to its label so
users can see at a glance which prompts align with the Nourish
nutrition surface.
- Same one-tap fireChip behavior as the regular chips —
identical POST to /api/zappy with the chip's label as the
prompt. The leaf is a visual program tag, not a separate code
path. During firing the leaf is replaced inline by the
spinner so the loading state matches the regular chips.
The green is the existing Nourish brand color already used in
IntelligenceMenu for the same surface — not a new token.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* style(chef-b): intersperse Nourish chips into the main suggestion row
Dropped the dedicated "Nourish program" section and label. The
three Nourish-tagged chips (High protein, Gut health, Real food)
now sit in the single flex-wrap row alongside the regular
presets, each still carrying its green leaf glyph as a visual
tag. Order is intentionally interspersed (positions 2, 5, 8 in
the 11-chip row) so the row reads as a mixed bag of options
rather than a categorized taxonomy.
Data model collapsed to a single `Chip = { label, nourish? }`
array. Template iterates once; `chip.nourish` toggles the leaf
icon. The leaf is replaced inline by the loading spinner while
firing, identical to non-Nourish chips.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(chef-b): never ask clarifying questions on short prompts
The OpenAI system instruction left room for Chef ₿ to ask follow-
up questions when the user's prompt was a short theme like
"Real food" or "Gut health" (one of the new suggestion chips).
The chips are designed as one-tap presets — the user expects a
recipe to land, not a question they can't reply to (the endpoint
is single-turn and there's no chat UI).
Added a rule to SYSTEM_INSTRUCTION: always commit to a recipe,
treat short theme prompts (with the chip labels listed as
examples) as creative direction, make sensible assumptions, and
go straight to the recipe. No clarifying questions, no offers to
suggest options, no stalling.
If we later add a true chat / reply affordance, this guardrail
can be loosened.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: spe1020 <sethsager@Seths-MacBook-Air.local>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6164da1 commit 1bc459d
3 files changed
Lines changed: 182 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
41 | 106 | | |
42 | 107 | | |
43 | 108 | | |
| |||
115 | 180 | | |
116 | 181 | | |
117 | 182 | | |
118 | | - | |
119 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
120 | 190 | | |
121 | | - | |
122 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
123 | 194 | | |
124 | 195 | | |
125 | 196 | | |
126 | | - | |
| 197 | + | |
127 | 198 | | |
128 | 199 | | |
129 | 200 | | |
130 | 201 | | |
131 | 202 | | |
132 | | - | |
| 203 | + | |
133 | 204 | | |
134 | 205 | | |
135 | 206 | | |
| |||
383 | 454 | | |
384 | 455 | | |
385 | 456 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
395 | 469 | | |
396 | 470 | | |
397 | 471 | | |
| |||
427 | 501 | | |
428 | 502 | | |
429 | 503 | | |
| 504 | + | |
430 | 505 | | |
431 | 506 | | |
432 | | - | |
433 | | - | |
| 507 | + | |
| 508 | + | |
434 | 509 | | |
435 | 510 | | |
436 | 511 | | |
| |||
456 | 531 | | |
457 | 532 | | |
458 | 533 | | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
459 | 563 | | |
460 | 564 | | |
461 | 565 | | |
| |||
805 | 909 | | |
806 | 910 | | |
807 | 911 | | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
808 | 969 | | |
809 | 970 | | |
810 | 971 | | |
| |||
0 commit comments