Skip to content

feat: [UIE-8731] - Roles Table and Users Table ui fix #12233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

mpolotsk-akamai
Copy link
Contributor

@mpolotsk-akamai mpolotsk-akamai commented May 16, 2025

Description 📝

Roles Table and Users Table UI fix

Changes 🔄

List any change(s) relevant to the reviewer.

  • fixed "Add a User" button styling issue on small screens in the Users table
  • centered the empty state message in the Roles table
  • added a "Roles" header to the Roles tab
  • fixed show/hide functionality in the Permissions section
  • UI adjustments in the Roles table (margins, padding, button positioning)

Target release date 🗓️

June 3rd

Preview 📷

Before After
Screenshot 2025-05-16 at 12 12 40 PM Screenshot 2025-05-16 at 12 13 41 PM
Screenshot 2025-05-16 at 12 16 13 PM Screenshot 2025-05-16 at 12 14 53 PM
Screenshot 2025-05-22 at 12 55 11 PM Screenshot 2025-05-22 at 12 55 01 PM
Screenshot 2025-05-22 at 12 55 55 PM Screenshot 2025-05-22 at 12 55 49 PM

How to test 🧪

Prerequisites

(How to setup test environment)

  • Ensure the Identity and Access Beta flag is enabled in dev tools
  • Use devenv and login as vagrant user or use mock data

Verification steps

(How to verify changes)

  1. Go to the Users tab

    • Confirm that the "Add a User" button displays correctly on small screens
  2. Go to the Roles tab

    • Ensure that the empty state message in the Roles table is centered
    • Ensure that a "Roles" header is visible at the top of the tab
  3. Go to the Permissions section

    • Verify that the show/hide functionality works correctly
    • Expand the firewall_creator role
    • Confirm that there are exactly two permissions listed
    • Ensure the "Expand" button is not shown in this case
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@mpolotsk-akamai mpolotsk-akamai force-pushed the UIE-8731-8757-styling-issues branch from 8b72506 to 531b6b2 Compare May 16, 2025 10:37
@mpolotsk-akamai mpolotsk-akamai self-assigned this May 16, 2025
@mpolotsk-akamai mpolotsk-akamai marked this pull request as ready for review May 16, 2025 10:52
@mpolotsk-akamai mpolotsk-akamai requested a review from a team as a code owner May 16, 2025 10:52
@mpolotsk-akamai mpolotsk-akamai requested review from mjac0bs, pmakode-akamai and cpathipa and removed request for a team May 16, 2025 10:52
Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Thanks @mpolotsk-akamai, changes looked good overall, but the unit test failure does seem related. Seems like maybe updating tests to mock the intersection observer is necessary? Will approve once that's addressed.

Here are a couple other things I noticed for consideration:

  • The tooltip icon for Permissions seems oddly placed. I would expect it to be on the same line as Permissions, to its right. Would you expect the same? This is an existing issue in dev, and maybe it already has an intended ticket for follow up.
  • A couple issue I noticed on small mobile screens:
    • The role name is illegible due to wrapping.
    • The Assign Role button extends beyond the table.
    • I am wondering about mobile view in general for this table. Did UX give any insight on columns that could be dropped/how the table could be condensed to be more mobile-friendly? (Description takes up a lot of space, but seems important, for ex.) That's a larger question, and I know not necessarily in scope for this PR.

Screenshot 2025-05-16 at 8 43 25 AM

Screen.Recording.2025-05-16.at.9.08.41.AM.mov

@mpolotsk-akamai
Copy link
Contributor Author

@mjac0bs ,
thank you for the review!

@cpathipa cpathipa requested a review from corya-akamai May 19, 2025 14:01
Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Thanks for addressing feedback!

@mjac0bs mjac0bs added the Add'tl Approval Needed Waiting on another approval! label May 19, 2025
Copy link
Contributor

@corya-akamai corya-akamai left a comment

Choose a reason for hiding this comment

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

Can we pull out the changes to useCalculateHiddenItems and handle those separately?

@github-project-automation github-project-automation bot moved this from Review to Changes Requested in Cloud Manager May 20, 2025

import type { PermissionType } from '@linode/api-v4';

/**
* Custom hook to calculate hidden items
*/
export const useCalculateHiddenItems = (
Copy link
Contributor

Choose a reason for hiding this comment

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

What was the issue with the previous implementation? A lot of time was spent to avoid unnecessary calculations, if we are reverting that, we need to document why that is necessary. There are no screenshots showing this change, and no unit tests to ensure we aren't breaking something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review, @corya-akamai !
The previous implementation had a few issues:

  1. The expand button in role rows was showing the total number of assigned permissions, not just the hidden ones.
  2. It was showing “+N” even when all items were already visible (e.g., only 3 permissions).
  3. The hidden permissions count only updated after expanding and collapsing. If there were no hidden items, the “Expand (+N)” button would disappear completely after collapsing again.

From my understanding, the core issue was that getBoundingClientRect() was called before the layout had fully settled. Combined with -webkit-line-clamp, which visually hides overflow content without actually laying it out, this led to inaccurate measurements, causing the logic to assume all items were hidden, even when they were visible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ve also added screenshots that show the issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mpolotsk-akamai awesome thanks!

@mpolotsk-akamai mpolotsk-akamai force-pushed the UIE-8731-8757-styling-issues branch from a2ec668 to 6e4d382 Compare May 22, 2025 10:52
@github-project-automation github-project-automation bot moved this from Changes Requested to Approved in Cloud Manager May 22, 2025
Copy link
Contributor

@corya-akamai corya-akamai left a comment

Choose a reason for hiding this comment

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

Can we pull that useCalculateHidden into another PR?

@github-project-automation github-project-automation bot moved this from Approved to Changes Requested in Cloud Manager May 22, 2025
@mpolotsk-akamai
Copy link
Contributor Author

After discussion with @corya-akamai and @aaleksee-akamai , I’ve removed the fix for the Expand/Hide functionality from this PR. That issue will be addressed separately in a dedicated PR.

@github-project-automation github-project-automation bot moved this from Changes Requested to Approved in Cloud Manager May 22, 2025
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 605 passing tests on test run #9 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing605 Passing4 Skipped119m 40s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

6 participants