Commit graph

3401 commits

Author SHA1 Message Date
Thiemo Kreuz e2cce0dd3d Minor fixes and optimizations to ParameterSelectWidget
Optimization: Don't search for a checkbox that represents a not yet
named parameter placeholder. There is never one.

Fix: Store null, not undefined.

Bug: T312213
Change-Id: I395008f15d13133ad456d0a77571b7aa1c7a7fc9
2022-07-19 16:36:30 +02:00
Ed Sanders 33546466eb Add 'vector-body' hack to TargetWidgets
Bug: T313221
Change-Id: I06366d4601342435b70d311742ee985e01b0477b
2022-07-18 14:12:10 +01:00
jenkins-bot 684a69c17e Merge "Unhighlight parameter on blur" 2022-07-18 11:47:08 +00:00
jenkins-bot 458264a505 Merge "Merge redundant sidebar selection events in two-pane layout" 2022-07-18 11:38:27 +00:00
jenkins-bot 39dd216650 Merge "Remove/fix obsolete code trying to un-highlight parameters" 2022-07-18 11:37:22 +00:00
jenkins-bot 411a5d0208 Merge "Move debounce check from outline into part widget class" 2022-07-18 11:36:30 +00:00
Thiemo Kreuz 569ad3d538 Remove/fix obsolete code trying to un-highlight parameters
Fix setParameter() and let it (un)highlight parameters independent
from a selection (called "set" here).

Bug: T312925
Change-Id: Ie4e9ba94659f4f70160193ca6bec804f8a4473e4
2022-07-18 13:04:42 +02:00
Adam Wight 42cbde12a8 Unhighlight parameter on blur
Bug: T312925
Change-Id: I5de5dbb5e0f9f2ae1eb8e5f2c07317cda50680ea
2022-07-18 12:59:23 +02:00
Thiemo Kreuz 58c19747da Move debounce check from outline into part widget class
This just moves code to an – in my opinion – more appropriate place.
Here we can't forget it.

Change-Id: I8fff83b1586fc14d762b324e5443611370470983
2022-07-18 12:48:45 +02:00
jenkins-bot 0cd660ab39 Merge "Remove comments from two-pane layout that don't add information" 2022-07-18 10:47:31 +00:00
jenkins-bot 55b4c86802 Merge "Exit loop in onStackLayoutFocus earlier" 2022-07-18 10:04:11 +00:00
jenkins-bot eaca5e8ad0 Merge "Simplify interface to remove pages" 2022-07-18 09:55:18 +00:00
Thiemo Kreuz 83261578b6 Remove comments from two-pane layout that don't add information
These comments just repeat what the code says. Most of them are
copied from OOUI. Some talk about BookletLayout – a class name we
don't use any more.

Change-Id: I7ce354dfe059657395103ffef767eb8f6d37bfb7
2022-07-18 09:36:37 +00:00
Adam Wight 2759752a0a Simplify interface to remove pages
Makes some things easier, some harder—not sure if this is a helpful
patch.

Change-Id: If56e9b2fbc1796cd637aaeececec779d31a7921f
2022-07-18 05:31:42 +00:00
jenkins-bot 6f16d02c0c Merge "Wikitext mode: Use action=parse for preview" 2022-07-16 16:54:30 +00:00
Thiemo Kreuz b7fb9e873f Merge redundant sidebar selection events in two-pane layout
Note how the two-pane layout was already handling the two events
identical:

 sidebarPartSelected: 'onSidebarItemSelected',
 templateParameterSelected: 'onSidebarItemSelected'

We move this knowledge up one level into the sidebar. Both actions
now trigger the same event.

This implies that we are now using the event formerly known as
"sidebarPartSelected" to act on both top-level parts as well as
parameters. We reflect this by renaming it to "sidebarItemSelected".

