Commit graph

3343 commits

Author SHA1 Message Date
Adam Wight fb81938c74 Take parameter list out of tab navigation when empty
This prevents an invisible and unactionable focus target when the
parameter search field doesn't match anything.

Bug: T312547
Change-Id: Ib29913a547cd68649d29e28d921c4c1358bad7b8
2022-07-08 13:59:37 +02:00
jenkins-bot 55cc3af23d Merge "Don't refocus content pane after removals" 2022-07-08 11:16:25 +00:00
Adam Wight 352dcc6177 Don't refocus content pane after removals
Causes problems when we remove a parameter using the spacebar, for
example.

This partially reverts Id3843b2c7ad6.

Bug: T312524
Bug: T312205
Change-Id: I65d834bc0d2cc649803b536ecc65bdd1fa166a32
2022-07-08 12:23:36 +02:00
WMDE-Fisch ab7bc03b18 Lessy-fying OutlinePartWidget and OutlineButtonWidget rules
Using a certain amount of depth to make sure to override OOUI
specificity.

More can be done in follow ups.

Change-Id: I1edc5db98d16a4c0de8abd7f705776fb9eb65b97
2022-07-08 10:29:57 +02:00
WMDE-Fisch 83c30099ec Move obvious Outline related CSS into own file
Should be a noop. Also moving one rule further up to the set of
similar selectors.

Removing one rule that was disabled for some time now.

Optimizations follow.

Change-Id: I8da70a52c13afd8ac1c3ff43bae63a203c3bf86a
2022-07-07 22:05:09 +02:00
jenkins-bot e635e70cca Merge "No highlight for selected template names" 2022-07-07 15:39:46 +00:00
jenkins-bot 768e8517f8 Merge "Revert "Restore selection after keyboard parameter navigation"" 2022-07-07 15:14:31 +00:00
Andrew Kostka 079a1ce6ff Remove highlighting when typing in a search field
Bug: T311204
Change-Id: I583c02df3def6cfeb347e9b63045b62e1d735e24
2022-07-07 13:40:42 +00:00
Adam Wight a83d37d864 Revert "Restore selection after keyboard parameter navigation"
We don't want to restore selection.  Instead, we'll remove all
parameter selections onFocus, in a later patch.

This reverts commit 787d44af66.

Bug: T312017
Change-Id: Ia1dc8061dfd1813a58befff5adc5c3882b54d8e2
2022-07-07 15:24:11 +02:00
jenkins-bot fd86b7f38d Merge "Autofocus template input field on dialog open" 2022-07-07 13:18:53 +00:00
jenkins-bot e6737b55af Merge "Drop StackLayout" 2022-07-07 13:17:08 +00:00
Andrew Kostka 3f8387af17 Autofocus template input field on dialog open
Bug: T312205
Change-Id: Id3843b2c7ad6b3eb4a11e0c6d288dd69804973f8
2022-07-07 14:26:17 +02:00
Adam Wight 483528affe Drop StackLayout
Gets rid of some unused behaviors that we've already disconnected.
Brings the remaining styling into VE files.

Bug: T312524
Change-Id: Ie94472019ba41124831621c45713861297219594
2022-07-07 13:06:24 +02:00
Svantje Lilienthal e286e11a6c No highlight for selected template names
Bug: T311204
Change-Id: I949ede551b122c365954ef5315103e0749353288
2022-07-07 09:16:05 +00:00
jenkins-bot ab8fba0f2a Merge "Remove dead code when adding parameters" 2022-07-07 07:26:05 +00:00
jenkins-bot 1548904bc4 Merge "Update styling for the floating help button" 2022-07-06 16:16:22 +00:00
WMDE-Fisch be05a524d1 Remove dead code when adding parameters
Both parts are not relevant anymore:
- The first part is about focusing parameter placeholder pages.
  These are added after load only when using the keyboard shortcut.
  Focus will be done separately in that case.
- The second part is dead code since some time now. Also it is not
  needed here. Scrolling to newly added parameters is done via the
  setPage() method in the layout.

