Juicy/juicy-tile-list

Change priority range

Closed this issue · 4 comments

Today @Starcounter-Jack suggested changing the priority range to 1-100 (and direction to ascending).
The goal is to avoid 0.00000000000001 hacks in case of tiles provided by different vendors.

With priorities still used as (real) Numbers, but advertised as in natural range, with somehow described steps, we would not block it technically, but we hope that naturally people will use numbers like 1,2,3. So instead of thin tailed exponential distribution, we will get something more log-normal.

I would suggest inverting the direction, and technically support priority from [0, +\infty], not to impose our use case on others, or block any future needs, but advertise 1-100 in our application.

Reversing of the order will have immediate consequence on the existing layouts, which will appear in the inverted order. Such change needs to be well prepared in all apps that use default layouts.

Other than that I agree this is a nice idea. Couldn't we just keep the current direction?

By current direction, do you mean [0, +\infty] range with current direction, so:

  • 0 means last
  • Number.POSITIVE_INFINITY means first?
    I do not think it makes sense, as then there is no way to set the second item

Why would anyone use POSITIVE_INFINITY? I think the same principle is used in CSS (order, z-index) and there is no problem with it. The higher value comes first. Equal values come at the order of definition.

0 actually means baseline, so I can use positive values to move things above the baseline or negative values to move things below it.