Change-Id: I9a2c95f91f05de7312d38ec4c8b360141a0c447d
2022-07-15 16:21:04 +00:00
jenkins-bot 1a4bb6c5e4 Merge "Rename misleading templateParameterAdded event" 2022-07-15 14:55:09 +00:00
jenkins-bot 7ef5edf209 Merge "Rename misleading templateParameterSelectionChanged event" 2022-07-15 14:53:20 +00:00
Thiemo Kreuz 6e18ce647e Exit loop in onStackLayoutFocus earlier
The optimization removed in this patch is done twice. The effect is
that the loop does not end when it finds a match but the match happens
to be the current page.

This doesn't change anything. It's really only about performance.

Change-Id: I5c2de101eb2f14f814f00cf7eacf46b70346f4c8
2022-07-15 15:27:03 +02:00
Thiemo Kreuz 3f938d3c4f Rename misleading templateParameterAdded event
This is not only fired when a parameter is added. It's also fired
when pressing spacebar on a parameter that already exists.

Change-Id: I245aa9f5938eb38c3a3f224a4d642d57068cf23b
2022-07-15 14:26:41 +02:00
Thiemo Kreuz d57210c1c0 Rename misleading templateParameterSelectionChanged event
This is not only fired when a parameter is checked or unchecked.
It's also not only fired when another parameter in the parameter
SelectWidget is selected. It's always fired just because the
spacebar is pressed. This is so we can scroll that parameter into
view.

Change-Id: Id621405b7ca3116cd4a06f474e49776d0830dccc
2022-07-15 14:19:19 +02:00
Thiemo Kreuz 647b5aa8e9 Remove non-helpful 1px hack from template dialog sidebar
This line was added as part of I0229b63. While what the comment says
is still true to some degree, the line stopped being helpful when
we introduced sticky headers. When scrolling the sidebar for a
multi-part template with many parameters the sticky header jumps up
and down by this 1 pixel.

TL;DR: This is one of these hacks where it's better to remove it and
look for a better solution when we notice the original issue again.

Bug: T312768
Change-Id: I2fedea4e1d4d6c95c74a63c522821a6ebc2ee2b2
2022-07-15 13:00:40 +02:00
jenkins-bot 6baefa1190 Merge "Adapt bottom margin of last element in content pane of template dialog" 2022-07-15 07:51:48 +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
Svantje Lilienthal 6d31ca5b3f Adapt bottom margin of last element in content pane of template dialog
Bug: T312923
Change-Id: I9068053900915cc5838eeb1e96c48f6b8fff0936
2022-07-14 15:56:47 +02:00
Svantje Lilienthal 36d817dfcd Only move content pane element to top when sidebar element is clicked
This patch contains a small cleanup that moves the scrollIntoView into onSidebarItemSelected.
Since all other places already have a focus call, scrollIntoView is not needed there.

Bug: T312850
Change-Id: I1a3cb3905faea2bd8a6bf8dc4cfd748813e1c875
2022-07-14 15:32:14 +02:00
jenkins-bot b4b6940c64 Merge "Minor fixes to template dialog related code documentation" 2022-07-14 07:01:11 +00:00
Thiemo Kreuz 0bf4a4a147 Use named colors in template dialog LESS styles
Change-Id: I935e1bcacfe8bb61fa69da9fa42417c76c8e505a
2022-07-13 17:51:32 +02:00
jenkins-bot 1e0ac6de13 Merge "Use position-sticky() from mediawiki mixin" 2022-07-13 14:21:23 +00:00
WMDE-Fisch a4aa684308 Don't call parent on SelectWidget focus event
This regression from Iaf089f4b271fd853b17c1aa7f5938510ea8f5431.

Not calling the parent here was is essential, because when clicking
the checkboxes this event will trigger the focus of the whole widget.

That's not what we want in this case though. Also it seems we don't
need any of the logic from the parent and can get rid of that
complexity.

