Skip to content
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

change: [M3-8442] - Remove Double border on "Billing & Payment History" table with dark theme. #11111

Conversation

hasyed-akamai
Copy link
Contributor

Description 📝

Border for "Billing & Payment History" table was not properly styled for Cloud Manager's dark theme, resulting in double border for the table.

Changes 🔄

  • based on the theme we have changed the border size.

Target release date 🗓️

Preview 📷

Before After
Before After

How to test 🧪

Prerequisites

  • Log into accounts which is having any "Billing & Payment History" table entry:

Reproduction steps

  • Landing:
    • Observe the border of "Billing & Payment History" table is reduced.

Verification steps

  • After changes, observe "Billing & Payment History" table border gets half.

As an Author I have considered 🤔

Check all that apply

  • 👀 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

@pmakode-akamai pmakode-akamai added the Design Tokens Laying the groundwork for Design Tokens label Oct 17, 2024
@hasyed-akamai hasyed-akamai marked this pull request as ready for review October 17, 2024 10:17
@hasyed-akamai hasyed-akamai requested a review from a team as a code owner October 17, 2024 10:17
@hasyed-akamai hasyed-akamai requested review from cpathipa, hkhalil-akamai, pmakode-akamai, a team, carrillo-erik and jaalah-akamai and removed request for a team October 17, 2024 10:17
? `1px solid ${theme.borderColors.divider}`
: 0,
})}
>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this solves the root problem, it just overrides it. I would undo this change and I'll point out what should change.

@jaalah-akamai
Copy link
Contributor

Since we're wrapping this entire section in a paper which has a border, we should be able to pass sx={{ border: 0 }} to this Table on L441.
https://github.com/linode/manager/blob/develop/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx#L441

The other issue on on L479 where that style is no longer relevant and can be removed.
https://github.com/linode/manager/blob/develop/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx#L479

Let me know if that fixes all the issues

Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

Agreed with Jaalah's feedback.

@hasyed-akamai
Copy link
Contributor Author

hasyed-akamai commented Oct 17, 2024

Since we're wrapping this entire section in a paper which has a border, we should be able to pass sx={{ border: 0 }} to this Table on L441. https://github.com/linode/manager/blob/develop/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx#L441

The other issue on on L479 where that style is no longer relevant and can be removed. https://github.com/linode/manager/blob/develop/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx#L479

Let me know if that fixes all the issues

Screenshot 2024-10-21 at 8 16 02 PM
I've implemented the changes as mentioned. however, I've encountered a new issue with an unexpected extra borderBottom that appears only in the dark theme.

06_08_13
I also attempted to add a style={{ border: 0 }} attribute to L524 to remove the extra borderBottom. However, this approach did not work effectively for multiple rows.

I feel like my current approach of adding borders based on the theme is functioning adequately, although it may not be the most appropriate long-term solution. I feel that customization for this component may be necessary. However, I am open to exploring other options and would appreciate any suggestions you might have.

@jaalah-akamai
Copy link
Contributor

jaalah-akamai commented Oct 22, 2024

I think you're on the right approach. The way I would think about this is: We're generating rows via a map. So we're able to determine the last table row. So one way would be to allow an sx prop to be applied to the row from which we can target all the cells that have a border bottom.

return orderedPaginatedData.map((thisItem, idx) => {
        const lastItem = idx === orderedPaginatedData.length - 1;
        return (
          <ActivityFeedItem
            sxRow={
              lastItem
                ? {
                    '& .MuiTableCell-root': {
                      borderBottom: 0,
                    },
                  }
                : {}
            }
            ... other props
          />
        );
      });
<TableRow data-testid={`${type}-${id}`} sx={sxRow}>

Hope that helps... otherwise submit some commits so I can give feedback

@hasyed-akamai
Copy link
Contributor Author

Screenshot 2024-10-23 at 12 59 28 PM

I've followed the steps you mentioned, and everything is working perfectly now! Thank you so much for your help!

Copy link

Coverage Report:
Base Coverage: 87.01%
Current Coverage: 87.01%

Copy link
Contributor

@carrillo-erik carrillo-erik left a comment

Choose a reason for hiding this comment

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

Verified that the most recent changes remove the double border in dark mode, do not cause any unexpected regressions, and resolves the issue rather than override old styles.

@hasyed-akamai hasyed-akamai added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Oct 25, 2024
@pmakode-akamai pmakode-akamai merged commit 6c6f700 into linode:develop Oct 28, 2024
23 checks passed
Copy link

cypress bot commented Oct 28, 2024

Cloud Manager E2E    Run #6739

Run Properties:  status check passed Passed #6739  •  git commit 6c6f700858: change: [M3-8442] - Remove Double border on "Billing & Payment History" table wi...
Project Cloud Manager E2E
Branch Review develop
Run status status check passed Passed #6739
Run duration 31m 43s
Commit git commit 6c6f700858: change: [M3-8442] - Remove Double border on "Billing & Payment History" table wi...
Committer hasyed-akamai
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 6
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 445
View all changes introduced in this branch ↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Design Tokens Laying the groundwork for Design Tokens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants