Black-Kamelia / Hedera

A self-hosted screenshots/files hosting system. Hedera + ShareX = ❤️
Apache License 2.0
33 stars 2 forks source link

Decide default state of the sidebar base on viewport size #79

Open SlamaFR opened 1 year ago

SlamaFR commented 1 year ago

We could use the screen size of the client to decide if the sidebar should be open or closed by default.

For example, if a client connects to the application with a small 4:3 screen (lol), the sidebar should be collapsed by default. We'll come up with a minimum size requirement to meet to have the sidebar opened by default.

notKamui commented 1 year ago

Do we persist the open state in localstorage ? or does it get reset on every reload ? Do we autoclose/autoopen on viewport resize ?

Note that we'll also have a mobile version of the sidebar at some point, in which case the open state should not be used (always reset to not opened on reload)

SlamaFR commented 1 year ago

At the moment, the state is stored in local storage, and should remain, in my opinion.

The plan should be to decide initial state on load based on the viewport if local storage is empty, and update the state when viewport become too small. If you have any suggestion, feel free to share them.

notKamui commented 1 year ago

ok so tdlr :