ex_doc icon indicating copy to clipboard operation
ex_doc copied to clipboard

Feature to store sidebare state across reloads

Open cw789 opened this issue 2 years ago • 10 comments

Is it desired to store the sidebar state in ~~localStorage or~~ sessionStorage?

For me if I go into my docs "reading mode". Means I close the sidebar and read page by page using the "Next Page →" link on the bottom of each page. It is annoying if on every next page the sidebar pops up "opened" again.

I could contribute this feature when the dev environment is ready to be used on latest node again. I'm to lazy to install old node version for small contributions.

cw789 avatar Apr 17 '22 13:04 cw789

This is tricky because it is stored Per Domain and also we don’t want necessarily for a closed side bar to stick when you come back to hexdocs a week later. So my thought at the moment is no. :)

josevalim avatar Apr 17 '22 13:04 josevalim

I understand. But if we use sessionStorage it would only be valid for your Browser tab session. Means sidebar would only be still closed if you use the same Browser tab a week later (just hitting the peoples never closing tabs - and finding them a week later again ;).

cw789 avatar Apr 17 '22 14:04 cw789

Ah, so that works for me!

josevalim avatar Apr 17 '22 14:04 josevalim

Fine. Then keep it open.

cw789 avatar Apr 17 '22 14:04 cw789

I could contribute this feature when the dev environment is ready to be used on latest node again.

Btw, a PR that bumps to latest node is welcome (i.e. a PR that makes it work for you). Otherwise no one might submit this feature.

josevalim avatar Apr 17 '22 14:04 josevalim

I know, but first I've tried to get rid of less and switch to esbuild... Then my time ended. The setup here has grown quite some complexity.

cw789 avatar Apr 17 '22 14:04 cw789

I think it is easier first to just update to latest node, instead of doing a full migration. :)

josevalim avatar Apr 17 '22 15:04 josevalim

So I've really tried now to update ex_doc to be compatible with latest Node. But I'm sorry I've not managed to be successful.

Doing an immediate update of webpack 4 to webpack 5 to make it work (for now) seems to much energy for now for me.

cw789 avatar Apr 17 '22 17:04 cw789

I've spent bit of time again. Downgraded Node to LTS v16 on my machine - no success. So it's either that the setup does not work on Windows or does not work with latest Node v16 either.

Then I've tried to ditch webpack with esbuild - no success. The handlebars plubin I've found for esbuild doesn't seem to work.

This is not any critic. This is just a public log what I've already tried.

cw789 avatar Apr 18 '22 13:04 cw789

I know, but first I've tried to get rid of less and switch to esbuild... Then my time ended. The setup here has grown quite some complexity.

Relevant to this, I've started to work my way through the Less files, converting to CSS, and hope to subsequently have a go at moving to esbuild. (#1542)

DavidOliver avatar Apr 28 '22 10:04 DavidOliver