Bug: T289043
Change-Id: I928afef01b9e62a9da91db10340d9df78717e125
2022-07-06 15:54:29 +00:00
jenkins-bot 9754f8fd8f Merge "Focus the input after switching to the content pane" 2022-07-06 14:19:41 +00:00
Andrew Kostka d097a83c54 Update styling for the floating help button
Bug: T310762
Change-Id: I2f8d668caad224b51e095ba423a761014a5a994e
2022-07-06 15:43:13 +02:00
Adam Wight f93527e00f Scroll even if sidebar selection hasn't changed
This should be safe because selection is only set from use cases
in which we do want the sidebar scrolled to the matching item.

Bug: T290975
Change-Id: Ib0c66bb048768d633d0f638c775eba24cd652db8
2022-07-06 14:58:55 +02:00
Adam Wight b20b5dbe9d Focus the input after switching to the content pane
... except on mobile because the keyboard will expand.

Need to disable a spurious focus when the element isn't visible,
because this was making it impossible to focus later once it becomes
visible.

Bug: T290975
Change-Id: I0e6057d1cfbef24324a287e50e4988f935720c61
2022-07-06 14:47:50 +02:00
Adam Wight d9e56ef69a Remove unused autofocus code
Two-pane layout setPage no longer does any focusing, so this variable
is not respected anyway.

Change-Id: I1ddb06e11b68be300013a92b2dd05b90583ddc2a
2022-07-06 14:12:35 +02:00
jenkins-bot ddd56ff542 Merge "Use "Add template" label in the sidebar and as the header" 2022-07-06 11:40:48 +00:00
Andrew Kostka d5b8107902 Use "Add template" label in the sidebar and as the header
Bug: T311107
Change-Id: Ib85c08c5d72e621a7687dc393b2f8d9443f13b06
2022-07-06 10:55:43 +00:00
Thiemo Kreuz 217885013a Refine height calculation of template parameter docs
Instead of using a potentially weird fractional value like 3.2 lets
use the floor(ed) value, e.g. 3. Reasoning: These fractions are not
from text lines but optional margins between some of the lines. These
margins should not be counted.

Also increase the cut point from >=3 to >3. This is much closer to
the original specification that talked about "2 lines plus x
characters". See T273426. These "x characters" are the 3rd line.

Bug: T310775
Change-Id: Ib5d1642d7967593dd5f13e556c6244fc44677af4
2022-07-06 10:40:51 +00:00
Andrew Kostka 08e8581944 Use full dialog width for add template input on mobile
Bug: T311109
Change-Id: I5b6beced37d569689470d19361420bead38d18cb
2022-07-06 11:52:49 +02:00
jenkins-bot 4730987f2c Merge "Remove selection when selected parameter is unchecked" 2022-07-06 08:11:01 +00:00
WMDE-Fisch bc4fcfa04a Remove selection when selected parameter is unchecked
Adjusting some methods to support the usecase.

Bug: T312085
Change-Id: I4b97ab912f9ac0046f72167c3b573ee8e14e58d9
2022-07-05 19:22:36 +02:00
jenkins-bot ea21d8eacc Merge "Restore selection after keyboard parameter navigation" 2022-07-05 13:39:22 +00:00
jenkins-bot a5b9538a6b Merge "Drop unused active state" 2022-07-05 13:16:18 +00:00
Adam Wight b275bb33d4 Remove max-width limitation on inputs for mobile skin
All elements should be able to use the full window width.

Bug: T311109
Change-Id: I1e3ca6718a44cbdaa74d0c5bc94d0f475cd5e6bd
2022-07-05 14:02:43 +02:00
Adam Wight 787d44af66 Restore selection after keyboard parameter navigation
When blurring out of keyboard parameter navigation, the
last-selected parameter will be highlighted again.

Bug: T312017
Change-Id: I8b0fb667b44b324529d4c45c39bf21573517f989
2022-07-05 13:37:38 +02:00
Adam Wight 441ffc5a84 Drop unused active state
`OO.ui.PageLayout.prototype.setActive` explains that the "active"
state only makes sense for a case we don't support, when a booklet
layout is used in non-continuous mode.

Change-Id: Ib5ddd605f29e82ebc85b833ac96b70ff4c95e502
2022-07-05 13:16:31 +02:00
Adam Wight fd002928e2 Always scroll to current page
Most of setPage's side-effects are redundant and can be skipped when
reselecting an item which already the current selection—except for
scrolling, which is useful to perform every time, for example when
clicking on the already-selected sidebar item.

