Skip to content

Purchase management: Correct DataViews table CSS #102711

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

Conversation

JessBoctor
Copy link
Contributor

@JessBoctor JessBoctor commented Apr 21, 2025

Related to #

Proposed Changes

  • Correct the CSS for the DataViews table to get it as close to the current Active Upgrades layout as possible.

Production

Screenshot 2025-05-19 at 12 06 56 PM

DataViews PR

Screenshot 2025-05-19 at 12 06 00 PM

One specific change to note, since DataViews renders the fields in a true table format, we can no longer rely on flex to push the "status" column to the right and reduce its width. So when there are extremely long site titles or URLs, this PR has changed the CSS to hide the overflow. The other option is to break the string and wrap it on a new line.

Production: Shifts the "columns" to handle the longer string
Screenshot 2025-05-19 at 12 19 10 PM

DataViews PR: Hides the overflow
Screenshot 2025-05-19 at 12 09 55 PM

Another issue to highlight is that DataViews doesn't currently allow the column elements to wrap or stack in smaller screens. Our current production option allows the different PurchasesItem components to wrap in together. DataViews maintains the table view which can be scrolled left or right for the whole view.

Why are these changes being made?

  • As part of converting the Active upgrades list from the PurchasesSites component to DataViews, we have to account for styling changes now that the different payment elements are being rendered in a table format.

Testing Instructions

  • Apply this PR to your dev environment and start up Calypso
  • Make sure to set purchases/purchase-list-dataview to "true" in development.json
  • Go to me/purchases
  • View the DataViews table and notice that styling is similar to when you visit https://wordpress.com/me/purchases

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@JessBoctor JessBoctor force-pushed the gh86616/add/purchases-list-in-dataviews-css branch from 6ffed8e to 1c3588f Compare April 22, 2025 15:40
@JessBoctor JessBoctor force-pushed the gh86616/add/purchases-list-in-dataviews-css branch from d35b7bf to 8977b93 Compare April 25, 2025 18:06
@JessBoctor
Copy link
Contributor Author

JessBoctor commented Apr 28, 2025

Making a note:

@sirbrillig pointed out in #102742 (comment) that the donation purchases are showing up below the DataViews table, rather than being included in it.

Screenshot 2025-04-25 at 10 34 56 PM

Need to figure out why that is happening.

UPDATE: Turns out this isn't CSS related, but rather the purchases being rendered outside of the original PurchasesSites component

@JessBoctor JessBoctor force-pushed the gh86616/add/purchases-list-in-dataviews-css branch from 8977b93 to cdcfdb0 Compare May 19, 2025 17:14
@JessBoctor JessBoctor marked this pull request as ready for review May 19, 2025 17:31
@JessBoctor
Copy link
Contributor Author

@sirbrillig I think the CSS fixes for the DataViews table are ready for review.

Copy link
Member

@sirbrillig sirbrillig left a comment

Choose a reason for hiding this comment

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

This looks way better! Thanks!

There's one more thing I noticed while testing this (and maybe you already know), but it's not directly related to this PR: I think the table view has lost the ability to link to the single purchase view. This becomes particularly notable at mobile width due to horizontal scrolling.

Production DataView DataView scrolled
Screenshot 2025-05-19 at 4 28 11 PM Screenshot 2025-05-19 at 4 28 40 PM Screenshot 2025-05-19 at 4 28 52 PM

Anyway, definitely not a blocker here. I'll mention it on #86616

@sirbrillig sirbrillig merged commit 6a88e05 into Automattic:trunk May 19, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants