Commit graph

221 commits

Author SHA1 Message Date
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
jenkins-bot 609f589557 Merge "Move feedback icon to correct position in template dialog" 2021-11-15 14:45:57 +00:00
jenkins-bot b84a6198db Merge "Update shortcut to add a part in the template dialog, take #3" 2021-11-15 14:34:52 +00:00
Thiemo Kreuz 0e1a5379da Move feedback icon to correct position in template dialog
Bug: T294839
Change-Id: Ib1a895735d795e0d38f38952fd8bce6ad3fee50e
2021-11-15 14:04:18 +00:00
Andrew Kostka 72641151e4 Implement floating help dialog for templates
Bug: T294839
Change-Id: Id224b61bd0cd57f5e970ab62db2d82dab1db9252
2021-11-09 15:28:23 +01:00
Thiemo Kreuz 5e13ccfb43 Update shortcut to add a part in the template dialog, take #3
Same as I980b72c, but with another shortcut. Again. We tried
Ctrl+Shift+X before (conflicts with RTL feature in VisualEditor), as
well as Ctrl+Alt+D (conflicts with "hide all windows" incUbuntu).

Bug: T294905
Change-Id: Iae7ba759fcd7c107ef586bd5d9ae3cdbe445cedc
2021-11-09 10:48:52 +01:00
Andrew Kostka 7f3c24b48e Update the shortcut for adding a template in the template dialog
Bug: T294905
Change-Id: I980b72c98835865c065163fa17bfcc3b9434a80b
2021-11-03 15:40:16 +01:00
Adam Wight 1e82a4ce78 Still hide mode button unless in small screen mode
Bug: T294351
Change-Id: Iebd9cbc5d48711c2e85cab927d4515e6fe0a7d03
2021-10-28 10:42:44 +02:00
Adam Wight b3e5478221 Show the "other actions" toolbar when unknown buttons are available
For example, the Citoid extension adds a "change reference type"
button which should be visible when editing a citation template.

TODO: Decide whether we want to hide the "hide options" button in
this case.  This should be handled in a separate patch and possibly
in a follow-up phase, it requires deeper changes to the logic.

Bug: T294351
Change-Id: I1c6c322fe48044d7e726bf20ba7cd2eda422cd8b
2021-10-27 13:10:23 +02:00
Thiemo Kreuz 96adda0d13 Add safe-guard for early template dialog resize events
I can't reproduce this error, but I feel better having this safe
guard in place. In theory it's possible to trigger resize events
before the TransclusionModel is initialized.

Change-Id: I4bbac0f73873813629ff854ee728465c6e2a4ba7
2021-10-27 12:50:20 +02:00
Thiemo Kreuz 597bacd63b Fix rebase mistake in TransclusionDialog class
I6909b3f0b2c153b7ee9995441e995ffa793eab40 was rebased, but
I0226ca7d39e04a69617c0d8a5d3c293cfc9e0709 was merged in the meantime.

Bug: T293202
Change-Id: I3cfec9ebc135eaf998a0982f458cfe75bfb2f01c
2021-10-26 10:34:26 +02:00
jenkins-bot a932e5b6b3 Merge "Fix/cleanup template dialog methods dealing with parts vs. items" 2021-10-25 10:02:04 +00:00
Thiemo Kreuz 29ef00fa29 Rework all code using template type related conditions
This is a more radical change, compared to the previous patch.
I will post more detailled explanations as comments on Gerrit.

Change-Id: I6909b3f0b2c153b7ee9995441e995ffa793eab40
2021-10-22 10:42:16 +00:00
WMDE-Fisch 2f9fe11231 Change template dialog hotkeys
Changed to be less conflicting see investigation in ticket.

Bug: T290262
Change-Id: If2b75cb1dd8bb26c685f8e51beebfa0e6ab6599c
2021-10-20 10:53:44 +02:00
jenkins-bot dfa08be3f5 Merge "Don't close the old sidebar when the add parameter button is pressed" 2021-10-18 14:02:21 +00:00
jenkins-bot 99f7acddf7 Merge "Auto hide the sidebar when only a single placeholder is present in narrow mode" 2021-10-15 08:13:41 +00:00
Andrew Kostka bf846d2313 Don't close the old sidebar when the add parameter button is pressed
Change-Id: I635d741a028196d9ad3b68cb26e5eac58b199fe5
2021-10-14 13:59:46 +02:00
Andrew Kostka 18964cdf2c Fix broken focus when using the add parameter button in the old sidebar
Bug: T293203
Change-Id: I9b9658ea05afe9c0d76e0956e8037842f540f74d
2021-10-14 13:43:35 +02:00
Andrew Kostka 0350b742c8 Auto hide the sidebar when only a single placeholder is present in narrow mode
Bug: T293202
Change-Id: I0226ca7d39e04a69617c0d8a5d3c293cfc9e0709
2021-10-14 11:37:23 +02:00
Andrew Kostka 0fa54f2f9e Check whether to show the sidebar after adding the parts
Bug: T292852
Change-Id: I18309164ae4838d9a7aa9fc842012806fbd0c845
2021-10-11 10:50:05 +02:00
jenkins-bot 871dd4486c Merge "Fix sidebar bottom position when pressing Ctrl+Shift+E" 2021-10-08 11:19:51 +00:00
Thiemo Kreuz f77ef7d7f4 Fix/cleanup template dialog methods dealing with parts vs. items
Some cleanup to improve readability and reduce the amount of code.
Relevant bits:
* One method name was wrong. It can actually return parameter ids,
  not only top-level part ids.
* I got rid of some fail-safe checks that are never needed or moved
  them to a more central place.

Change-Id: I08f2ad7bc7d3f985d6189dff170dda554f3d37c2
2021-10-08 07:43:23 +00:00
Thiemo Kreuz 25ee94ee07 Don't reset narrow screen mode when it's already active
Bug: T292693
Change-Id: I39f4655115c6162a0bc7984702bebe28f12563fe
2021-10-08 06:44:12 +00:00
Thiemo Kreuz 893a3d5cf0 Fix sidebar bottom position when pressing Ctrl+Shift+E
This patch fixes two issues:
* The bottom corner of the new sidebar was never correct because of
  a `padding: 2px` that was introduced later, but never compensated
  for.
* The moment the toolbar is shown it's not a single-template dialog
  any more. This implies minor style changes.

Bug: T290262
Bug: T292727
Change-Id: I08da73880c469085994ee4beb3fcdd973f80ae11
2021-10-07 18:46:47 +00:00
Thiemo Kreuz 1904698105 Move some logic into the TransclusionModel class
I moved some code around and found that quite a lot of code wants to
know:
* Is the length of this transclusion exactly 1?
* I need that 1st part.

There is more that can potentially moved from the dialog to the model.
But I don't want to make this patch to big.

Bug: T292371
Change-Id: Ia94ed0450d04dd97c4c41f5bf7c266f9a534e821
2021-10-06 16:00:18 +00:00
WMDE-Fisch 6c7f303c86 Focus initial/single template placeholder
This includes some moving of code. These helper functions seem to make
more sense in the TemplateDialog class.

Bug: T292371
Change-Id: I004405bab60a569b084f9083fefa41f44f9a5561
2021-10-05 12:58:55 +02:00
jenkins-bot 352075c815 Merge "Add more keyboard shortcuts for VE template dialog" 2021-10-05 10:05:08 +00:00