Commit graph

1273 commits

Author SHA1 Message Date
jenkins-bot 6f16d02c0c Merge "Wikitext mode: Use action=parse for preview" 2022-07-16 16:54:30 +00:00
Ed Sanders 2644c84cda Increase default debounce of live extension inspector/dialog to 1000ms
250ms gaps are pretty common when typing at a normal speed, resulting
in a lot of (often expensive) API requests (e.g. T312319). For most
use cases this level of responsiveness in the preview is not necessary.

Change-Id: I6504567d4da02a66171ee35a9c4fd35c85136909
2022-07-14 17:14:37 +01:00
Ed Sanders 3148e28f69 Wikitext mode: Use action=parse for preview
Using Parsoid HTML in the 2017WTE has enabled us to iron
out lots of rendering bugs over the past few years.

In that time Parsoid has been moved into PHP, and at some point
we also become the default parser.

Also more extensions have started to use content transform hooks,
which are only supported by the action API.

As a result it now seems like a good time to migrate back to the
content API instead of building the preview from Parsoid HTML.

Bug: T154844
Change-Id: I90d775dd71d5f5a61d651b63d946ab60a27e2ca3
2022-07-12 17:12:06 +01:00
jenkins-bot 55165649c7 Merge "Document some classes touched in the sidebar rewrite" 2022-07-12 13:53:29 +00:00
Adam Wight d77728bd4f Document some classes touched in the sidebar rewrite
Depends-On: I385dca1d95033961d3844e888521750443e49c95
Change-Id: Ic515b41863bcf2ac4daa0272f67e1d30238a4b85
2022-07-12 12:49:31 +02:00
WMDE-Fisch a0c0465d67 Don't access the stacklayout directly
Bug: T310867
Change-Id: I95cbdee26ead46c2d8803ddb3a9e06304f793407
2022-07-09 05:56:27 +00:00
jenkins-bot fd86b7f38d Merge "Autofocus template input field on dialog open" 2022-07-07 13:18:53 +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
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
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
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
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
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 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
Thiemo Kreuz 767a928a23 Move remove button toggle code to more appropriate place
This patch does a few closely related things:
* Replace a direct dialog → sidebar access with dialog → layout →
  sidebar.
* Move the misplaced removeButton.toggle() to a more appropriate
  place.

Bug: T311069
Change-Id: I5a2802aab587a6f7de4681bce4e9961a064ef8ee
2022-06-29 16:31:25 +02:00
Adam Wight 2ff0f6d5f2 Move custom buttons into outline controls
Bug: T311296
Change-Id: I5cc45f6a05ca029e319e04e76f6e35bfd5b506a6
2022-06-29 10:08:35 +00:00
Svantje Lilienthal ead1e258d5 Create new refreshControls function in TwoPane
Bug: T311296
Change-Id: I5a06238a7cf58189616f1b812bec74e99ef7922f
2022-06-29 11:44:07 +02:00
Adam Wight d138cd04bf Fixes for focusPart
We missed some usages.  Follows up on I5f05bc119dc213d8

Change-Id: Iaecb804300c37d43108a14e8db0068deb58f503c
2022-06-28 15:31:54 +02:00
jenkins-bot c29690b1f1 Merge "Move template dialog sidebar container into forked BookletLayout" 2022-06-28 12:56:24 +00:00
Adam Wight 978cefa13b Move template dialog sidebar container into forked BookletLayout
Bug: T310867
Change-Id: I7d2a882b99e4796ecc6594b1cfb638eecd985de2
2022-06-28 12:02:01 +02:00
Adam Wight 2dd9405e38 Move last remaining sidebar event handler into forked class
These are internal to the two-pane layout and sidebar, so the dialog
doesn't need to be involved.

Bug: T310866
Change-Id: I5f05bc119dc213d8e31db62a3808a2fadaf35d99
2022-06-28 11:35:22 +02:00
Thiemo Kreuz 31d75a1738 Move sidebar-related event handlers down into BookletLayout fork
Bug: T311069
Change-Id: I95fd2637ef4c39f8547e676dcfb5de333d5278e9
2022-06-28 11:27:02 +02:00
jenkins-bot 51cd862fce Merge "Adding canGoBack to the properties" 2022-06-28 08:55:53 +00:00
WMDE-Fisch bc1e3efa4b Adding canGoBack to the properties
As disussed in Id23d3ac5e1715387c78916adeb8ca5f675005a5c

Change-Id: I1368199a4b709d5634ca6e20f04323a0227065be
2022-06-28 10:35:44 +02:00
Adam Wight d5f2767605 Remove unused parameter to focus
The one usage of this wasn't working.  FIXME: maybe we want to
restore the behavior, to focus the first parameter in the dialog
after opening.

Bug: T310866
Change-Id: Ibe0151fbedb3a9716bb231b5d398c4ae670fd667
2022-06-28 09:54:39 +02:00
jenkins-bot e8ece4da06 Merge "Drop unused "editable" configuration from template dialog" 2022-06-28 07:28:12 +00:00
jenkins-bot 8c94e2b5aa Merge "Move template dialog sidebar clearing to more appropriate place" 2022-06-28 07:13:27 +00:00
Thiemo Kreuz b0ce363e2b Drop unused "editable" configuration from template dialog
This defaults to false. It looks like this default is used in the
MWTemplateDialog base class. However, it also looks like this base
class is never used on it's own. All users we know use the subclass
MWTransclusionDialog where "editable" is true.

https://codesearch.wmcloud.org/search/?q=%2C%5Cs*ve%5C.ui%5C.MWT(emplate%7Cransclusion)Dialog&files=%5C.js%24

In the process I also remove some comments that literally repeat the
code and don't add any knowledge because of this.

Bug: T310867
Change-Id: Ie245aab80d1e77a8406f5591062e9cf49fd9613f
2022-06-28 09:11:31 +02:00
jenkins-bot 5d2d36f9d7 Merge "Remove dead code (not) selecting first template parameter" 2022-06-28 07:03:22 +00:00
jenkins-bot 6641f7da85 Merge "Move .addPromptedParameters() calls to more canonical places" 2022-06-28 06:59:49 +00:00
Thiemo Kreuz fd0b32fe31 Remove dead code (not) selecting first template parameter
This code was meant to select the first parameter of a template the
moment it is added. It's at least partly broken because it doesn't
consider the so called "prompted" parameters that have been added
just a few lines above. It's a questionable feature anyway. We are
going to refine all focus-related behavior anyway. Let's remove this
broken stuff and reimplement it later (probably in a different place)
when we continue working on this.

The FIXME was added in I720ce1a.

Bug: T311223
Change-Id: I1801efe38387b5e7a1b76417c1e5d7db4e4b96d0
2022-06-28 08:42:59 +02:00
Thiemo Kreuz 76f563c929 Move .addPromptedParameters() calls to more canonical places
This was done in 3 rather "random" places:
1. Whenever a template is manually added. But rather late, after the
   template was added, in an event handler that is about focus
   behavior. It should not continue to manipulate the template that
   was just added.
2. When the dialog opens with a template preloaded by name, as it is
   done from the citation menu.
3. When the dialog is about to finish loading.

This patch fixes 2 issues:
* Get rid of a duplicate call (number 2 and 3) when using the
  citation menu.
* Move number 1 to a place where it's executed much earlier, and
  only when the user clicks "add template" in a template placeholder.
  There is no other way to add a template to an existing transclusion,
  but it's still a more appropriate place I feel.

Bug: T311069
Change-Id: I8a65ad703b95ba2092e9ef73493e9903e96b0dd6
2022-06-28 08:40:24 +02:00
Adam Wight b1a12aeaab Simplify focusing a parameter
We can use setPage, thereby removing a dependency on the
OutlineSelectWidget.

