Commit graph

3494 commits

Author SHA1 Message Date
Ed Sanders 4bf8955c18 Link inspector: Avoid focussing a input when it isn't visible
Bug: T321026
Change-Id: I4edcf9c0cbe13eac450bc8e05883c7506b8dbfaf
2022-11-18 13:25:40 +00:00
Ed Sanders 2a4b4f6b96 GalleryContextItem: Only count image node children
Bug: T320874
Change-Id: I524901619820482c7152d7c7b9bc4a2b9f6ee3ca
2022-10-16 00:03:26 +01:00
Thiemo Kreuz 003f5fc82e Remove redundant/unused CSS for template parameter page
A lot of this just repeats what is already set by some other rule,
e.g. because it is the OOUI default anyway. Warning. This patch is a
little more agressive. I tested it on desktop and mobile, even with
MonoBook, and could not spot a different. Please do some more tests.

Change-Id: I0ee6e70f4f14c20d431643c53031d6d5b8df1aa2
2022-09-12 11:32:39 +00:00
jenkins-bot f153331ee3 Merge "Remove redundant "choose" event handler" 2022-09-12 10:03:52 +00:00
jenkins-bot b3443cd96c Merge "Enable template editor toolbar deeper in the stack" 2022-09-12 09:52:26 +00:00
jenkins-bot 58aacfa046 Merge "Fix parameter labels not being clickable" 2022-09-12 09:50:04 +00:00
jenkins-bot 5d24bea80a Merge "Start with last item when shift+tabbing into parameter list" 2022-09-08 12:40:40 +00:00
jenkins-bot ee9866bfc9 Merge "Make "(undocumented parameter)" part of the parameter label" 2022-09-08 11:52:52 +00:00
jenkins-bot 182eb7340e Merge "Fix calling order in template dialog .getSetupProcess()" 2022-08-30 13:28:51 +00:00
Thiemo Kreuz 663936ab6e Fix calling order in template dialog .getSetupProcess()
This fixes two issues:
1. .initializeAllStickyHeaderHeights() is now executed after the
   .ve-ui-mwTransclusionDialog-single-transclusion CSS class is set.
   This is critical because in this mode the sticky header does
   have a different height.
2. We get rid of 2 references to .sidebar that should not have been
   in this class in the first place.

Also bring some more calls in an order that makes sense. This does
not make a difference and is only for readability.

Bug: T315292
Change-Id: I22f6c11de8f693edb03485adcaa186bd4b283b2f
2022-08-30 14:20:42 +02:00
Thiemo Kreuz 337ee1588e Remove redundant "choose" event handler
I'm pretty sure this extra call is just pointless. This "choose"
event is triggered every time a new parameter is added to the list of
parameters. But there is another code path that is triggered in the
exact same situations: the onReplacePart event handler.

As far as I remember this "choose" handler was added very early when
the other events haven't been implemented yet.

This should be fairly easy to test. The only situation where this
could make a difference is:
1. When you have a template with 3 parameters and you add a 4th
   parameter.
2. When you edit an existing multi-part transclusion that contains a
   lot of parameters, but the parameters are initially hidden. The
   widgets are only created when you click "show all" or start
   searching.

Change-Id: I59e3873a4fe6fa5a01d681fce89fbe00756ae815
2022-08-30 12:23:07 +02:00
Thiemo Kreuz e5d6af728e Add missing call to .recalculateStickyHeaderHeight()
This was missing when you:
* Insert a new template and select a template with a lot of
  parameters.
* Same when you edit an existing multi-part template and add a new
  part (Ctrl+D) with many parameters.

Bug: T315292
Change-Id: Icd281c21a1b40d8e29343fa4975e27e8d927cd15
2022-08-30 11:57:23 +02:00
Thiemo Kreuz d92da786a2 Fix parameter labels not being clickable
This is only an issue when a long parameter description is collapsed.
The float is a left over from a time when there was a delete button
on the right side of each parameter label. This is gone.

Bug: T310137
Change-Id: I249f0592de9c73a07af22bd7f86241caf0207770
2022-08-29 17:12:28 +02:00
Thiemo Kreuz 299738307e Make "(undocumented parameter)" part of the parameter label
This makes it possible to click on "(undocumented parameter)"
to focus the input field – the same effect as when clicking the
parameter name.

This also lower-cases the initual "(U…". This is not the beginning of
a sentence.

Change-Id: Ibfa5bbaee39c2b3a4fefbcee33102b85ca3ba9c0
2022-08-29 17:00:23 +02:00
Thiemo Kreuz d10dd4ded0 Don't focus template input fields (and open keyboard) on mobile
On mobile, tapping anything in the sidebar should only scroll the
corresponding element into view, but not focus the input field. The
reasoning is that an on-screen keyboard should only pop up when the
input field is actually tapped.

By the way, the "jump" issue in T312768 was because of the same
reason. In that case an onFocus happens before we have a chance to
scroll. Unfortunately there is no way to reverse the execution order
of these. Which is why we disabled the animation there.

