Commit graph

247 commits

Author SHA1 Message Date
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
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
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 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 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 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
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
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
Adam Wight 15ef2dc3c6 Remove inaccessible ARIA annotation from old sidebar
This was added via I3b792ff. It's about the old sidebar which isn't
accessible any more.

Bug: T311069
Change-Id: I29919285255a84bd58aa06ee1b2816d25a8112a6
2022-06-22 13:44:23 +02:00
Thiemo Kreuz a04d56b6a6 Remove some "pocSidebar" related pieces from template dialog
This is a direct follow up for what was done in I83bbb48.

Bug: T310868
Change-Id: Icd9ed2e8f93b269d0d2d8b0fcfae4febab5e45de
2022-06-21 15:50:23 +00:00
WMDE-Fisch 8535fa72ab Remove dead code in MWTransclusionDialog
Removing CSS will go into a follow up.

Bug: T310859
Change-Id: I05a0c12ab98ca428aca64181469d8c9cf6311f03
2022-06-21 14:22:47 +02:00
Svantje Lilienthal a5831da808 Rename template dialog pocSidebar
Bug: T310868
Change-Id: I83bbb480163532ff56ba6a3a36322d107c737cac
2022-06-20 16:12:50 +02:00
Thiemo Kreuz 6458c346d8 Limit template dialog back button to 1 of 3 entry points
There are 3 ways to enter the dialog:
* Editing an existing template.
* Start empty.
* Start with a known template name.

The back button should only ever appear in one of the three modes.

The last mode is the one that's used in the Cite dialog.

Bug: T310602
Change-Id: Id23d3ac5e1715387c78916adeb8ca5f675005a5c
2022-06-20 07:46:03 +00:00
WMDE-Fisch 82718bf70a Remove feedback message link
The testing phase for the implemented features is finished. So the
feedback link for the project can be removed.

Also added missing documentation for a message key used.

Bug: T307188
Change-Id: I2e2e4ff58d2bacda5ae841bcf6f418e786a3967e
2022-06-15 12:37:14 +00:00
Adam Wight 1b4c81c27d Remove $wgVisualEditorTransclusionDialogInlineDescriptions feature flag
The feature is always enabled now.

Bug: T307188
Change-Id: Id8b39d44901dee9118837fc4670d7faa4ef19b43
2022-06-15 12:09:47 +02:00
Adam Wight f7050a2bac Restore internal mechanism to use either back or close button
For some use cases of the transclusion dialog such as Insert
Citation, the back button is inappropriate and we want to keep the
close box.

This partially reverts commit 2e2e40e76e.

Bug: T310602
Change-Id: If68a822c260618c0a93eb8d0c46d2b452fee8baa
2022-06-15 11:09:50 +02:00
Adam Wight e1ea921f76 Remove $wgVisualEditorTemplateSearchImprovements feature flag
The feature is always enabled now.

Bug: T307188
Change-Id: I34a3db44355d93413f611b99cd80b876d8737413
2022-06-14 10:48:19 +02:00
Adam Wight 2e2e40e76e Remove $wgVisualEditorTransclusionDialogBackButton feature flag
Feature is always enabled now.

Bug: T307188
Change-Id: I70305ec3d2ed9cfb767ee9ea90e8ed6c93cfbdbb
2022-06-10 17:33:56 +02:00
Andrew Kostka efa0e3ae9a Make collapsible descriptions more responsive
Bug: T307986
Change-Id: Ib28ec5a5c73fab8eb2b10ed6153a30028c3505cb
2022-05-27 16:10:00 +02:00
Andrew Kostka 46846d1b01 Improve collapsible descriptions for smaller screens
Bug: T307986
Change-Id: Iac6205fc90a884965c2e37cf6ed4b403874256d8
2022-05-19 12:39:20 +02:00
Andrew Kostka 0c176752eb Fix non-collapsible parameter descriptions on smaller screens
This patch fixes a bug which causes long parameter descriptions to
be to non-collapsible when adding them from the sidebar-only view on
smaller screens.

Change-Id: If373587a9b2c3841ad6814f74bfcbf0c0f013488
2022-05-19 12:26:30 +02:00
Thiemo Kreuz eb25116734 Block Ctrl+Del/Backspace when Remove button is inaccessible
* I can't guarantee this fixes T301914. But I suspect the bug can not
be triggered any more with this plus If9b6050 in place.

* I wasn't able to reproduce the issue locally. But I learned that
  1. it's related to the hotkey, and
  2. it's because the dialog looses focus, and the focus ends on the
     VE surface in te background. Pressing Esc there closes VE. That's
     intended behavior.

* I tried to use .trigger( 'click' ), but it doesn't make much of a
difference. The only magic check is if the button is disabled. But no
visibility checks are done.

Bug: T301914
Change-Id: I2f66fc2411144c60cd08baae58452d336b4e9802
2022-03-02 11:56:29 +00:00
Svantje Lilienthal fb95572429 Added check for hotkey action on input or textareas
Bug: T301913
Change-Id: If9b6050c378836157fa1df5b9782ba4632890f1a
2022-03-01 10:14:52 +00:00
WMDE-Fisch 4b2931276c Add ctrl/cmd backspace hotkey to delete part
Bug: T300971
Change-Id: Ie8752d632fba6a15cbf45176b71b3c77a7171360
2022-02-08 16:17:12 +00:00
WMDE-Fisch ef87088198 Wire move/delete hotkeys to button functionallity
The behavior is now consistant with what would happen when the
buttons are triggered.

