Repository navigation
Conversation
The banner (instance name and version) and the license information take up most of the homepage, but are rarely of interest after the first visit. Both now have a close button, and the user dropdown in the navbar gets an entry "Restore hidden homepage boxes" (only shown while something is hidden), which brings them back. The closed boxes are remembered per browser in a cookie rather than in the local storage, so that the server can already render them hidden. That way they do not flash up on page load before the javascript has run. The mechanism is generic: any box can be made closable with the macros in components/dismissible.macro.html.twig and a unique id.
|
Hmm, i am wondering how necessary this feature is. You can simply disable the banner and license infos completly via the system settings. I guess nobody would ever reopen the license info panel again, after he closed it. For the banner it might be more useful to make it dismissable, and it probably does not hurt to have this feature and it might be useful for other occasions to have the infrastructure for dismissable panels existing. |
|
I hear you. Just a personal preference on UX, I like when settings/modifications are easy to control inline directly at the location that stimulates the desire (eg seeing the large boxes and wanting them to go away in this case). Part-DB is awesome but I'm still learning it and walking through every setting from the various settings areas takes time and also requires users to even know it's possible in the first place (to be fair I haven't spent a ton of time on all of those pages as there are so many great features and tweaks that are possible). I will probably continue to add more inline support for things, and totally understand if that's not desired, but ideally I will try to have things adjust existing backend settings so they're always re-adjustable with the same architecture. I'm just a sucker for reducing clicks. :) |
|
I tried it out, and i think its fine to let users hide these panels for themselves. But i do not really find the restore button in the navbar dropdown really intuitive. I think it would be better directly somewhere on the homepage. For some more universal applicability, it would be good, to maybe add some site wide prefix, or something and then restore everything with that prefix when the restore button is clicked. |
The banner (instance name and version) and the license box take up the top of the homepage on every visit, which is useful once and then mostly pushes the rest down.
Both boxes now have a close button (x, top right). A closed box stays closed across reloads and Turbo navigations. While anything is hidden, the user dropdown in the navbar shows a "Restore hidden homepage boxes" entry that brings everything back with one click, without a reload.
How it works:
dismissed_boxes, per browser,path=/, one year,SameSite=Lax, refreshed on page load while non-empty). A cookie rather than localStorage so that Twig can render a closed box with thehiddenattribute already in the HTML: nothing flashes up before the JavaScript runs.templates/components/dismissible.macro.html.twigmakes any box closable:{{ dismissible.attributes('unique_id') }}on the element and{{ dismissible.close_button() }}inside it. Only the banner and the license box are wired up here.btn-close(white variant on the license header) withtitleandaria-label; no custom CSS.Two new translation strings (
homepage.dismiss_box,homepage.restore_boxes).Notes for review: