New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax of mv-bar #303
Comments
Hello, I usually find the standard syntax for this kind of attributes always ending in a form like attr="option no-option", we're already familiar with the notion of the name being the positive version and the "no-name" being the negative option. EX: mv-bar="no-save clear download no-login". We can explore other options as well. |
@eikishi01 Exactly, however in this case we need to convey three states, as explained in the first post. |
On syntax update idea, relative can be updated to use "with-" instead of "yes-" for a more comprehensive reading.
|
Ah, that's interesting, @karger suggested the same thing earlier today. If multiple people had the same idea, it means it might be intuitive. |
I just had an idea about this! While using relative and absolute values together is currently possible, it doesn’t make a ton of sense. Also, using relative positive values only makes sense on optional buttons. What if the syntax for absolute and relative positive was the same, and we figured out which one it is based on whether the button is optional or not? The main drawback of this: It will not possible to have a toolbar with ONLY optional buttons (e.g. |
Ok, let's say, we have the available button declarations with an identifier of optional or not in mv code, then it checks for:
|
Forgot this:
|
That means you cannot have an absolute order that includes optional buttons, which is pretty common. |
Another idea @karger mentioned yesterday was using an "only" keyword to indicate this is absolute. So, to summarize:
I'm not sure if If relative identifiers don't affect order (as is the case right now), I can't think of a reason why we might want to override the heuristic in the other way, i.e. force relative. One downside is that both the author and anyone reading their markup, need to be aware of which buttons are optional to interpret the value of Perhaps
The downside of that is backwards compatibility: Existing absolute values will now be interpreted as relative. But hopefully that shouldn't be a huge problem, since the buttons will still be there, just with some more added, and most uses of Thoughts? |
Sorry, for me this looks even more complicated than before. Standard buttons list can be changed or reordered only if: mv-bar -all standard buttons in standard order So the only rule would be: If you want to customize the mv-bar you have to specify the buttons in the order that you want to have them |
@kosirm I’m a bit confused. Firstly,
You don't need to specify the attribute at all for that.
You mean relative values should not be possible? So users should be aware of every button and list it if they just want to not have a login button? What happens if Mavo adds a new button in the future? This seems contrary to the needs of pretty much every other user I've talked to. In any case, if you never want relative values, you can just always specify "only" and it what I'm proposing works exactly as you described... The fact that there's also a relative syntax supported shouldn't be an issue if you don't need it, right? You are right though that the heuristic is a bit complicated. I edited my post above with a proposal to simplify things. |
It seems really stupid idea, I admit :)
If mavo adds new buttons and user customized mv-bar, it's his responsability to add new button, if he wants. I definetely wouldn't like to see some now button on mv-bar, which I didn't put there, when I upgrade mavo.
Sure! |
The "only" would be just in the beginning, not before every button, like
Of course not! Feedback is welcome! However, we need to take all users feedback into account, and from the Mavos I've seen, it seems most uses of |
I like the Then |
ONLY assumes meaning "Only these buttons". It doesn't presupposes any other meaning like relative or absolute, so it is redundant in case of absolute. no-foo, yes-foo, add-foo, etc. require from user to understand and remember set of rules, which is more demanding then remember list ot button names. |
This is what absolute means! Only these buttons, in that order.
Yes, or entirely custom button elements inside a custom bar which is not relevant for this discussion. That doesn't change with this proposal, it's only the syntax we're discussing, not the functionality.
So your disagreement basically boils down to "use a keyword for relative, not absolute". I don't see any particular simplicity benefit going one way or another. I understand that this is your primary use case so you're concerned about it becoming more verbose. However, most of the Mavos I see in the wild use relative values, so it would make sense to keep that shorter. And we're only talking about 6 characters here. I’m wondering if with all the ideas that have been mentioned in the thread it's unclear what the current proposal is, which would explain comments like "require from user to understand and remember set of rules". Here it is again:
|
Sorry for stealing your time, I wanted to be useful :)
Nicely put. Finally it settled in my mind, I can totaly accept that. |
We discussed this in our weekly F2F meeting today, and we resolved to a similar idea. The issue with my current proposal is that things like So we decided the following:
@kosirm this is basically the syntax you wanted too :) I guess one issue is: What happens if someone forgets |
@LeaVerou Perfect! |
Right now
mv-bar
accepts identifiers of three kinds:mv-bar="edit save"
mv-bar="no-login"
mv-bar="yes-export"
.As you can see, while
no-foo
is nice and readable,yes-foo
is super weird. Other options would beadd-foo
, but that conflicts with adding collection items. I'm thinking of switching to+
and-
for relative identifiers. However, that means the difference from absolute ones is much less visible. Compare:and
Another drawback of the current syntax is that it would look super awkward with button names that actually start with
no-
oryes-
.Thoughts? Perhaps you can think of a better, completely different syntax?
Poll on Twitter
The text was updated successfully, but these errors were encountered: