Skip to content

feat(admin): custom plan dropdown in the users table - #31

Merged
devtofunmi merged 2 commits into
mainfrom
feat/admin-plan-dropdown
Sep 27, 2026
Merged

devtofunmi merged 2 commits into
mainfrom
feat/admin-plan-dropdown

Conversation

@devtofunmi

Copy link
Copy Markdown
Owner

Summary

Replaces the default browser dropdown for changing a workspace's plan in the admin users table with a custom dropdown that matches the app's dark UI.

What's new

  • Button: a pill with a dot (grey = free, amber = paid), the plan name and an arrow; shows a spinner and is disabled while saving
  • Menu: Free, Pro, Team and Business with each plan's price and run limit, and a check on the current plan
  • Never clipped: the menu floats above the page (rendered in a portal), so the table's scroll area can't cut it off; it opens upward near the bottom of the screen
  • Closes on outside click, Escape, Tab, scroll or resize
  • Keyboard and screen readers: arrow keys, Home/End, Enter or Space; announced as a list of options (listbox)

Saving is unchanged: picking a different plan calls /api/admin/set-plan and refreshes the table.

The admin users table used a native <select> to change a workspace's
plan, which looked out of place against the rest of the dark UI and
couldn't show any detail about each plan. PlanDropdown replaces it.

- Trigger: a compact pill with a status dot (grey for free, amber for
  paid), the plan name and a chevron. It shows a spinner and is
  disabled while a change is saving.
- Menu: lists Free, Pro, Team and Business with each plan's price and
  monthly run limit (taken from the plan catalog) and a check on the
  current plan, styled like the profile menu.
- The menu is rendered in a portal with fixed positioning. The users
  table scrolls inside an overflow container that would clip an
  absolutely positioned menu on the bottom rows. The menu opens below
  the trigger, flips above it near the viewport bottom, and is clamped
  inside the viewport horizontally.
- Closes on outside click, Escape, Tab, and on page scroll or resize so
  the fixed menu never drifts away from its trigger.
- Keyboard: ArrowUp/ArrowDown on the trigger open it; inside the menu
  arrows, Home and End move, and Enter or Space pick. Uses listbox and
  option roles with aria-activedescendant for screen readers.
- Picking the current plan again is a no-op; any other plan is passed
  to onChange.
Replace the native <select> in PlanSelect with PlanDropdown. The save
logic is unchanged: choosing a different plan posts to
/api/admin/set-plan, shows the busy state while it runs, and refreshes
the table on success.

The plan catalog imports move into the dropdown, which now owns the
list of plans.
@vercel

vercel Bot commented Sep 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
jargons-8yyz Ready Ready Preview Sep 27, 2026 12:01pm UTC

@devtofunmi
devtofunmi merged commit efff299 into main Sep 27, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8c57fdb0 Deployed Sep 27, 2026 by vercel[bot]
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