Skip to content

feat(code): condense plan approval options#3066

Merged
adboio merged 1 commit into
mainfrom
07-01-feat_code_condense_plan_approval_options
Jul 2, 2026
Merged

feat(code): condense plan approval options#3066
adboio merged 1 commit into
mainfrom
07-01-feat_code_condense_plan_approval_options

Conversation

@adboio

@adboio adboio commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Problem

plan approval options are getting 🥜

Screenshot 2026-07-01 at 3.08.03 PM.png

Changes

made them nice and condensed - two buttons:

  1. yes, with mode dropdown
  2. no, with feedback line

Screenshot 2026-07-01 at 3.09.50 PM.png

user's last plan approval mode is stored and used as the default, falling back to "auto"

How did you test this?

manually, storybook

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

adboio commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 7bdef00.

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(code): condense plan approval optio..." | Re-trigger Greptile

Comment on lines +59 to +82
it("defaults to auto when there is no prior or remembered mode", async () => {
const user = userEvent.setup();
const { onSelect } = renderSelector([
AUTO,
ACCEPT_EDITS,
DEFAULT_MODE,
REJECT,
]);

await user.click(screen.getByText("Approve and proceed"));

expect(onSelect).toHaveBeenCalledTimes(1);
expect(onSelect).toHaveBeenCalledWith("auto");
});

it("defaults to the remembered last choice over the auto fallback", async () => {
const user = userEvent.setup();
useSettingsStore.setState({ lastPlanApprovalMode: "acceptEdits" });
const { onSelect } = renderSelector([AUTO, ACCEPT_EDITS, DEFAULT_MODE]);

await user.click(screen.getByText("Approve and proceed"));

expect(onSelect).toHaveBeenCalledWith("acceptEdits");
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tests 1 and 2 exercise the same behaviour (initial mode pre-selection on approve) with different inputs; the team prefers parameterised tests. A single it.each table would express both cases more concisely and make it easy to add future combinations (e.g., a remembered mode that is no longer in the options list).

Suggested change
it("defaults to auto when there is no prior or remembered mode", async () => {
const user = userEvent.setup();
const { onSelect } = renderSelector([
AUTO,
ACCEPT_EDITS,
DEFAULT_MODE,
REJECT,
]);
await user.click(screen.getByText("Approve and proceed"));
expect(onSelect).toHaveBeenCalledTimes(1);
expect(onSelect).toHaveBeenCalledWith("auto");
});
it("defaults to the remembered last choice over the auto fallback", async () => {
const user = userEvent.setup();
useSettingsStore.setState({ lastPlanApprovalMode: "acceptEdits" });
const { onSelect } = renderSelector([AUTO, ACCEPT_EDITS, DEFAULT_MODE]);
await user.click(screen.getByText("Approve and proceed"));
expect(onSelect).toHaveBeenCalledWith("acceptEdits");
});
it.each([
{
label: "no prior or remembered mode",
lastMode: null as null,
options: [AUTO, ACCEPT_EDITS, DEFAULT_MODE, REJECT],
expected: "auto",
},
{
label: "remembered last choice over the auto fallback",
lastMode: "acceptEdits" as const,
options: [AUTO, ACCEPT_EDITS, DEFAULT_MODE],
expected: "acceptEdits",
},
])("defaults to $expected when $label", async ({ lastMode, options, expected }) => {
const user = userEvent.setup();
useSettingsStore.setState({ lastPlanApprovalMode: lastMode });
const { onSelect } = renderSelector(options);
await user.click(screen.getByText("Approve and proceed"));
expect(onSelect).toHaveBeenCalledTimes(1);
expect(onSelect).toHaveBeenCalledWith(expected);
});

Context Used: Do not attempt to comment on incorrect alphabetica... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +192 to +202
if (!selectedMode) {
return (
<ActionSelector
title="Implementation Plan"
question="Approve this plan to proceed?"
options={toSelectorOptions(options)}
onSelect={onSelect}
onCancel={onCancel}
/>
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicate string literals in fallback path

The strings "Implementation Plan" and "Approve this plan to proceed?" appear verbatim in both the degenerate-case ActionSelector fallback (lines 194–196) and the main render path (lines 248–254). Extracting them to constants at the top of the function would satisfy OnceAndOnlyOnce and prevent the two copies from drifting.

Context Used: Do not attempt to comment on incorrect alphabetica... (source)

@adboio adboio marked this pull request as ready for review July 1, 2026 19:11
@adboio adboio requested a review from a team July 1, 2026 19:11
Generated-By: PostHog Code
Task-Id: 787ae949-1b72-4246-afc9-d30ebe3c96a3
@adboio adboio force-pushed the 07-01-feat_code_condense_plan_approval_options branch from 5c2de91 to 7bdef00 Compare July 1, 2026 19:26
@adboio adboio merged commit 9725323 into main Jul 2, 2026
24 checks passed
@adboio adboio deleted the 07-01-feat_code_condense_plan_approval_options branch July 2, 2026 12:02
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.

2 participants