snapshot-labs / sx-monorepo

Snapshot monorepo
https://snapshot.box
MIT License
17 stars 17 forks source link

style: votes page horizontally scrollable on mobile #331

Closed bonustrack closed 3 months ago

bonustrack commented 6 months ago

On mobile and on the page "votes" there isn't enough space to show the content for votes, we should make the table scrollable horizontally, similar than site like https://www.coingecko.com The cells should have a minum width so it doesnt take extra line, (first cell dont need to be sticky like on coingecko). Screenshot_20240509_064527_Chrome

ChaituVR commented 6 months ago

Delegates and leaderboard use similar layout, what should happen to them? same as votes?

ChaituVR commented 6 months ago

I had a blocker with sticky property on thead, will wait for this https://github.com/snapshot-labs/sx-monorepo/issues/145#issuecomment-2104404066

wa0x6e commented 6 months ago

We currently hide some column in smaller screen.

I guess with this feature, we keep columns ?

wa0x6e commented 6 months ago

I had a blocker with sticky property on thead, will wait for this #145 (comment)

Merged, so this can move on

ChaituVR commented 6 months ago

sticky doesn't work here. we may have to remove the stickiness of this page. also, the vote % in the background for each will not be correct if we allow horizontal scrolling.

Sekhmet commented 5 months ago

I bumped it to Medium as I think it will require quite a bit of work.

wa0x6e commented 5 months ago

@bonustrack What's the decision here, following the issues raised by chaitu ?

bonustrack commented 4 months ago

sticky doesn't work here. we may have to remove the stickiness of this page. also, the vote % in the background for each will not be correct if we allow horizontal scrolling.

For the background with vote % if the page is larger than the screen we can make the bg sticky and base the % from the screen width (and not the whole page width). Does it make sense?

wa0x6e commented 4 months ago

And we remove sticky?

bonustrack commented 4 months ago

For the sticky, I'm not sure what's blocking, we can use div if table is not working

wa0x6e commented 4 months ago

Not an issue of table or div, sticky does not simply seem to work when inside overflow: scroll, it does not stick

ChaituVR commented 3 months ago

There are two problems with this:

  1. If we want sticky nature like below video, we won't able to make it horizontally scrollable https://github.com/user-attachments/assets/30bc0a8f-663b-4070-b290-6720dbee1779

  2. Not sure how we want to handle voting power in the background,

    Untitled 2

    Here we have the same width as the screen, so if a user 50%, it will add a background of half the screen, but if we allow horizontal scroll, it may go under the scroll

bonustrack commented 3 months ago

Need to figure out a solution to keep the first nav with "Overview, votes, discussion" sticky

bonustrack commented 3 months ago

Here is an example of the UX we want done with CSS using Claude https://claude.site/artifacts/40c93fdf-5cec-4ed5-b845-232b40385d56