In sidebar mode show if a module is in default state or not
Needs ReviewPublic

Authored by bport on Mar 31 2020, 9:40 AM.

Details

Reviewers
ervin
meven
crossi
hchain
mart
Group Reviewers
Plasma
VDG
Summary

Depends on D28460

Diff Detail

Repository
R124 System Settings
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 25019
Build 25037: arc lint + arc unit
bport created this revision.Mar 31 2020, 9:40 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 31 2020, 9:40 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
bport requested review of this revision.Mar 31 2020, 9:40 AM

Please include screenshots when you do UI changes.

sidebar/package/contents/ui/CategoriesPage.qml
191

Kirigami.Units.iconSizes.small and elsewhere

Why do you need this wrapper Item, though?

bport edited the summary of this revision. (Show Details)Mar 31 2020, 9:42 AM
bport added a reviewer: VDG.
ndavis added a subscriber: ndavis.Mar 31 2020, 1:25 PM

This is merely an indicator and not a button, right? If so, you should not use edit-reset since you cannot actually reset the settings there. I'll try to come up with another indicator.

I'm concerned that this indicator will make system settings visually messy. Is it really needed?

IMHO this is wholly pointless a change, currently. Most people won't care about if they've made changes or not in SySe from the defaults, and quite frankly seeing that indicator on the sidebar would potentially even deter user customisation if not utterly confuse people. If it was an optional setting in settings to show these changed settings indicators on the sidebar (such as a checkbox item in the SySe menu) that you could turn off by default, I wouldn't mind this at all.

filipf added a subscriber: filipf.Mar 31 2020, 1:59 PM

Can you explain why we want this? It's going to be visually prominent so we need a good reason.

bport added a comment.Mar 31 2020, 2:15 PM

Goal of this feature is to improve user discoverability and allow them to find more easily which settings diverged from defaults one, so they can more easily revert to the default value when needed
Indeed the current indicator is not the good one, and I will be happy to have some help to find a nicest one.

ndavis added a comment.EditedMar 31 2020, 2:48 PM

maybe it would make more sense to add a different way to view non-default settings? like maybe a summary of custom settings. It might have issues with organization, but it would require less navigation.

bport added a comment.Mar 31 2020, 3:48 PM

Test with a blue dot, took less space than an icon
Wa can imagine a tooltip when you go hover the dot explaining it

abetts added a subscriber: abetts.Mar 31 2020, 4:15 PM

If I am understanding correctly, this patch adds icons in the kcm list to indicate changes you can revert by going to the kcm. Basically, default settings have changed and now you have the possibility to see that changes have been made. I am not sure that I like the implementation. I have some questions.

What will you do when all of them are changed in some way? Will the entire kcm list show an icon indicating change? If you think about it, KDE is the DE of changes and options. I feel all of these are going to show some kind of change, that could be overwhelming. At the end of the day, is it necessary? Wouldn't this be something that probably works best by having it in the reset/defaults button?

Also, these icons indicate change, if you click on the item and then land in a kcm that doesn't present more clues as to what changed, then you are left with the default action to click defaults or reset on the kcm anyway. There doesn't seem to be much more value there.

bport added a comment.Mar 31 2020, 4:27 PM

If I am understanding correctly, this patch adds icons in the kcm list to indicate changes you can revert by going to the kcm. Basically, default settings have changed and now you have the possibility to see that changes have been made. I am not sure that I like the implementation. I have some questions.

What will you do when all of them are changed in some way? Will the entire kcm list show an icon indicating change? If you think about it, KDE is the DE of changes and options. I feel all of these are going to show some kind of change, that could be overwhelming. At the end of the day, is it necessary? Wouldn't this be something that probably works best by having it in the reset/defaults button?

Being the DE of "changes and options" don't mean all people are changing everything, but that also mean some people will do some change and then don't remember what they changed, and will never find what differ from the default values. Reset / Default button have totally different purpose, default button will set back default value and will be indeed active if module don't have default value. However, user will know that only if he goes to the good module. Problem for a "lambda" user is to remember what change.

Also, these icons indicate change, if you click on the item and then land in a kcm that doesn't present more clues as to what changed, then you are left with the default action to click defaults or reset on the kcm anyway. There doesn't seem to be much more value there.

There is another patch for this purpose
https://phabricator.kde.org/D27540

I get a compile error:

/home/nate/kde/src/systemsettings/core/MenuItem.cpp: In member function ‘void MenuItem::updateDefault()’:
/home/nate/kde/src/systemsettings/core/MenuItem.cpp:154:36: error: ‘isDefaults’ is not a member of ‘KCModuleLoader’
  154 |     d->isDefault = KCModuleLoader::isDefaults(d->item);
      |                                    ^~~~~~~~~~

Does this have un-merged dependencies? If so, you can mark them in Phab by adding the text Depends on D12345 (but the actual patch ID, not D12345 :) ) in the Summary section.

bport added a comment.Mar 31 2020, 5:52 PM

I get a compile error:

/home/nate/kde/src/systemsettings/core/MenuItem.cpp: In member function ‘void MenuItem::updateDefault()’:
/home/nate/kde/src/systemsettings/core/MenuItem.cpp:154:36: error: ‘isDefaults’ is not a member of ‘KCModuleLoader’
  154 |     d->isDefault = KCModuleLoader::isDefaults(d->item);
      |                                    ^~~~~~~~~~

Does this have un-merged dependencies? If so, you can mark them in Phab by adding the text Depends on D12345 (but the actual patch ID, not D12345 :) ) in the Summary section.

Ok I will add it I thought setting a parent revision on the right sidebar was enough

bport edited the summary of this revision. (Show Details)Mar 31 2020, 5:56 PM

Is D28460 the only other patch that's needed? I applied that and then this patch compiled fine, but I don't see any difference in the sidebar, despite having changed some settings from their default values.

bport added a comment.Mar 31 2020, 7:21 PM

Is D28460 the only other patch that's needed? I applied that and then this patch compiled fine, but I don't see any difference in the sidebar, despite having changed some settings from their default values.

No we also need to add probe to each KCM there is an example with the color one there D28462 (locally I have more example but need some code cleanup and not needed for code review so I will do code cleanup after probe API cleanup is done i.e. patch D28460)

So every single KCM will need to be patched to add a settings proper in support of this? Oof. Is there no easier way?

ndavis added a comment.Apr 1 2020, 6:51 PM

So every single KCM will need to be patched to add a settings proper in support of this? Oof. Is there no easier way?

Perhaps we could find a way to turn it to our advantage? Do all KCMs really need to have this kind of indicator?

bport added a comment.Apr 2 2020, 6:06 AM

Yes we will need to have a probe for each KCM, and I currently look to reuse this probe in the KCM that will split a bit more data and UI.
Some KCM like pulseaudio one don't need that for example, because there is no default setup

How about instead of a blue dot there's instead an option in the SySe hamburger button menu to use search to filter out any settings pages where settings haven't been changed, meaning that only settings with changes made to them are then listed in the search results?

mart requested changes to this revision.Apr 6 2020, 9:28 AM
mart added a subscriber: mart.
mart added inline comments.
sidebar/package/contents/ui/CategoriesPage.qml
191

try to keep the item count as small as possible, especially in item delegates.
I would really prefer if we could do without this wrapper

sidebar/package/contents/ui/SubCategoryPage.qml
198

width: Kirigami.Units.iconSizes.small

This revision now requires changes to proceed.Apr 6 2020, 9:28 AM
bport added inline comments.Apr 6 2020, 12:34 PM
sidebar/package/contents/ui/CategoriesPage.qml
191

Indeed this wrapper is not needed

sidebar/package/contents/ui/SubCategoryPage.qml
198

Thanks I will fix that

bport updated this revision to Diff 79499.Apr 6 2020, 3:43 PM

Change icon with a blue dot

bport marked 5 inline comments as done.Apr 7 2020, 8:02 AM
bport edited the summary of this revision. (Show Details)
ervin requested changes to this revision.Apr 7 2020, 4:53 PM
ervin added inline comments.
core/MenuItem.h
160

I don't like the name much, I think it could be confused with updating actual default value or such... updateIsDefault() is not great either though... :-/

sidebar/SidebarMode.cpp
117

This is generally implemented by calling the roleNames() of the parent class and then tune the returned hash. This way you ensure you keep the support for the standard roles. In your case that'd give something like:

auto roleNames = QStandardItemModel::roleNames();
roleNames.insert(MenuModel::IsDefaultRole, "default"); // yeah... QML doesn't have the isFoo convention, go figure
return roleNames;
586

I'd feel better with a Q_ASSERT(item)

588

Technically correct, we tend to favor the use of isEmpty() though.

sidebar/package/contents/ui/CategoriesPage.qml
190

Missing spaces around *

sidebar/package/contents/ui/SubCategoryPage.qml
195

This is twice the same Rectangle item, what about we make a reusable element and use it at both places to reduce code duplication?

197

Spaces missing around *

This revision now requires changes to proceed.Apr 7 2020, 4:53 PM
bport updated this revision to Diff 79771.Apr 10 2020, 3:26 PM
  • Factorize QML code
  • Rename isDefault to showDefaultIndicator
bport marked 7 inline comments as done.Apr 10 2020, 3:27 PM
GB_2 added a subscriber: GB_2.Apr 20 2020, 8:50 AM

How about instead of a blue dot there's instead an option in the SySe hamburger button menu to use search to filter out any settings pages where settings haven't been changed, meaning that only settings with changes made to them are then listed in the search results?

I personally would like this much more than having a blue dot, otherwise it could get very distracting or cluttered if you made changes in many different KCMs.

ervin accepted this revision.Apr 21 2020, 6:44 PM

LGTM

bport added a comment.May 11 2020, 7:52 PM

Default indicator discussion is now on https://phabricator.kde.org/T13008