Instead of emitting a button click I directly wired the methods
that will by triggerd by the click. This might make it easier to
remove the old sidbar later.

To avoid movement when the buttons should be disabled, an
additional check was added to the onMove method. It's not identical
to the more complex check in the outlineControlsWidget, but should
be enough for our use case. The onDelete method already just does
nothing if nothing is selected.

Bug: T300971
Change-Id: I8a278c9657c91fd648944b5a8c1204c9fff75b7e
2022-02-08 15:41:01 +01:00
jenkins-bot 440620ae73 Merge "Show a keyboard shortcut when hovering over a toolbar button" 2022-02-01 12:33:39 +00:00
Thiemo Kreuz 7298834211 Follow naming convention for static methods
Change-Id: Ie2d7fb061fcb46765ba8796911425d58218736d1
2022-01-27 09:12:23 +01:00
Adam Wight 7e7ad97bf6 Don't wrap unknown actions with confirmation
For example, the "apply changes" button was producing a confirmation
dialog.

Bug: T300095
Change-Id: I77e53cc0cf62ff7c0aca052568384e20490ce7ec
2022-01-26 14:40:58 +01:00
WMDE-Fisch 5b4e53148d Confirm before close when all parameter values are deleted
Do show a confirmation when editing templates without parameters,
but don't show the confirmation when you're only on the template search
page.

Bug: T299394
Change-Id: I8205bb6a0f92b7b535a80f7f6a43674f1aa5b51b
2022-01-24 11:43:27 +01:00
Adam Wight a7ba729d8c Refactor confirmation logic
Shouldn't change behavior.

Split from I8205bb6.

Bug: T299394
Change-Id: I32876939d4f61c3be8e756c6eba6f74ea98c11f1
2022-01-24 11:43:27 +01:00
Andrew Kostka 856ad0fc03 Show a keyboard shortcut when hovering over a toolbar button
Bug: T299490
Change-Id: I5af6ecf10b90c6a85bccc8489584322e1ba20bd5
2022-01-21 20:08:20 +01:00
jenkins-bot 9ec8a68891 Merge "Link to a list of keyboard shortcuts from the template help dialog" 2022-01-21 18:28:30 +00:00
Andrew Kostka eaa438abcb Link to a list of keyboard shortcuts from the template help dialog
Bug: T299487
Change-Id: Ieef99eeb9c43817981e2ae5b5340a58c2aca4920
2022-01-21 17:24:34 +01:00
WMDE-Fisch cede096333 Update accept button in confirmation dialog
The only places where this dialog is used now will have the same
button labels and format. We want to use "normal" destructive here
so no additional "primary" styling.

It seems that the focus on the action will only be applied
automatically when it is primary. So extra code is needed.

Bug: T299647
Change-Id: Ib5250b79e85d27ea197b83c6380863d0749e5d89
2022-01-21 15:32:58 +00:00
Andrew Kostka 8da9661e11 Add a title to the templates help button
Bug: T299499
Change-Id: Ibb4aca479674668d6c14b8ace037433fa305dc35
2022-01-21 11:11:46 +01:00
Thiemo Kreuz 33a2f21589 Disable edit button while loading template dialog
Bug: T297773
Change-Id: I51fc0af4c3b29fd0801fc06a1dc07ad3fd7f1da3
2022-01-18 12:29:27 +00:00
Adam Wight 587ba4c662 Confirm before closing template dialog
Reuse the back button confirmation dialog for the close button.  The
condition is slightly different: need confirmation if there are any
manually-entered values for any parameter AND the user has edited
the template in this session.

The "reset" action was synthetic, only used internally and not
connected to buttons or menus.  Canonically, action='' is the close
action for OOUI.

Bug: T297792
Change-Id: I4ff644c7ab24ed9ba1a4c27d762563c5d6771cfc
2022-01-12 10:47:21 +01:00
Adam Wight cbe2fd634f Replace confirmation overlay with a popup dialog
Currently, the insert template dialog includes a back button in the
upper corner.  Confirmation of abandoning unsaved changes was
accomplished in an overlay panel.  This patch rewrites as a dialog
and updates the on-screen text.

Bug: T297792
Change-Id: Ifa2ff97c9284609ee2a784f455789c56a762ba50
2022-01-11 18:37:29 +01:00
jenkins-bot 131f7e940d Merge "Add safe-guard for early template dialog resize events" 2021-12-07 13:08:42 +00:00
Svantje Lilienthal 65bef19f73 Prepend multipart message in onReplacePart to prevent it from moving around
onReplacePart is being called when templates are being moved up or down. 
To prevent that the multipart message gets moved around passively e.g. 
by one element being added above it, this patch adds it to the top after each movement.

Bug: T292829
Change-Id: I946c9bc4ba5e1d261aefbb28a8c642bb58964842
2021-12-06 13:58:09 +00:00
WMDE-Fisch eef0ce91f7 Parse new link in multipart message
We forgot change the way that message is build while adding the link
in 07f105fd7. Now it gets parsed correctly and the link will open in
a new tab.

Bug: T284985
Change-Id: I1ed9dfdafd08d08c5aff45f4b74c540b35ec14a1
2021-12-03 10:36:44 +00:00
Thiemo Kreuz ddaa6a18c1 Fix missing Meta+D shortcut on Mac
I also discovered and applied ways to make this code more compact.

Bug: T294905
Change-Id: I1edc2b3b0a77e02bf8e7ac789cabe007c5f5c527
2021-11-23 10:38:50 +01:00