Apply better UX to collaboration management#471
Conversation
Static Review CommentsBranch: SummaryThis PR is a significant UX improvement to the collaboration management interface. The core changes are:
Overall the architecture is heading in the right direction. The dialog-based approach is a nice upgrade from the old hidden-div modal. The local cache pattern avoids unnecessary round-trips. There are a few issues to address before merging.
Critical Issues 🔴Issue 1: Duplicate "Manage" buttons appended on every refreshFile: Problem:
This works once. But if Current Code: Array.from(groupMembersElement.children).forEach(child => {
const groupMembersActionsElement = child.querySelector(".actions")
for (const collaboratorId in collaborators) {
if (groupMembersActionsElement?.getAttribute("data-member-id") == collaboratorId) {
// ... always appends, never clears
groupMembersActionsElement.appendChild(memberHTML)
}
}
})Suggested Fix: Array.from(groupMembersElement.children).forEach(child => {
const groupMembersActionsElement = child.querySelector(".actions")
for (const collaboratorId in collaborators) {
if (groupMembersActionsElement?.getAttribute("data-member-id") == collaboratorId) {
// Clear any previously injected manage buttons
groupMembersActionsElement.querySelectorAll(".manage-button")
.forEach(btn => btn.closest("div")?.remove())
let memberHTML
if (userHasEditAccess) {
memberHTML = this.createMemberHTML(collaboratorId)
} else {
memberHTML = document.createElement("div")
memberHTML.innerHTML = "You do not have permission to edit member roles"
}
groupMembersActionsElement.appendChild(memberHTML)
}
}
})How to Verify:
Major Issues 🟠Issue 2: Injected
|
There was a problem hiding this comment.
Some issues found during manual testing.
-
I still have to refresh the component to see a user in the group after a successful invitation.
-
The page automatically refreshes after ownership is transferred, can we stop that one too?
-
When I do something wrong (such as try to remove the only OWNER or remove myself) I do not see the error message because the role picker covers the message. This is a regression from
main.
main
470-manage-roles-interactions-in-collaboration-management-is-icky
- I do not see custom roles in the roles picker when I am managing roles for a user. This is a regression from
mainwhere I do see those roles in the role picker.
main
470-manage-roles-interactions-in-collaboration-management-is-icky
- 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.
mainbehaves the same way.
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.
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.
d781693
into
421-collaborator-management-component-refresh-required
This pull request makes a minor adjustment to the
interfaces/manage-project/collaborators.htmlfile. The change removes unnecessary CSS properties from the#projectManagementBtnstyle, which likely improves the button's visibility and layout.position: absoluteanddisplay: nonefrom the#projectManagementBtnCSS rules incollaborators.html.