mwalbeck / nextcloud-breeze-dark

A Breeze Dark theme for Nextcloud
GNU Affero General Public License v3.0
317 stars 57 forks source link

not accessible when the accessibility app is deactivated #244

Open diemelone opened 3 years ago

diemelone commented 3 years ago

Describe the bug not accessible when the accessibility app is deactivated

To Reproduce

  1. deactivate the accessibility app
  2. Try to activate Breeze Dark in the settings

Expected behavior Setting should be accessible

Screenshots not needed

Setup (please complete the following information):

Additional context Breeze Dark should add the accessibility settingspage as well if it does not exist already. I deactivated the accessibility app because the native darkmode looks weird with my chosen primary color. I deactivated it for users not to have the same issues.

mwalbeck commented 3 years ago

I definitely agree but the reason I haven't done it is because currently it generates error messages if two apps register the same settings section. I remember seeing a discussion about it a while back but now I can't seem to find it. I also don't know if it is possible to do a conditional registration, so the section only gets registered by breeze dark if it doesn't exist. I haven't had too much time to look into it but so far I haven't found a way to do it yet.

diemelone commented 3 years ago

Ok, for the meantime I have a quick and dirty fix, without changing code (to avoid having to do this on every update) I just hid the accessibility theme from the users using the custom css app. If they don't know its there, they wont search. I guess changing the theme for every user should be possible via the preferences in the database

#accessibility .preview-list {
    display: none;
}
mwalbeck commented 3 years ago

Yeah, you can also do the following if you just want to hide the dark theme

#accessibility .preview-list .preview:nth-of-type(2) {
    display: none;
}

I guess changing the theme for every user should be possible via the preferences in the database

You can do it with the occ command. The Accessibility has a theme option that is either not present or set to dark so it just needs to be delete. The following shows which options are set for the Accessibility app

php occ user:setting UID accessibility

And to delete the theme option you can do this

php occ user:setting --delete UID accessibility theme

Of course replacing UID with the UID of a user

diemelone commented 3 years ago

I also don't know if it is possible to do a conditional registration, so the section only gets registered by breeze dark if it doesn't exist.

Did you take a look at apps like quota warning, impersonate, mail, ... they all appear in the same admin setting section but if none is activated you cant see the section. Otherwise this could be a workaround: a dropdownlist of available setting sections for the admin to choose in which section breeze dark settings are located.

mwalbeck commented 3 years ago

Did you take a look at apps like quota warning, impersonate, mail, ... they all appear in the same admin setting section but if none is activated you cant see the section.

There are some settings sections that are built-in to Nextcloud core which behave like that which these apps are using, but currently it doesn't seem like that functionality can be achieved when apps register their own sections.

Otherwise this could be a workaround: a dropdownlist of available setting sections for the admin to choose in which section breeze dark settings are located.

Sadly I don't think that is feasible based on how the system currently works.

diemelone commented 3 years ago

Is there any way of manually creating the settings section to get it to work?

mwalbeck commented 3 years ago

As far as I know settings sections has to be registered with code either in Nextcloud core or in an app, so no I don't believe so.

diemelone commented 3 years ago

The accessibility site is still there, it is just hidden so I used the "external sites" app to create a new list item in this menu which leads to the accessibility setting: https://NC.tld/index.php/settings/user/accessibility

grafik

grafik

mwalbeck commented 3 years ago

Sorry for the slow responses, I've been quite busy lately.

That's interesting and it seems like a reasonable workaround. Though it also provides a way to create a workaround in the app. One possibility would be adding the "Accessibility" settings section to the settings sidebar with javascript if it doesn't exists.