Commit graph

2776 commits

Author SHA1 Message Date
Bartosz Dziewoński a667045383 Revert "Avoid referencing methods via strings"
This reverts commit 48283d5f19.

Change-Id: Ifc2b7fb9e9fb7deaecb6c0475db0f9253e81869f
2021-09-13 18:36:07 +00:00
Thiemo Kreuz 48283d5f19 Avoid referencing methods via strings
Should be a bit more obvious, I hope.

Change-Id: I024ac1e2d68bfe4c5af733c48967af4c51f336c1
2021-09-13 14:26:16 +02:00
Thiemo Kreuz 1493aa7a35 Split focus handling from add/remove parameter events
* The template model fires an "add" event. Listeners don't
  automatically steal the focus any more.
* Instead there is a separate "focusTemplateParameterById" event
  fired from all relevant places that add a parameter.
* The "remove" doesn't steal the focus any more.

Bug: T285323
Change-Id: I93f17727524bfbcf6f11647a6c2441781337c4cc
2021-09-11 17:47:02 +00:00
Thiemo Kreuz ec526ea64f Make "templateParameterClick" event similar to "choose"
The original idea was to make the interface as narrow as
possible. However, it turns out it's better to model the
"templateParameterClick" event more closely after the "choose"
event.

This is split off to make reviewing the following patches
easier.

Change-Id: I271f576c6cd756cecfc6cb1fd64810f8da5c3575
2021-09-10 17:19:19 +02:00
jenkins-bot 9ef1b22b37 Merge "Clean up post- OOUI fix" 2021-09-10 14:37:12 +00:00
jenkins-bot 843aa24efd Merge "Don't allow users to add parameters that contain forbidden chars" 2021-09-10 10:14:53 +00:00
jenkins-bot 022db20850 Merge "Add input validation to the add parameter page" 2021-09-10 10:14:50 +00:00
jenkins-bot 2b7b96bbdc Merge "Remove invisible tab target from template dialog sidebar" 2021-09-10 10:00:17 +00:00
Adam Wight f8cf9e9b8e Clean up post- OOUI fix
Pure cleanup, doesn't change behavior.

Change If8da5ae85dff63c34 included in OOUI v0.42.0 tracks invisible
controls, so it's no longer necessary to maintain persistent class
variables pointing to the buttons.

Also simplify repeated logic to make it clearly exclusive.

Bug: T290554
Change-Id: If9b6404d7061999540515645fa8e50b9a21f5a21
2021-09-10 09:39:07 +00:00
jenkins-bot 38b0791ed8 Merge "Fix missing and flipped template dialog help messages" 2021-09-10 09:37:38 +00:00
Thiemo Kreuz 30d4096aeb Remove invisible tab target from template dialog sidebar
The list of parameters should remove itself from the list of
possible tab navigation targets when it's empty.

Note there is no way to remove elements from the parameter
list. That's why we don't care about "remove" or "clear"
actions.

Change-Id: I8b1215117e0ddc94f787d173e9bea6f7567d9671
2021-09-10 06:42:22 +00:00
Thiemo Kreuz 94a419e9a6 Fix missing and flipped template dialog help messages
Bug: T288465
Change-Id: I4aaa8d889084b770fa0cafab69a0b65128f3d82a
2021-09-09 16:11:00 +02:00
Andrew Kostka 0c14b6d0bb Don't jump back-and-forth between fullscreen and floating when resizing
Previously, when the tranclusion dialog was being resized, there was
a specific width at which both the sidebar was collapsed and the dialog
was downsized from "larger/large" to "medium". This resulted in the
dialog switching from fullscreen to floating, since the dialog's width
breakpoint for "medium" doesn't match our width breakpoint for mobile.
If the user continued to downsize past this breakpoint, then the dialog
would eventually switch back to fullscreen resulting in this weird
behavior.

A simple way to prevent this is to avoid changing the dialog's size
at all. Since we don't support collapsing the new sidebar (unless
already in fullscreen), we can just leave the dialog at the
"larger/large" size.

Bug: T274554
Change-Id: I5460cdfb1a7ed73fe7957745ba37055c5f66dce1
2021-09-09 12:16:52 +02:00
Andrew Kostka 4c0666fd19 Don't allow users to add parameters that contain forbidden chars
Bug: T285869
Change-Id: I1011949c2724939f3cec1e1a2ae1c821c33eff84
2021-09-09 11:43:49 +02:00
Andrew Kostka 075ca72fe8 Add input validation to the add parameter page
Bug: T285869
Change-Id: Iebb982e95aa19bd61fcda915981d505cc243c4b2
2021-09-09 11:42:53 +02:00
Thiemo Kreuz 7edb3a82b8 Rename ambiguous onParameterInput event handler
This is split from patch Iebb982e to make it easier to review.

The name is rather ambiguous. Does "input" refer to the input
element? Is it triggered for every key press, i.e. when the
input changes? Or when it's submitted?

