Skip to content

feat(web): set goals in a popover above the composer - #1476

Merged
nixuuu merged 1 commit into
devfrom
feat/goal-setting-redesign
Nov 29, 2026
Merged

nixuuu merged 1 commit into
devfrom
feat/goal-setting-redesign

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 29, 2026

Copy link
Copy Markdown
Member

What changes

Setting a goal moves from a modal dialog to a popover on the composer's top edge, as wide as the composer. On phones it is a bottom sheet (the kit Popover with sheet). The thread stays in view while you write the goal. The same entry points open it: "Set a goal" in the composer's + menu and Set / Replace the goal… in the command palette.

Inside the popover:

  • Sentence editor. "Done when" leads into the objective, so the goal reads as a condition the agent can check. The placeholder is "describe the finished result".
  • Condition chips. tests pass, the build passes, lint is clean and types check add " and …" to the objective with one click. A chip leaves the row once the text contains it.
  • Token budget (Codex only). The number field becomes a segmented choice: No limit, 1M, 5M, 20M or Custom. Custom shows a number field.
  • Live summary. One sentence states when the harness stops working on the goal. The chosen budget is highlighted and swaps in place when it changes. This sentence replaces both earlier descriptions, under the title and under the budget field.
  • Replacing an open goal. A single "Replaces “…”" line replaces the info alert.
  • Keyboard and draft. Ctrl/Cmd+Enter submits. Escape or a click outside closes the popover and keeps the draft and the budget for the next opening. A stored goal clears them.

Code:

  • GoalDialog.svelte → GoalPopover.svelte. New GoalObjectiveEditor.svelte and GoalBudgetPicker.svelte.
  • Budget presets, condition helpers and budgetTokens live in goals.ts.
  • +page.svelte anchors the popover to [data-thread-composer-slot].
  • docs/ui-api.md: the features/goals description and its status line.

Copy audit (docs/copy.md §8)

# Item Result
1 One idea per sentence, length, active voice, sentence case, punctuation Pass. The summary is 14–22 words, within the 25-word limit for descriptions. Chip labels and the placeholder are lower case on purpose: they continue the "Done when" sentence.
2 Glossary Pass (goal, turn, token, budget). No banned synonyms and no new terms.
3 Buttons start with a verb Pass: Cancel, Set goal, Replace goal. Chips: see item 10.
4 Errors Pass. "Enter a whole number of tokens." states the fix without blame. Save failures keep the gateway's message in an alert.
5 Empty states Not applicable.
6 Repeated wording Fixed. The dialog description and the budget hint said the same thing; one live summary sentence replaces both.
7 External gaps Not applicable.
8 "Soul" sentences None.
9 Short, typical and long values Pass on desktop. Long objectives grow the editor (capped, then it scrolls), and a long replaced goal truncates on one line. Phone width not checked, see below.
10 No cue by icon alone Fixed. A chip's "+" was the only sign that it adds text. Chips now have the accessible name Add “tests pass” and so on.

Rewritten strings:

  • "Codex keeps starting turns on its own until the goal is met, blocked or out of budget." → "Codex keeps starting turns on its own until the goal is met, it is blocked or it has used 5M tokens." The budget part changes with the choice.
  • "Describe how the agent can check that the work is done." (hint) and "Goal" (label) → the "Done when" sentence lead and the placeholder "describe the finished result".
  • "Codex stops working on the goal once it has used this many tokens." (hint) → covered by the summary sentence.
  • Alert "This replaces the current goal: “…”" → "Replaces “…”".

Verification

Local:

  • apps/web typecheck (svelte-check, --fail-on-warnings): 0 errors and 0 warnings after rebasing on dev.
  • oxlint and oxfmt on the changed files.
  • Real app in Chromium at 1440 px, dark theme: a local gateway, worker and web stack with a Codex thread. Checked: "Set a goal" from the + menu, the popover anchored above the composer at its width, a chip, a budget preset and the summary.
  • A stand-in composer page, dark and light themes. Checked:
    • empty and filled states;
    • a Custom budget that is invalid and then corrected (message and aria-invalid clear);
    • a save error;
    • Claude replacing an open goal;
    • Escape keeping the draft and the budget, and a click outside closing the popover.
  • Three critique rounds in a separate context. Fixes from them: a placeholder that looked like filled text, a summary that said "no limit" while the custom budget was invalid, and chip spacing and alignment.

Not verified:

  • Phone bottom sheet (390 px). The browser session could not emulate a narrow viewport.
  • Opening from the command palette in a running app. That path sets the same state the + menu sets.
  • Saving a goal against a live harness: the preview worker had no provider credentials.

The rest is left to CI.

🤖 Generated with Claude Code

The goal dialog becomes a popover on the composer's top edge, as wide as
the composer (a bottom sheet on phones), so the thread stays in view.
The objective reads as the end of "Done when…", common checks join it
with one click, Codex budgets are presets or a custom number, and one
sentence says when the agent stops. Escape or a click outside keeps the
draft for the next opening.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nixuuu
nixuuu enabled auto-merge (squash) November 29, 2026 15:51
@nixuuu
nixuuu merged commit 8594860 into dev Nov 29, 2026
24 checks passed
@nixuuu
nixuuu deleted the feat/goal-setting-redesign branch November 29, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant