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

Fix layout on assets detail page #2279

Merged
merged 7 commits into from
Jul 30, 2024
Merged

Conversation

kattylucy
Copy link
Collaborator

@kattylucy kattylucy commented Jul 11, 2024

  • Asset detail page: Add < no data available > if data is empty to avoid layout emptiness/switching (picture 1)
  • Liquidity page: Prevent layout switching by reorganizing rendering of component (picture 2)
  • Prime page: Add box around graph layout to maintain dimensions. (picture 3)

#2223

  • [ x ] Dev

Picture 1
Screenshot 2024-07-11 at 11 24 02 AM

Picture 2

Screen.Recording.2024-07-11.at.11.42.43.AM.mov

Picture 3
Uploading Screenshot 2024-07-11 at 1.45.46 PM.png…

Copy link

github-actions bot commented Jul 11, 2024

PR deployed in Google Cloud
URL: https://app-pr2279.k-f.dev
Commit #: 2ef57d9
To access the functions directly check the corresponding deploy Action

Copy link

github-actions bot commented Jul 11, 2024

PR deployed in Google Cloud
URL: https://pr2279-app-ff-production.k-f.dev
Commit #: 2ef57d9
To access the functions directly check the corresponding deploy Action

@kattylucy kattylucy force-pushed the prevent_content_layout_switch branch from c22f9f6 to 2bff3a2 Compare July 11, 2024 18:32
@kattylucy kattylucy marked this pull request as ready for review July 11, 2024 18:47
@sophialittlejohn
Copy link
Collaborator

This looks good! One more thing that would be great in this ticket is if we could prevent the vertical jumping of the page on load which happens while the charts are loading. There's an example here that shows what I mean. Also I got the name wrong, the ticket was supposed to say fix Cumulative layout shift (CLS) instead of content, sorry! So the idea would be to reserve the space in advance for the charts so when they load they fill the space and don't cause the content beneath it to jump.

@kattylucy
Copy link
Collaborator Author

kattylucy commented Jul 16, 2024

Ok, so I did some research into CLS - The best way to fix it, as suggested is to add a fixed height to the container around the graph. Which I did, now, if the data is non-available for the graph, we then have a big container with no data on it (which can be weird), I kept the changes and you can check asset performance graph to see it working.

If we decide we don't want an empty container when no data is available and we want to hide the container (as it was prev), we need to be ok with the content switching in the x axis, so in this example, the key metrics card switching to the left.

Let me know which option you prefer and I'll make the changes. Im personally fine with the fixed height to avoid any jumping either on the x or y axis of the page.

@sophialittlejohn

@sophialittlejohn
Copy link
Collaborator

I think it's better to fix the height because we will generally assume that the subquery is working and the data will load. The table on the asset detail page looks good now when it loads, no more content jumping 🙌 if you could just do the same for the rest of the graphs that would be amazing!

  • graph on pool detail page
  • graph on prime page
  • graph on portfolio page

@kattylucy
Copy link
Collaborator Author

Yes, will do that - I was waiting to confirm which approach to take. Thank YOU! @sophialittlejohn

@kattylucy kattylucy force-pushed the prevent_content_layout_switch branch 3 times, most recently from 5c906ce to 9dacc38 Compare July 19, 2024 16:57
Comment on lines 142 to 147
const aggregatedData = data.reduce((acc, cur, index) => {
if (index % 2 === 0) {
acc.push(cur)
}
return acc
}, [])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is every second item being skipped in the data array?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it was mostly for the graphs with a lot of data to avoid showing every item and have more space for the dates. I changed it back

Screenshot 2024-07-23 at 8 30 39 AM

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that should be handled by the charts lib (recharts) itself We've done it in some other charts. You can programmatically determine how many data points should be shown

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we want to do that or do we want to keep the data as in the picture (with -35 degree) so it doesn't look all grouped together (impossible to read)? I'm open to both options but I'm not sure if we want to display all of the data anyways.

Copy link
Collaborator

@sophialittlejohn sophialittlejohn left a comment

Choose a reason for hiding this comment

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

Looks good!

@kattylucy kattylucy force-pushed the prevent_content_layout_switch branch from c90c3e2 to 2ef57d9 Compare July 30, 2024 12:42
@kattylucy kattylucy merged commit 2c7180c into main Jul 30, 2024
13 checks passed
@kattylucy kattylucy deleted the prevent_content_layout_switch branch July 30, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants