Skip to content

421 collaborator management component refresh required#469

Open
cubap wants to merge 6 commits intomainfrom
421-collaborator-management-component-refresh-required
Open

421 collaborator management component refresh required#469
cubap wants to merge 6 commits intomainfrom
421-collaborator-management-component-refresh-required

Conversation

@cubap
Copy link
Member

@cubap cubap commented Feb 13, 2026

This pull request improves the handling of collaborator roles and user feedback in the project management UI. The main changes ensure that collaborator role updates are immediately reflected in the frontend state and UI, and that user actions trigger toast notifications for clearer feedback. Error handling has also been improved for better reliability.

Collaborator Role State Synchronization:

  • The Project class (api/Project.js) now updates its local collaborators state when members are removed, promoted, demoted, or have their roles changed, ensuring the frontend always reflects the most current roles. [1] [2] [3] [4] [5]

UI Updates and Feedback:

  • Added a refreshCollaborators method to the project-collaborators component, and integrated it into the roles-handler component so that collaborator list UI updates automatically after role changes, without needing a full page refresh. [1] [2]
  • Replaced alert dialogs with toast notifications for all collaborator role actions (add/remove/promote/demote/set to viewer), and improved error handling to display error toasts when actions fail. [1] [2]

cubap added 2 commits February 6, 2026 09:46
Update local collaborator cache and improve UI feedback for role/member changes.

- api/Project.js: keep this.collaborators in sync by deleting entries on member removal and updating roles after makeLeader, demoteLeader, setToViewer and setRoles calls so the client-side state reflects server changes.
- components/project-collaborators/index.js: add refreshCollaborators() to re-render the collaborators list when roles change.
- components/roles-handler/index.js: replace alert() calls with TPEN.eventDispatcher 'tpen-toast' notifications, add try/catch error handling, and call refreshCollaborators() after successful operations to update the UI.

These changes ensure consistent local state and provide non-blocking toast notifications instead of modal alerts.
@cubap cubap self-assigned this Feb 13, 2026
@cubap cubap linked an issue Feb 13, 2026 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Update RolesHandler to improve accessibility, robustness, and control flow for role management UI.

- Added aria-expanded and data-role-management-open attributes to manage button markup for accessibility.
- Removed unused userId/isOwnerOrLeader logic.
- Removed manageRoleButtons setup and consolidated toggle logic into toggleRoleManagementButtons with defensive checks (valid button, memberId, actions container, and collaborator existence).
- Use dataset flags and aria-expanded to track open/closed state and cleanly add/remove role management UI.
- Replaced dynamic actions map with an explicit switch-based handler to await async actions and directly handle the manage-roles button case.

These changes make the role management UI safer against missing DOM/Project state and clearer in behavior.
* major reorganization for better UX

* evening out styling

* cleanup and accessibility review

* Update index.js

* Update collaborators.html

* addressing Claude's suggestions

Send the correct roles payload from ManageRole (use this.group). Update RolesHandler to improve styling, accessibility, and behavior: switch hardcoded colors/shadows to CSS variables; register a cleanup callback to remove injected styles; add aria-labelledby to the modal; prevent duplicate injected manage buttons; track the trigger element and restore focus when the modal closes; set aria-pressed on toggles; disable the Save button and show a loading state while saving; replace alerts with toasts and improve error handling for ownership transfer. These changes fix a payload bug and enhance reliability and accessibility of the roles UI.

* Add custom roles UI and selection logic

Render a Custom Roles section in the manage modal and wire up toggle buttons for any non-default roles defined on the project. Adds CSS for custom-role toggles, shows the section only when custom roles exist, and toggles aria-pressed/active state on click. Collects active custom-role-toggle values into selected/current roles when saving and viewing, updates the viewer fallback logic to require absence of LEADER/CONTRIBUTOR, and includes custom roles in the originalSelection comparison. Also makes openManageModal async and tweaks manage-button styling to use CSS vars for background and hover color.
@cubap
Copy link
Member Author

cubap commented Feb 13, 2026

The UI allows me demote myself from being the LEADER, even when I am the last leader. The changes paginate. However, that is an illegal role change that is actually denied. I see my leader role still after I refresh the page. main behaves the same way.

So, maybe we try this again? I can remove the last "leader" legally and get back a 200.
image

I think this would work if we actually get an error back. I can confirm that the leader role pops back in when I refresh.

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.

Collaborator Management Component: Refresh Required

1 participant