Skip to content

Workspace buttons discloser switched to a Semantic UI menu #585

Open
hoyla wants to merge 8 commits intomainfrom
ljh-workspace-extra-buttons-as-menu
Open

Workspace buttons discloser switched to a Semantic UI menu #585
hoyla wants to merge 8 commits intomainfrom
ljh-workspace-extra-buttons-as-menu

Conversation

@hoyla
Copy link
Contributor

@hoyla hoyla commented Mar 4, 2026

I hope to add some more options for workspaces and I think having a stack of buttons displayed vertically will start to look strange if we keep adding more, so I've changed the discloser that shows more buttons ...

Picture 243

... to a regular dropdown menu, which will more suitably handle additions:

Picture 245

Permissions/context-based UX remains the same: don't show an option if you can never do something (like Take Ownership for non-admins); display but disable if you could do something if you owned the workspace (like Share/Rename).

  • Replace custom button/div dropdown with Semantic UI Dropdown component
  • Switch disclosure icon from expand-more chevron to hamburger (bars) icon
  • Add controlled open mode (isOpen/onClose) to ModalAction, ShareWorkspaceModal, and TakeOwnershipOfWorkspaceModal so modals can be triggered from menu items
  • Menu items use Semantic UI Dropdown.Item with icons matching the tree context menu
  • Take Ownership is hidden for non-admins; Share/Rename/Delete shown disabled for non-owners
  • The controlled/uncontrolled open state pattern was duplicated across ShareWorkspaceModal, TakeOwnershipOfWorkspaceModal, and ModalAction so, in anticipation of further menu options that will introduce additional modals (I have some in mind - see e.g. Allow users to leave a workspace that isn't public and isn't owned by that user #431 and Export workspace inventory #588 - we extracted it into a reusable useControlledOpen hook.

Tested locally and on playground with no noticeable ill effects

@hoyla hoyla self-assigned this Mar 4, 2026
@hoyla hoyla added workspaces ux/ui quick win Something small ... allegedly feature Departmental tracking: work on a new feature maintenance Departmental tracking: maintenance work, not a fix or a feature and removed feature Departmental tracking: work on a new feature labels Mar 4, 2026
@hoyla hoyla marked this pull request as ready for review March 4, 2026 10:06
@hoyla hoyla requested a review from a team as a code owner March 4, 2026 10:06
@hoyla hoyla marked this pull request as draft March 5, 2026 16:17
@hoyla
Copy link
Contributor Author

hoyla commented Mar 5, 2026

DRAFT: I refactored this while working on the json export #589 and need to merge those improvements in

@hoyla
Copy link
Contributor Author

hoyla commented Mar 7, 2026

Hold in draft until some other stuff is out of the way

hoyla added 6 commits March 10, 2026 20:25
…icon

- Replace custom button/div dropdown with Semantic UI Dropdown component
- Switch disclosure icon from expand-more chevron to hamburger (bars) icon
- Add controlled open mode (isOpen/onClose) to ModalAction, ShareWorkspaceModal,
  and TakeOwnershipOfWorkspaceModal so modals can be triggered from menu items
- Menu items use Semantic UI Dropdown.Item with icons matching the tree context menu
- Take Ownership is hidden for non-admins; Share/Rename/Delete shown disabled for non-owners
The ModalAction components are now used in controlled mode (isOpen/onClose)
so their children (trigger buttons) are never rendered. Remove the unused
imports and children content, converting to self-closing elements.
The controlled/uncontrolled open state pattern was duplicated across
ShareWorkspaceModal, TakeOwnershipOfWorkspaceModal, and ModalAction.
Extract it into a reusable useControlledOpen hook in anticipation of
further menu options that will introduce additional modals.
@hoyla hoyla force-pushed the ljh-workspace-extra-buttons-as-menu branch from a7533c2 to 0ef6a7b Compare March 10, 2026 21:08
Place the hook alongside ModalAction and other shared UI utilities rather
than in a separate hooks/ directory, keeping related code colocated.
@hoyla hoyla marked this pull request as ready for review March 11, 2026 09:01
@hoyla hoyla removed their assignment Mar 11, 2026
@philmcmahon philmcmahon requested a review from Copilot March 12, 2026 12:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Replaces the custom button-based dropdown for workspace actions with a Semantic UI Dropdown menu, and introduces a reusable useControlledOpen hook to support both controlled (parent-driven) and uncontrolled (internal state) modal open/close patterns.

Changes:

  • Replaced the custom expand-more button/div disclosure with a Semantic UI Dropdown component using a hamburger icon trigger
  • Added isOpen/onClose controlled-mode props to ModalAction, ShareWorkspaceModal, and TakeOwnershipOfWorkspaceModal, extracted into a shared useControlledOpen hook
  • Updated workspace header CSS to use flex-end and box-sizing: border-box

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
useControlledOpen.ts New reusable hook for controlled/uncontrolled open state
WorkspaceSummary.tsx Replaced custom dropdown with Semantic UI Dropdown; modals now triggered via menu items with controlled open state
ModalAction.tsx Added controlled open support via useControlledOpen
ShareWorkspaceModal.tsx Added controlled open support via useControlledOpen
TakeOwnershipOfWorkspaceModal.tsx Added controlled open support via useControlledOpen
_workspace.scss Minor layout fixes for workspace header

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

In controlled mode, setOpen(true) was writing to internalOpen which is
never read (open derives from props.isOpen). Remove the dead state write
so the controlled branch only delegates to onClose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature quick win Something small ... allegedly ux/ui workspaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants