Server: usePercentualAppMenuLimit is hard-coded to a number that doesn't suit me.

Created on 9 Apr 2019  路  14Comments  路  Source: nextcloud/server

Is your feature request related to a problem? Please describe.
Every time I upgrade Nextcloud, I edit core/js/js.js and change usePercentualAppMenuLimit from 0.33 to 0.90, so that I can see all of my app icons without some of them disappearing into a menu. Now that code signing is in effect, my instance is now failing its integrity check.

Describe the solution you'd like
I'd like usePercentualAppMenuLimit to be set by a configuration variable, rather than being hard-coded.

Describe alternatives you've considered
I've considered living with the default value, but since I'm using the "External sites" app to place more icons in the top margin of my instance, this is very frustrating.

0. Needs triage enhancement

Most helpful comment

My work-around is to pop this command in my cron configuration, just after the bit that runs cron.php:
sed -i '/usePercentualAppMenuLimit/s/0.33/0.99/' /var/www/nextcloud/core/js/js.js
(edit paths as appropriate)

This automatically changes the value of the variable should it be changed by an update.

Of course, occ integrity:check-core hates it, but I just hate it right back.

All 14 comments

I'd like to see that too.

Could be great for me too !

related to #13079

My work-around is to pop this command in my cron configuration, just after the bit that runs cron.php:
sed -i '/usePercentualAppMenuLimit/s/0.33/0.99/' /var/www/nextcloud/core/js/js.js
(edit paths as appropriate)

This automatically changes the value of the variable should it be changed by an update.

Of course, occ integrity:check-core hates it, but I just hate it right back.

Yes, closing in favour of #13079.

13079 will leave this issue unresolved, as I said on that issue on 23rd April.

@Brianetta yes, I understand. But we will not support the manual edit of hardcoded values on our scripts. We tend to find the sweet spot for user experience and it is carefully picked. See the whole discussion on #13079.
In the end we have to draw a line, otherwise we get submerged under the load of custom edits/requests/enhancements. :)

I hope you can understand.

Not really, no.

My work-around is to pop this command in my cron configuration, just after the bit that runs cron.php:
sed -i '/usePercentualAppMenuLimit/s/0.33/0.99/' /var/www/nextcloud/core/js/js.js

Unfortunately this does not work anymore with v17, because const usePercentualAppMenuLimit does not seem to exist anymore, not even the files js.js/init.js*. Where is this limit set now?

@Brianetta thx! No clue, why GitHubs search did not find me that.

Anyhow, this directory core/src/ may be there in the repository, but: I use nextcloud:latest Docker image, and the currently latest Dockerfile installs this bz2. Neither in this archive nor in my running instance there is a directory core/src/, let alone a file init.js

It looks like the term usePercentualAppMenuLimit is only found within a js mapfile:

$ rg -l usePercentualAppMenuLimit ~/downloads/nextcloud/
downloads/nextcloud/core/js/dist/main.js.map

I am not very well-trained in reading js map files, so how can we get from there to where that setting is actually in the running instance?

sed -i '/appmenu li/s/(n\*=.33)/(n*=.99)/' /var/www/nextcloud/core/js/dist/main.js

Another possible, but very dirty hack:

  1. Install the Custom CSS App
  2. Insert the following CSS code (in Settings -> Design -> Custom CSS) and adjust the min-width according to your number of apps:
@media (min-width: 1150px) {
    #appmenu li.hidden {
        display: flex !important;
    }
    #appmenu #more-apps {
        visibility: hidden !important; 
    }
}

con: No flexible response, manual adjustment to number of apps
pro: No modification of base files --> integrity check passes; will likely endure updates.

P.S.: Yes, I know that it's bad to comment on closed issues. Sorry for that.

I like the hack though :grin: :+1:

Was this page helpful?
0 / 5 - 0 ratings