Skip to content

Open the status menu from the plan's status badge#146

Merged
HamptonMakes merged 2 commits into
mainfrom
hampton/status-badge-menu
Jul 17, 2026
Merged

Open the status menu from the plan's status badge#146
HamptonMakes merged 2 commits into
mainfrom
hampton/status-badge-menu

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

Why

With folders shipped, the "Move to…" button on the plan page read like a folder mover — but it changed the plan's status. Feedback from Hampton: the status badge itself should be the thing you click to change status.

What

  • Clicking the status badge in the plan header now opens the status menu (same statuses, hints, and publish-confirmation as before). The badge gets a caret, pointer cursor, role="button", and tabindex — but only for viewers allowed to change status; for everyone else it stays a plain label.
  • The old "Move to…" button is removed from the actions row.
  • Removes the now-unused generic dropdown_controller.js.

How it respects the broadcast constraint

The badge lives inside the broadcast-replaced #plan-header, which renders requestless (no current_user), so the policy-gated menu — with its button_to CSRF forms — must stay outside that region. The new coplan--status-menu Stimulus controller spans both: the badge ships in everyone's broadcast HTML as a plain span, and badgeTargetConnected decorates it as interactive only when the scope also contains a menu. Broadcast replacements re-trigger the decoration automatically.

Screenshot

Clicking the DEVELOPING ▾ badge:

(screenshot verified locally — badge opens the menu anchored directly beneath it)

Testing

  • Updated human_editing_spec: status change now driven by clicking the badge (role='button' selector also asserts the JS decoration ran); non-author spec asserts no menu and no interactive badge.
  • Full suite: 1130 examples, 0 failures.

🤖 Generated with Claude Code

HamptonMakes and others added 2 commits July 16, 2026 15:04
"Move to…" read like a folder mover now that folders exist. The status
badge in the plan header is the natural affordance: clicking it opens
the same policy-gated status menu.

The badge lives inside the broadcast-replaced #plan-header (rendered
requestless, no current_user), so the menu still renders outside it.
A new coplan--status-menu Stimulus controller spans both regions and
only decorates the badge as interactive when a menu is present for the
viewer. Removes the now-unused generic dropdown controller.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HamptonMakes
HamptonMakes merged commit 9aa76fe into main Jul 17, 2026
4 checks passed
@HamptonMakes
HamptonMakes deleted the hampton/status-badge-menu branch July 17, 2026 21:00
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