Bug: T289043
Change-Id: I1c18802b8ff776fa8d9c17e3df8020354690d29f
2022-08-28 14:26:29 +00:00
Thiemo Kreuz c35c1f6813 Dynamically calculate height of toolbar sticky headers
Alternative for Idf4d69d.

Bug: T315292
Change-Id: I15231d66bb832b92d1924881b0df7dbe9f26a921
2022-08-18 17:59:03 +02:00
Thiemo Kreuz e338a3c35d Enable template editor toolbar deeper in the stack
We can do this more in-place instead of reaching into the structure
from the outside.

Change-Id: I1beb5f7dcfef027f811a3bb4d2a2ef323e2535e3
2022-08-17 13:37:48 +02:00
jenkins-bot 16a8dc34a0 Merge "ve.ui.MWTargetWidget: Remove top margin in Vector 2022" 2022-08-16 22:51:35 +00:00
Thiemo Kreuz 1926ab7b05 Code cleanup in ExpandableContentElement
This is split off from the unfinished patch I039d6f6. This only moves
existing code around, makes use of chaining and such to make code
more compact and hopefully more readable. Methods are renamed to
reflect better what they actually do. No behavior should change.

Change-Id: I3ba538c8c77ad4455bf0f0aa821ca14feadef7cc
2022-08-15 08:40:11 +00:00
Thiemo Kreuz eb71810b6d Start with last item when shift+tabbing into parameter list
Note this implementation introduces some technical debt: It adds a
little bit of knowledge about what "part widgets" and the toolbar are
to the parameter SelectWidget. I think this is acceptable.
A "cleaner" implementation is probably so complicated that we don't
want it in the code, for such a minor benefit. However, alternative
patches are very much welcome.

Bug: T313703
Change-Id: I957698d58a7622cbe54bcc2ba454388ba9f09537
2022-08-11 18:23:51 +00:00
Thiemo Kreuz 89ace728a4 Chain scroll calls instead of just calling after each other
Change-Id: I420fbd29ab79d6f2e1e9ef02bc3c99050126c3c8
2022-08-11 15:35:45 +00:00
Ed Sanders 9f5944af9e ve.ui.MWTargetWidget: Remove top margin in Vector 2022
Change-Id: I3d079a9e1b44821180c849c2c018a2314b2e089e
2022-08-11 14:27:53 +01:00
Bartosz Dziewoński d36d467a82 ve.ui.MWTargetWidget: Suppress the stacking context established by .vector-body
Bug: T314230
Change-Id: I742f0435f279689dbdac8e811a8aeab00cc9086b
2022-08-11 01:47:19 +02:00
jenkins-bot f842d6fa97 Merge "Rename value state variable" 2022-08-05 09:23:08 +00:00
WMDE-Fisch c66e700469 Rename value state variable
Is more intuitive like that.

Change-Id: Ib36d6fa1bce9a564f5b9a1c027f2573a5775d2c5
2022-08-05 10:07:18 +02:00
WMDE-Fisch 6cfa2e7dd0 Fix typos
Change-Id: Iaa7bf09877f32f7c19217103773657a8d8a81d16
2022-08-05 10:00:54 +02:00
Adam Wight 63c625f261 Remove unused config parameter from forked ControlsWidget
Split from I8eb279f.

Bug: T311296
Change-Id: I1739af4ca3c92a3aab08c61be8f665d2d3997f7c
2022-08-04 20:14:41 +02:00
jenkins-bot e857ded358 Merge "Streamline button margin calculation for outline parts" 2022-08-04 13:05:18 +00:00
WMDE-Fisch 7f4645bbe0 Streamline button margin calculation for outline parts
Generally the default button margin on the parts is 24px. The only
exception are the placeholder and wikitext when they are the last
parts in the outline.

Bug: T312644
Change-Id: Ie513bf1c022b2696cc92aacbbca59ddf6e55043e
2022-08-03 13:09:51 +02:00
jenkins-bot e50c0af860 Merge "Show "no parameters" message only when there are no parameters" 2022-08-03 09:43:50 +00:00
Thiemo Kreuz cdf9a59278 Tweak the hard coded top scroll padding for the parameter list
In Iebfe2e2 we already tweaked this by 1px. Turns out this was not
enough in all relevant situations. I still get random scroll events
just because I move the mouse around. Setting: Firefox, 120% zoom,
multi-part transclusion.

Bug: T312926
Change-Id: I475c1ef029e9721cc663881e40547730389cd26d
2022-08-03 11:15:32 +02:00
Thiemo Kreuz 5eb1193670 Tweaks to focus/scrolling code relative to sticky header
* Rename method because it turns out it is not only about the sticky
  header, but also relevant when there is no header.
* Move some code to more appropriate places.
* Use 0 as documented in OOUI, not null.
* Set the padding back to 0 when the sticky header is not visible.
  As of now this is an unreachable state because the filters never go
  away after they have been made visible. Still this code was always
  written with this possibility in mind to make it future-proof.
* Performance optimization for the boolean "show filters?" check.

