Skip to content

Remove "Stop All" button from command center toolbar#2460

Merged
k11kirky merged 4 commits into
mainfrom
posthog-code/remove-stop-all-command-center
Jun 3, 2026
Merged

Remove "Stop All" button from command center toolbar#2460
k11kirky merged 4 commits into
mainfrom
posthog-code/remove-stop-all-command-center

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

@k11kirky k11kirky commented Jun 2, 2026

Problem

Two pieces of Command Center feedback from the thread:

  1. The toolbar had a "Stop All" button that cancels every running/waiting agent at once — an easy-to-hit, broad action whose value was questioned.
  2. After trimming the grid down to a couple of tasks, opening a task full-screen and coming back re-filled all the empty cells with recent tasks, so the curated layout was lost every time.

Changes

Remove "Stop All"

  • Removed the button from CommandCenterToolbar, plus the now-unused stopAll handler, hasActiveAgents check, cells prop, and the getSessionService / Stop icon / CommandCenterCellData imports.
  • CommandCenterView no longer passes cells to the toolbar.

Stop autofill from clobbering a curated grid

  • Autofill re-ran on every mount (its guard was a per-mount useRef), so navigating away and back re-topped-up empty cells. It's now a one-time bootstrap gated on a persisted hasAutofilled flag.
  • The flag is set once autofill populates the grid, when the grid is already full, or when the user manually assigns a task — so a curated layout (including deliberately empty cells) survives navigation.
  • The flag stays unset when there are no eligible tasks yet, so autofill can still bootstrap the grid once recent tasks exist.
  • The existing "top up empty slots on first open" behaviour is preserved.

How did you test this?

  • vitest run on commandCenterStore.test.ts and useAutofillCommandCenter.test.ts — 26 tests pass, including new cases: autofill no longer tops up once hasAutofilled is set, the flag is set on fill / full grid / manual assign, and it stays unset when there are no candidates.
  • tsc -p tsconfig.web.json reports no errors in the command-center files; biome check is clean.

Automatic notifications

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

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: 9b8fb3a5-83c9-4ca0-9a49-274c18e45792
@k11kirky k11kirky marked this pull request as ready for review June 2, 2026 11:01
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 2, 2026

Reviews (1): Last reviewed commit: "Remove "Stop All" button from command ce..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@sakce sakce left a comment

Choose a reason for hiding this comment

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

oh yeah

k11kirky added 3 commits June 2, 2026 12:06
Autofill re-ran on every mount (its guard was a per-mount ref), so opening
a task full-screen and returning to the Command Center re-topped-up the
empty cells the user had deliberately left, wiping their trimmed layout.

Make autofill a one-time bootstrap gated on a persisted `hasAutofilled`
flag instead. The flag is set once autofill populates the grid, when the
grid is already full, or when the user manually assigns a task — so a
curated layout (including deliberately empty cells) survives navigation.
The flag stays unset when there are no eligible tasks yet, so autofill can
still bootstrap the grid once recent tasks exist.

Generated-By: PostHog Code
Task-Id: 9b8fb3a5-83c9-4ca0-9a49-274c18e45792
Simplification pass: the "grid already full" case is now handled inside
`autofillCells` (it sets `hasAutofilled` when every cell is already
populated), so the separate `markAutofilled` action, the hook's
`emptySlots === 0` special branch, and the redundant `candidates.length
=== 0` guard all go away. The hook now just computes candidates and hands
them to `autofillCells`, which owns all of the bootstrap-recording logic.

No behavior change — full grid still records the bootstrap, a partial grid
with no eligible tasks still leaves the flag unset for a later retry.

Generated-By: PostHog Code
Task-Id: 9b8fb3a5-83c9-4ca0-9a49-274c18e45792
Generated-By: PostHog Code
Task-Id: 9b8fb3a5-83c9-4ca0-9a49-274c18e45792
@k11kirky k11kirky merged commit 843e0c4 into main Jun 3, 2026
18 checks passed
@k11kirky k11kirky deleted the posthog-code/remove-stop-all-command-center branch June 3, 2026 09:25
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