Change-Id: Iddbe3bfb9faf3561d8d71b96ffae507799827a95
2021-09-07 09:04:33 +02:00
jenkins-bot 0520bb6e34 Merge "Don't allow parameter names that break the wikitext syntax" 2021-09-06 08:39:07 +00:00
Thiemo Kreuz 3ee7a1f1ed Do not pass Message object to …DismissibleMessageWidget
I wanted to change this for quite a while now. It was discussed
again in Iff1d2c0.

Change-Id: Iaaac9bf91d9b11557ab068d2c719084c46b3ecb2
2021-09-03 15:21:36 +00:00
Thiemo Kreuz 1f4880181e Don't allow parameter names that break the wikitext syntax
Any of these characters results in bad wikitext, when we accept
it in a template parameter name.

Instead of displaying an error message we simply block the
button, as long as the input is not a valid parameter name.
Coming up with a message is not really worth it, I would
argue. Users typically don't have a reason to use any of these
characters. This is super rare. And even if, the behavior of
the widget is not hard to understand, I believe.

The same is done in ve.ui.MWParameterSearchWidget, a little
hidden in the .addResults() method.

Not yet approved by UX. Can be done in demo time.

Bug: T285869
Change-Id: I5576cdfb90411e5fdec93749f72939d31ecd9c56
2021-09-03 15:20:13 +02:00
jenkins-bot 6caf286134 Merge "Hide "required" indicator in new sidebar" 2021-09-03 11:08:17 +00:00
jenkins-bot e57bc90459 Merge "Fix doc padding in new sidebar" 2021-09-03 11:08:15 +00:00
Adam Wight 7fd96f9b38 Hide "required" indicator in new sidebar
This is redundant with other hints.

Change-Id: I15aa2c0249efdd2071af0c085c0a5de6a1d25b29
2021-09-03 11:48:26 +02:00
jenkins-bot 836ab09a79 Merge "Rename and document select/focus events in template dialog" 2021-09-03 09:38:21 +00:00
Adam Wight 7b0d4b1224 Fix doc padding in new sidebar
This was causing the doc text to be undesirably indented.

Change-Id: I3cf8fb1136d354ca04ee077c19e37998fdb85549
2021-09-03 11:37:18 +02:00
jenkins-bot 7eb5b5a1ef Merge "Cleanups and optimizations related to .parseDom()" 2021-09-02 20:03:09 +00:00
Thiemo Kreuz 36bd65dda7 Cleanups and optimizations related to .parseDom()
E.g. avoid calling the rather expensive method multiple times
in a row, if only 1 of the results is needed.

Change-Id: Iff1d2c0892367e927303f6f45d3231e04c045cab
2021-09-02 18:29:09 +00:00
jenkins-bot a7c584b6db Merge "Minor CSS cleanup related to gaps between booklet pages" 2021-09-02 14:19:57 +00:00
jenkins-bot d0653d8929 Merge "Tighten vertical gap between parameters" 2021-09-02 13:49:52 +00:00
Thiemo Kreuz e621df1cbe Minor CSS cleanup related to gaps between booklet pages
* Use a more specific …-top property, as this is the only thing
  we need to overwrite.
* Bring some selectors in a hierarchical order that makes more
  sense.

Change-Id: If36db87d83f699fe0a43ac67d439cac42cbb1fa3
2021-09-02 15:41:40 +02:00
jenkins-bot 5764fc6ac0 Merge "Make sure links in notices open in new tabs" 2021-09-02 13:22:31 +00:00
jenkins-bot 25da8cb9d7 Merge "Update template dialog help messages" 2021-09-02 13:20:31 +00:00
jenkins-bot 7848b1a071 Merge "Fix inconsistent keyboard :focus styles in template outline" 2021-09-02 13:04:17 +00:00
Adam Wight 7fca2417b8 Tighten vertical gap between parameters
Bug: T288465
Change-Id: I608f6e398ec77bf87bca363c761d44661ced8dfd
2021-09-02 14:33:53 +02:00
Adam Wight d8dcc89fa0 Update template dialog help messages
* New help text for the case where TemplateData is present, whether
  or not it includes a description.
* Remove help text when TemplateData is missing.

