caddy icon indicating copy to clipboard operation
caddy copied to clipboard

[file_server browse] Layout setting is not saved

Open trmdi opened this issue 1 year ago • 12 comments

When you change the file browser's layout between Grid/List, it's reset when you leave the current page/open other directory. It would be better if the setting remains consistent until the user changes it.

trmdi avatar Jun 10 '24 01:06 trmdi

Agreed. Can you suggest a good way to do that that doesn't require cookies?

mholt avatar Jun 10 '24 02:06 mholt

Agreed. Can you suggest a good way to do that that doesn't require cookies?

I don't know what is better, what's wrong with the cookie?

trmdi avatar Jun 10 '24 05:06 trmdi

Europe's laws make the use of cookies rather unbearable.

mholt avatar Jun 10 '24 08:06 mholt

Maybe local storage?

aliasgar55 avatar Jun 10 '24 09:06 aliasgar55

Europe's laws make the use of cookies rather unbearable.

Caddy is already using cookies, isn't it? https://github.com/search?q=repo%3Acaddyserver%2Fcaddy%20cookie&type=code So I think the EU's cookie law is not an issue here.

trmdi avatar Jun 10 '24 09:06 trmdi

The only time we set cookies, AFAIK, are when the user explicitly configures load balancing policy as such. The rest of those results are related to parsing existing cookie headers, not setting.

mholt avatar Jun 10 '24 13:06 mholt

Maybe local storage?

Maybe, but that will be lost when sharing a link. You will be viewing a grid and someone else will see the list.

mholt avatar Jun 10 '24 13:06 mholt

The only time we set cookies, AFAIK, are when the user explicitly configures load balancing policy as such. The rest of those results are related to parsing existing cookie headers, not setting.

I saw there is a cookie for the Sorting button which is very similar to the Layout button.

trmdi avatar Jun 10 '24 14:06 trmdi

Oh, interesting. I thought we got rid of those for query string parameters. In fact, I distinctly remember doing this... :thinking: We should probably remove those in favor of the query string.

mholt avatar Jun 10 '24 14:06 mholt

Maybe local storage?

I think the cookie law is applied to similar types of cookie including localStorage.

trmdi avatar Jun 12 '24 03:06 trmdi

Oh, interesting. I thought we got rid of those for query string parameters. In fact, I distinctly remember doing this... 🤔 We should probably remove those in favor of the query string.

Just curious why don't you accept the law? Maybe add an opton for caddy's admin to show/not show the cookie banner? Because we can not avoid storing a user's preference in their browser. Anyway, clicking on the Accept Cookie button is not really a problem.

trmdi avatar Jun 12 '24 03:06 trmdi

Cookie banners are destroying the Web.

I think we can avoid it with query strings. But it might be a little more involved since it requires changing the links.

mholt avatar Jun 12 '24 03:06 mholt