Bug: T312926
Change-Id: Iaba08ccd8bf00360fd26f9268d5be43df4f4fbd8
2022-08-02 11:41:23 +00:00
Thiemo Kreuz 0b28414dff Restore scrolling parameters into view with(out) sticky header
This is a partial revert of Ide45141. Now the scrolling always
happens (again), but properly considers the presence of the sticky
header. It was also not correctly initialized on construction time.

This is a candidate for a backport. The patch is intentionally as
small as possible because of this. Code cleanup will be done in a
later patch.

Bug: T312926
Change-Id: I06425b42566bfb2087846636055ee75e98a05029
2022-08-02 12:29:06 +02:00
Thiemo Kreuz b9376f5990 Show "no parameters" message only when there are no parameters
The message was also shown when a documented template appears as
part of a multi-part transclusion but with zero parameters being
used. You see the filters in this case and can click "show all".
The message is just wrong in this situation.

Bug: T312926
Change-Id: I8d26ceec483e05fd1f69013e506fa1eb4e4c29ed
2022-08-02 11:48:45 +02:00
Thiemo Kreuz 800461efac Scroll below sticky header only if sticky header is present
Bug: T312926
Change-Id: Ide45141f0a21b782f8674ecbed9ee512de985661
2022-08-01 15:37:33 +02:00
jenkins-bot 2f555569ea Merge "Tweak the hard coded top scroll padding for the parameter list" 2022-08-01 13:05:03 +00:00
WMDE-Fisch 8ae4d291df Tweak the hard coded top scroll padding for the parameter list
Currently the sticky size is exactly 114px. With 115px you also can
see an auto scroll effect on multi part transclusions when you hit
that 1px sweat spot at the top of the list.

Bug: T312926
Change-Id: Iebfe2e2c6360c650755cd985157949a26a5287a4
2022-08-01 14:07:31 +02:00
jenkins-bot a1bd30f35d Merge "Simplify partly redundant findFirstSelectedItem implementation" 2022-08-01 11:45:08 +00:00
Thiemo Kreuz d01d1e78c2 Simplify partly redundant findFirstSelectedItem implementation
Introduced via Ibc56abf. But the OOUI SelectWidget does have some
methods for this already.

This patch also updates some @mixins documentation.

Bug: T302965
Change-Id: Iffbb44d41586786a2165f8d7916f94a52ad19122
2022-08-01 11:07:29 +00:00
jenkins-bot ee760ee2a6 Merge "Fix forgotten "setPage" property because of merge conflict" 2022-08-01 09:37:40 +00:00
Thiemo Kreuz cdb9766752 Fix forgotten "setPage" property because of merge conflict
The rename in I5a16ab4 was done the exact same time a new usage was
introduced via Ibb717ca. Neither patch shows a conflict. Still there
is one.

I remove the extra `|| null` line because it is just not needed. We
don't need to set the property to null when it was already null.

Bug: T312213
Change-Id: Id3f025786c9412e8c1946434113c41356da08098
2022-08-01 09:42:25 +02:00
Andrew Kostka dc91a39f8b Use the same styling for add template and add parameter buttons
Bug: T314052
Change-Id: I62d4e282b0e8f0a32e37e144db358144224119f1
2022-07-28 16:24:15 +02:00
jenkins-bot 6422e69821 Merge "Minor code cleanups in forked BookletLayout and related" 2022-07-28 12:59:10 +00:00
jenkins-bot 13c2a24f6c Merge "Prefer adding parameter to currently focussed template" 2022-07-28 11:34:38 +00:00
jenkins-bot 52c155f43f Merge "Fix "null is not a string" error in event logging code" 2022-07-28 10:41:15 +00:00
Thiemo Kreuz 741dbe5ccf Minor code cleanups in forked BookletLayout and related
E.g. renaming variables and moving code around. No functional change.

Change-Id: I39e76356c62a0d1bcdf1d20bc8215f09604ad07d
2022-07-27 16:04:27 +02:00
jenkins-bot 94268009c9 Merge "Remove dead code, deleting parameters is not possible" 2022-07-27 09:41:51 +00:00
Thiemo Kreuz b085d6cf24 Prefer adding parameter to currently focussed template
Instead of the template that's currently selected. That's confusing,
e.g. when you click one of the search fields, search for a parameter,
can't fine it, and press ctrl+shift+d to add an undocumented
parameter. Or you navigate the list of parameters with the cursor
keys, can't find the parameter you are looking for, and press
ctrl+shift+d to add it.

Still falls back to the selection when the focus is outside of the
sidebar.

We suggest to merge this before UX review, and review it later in
demo time. It's easy to undo if necessary.

Bug: T313388
Change-Id: I9848dd0af4fe821526dafc18bbd7cb1ab0e68cfc
2022-07-27 09:17:23 +02:00
jenkins-bot e06cdeadb1 Merge "ve.ui.MWGalleryDialog: Fix "Alternative text" not being readonly sometimes" 2022-07-26 20:26:17 +00:00
jenkins-bot f7d9da3317 Merge "Start altText as null to avoid empty alt for new gallery images" 2022-07-26 20:00:52 +00:00