Commit graph

13825 commits

Author SHA1 Message Date
jenkins-bot 9754f8fd8f Merge "Focus the input after switching to the content pane" 2022-07-06 14:19:41 +00: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 b902ad7882 Merge "Gallery image: Hide more attributes when diffing" 2022-07-01 22:33:56 +00: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 d1effc5c16 Gallery image: Hide more attributes when diffing
Only 'altText' should be described, everything else
is computed or, in the case of `resource`, results in
nodes being incomparable.

Change-Id: I586b67a0cfa30fae10a86fe3791f7e532c0ed754
2022-07-01 13:14:49 +01: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
Adam Wight d93e35a0d1 Reconnect "soft select" event
Bug: T311296
Bug: T311711
Change-Id: Ic4ee673d339ec0b4b5f54f3d7a878e3ab03f7113
2022-07-01 12:30:01 +02:00
jenkins-bot fe8dd8f604 Merge "Use short style to wire event reemission" 2022-07-01 07:57:03 +00:00
jenkins-bot 22c402356a Merge "Remove set event with no listeners" 2022-07-01 07:57:01 +00:00
jenkins-bot 0c49b144d9 Merge "Fix gray highlighting for parameters" 2022-07-01 07:24:53 +00:00
Adam Wight d592c75623 Use short style to wire event reemission
Change-Id: Id39ecc8e96627a228c8da91628f769cab42f71bd
2022-06-30 15:55:17 +02:00
Adam Wight 68e2f6279a Remove set event with no listeners
Change-Id: I4bdabf0129b65d76281f9f18b92ba202bb9840d3
2022-06-30 15:55:17 +02:00
jenkins-bot 80344da282 Merge "Select parameters like templates" 2022-06-30 13:54:50 +00:00
Andrew Kostka 9821f860e8 Fix gray highlighting for parameters
Bug: T311204
Change-Id: Iff4c5deff67c74496fe98fa3ee58b97ff9a7c847
2022-06-30 15:20:14 +02:00
Svantje Lilienthal b4ed246db2 Re-add refreshControls to TwoPaneDialog
809881 removed one refreshControl too many

Bug: T311296
Change-Id: I72eb03e3db948213117a94d86d79401448759342
2022-06-30 14:31:13 +02:00
Adam Wight aa7501a8e3 Select parameters like templates
Bug: T311204
Change-Id: I61294087963f4659f065f011a2cac350cfd35dda
2022-06-30 14:23:41 +02:00
jenkins-bot a9ac3052db Merge "Rely on selection changed event for updating controls" 2022-06-30 08:18:35 +00:00
jenkins-bot 7570742468 Merge "Calculate controls using sidebar selection" 2022-06-30 08:00:15 +00:00
jenkins-bot df26e6f9c3 Merge "Template dialog controls default to disabled" 2022-06-30 07:28:48 +00:00
Adam Wight 7d023e2dce Rely on selection changed event for updating controls
This event makes other calls redundant because it's always sent from
setPage and onReplacePart.

Bug: T311296
Change-Id: If214a713ed7299320d499c3e5687eda013fe0aab
2022-06-30 08:55:38 +02:00
Adam Wight 699c73893d Calculate controls using sidebar selection
In an important use case (spacebar selection of sidebar parts), the
content pane selection isn't updated.  This patch switches to read
the sidebar selection rather than the content pane selection.

Bug: T311296
Change-Id: I684a9edf04b6615cc840bbb89e8c1d03a0ab8e94
2022-06-30 08:53:15 +02:00
Adam Wight d32303587e Template dialog controls default to disabled
If nothing has been selected, the action buttons should be
initialized in a disabled state.

Bug: T311608
Change-Id: I32fee0d73f6e13e09dc421c944df73b79e0260bb
2022-06-30 07:55:25 +02:00