Bug: T312855
Bug: T312856
Bug: T312924
Change-Id: Ib3a2eeeb6d519dfa1bb627049f6b3a4708017e86
2022-07-13 15:27:24 +02:00
Thiemo Kreuz 466a73e730 Minor fixes to template dialog related code documentation
Change-Id: I0b5e0ede45578db23ecd5817baf842eb3cc3dbf4
2022-07-12 20:10:02 +02: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
jenkins-bot 98ec1db594 Merge "Don't set a ParameterPage as next selection after delete" 2022-07-12 13:04:01 +00:00
jenkins-bot 927ca77182 Merge "Safe to call setPage with a null page" 2022-07-12 12:22:25 +00:00
WMDE-Fisch 8aee4e8e70 Use position-sticky() from mediawiki mixin
This will also slightly improve the situation for older Safari
browser by adding a -webkit rule.

Change-Id: I16b065adddd8ffe21936db9794495a891792ce8c
2022-07-12 14:09:01 +02:00
jenkins-bot 7c935f8935 Merge "Use @type instead of @var for JavaScript variable" 2022-07-12 11:57:44 +00:00
Adam Wight 150aad380d Safe to call setPage with a null page
Fixes a bug that crashes the interface when unsetting the focus after
another input was focused, because `page` is undefined in this case.

We were already calling `setPage` to unset focus, so document it.

Bug: T312017
Change-Id: I2926beffe23e0ee822f5690d4791534a5413886a
2022-07-12 13:52:30 +02:00
jenkins-bot 4eebfd2635 Merge "Don't access the stacklayout directly" 2022-07-12 11:36:02 +00:00
WMDE-Fisch 5067a1e216 Don't set a ParameterPage as next selection after delete
This can only happen when deleting the last part of a transclusion,
then we want to set the previous page as selected. This should never
be a parameter though.

Bug: T312221
Change-Id: I06700dcf37f6d4f7dd073f8f2bc1b8b0a17a62c4
2022-07-12 13:35:34 +02:00
jenkins-bot b736727b07 Merge "Use short syntax for transforming one event into another" 2022-07-12 11:28:06 +00:00
WMDE-Fisch 41bb082def Use @type instead of @var for JavaScript variable
Just putting this eslint auto fix out there. No hard feelings, but
a warning that pops up everytime.

Change-Id: I157e0338e5f5a6f27dbbd9ae116da0f922468586
2022-07-12 11:18:27 +00:00
WMDE-Fisch ec522938b8 Scroll parameter items into view when hidden behind sticky
Triggers scroll in all situations where highlighting changes.

Including keyboard navigation.

Bug: T312542
Change-Id: I849f64c5cefe0cac3fde6e848b23b7b0cfc489ce
2022-07-12 10:52:19 +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 b75082009a Differ between setting and highlighting a parameter
Introducing a set method to have a different state for a set
parameter and a highlighted one in the selection.

Allows us to remove a lot of workarounds for missusing the
highlight state and fixes several issues with these workarounds.

Main implications:
- Keyboard navigation and mouse hover now sets the grey highlight
- If a parameter is set (blue highlight) keyboard navigation returns
  when focusing the SelectWidget
- If nothing is set keyboard navigation starts at the top after focus
- Unchecking a parameter using space will not influence the keyboard
  focus in the list
- Highlighting a parameter with the mouse lets keyboard navigation
  continue from there.

Bug: T312647
Bug: T311204
Bug: T312213
Depends-On: I385dca1d95033961d3844e888521750443e49c95
Change-Id: Iaf089f4b271fd853b17c1aa7f5938510ea8f5431
2022-07-12 10:18:56 +00:00
Thiemo Kreuz 6d41da0de7 Use short syntax for transforming one event into another
Change-Id: Id794f2b620edebd6eab71e3380ce1eeffcdc95ef
2022-07-12 11:54:04 +02:00
jenkins-bot a305571b23 Merge "Add grey background when buttons are in focus" 2022-07-09 07:15:16 +00:00
jenkins-bot 086a73804f Merge "Use rgba instead of hex to highlight identical styling" 2022-07-09 07:15:13 +00: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 479732f516 Merge "Take parameter list out of tab navigation when empty" 2022-07-08 13:13:26 +00:00