Bug: T288465
Change-Id: I0668ccae8eeb5ffffc626e3b7d24c1d7ed99bbed
2021-09-02 14:24:35 +02:00
WMDE-Fisch e8bb4b5010 Make sure links in notices open in new tabs
Bug: T276574
Change-Id: I458afab8a34d97619f858c49eea0cef3ad1b83fa
2021-09-02 14:12:01 +02:00
jenkins-bot 52fe00975e Merge "Add notes and warning for missing parameter documentation" 2021-09-02 11:49:59 +00:00
jenkins-bot 52ed6367f9 Merge "Mark link to non-existing template page red" 2021-09-02 10:25:54 +00:00
jenkins-bot 7c304dc444 Merge "Highlight first template parameter when using tab to navigate" 2021-09-02 10:18:22 +00:00
jenkins-bot abdbf57f84 Merge "Fix click/enter on template parameters not focusing the input" 2021-09-02 10:11:49 +00:00
jenkins-bot c8e00fb98a Merge "Highlight corresponding template parameter in new sidebar" 2021-09-02 10:10:13 +00:00
Thiemo Kreuz a395e76653 Mark link to non-existing template page red
Bug: T272487
Change-Id: I15b377feda3a4e3b4570986668dfaa066afd70e9
2021-09-02 10:02:57 +00:00
Thiemo Kreuz 06cf00f4c6 Rename and document select/focus events in template dialog
I tried hard to come up with the best possible names. Some of the
criteria I used:
* Longer and more unique is better. This makes it much easier to
  e.g. search for the event name.
* The term "part" should only be used for top-level parts. While
  template parameters have a unique id, they are not a subclass
  of …TransclusionPartModel and therefor not "parts".
* BookletLayout manages "pages" via "page names".
  * The page names of top-level parts are identical with the part
    id, see ve.ui.MWTemplateDialog.getPageFromPart.
  * The page names of parameters are identical with the parameter
    model id, see ve.ui.MWTemplateDialog.onAddParameter.

Some code knows parameter ids, but not what pages are. Other code
knows page names, but not what parameters are. The transition
currently happens in the …OutlineContainerWidget. We might want
to move this point up to the …TemplateDialog. But I would argue
this is good enough for now and can be changed later, if needed.

Bug: T285323
Change-Id: Iab2805b3203988db400b67c8d00e48905fdc53dc
2021-09-01 16:23:59 +00:00
WMDE-Fisch 1673f9f8bf Add notes and warning for missing parameter documentation
Bug: T276574
Change-Id: Iba0dd661ccdfd6cbb13aef7e8ace25995ecf0cf8
2021-09-01 17:29:25 +02:00
Thiemo Kreuz fc0b419540 Highlight first template parameter when using tab to navigate
I tried to memorize the cursor position in the list of
parameters. This way you could leave the list with tab, and
return to the original position with shift+tab. Unfortunately
this is not how the SelectWidget works. The moment the
highlight is gone it's gone. There is nothing that remembers
a position. We could introduce code to do this. But I feel
like this is a lot of effort for not much benefit. Also not
listed as a requirement anywhere, at the moment.

Bug: T285323
Change-Id: I8d44ba4539ec4b5535bc031accfeacd87e1886eb
2021-09-01 14:05:01 +00:00
Thiemo Kreuz 7a8ad64cbd Fix click/enter on template parameters not focusing the input
This got lost in patch I20dbd2b.

Both events come from the same sidebar class. The difference
between the two is:
* selectPart is when the button representing a top-level part
  is clicked.
* focusPart is when a parameter name is clicked while the
  parameter is already checked.

Yes, this is confusing at the moment. Following patches will
rename, merge and split a lot of these events to be much more
self-explaining.

Bug: T285323
Change-Id: I0c6b53c93c712ff5e47c1beb5199d590cba7ab1a
2021-09-01 16:01:17 +02:00
Thiemo Kreuz b7efea5559 Remove unused event listener from …ParameterSelectWidget
We forgot to remove this in I319896a. The individual
…TransclusionOutlineParameterWidgets don't fire this event any
more. Instead this is done by the …SelectWidget.

Bug: T285323
Change-Id: I2c29e45127464785ffdc32d73b52188fcbefb7bf
2021-09-01 11:58:36 +00:00
Thiemo Kreuz b0ddcb0010 Highlight corresponding template parameter in new sidebar
Note there are currently two different code paths utilizing two
different events. The existing event handler actually changes
the selection of the top-level part in the sidebar (the
corresponding template name turns blue). The new event handler
highlights a parameter (it turns gray). This is currently
intentional (partly because of a bug in OOUI). I will try to
merge these code paths, if possible.

Please test, and if it works fine from the user's perspective,
please merge it as it is for now.

Bug: T285323
Bug: T289043
Change-Id: I8fafee68b8b7ff225c7b3c327f483f3426d8129c
2021-09-01 11:15:37 +02:00
jenkins-bot f7265428e8 Merge "Try to use margin/padding instead of flex for template dialog" 2021-09-01 08:53:01 +00:00
jenkins-bot 3b5064318c Merge "Connect focus event from BookletLayout to new sidebar" 2021-09-01 08:47:07 +00:00
Thiemo Kreuz a4dac831d9 Try to use margin/padding instead of flex for template dialog
Proof of concept: while flex is – well – flexible, it feels like
this should be possible with some good old block containers and
margins. It's pixel-perfect in my test.

Bug: T288465
Change-Id: I1458900fff197e08ce318398524a3cf2b6b9ee2a
2021-09-01 10:35:52 +02:00