Skip to content

feat(sessions): keep full plan accessible after approval#2133

Merged
charlesvien merged 2 commits into
mainfrom
posthog-code/keep-plan-visible-after-approval
May 21, 2026
Merged

feat(sessions): keep full plan accessible after approval#2133
charlesvien merged 2 commits into
mainfrom
posthog-code/keep-plan-visible-after-approval

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented May 13, 2026

Summary

Once a plan was approved (or rejected), the full plan markdown was unmounted and only the "Plan approved — proceeding with implementation" line remained. This made it impossible to revisit the plan after the fact — a gap Cory flagged when teeing up parallel agents or a master agent to plan what's next.

The plan text itself is already carried on the tool call's rawInput.plan; the renderer was just hiding it. This PR adds a show plan / hide plan toggle next to the status line so the full plan stays one click away (collapsed by default to avoid dominating the turn view).

Changes

  • PlanApprovalView.tsx — after approval/rejection, render the status line with a caret + · show plan affordance. Click expands the existing <PlanContent> (full markdown, scrollable, fullscreen button) inline. Pre-approval behavior is unchanged.
  • SessionView.tsx — drive-by fix: the offline-prompt PR (fix(sessions): preserve prompt when sending while offline #1971) added a duplicate useConnectivity() call that broke typecheck on main. Removed the redundant declaration. Filed as its own commit on this branch.

Behavior

State Before After
Plan pending Full plan visible Full plan visible (unchanged)
Plan approved "Plan approved" line only "Plan approved · show plan" — click to expand
Plan rejected "(Plan rejected)" only "(Plan rejected) · show plan" — click to expand

Test plan

  • Approve a plan from a running session — verify the "show plan" toggle reveals the full plan markdown.
  • Reject a plan — verify the same toggle works.
  • Open the `PlanApproved` / `PlanCancelled` Storybook stories (`ToolCallBlock.stories.tsx`) — verify the toggle renders.
  • Confirm pre-approval rendering is unchanged.

Created with PostHog Code

@charlesvien charlesvien force-pushed the posthog-code/keep-plan-visible-after-approval branch from 7837f1b to e790cb1 Compare May 21, 2026 01:45
@charlesvien charlesvien marked this pull request as ready for review May 21, 2026 01:45
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/sessions/components/session-update/PlanApprovalView.tsx:51-58
The toggle row is a plain `div` (`Flex` renders as a `div`) with an `onClick` but no `role="button"`, `tabIndex`, or keyboard event handler. Keyboard-only users can't tab to it or activate it, and screen readers won't announce it as interactive.

```suggestion
          <Flex
            align="center"
            gap="2"
            className={`px-1 ${canTogglePlan ? "cursor-pointer select-none" : ""}`}
            role={canTogglePlan ? "button" : undefined}
            tabIndex={canTogglePlan ? 0 : undefined}
            onClick={
              canTogglePlan ? () => setIsPlanExpanded((v) => !v) : undefined
            }
            onKeyDown={
              canTogglePlan
                ? (e) => {
                    if (e.key === "Enter" || e.key === " ") {
                      e.preventDefault();
                      setIsPlanExpanded((v) => !v);
                    }
                  }
                : undefined
            }
          >
```

Reviews (1): Last reviewed commit: "feat(sessions): keep full plan accessibl..." | Re-trigger Greptile

Once a plan was approved or rejected, the full plan markdown was
unmounted and only the "Plan approved" line remained — making it
impossible to revisit the plan when handing work off to a parallel or
master agent. The plan text is still carried on `toolCall.rawInput.plan`;
add a `show plan` / `hide plan` toggle next to the status line so the
full plan stays accessible (collapsed by default to avoid dominating
the turn view).

Generated-By: PostHog Code
Task-Id: fa647642-8b10-4bf8-a05d-896f5e355489
@charlesvien charlesvien force-pushed the posthog-code/keep-plan-visible-after-approval branch from e790cb1 to ab8bdaf Compare May 21, 2026 02:11
@charlesvien charlesvien enabled auto-merge (squash) May 21, 2026 02:12
@charlesvien charlesvien merged commit d46f76b into main May 21, 2026
15 checks passed
@charlesvien charlesvien deleted the posthog-code/keep-plan-visible-after-approval branch May 21, 2026 02:28
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