Bug: T294348
Change-Id: I90ba14817e5536ac018eb70102f657f29a29644d
2022-07-05 11:32:02 +02:00
jenkins-bot dca4e559e7 Merge "Fix broken scroll on sidebar toggle" 2022-07-04 14:33:34 +00:00
jenkins-bot b380f84d42 Merge "Prevent highlighting the first parameter when clicking to remove" 2022-07-04 14:24:17 +00:00
WMDE-Fisch ed4fa49520 Fix broken scroll on sidebar toggle
This was using the currentPage from the StackLayout. It will not
be updated there anymore.

Also removing the line about focus after toggle. We do not want
that anymore afaik.

Bug: T312015
Bug: T289043
Change-Id: I8b6eedd580d49604014118171c6da62849752d53
2022-07-04 16:00:39 +02:00
jenkins-bot 90a5f8aaad Merge "Reuse hard and soft action handlers" 2022-07-04 13:51:38 +00:00
Adam Wight 6c16f93504 Prevent highlighting the first parameter when clicking to remove
Tabbing into the parameter select list should highlight the first
parameter, but focusing a checkbox by clicking it to uncheck should
not trigger this highlighting.

Copied from the superclass method.

Bug: T312014
Change-Id: Ia1fd450bad4861eb2815ca21eae69ee31e40ac08
2022-07-04 15:50:56 +02:00
Svantje Lilienthal 788e21e0a4 Clicking template or parameter name scrolls it to top of dialog
Only works with changes in OOUI core. See https://gerrit.wikimedia.org/r/c/oojs/ui/+/753987

Depends-On: Ie822dc87bc5748985de5637cb35f1940837f64d3
Bug: T299036
Change-Id: Idaccc7c95d67abe14621eabb7725ba07e449ab1e
2022-07-04 15:23:34 +02:00
Adam Wight c2e111239b Reuse hard and soft action handlers
New sidebar events take a `soft` parameter allowing reuse between
"hard" and "soft" selection and parameter add.  The "hard" variant
causes a content-pane focus.

Bug: T311987
Change-Id: Ic49718840ae56eb4cfab01ce964a2fbc2d8db63b
2022-07-04 13:42:34 +02:00
Adam Wight 14deb729a4 Rewrite handlers using canonical setPage
More idempotent approach to state change, using a common function
that has all the side-effects.

Bug: T311987
Change-Id: I13e64ff5262295a60c28572855cfe36da7c3ff41
2022-07-04 13:41:19 +02:00
Adam Wight 8448f513a4 Two-pane layout setPage has all the desired side-effects
This becomes the canonical method to call when we want to update the
template dialog to select a new item.

Bug: T311987
Change-Id: Ie7880bfde41b77f0e6367cc8e3a78edb299391ce
2022-07-04 13:31:06 +02:00
Adam Wight 0c4716aaaf Replace event wiring for stackLayout.set with explicit call
Call the handler directly.  This avoids the `set` event handling for
add and remove parameters, causing minor behavior changes:

Moves the "reselect" logic after removing pages, from StackLayout to
the two-pane layout class.

Bug: T311987
Change-Id: I46454d184d4718bed45caf9f41487364611f1f44
2022-07-04 13:26:56 +02:00
Adam Wight a104d0c888 Use local state rather than stackLayout.currentItem
Bug: T311987
Change-Id: I62ddc013ae255bcbaf3478c7f0949238245988e6
2022-07-04 10:40:35 +02:00
Adam Wight 3e2d594148 Minor doc updates
Change-Id: I87156e203c131545c463bfa2307b2d8f7c5507ca
2022-07-04 10:40:02 +02:00
jenkins-bot e2ecb537e9 Merge "Gallery image: Use thumbUrl if src is not set (new images)" 2022-07-01 22:33:54 +00:00
WMDE-Fisch 4371c4fde2 Adding lines in doc comments
Change-Id: Ie9a8ae32b4fdf476ad607f805c91357d824474a4
2022-07-01 16:25:40 +02:00
Ed Sanders ce9619618b Gallery image: Use thumbUrl if src is not set (new images)
Bug: T310623
Change-Id: I5ded2dcf1864e0cb4a3df64b3b8bc873f7a35fe7
2022-07-01 13:14:03 +01:00
Adam Wight 1653815e8c Rename event to be descriptive, not prescriptive
Events should be named based on what happened, not what the
side-effect will be.

Change-Id: I563db48181e1db79ca22ef2ba1e25d5186976110
2022-07-01 12:42:23 +02:00