Bug: T310866
Change-Id: If097c9218fe56e63d9c003b10789c94513c20c93
2022-06-27 13:36:46 +02:00
Adam Wight 33d9f9958b Remove findClosestPage logic
This causes one small behavior change: when deleting one of several
wikitext transclusions or a part following a template without
parameters, the selection would previously be set to the *previous*
part, and now it's the *next* part.  This is arguably more consistent
with the behavior when removing eg. templates with parameters, after
which the next part is selected.

Doesn't affect removing parameters.

TODO: We might want to restore the already-broken behavior to focus
the first parameter of a newly-inserted template.

Bug: T310866
Change-Id: Ic5f47e31512d1a3949caf60613bd05b9a3bdf478
2022-06-27 13:36:44 +02:00
Thiemo Kreuz 8788077754 Move template dialog sidebar clearing to more appropriate place
This place is much better in so far that it much more obviously gives
us the guarantee that the sidebar and the content pane are always in
sync.

Bug: T311069
Change-Id: I01a7914fcba5d573abb957d0e34fa895874bd94e
2022-06-24 15:24:58 +02:00
jenkins-bot 958082378b Merge "Merge set handler into two-pane class" 2022-06-24 13:11:21 +00:00
jenkins-bot e54d380992 Merge "Remove newSidbar CSS and merge CSS rules" 2022-06-24 12:32:20 +00:00
Adam Wight 32a14d888b Merge set handler into two-pane class
Bug: T311069
Change-Id: I4cb7e63349904588bb27541d176378aa874d0a63
2022-06-24 12:32:16 +00:00
WMDE-Fisch c295a731ec Remove newSidbar CSS and merge CSS rules
In some cases ve-ui-mwTransclusionDialog-newSidebar could just removed
when there are specific enough classes present so that we can be
sure to not overwrite rules outside our use case.

e.g with the new ve-ui-mwTwoPaneTransclusionDialogLayout-stackLayout

Note that this will also remove some right padding on descriptions
where it seems that it was applied for no reason.

Bug: T310859
Change-Id: I6612fe1cb2ea6bd75e9bc3e6f4d6d8d0c4addc63
2022-06-23 17:42:24 +02:00
jenkins-bot 8fb649e979 Merge "Drop unused "continuous" configuration" 2022-06-23 12:29:57 +00:00
jenkins-bot 65170a656a Merge "Push ownership of the sidebar down into the two-pane layout" 2022-06-23 12:20:12 +00:00
Adam Wight 9f04a2516e Drop unused "continuous" configuration
Bug: T310867
Change-Id: I6773f657d2ad08bb9cdfb1fe2d480fee1d175412
2022-06-23 12:12:05 +00:00
jenkins-bot a536a66799 Merge "Never attach outlineSelectWidget to the DOM" 2022-06-23 11:24:21 +00:00
Adam Wight 90179c48ed Push ownership of the sidebar down into the two-pane layout
Leaves a reference in the TemplateDialog so that we can slowly
migrate the many usages.

Makes no other changes to how the sidebar is managed (yet!).

Bug: T311069
Change-Id: I45403cd32e3adbe357ebad7bbc851f60d92751e5
2022-06-23 11:22:08 +00:00
jenkins-bot b14f3a5965 Merge "Remove duplicate "add parameters" method from template dialog" 2022-06-23 11:17:12 +00:00
Adam Wight b39bb342ec Never attach outlineSelectWidget to the DOM
Bug: T310867
Bug: T310866
Change-Id: I8e3a12693bbe9f91a171484a03316c9d4c94a2be
2022-06-23 10:50:51 +00:00
Thiemo Kreuz 8854d03552 Inline template parameter id to page name connection
It's never used in a different way. A lot of other code depends
heavily on this fact. Let's hard-code it.

Bug: T310859
Change-Id: I65bbaea47341d74b49ce447c896eb2340f730e17
2022-06-23 12:24:08 +02:00