421 collaborator management component refresh required#469
Open
421 collaborator management component refresh required#469
Conversation
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.
Contributor
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.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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:
Projectclass (api/Project.js) now updates its localcollaboratorsstate 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:
refreshCollaboratorsmethod to theproject-collaboratorscomponent, and integrated it into theroles-handlercomponent so that collaborator list UI updates automatically after role changes, without needing a full page refresh. [1] [2]