Commit graph

9649 commits

Author SHA1 Message Date
Bartosz Dziewoński 4fb3db27e6 ve.ui.MWTemplatePlaceholderPage: Move label to real label for accessibility
By using OOUI 'label' instead of 'help', the label is associated with
the input using <label for=...> in HTML.

The result looks almost the same, except for font size. I like the
change, and I don't think it was intentional to make the font smaller
here.

Bug: T277028
Change-Id: If178ca8feb9970c9287ab6dfe51fdf0a81df1c45
2022-12-29 12:40:11 +00:00
jenkins-bot d411175cd8 Merge "TemplateDialog: separate “Add template” messages" 2022-12-28 23:46:27 +00:00
jenkins-bot 729eb1a79c Merge "Remove redundant/conflicting ARIA label in template dialog" 2022-12-28 23:45:27 +00:00
Pols12 afca7bf0af TemplateDialog: separate “Add template” messages
Use distinct messages for section heading, button label and input
aria-label, to allow a potentially better localization.

Bug: T304121
Change-Id: I3e3b06a035e2f11f5f32face789b934e22916e49
2022-12-22 15:08:31 +01:00
thiemowmde a8fc627f3c Remove redundant/conflicting ARIA label in template dialog
The ARIA label was added via Ieeb29de. It was reusing an existing
message.

Later we added a placeholder to the same input field via I07c6e60.
Since then screenreaders possibly read two texts: "Find template" and
"Add template".

Bug: T296465
Change-Id: Icb8d5419b4a4e34a224744873c557cb873e17c40
2022-12-22 15:07:24 +01:00
David Lynch e9b2965655 Log bucket/token for the DiscussionTools mobile a/b test
Bug: T321961
Change-Id: I1e809c4405a561b75e59d2c27edbfc8a3e838f09
2022-12-16 14:44:29 -06:00
Thiemo Kreuz 8a42b05622 ve.dm.MWTemplateSpecModel: Document some large params as private class
While at it, also fix a few broken uses of `@see` where `@link` was
intended or for full names, there is no syntax needed, as JSDuck
already links those.

Change-Id: Iaeb46b05c6f2e6f00198bc2ae773c895935b4cea
2022-12-15 23:35:11 +00:00
Bartosz Dziewoński b6929d5be1 Change mw.libs.ve.getTargetDataFromHref to not return bogus data for external links
For external links, `.title` and `.rawTitle` properties previously
contained the external link corrupted with some normalization intended
for MediaWiki titles.

This was useless, and in fact no caller actually uses this value:
they all check `.isInternal` first before accessing `.title` or
`.rawTitle`.

Also, correct other parameter documentation.

Change-Id: Ieeab56548f0a3b2f81a90f0d3ae0f81d744aa67b
2022-12-14 22:57:04 +01:00
jenkins-bot 0c5f131976 Merge "Use new stable API for subtitle modification" 2022-12-14 04:12:38 +00:00
Jon Robson 612a307d68 Use new stable API for subtitle modification
Bug: T324876
Depends-On: Id8436324e2ae2fd9f488b65b3b7bfc19611870d1
Change-Id: I8e538939a6d7d4474f2e96b93040f3c68c2f98ec
2022-12-13 01:13:46 +00:00
Bartosz Dziewoński 133cacc42d Remove obsolete browser support checks for HTML5 History API
It is available in all browsers we support.

Change-Id: I6c860eadd91e6e4061ed0364be0dc8c7b750d3e7
2022-12-12 20:47:32 +01:00
Bartosz Dziewoński 237ffde471 ve.ui.MWPopupTool: Update usage of 'mediawiki.feedback'
* bugsListLink option no longer exists (I0ea65bf97d)
* bugsLink doesn't require mw.Uri

Change-Id: I9ab9d8b096a58fe0c49b296b121e5fe9a8dfd8bd
2022-12-12 19:43:14 +01:00
David Lynch 2b49b3bde7 Try/catch around mw.Uri when decoding parsoid resources
An incorrectly-encoded fragment is allowed-in-wikitext but will make
mw.Uri throw an error. e.g. `[[foo#1%bar]]`

Bug: T324976
Change-Id: I97cb85507d9ae3d648300245dd7e48cc239c4d90
2022-12-12 09:37:30 -06:00
jenkins-bot c4f9513110 Merge "Always sanitize href attribute in UI" 2022-12-09 23:40:22 +00:00
jenkins-bot 2b39fa6246 Merge "Always sanitize href attribute in CE nodes" 2022-12-09 23:38:16 +00:00
Francois Pignon 1b27b12b66 Optimize some jQuery selectors
Bug: T324523
Change-Id: I5d749e222b01a4f6abbc4517a8b568ad3e73e47f
2022-12-06 00:05:06 +00:00
jenkins-bot f6047f8642 Merge "Handle errors when rendering visual diffs" 2022-12-05 23:35:01 +00:00
jenkins-bot 4263eb1786 Merge "Adjust to changes to redlink behavior from parsoid" 2022-12-05 20:26:34 +00:00
David Lynch 83a46a7817 Adjust to changes to redlink behavior from parsoid
Redlinks now come down with a `mw:LocalizedAttrs` typeof, and have the
display URL parameters rather than being bare titles.

Bug: T324352
Change-Id: Ia1776e6e1f171d227c7c402b39ca96d17fb56cdb
2022-12-05 11:55:33 -06:00
Ed Sanders 5e503eb378 Always sanitize href attribute in UI
Bug: T322704
Change-Id: I19f722c40f1f8e5b55e44d9fb11109a6f9951c06
2022-11-30 18:26:37 +00:00
Ed Sanders 7afbe7516d Always sanitize href attribute in CE nodes
Bug: T322704
Change-Id: I0ce6d57adf7c688d11f6fc39af291b44c4b5aeeb
2022-11-30 18:26:37 +00:00
Bartosz Dziewoński 1ea3bf3013 Handle errors when rendering visual diffs
There are some known bugs that we probably will not investigate
(T313809, T317455). Do something better than an infinite loading bar.

Follow-up to ee7c5d9d1a.

Change-Id: I339de7662ff68c2ea9bb1a738bb4207d1c399e59
2022-11-30 18:17:54 +00:00
Bartosz Dziewoński c9a9b619aa Only hide #siteNotice on skins where it's shown in the editable area
Bug: T324055
Change-Id: I07139358d0e20582a53fc6820ae022b9edc0ba95
2022-11-29 21:19:46 +01:00
Bartosz Dziewoński 62d80ff88d ve.init.mw.DesktopArticleTarget.init: Remove redundant selector
Hiding '.ve-init-mw-desktopArticleTarget-editableContent #toc' is not needed
when we already hide '.ve-init-mw-desktopArticleTarget-editableContent'.

Change-Id: I9f7dc5f64be1f392e846da5bcfcd0a5d17a65014
2022-11-29 20:52:03 +01:00
jenkins-bot a4919ff345 Merge "Do not grey out page title while loading NWE on Vector 2022" 2022-11-24 14:00:35 +00:00
Bartosz Dziewoński a7395a04d7 Do not grey out page title while loading NWE on Vector 2022
The "uneditable content" styles should not be applied if the page
title is outside of the editor, like on Vector 2022 since T310839.

Bug: T322725
Change-Id: I212e41e3770807d43b4c58377ce77f4521e6b489
2022-11-24 13:43:45 +00:00
Ed Sanders 4bf8955c18 Link inspector: Avoid focussing a input when it isn't visible
Bug: T321026
Change-Id: I4edcf9c0cbe13eac450bc8e05883c7506b8dbfaf
2022-11-18 13:25:40 +00:00
jenkins-bot 82c845d30d Merge "Always allow switching to visual when using DirectParsoidClient." 2022-11-07 23:04:10 +00:00
daniel ea62ee6b19 Always allow switching to visual when using DirectParsoidClient.
When using DirectParsoidClient, switching should be lossless.

Depends-On: I86c611fa0b717ef619e5ffe550b6c2be49a28c99
Change-Id: Ie30ccbc8c12ce48f481b9f727f28e60d21ee37b9
2022-11-07 21:25:27 +01:00
jenkins-bot 2b5aeaf649 Merge "Improve smooth scroll to section with visual section editing on desktop" 2022-11-06 22:53:44 +00:00
jenkins-bot a46d76bc1e Merge "Platform: Handle invalid JSON in the other path in #getUserConfig" 2022-11-06 22:47:50 +00:00
Bartosz Dziewoński 288159d65c Platform: Handle invalid JSON in the other path in #getUserConfig
I discovered recently that I had 64 KB of text stored in the
'visualeditor-findAndReplace-findText' preference.

I must have accidentally copy-pasted a whole page into the "Find"
field, the JSON that VisualEditor tried to save became invalid after
MySQL chopped off the string after 64 KB, and since then VisualEditor
was unable to update the find-and-replace dialog preferences.

Change-Id: Ib1d853263d873d969c7b015b3842524e1f7fc351
2022-11-06 22:40:40 +01:00
Bartosz Dziewoński d2bbd0ed76 Improve smooth scroll to section with visual section editing on desktop
Follow-up to 8101b6511e.
$toolbarPlaceholder.outerHeight() only needs to be added when not
using visual section editing.

Change-Id: Idc7d9d59dea9eacbb8ee584c69e6bc4798562ea1
2022-11-04 19:53:43 +01:00
Jon Robson 282d075e0c Don't log errors due to missing edit buttons
There's nothing we can do about missing edit buttons - they are likely
being scrubbed by some script or gadget, so let's not report the error.

Bug: T314952
Change-Id: Icf778074026a24561c228cbf11e583062571d0cb
2022-11-03 02:22:54 +00:00
Jon Robson 99f8a7275a wgAction is not a number
Follow up to Icd227fc54f3bc16d5ce84c419b69344ca0d21f28
Currently showing up in logs as "NaN" but logged elsewhere
so not needed.

Bug: T314952
Change-Id: I0bf0d428384aa35bd43be026d451d62a2c237267
2022-10-26 19:39:43 +00:00
jenkins-bot b0cdf612a3 Merge "Allow more 'rel' values on external links in Parsoid output" 2022-10-26 16:44:19 +00:00
jenkins-bot b81e8e3e2e Merge "ve.dm.MWMagicLinkNode: Fix matching RFC magic links" 2022-10-26 16:44:16 +00:00
Bartosz Dziewoński 56195923d8 Allow more 'rel' values on external links in Parsoid output
Follow-up to I4070b3b16c8b2b76a0e7a67599efd914cbde63aa.

Bug: T321437
Change-Id: I4917c208251b4bcf1d31b07e717266970cb1516d
2022-10-26 01:07:08 +02:00
Jon Robson 131d6a247d Add further debugging information
I would really like to get to the bottom of this :)

Bug: T314952
Change-Id: Icd227fc54f3bc16d5ce84c419b69344ca0d21f28
2022-10-25 00:45:44 +00:00
Bartosz Dziewoński 0a2db9c1e9 ve.dm.MWMagicLinkNode: Fix matching RFC magic links
We need to strip the protocol on both sides. This might have been broken
by Ic00b38b04ce78178c64c13bab7f1b2e4b6c5b803 in MediaWiki core.

Bug: T321437
Change-Id: I11903b767aebfdb189a8d54fbf6fb7f8ce9ffb6a
2022-10-24 17:18:05 +00:00
Bartosz Dziewoński fdb7390d27 Allow 'nofollow' on external links in Parsoid output
Bug: T321437
Change-Id: I4070b3b16c8b2b76a0e7a67599efd914cbde63aa
2022-10-24 18:49:58 +02:00
jenkins-bot e115c05504 Merge "logger: Also log VisualEditorFeatureUsage events via Metrics Platform" 2022-10-24 13:07:29 +00:00
Arlo Breault c1afc62040 Bump requested Parsoid HTML version to 2.6.0
Change-Id: I544d31ca6ea6186a4ddaf7ef25fdea899f454c58
2022-10-20 17:01:17 -04:00
Sam Smith ddb5ac3a14 logger: Also log VisualEditorFeatureUsage events via Metrics Platform
The VisualEditorFeatureUsage instrument is a candidate for migration to
the Metrics Platform [0]. The first step of the migration is to log
events both using the Event Platform directly (i.e. via
mw.eventLog.submit()) and using the Metrics Platform client (i.e. via
mw.eventLog.dispatch()).

The Metrics Platform Client can mix in additional information -
so-called context attributes [1] - based on the stream configuration.
The majority of the default values mixed into each event are already
known to the Metrics Platform Client.

Note well that the Metrics Platform client will not log an event without
one or more streams being configured to receive that event. Therefore,
this change is a NOP.

An example stream configuration is given in [2].

[0] https://wikitech.wikimedia.org/wiki/Metrics_Platform
[1] https://gerrit.wikimedia.org/g/mediawiki/libs/metrics-platform/
+/aed6738b845/js/src/StreamConfig.d.ts#31
[2] https://phabricator.wikimedia.org/T309602#7973206

Bug: T309602
Change-Id: If40fcc6cae371788b98365953218300a5c0b3ca1
2022-10-19 22:53:47 +00:00
Sam Smith 75dc014db9 Use wgWMESchemaVisualEditorFeatureUseSamplingRate config variable
... for the sampling rate for the VisualEditorFeatureUse schema.

Bug: T312016
Depends-On: I259757db0c4441a3fcfce505d5bc82dcf2acf58c
Change-Id: I4e03b442568ed695a14d280b0e8dd92e22616426
2022-10-19 07:46:18 -06:00
Ed Sanders 2a4b4f6b96 GalleryContextItem: Only count image node children
Bug: T320874
Change-Id: I524901619820482c7152d7c7b9bc4a2b9f6ee3ca
2022-10-16 00:03:26 +01:00
jenkins-bot 77565dabf3 Merge "De-duplicate replacePageContent methods between desktop and mobile" 2022-09-29 14:00:00 +00:00
jenkins-bot 2cbf2470dd Merge "ve.init.mw.DesktopArticleTarget: Fix double <div class="mw-parser-output"> after saving" 2022-09-29 13:38:40 +00:00
Ed Sanders 1992281c82 De-duplicate replacePageContent methods between desktop and mobile
Change-Id: Icab82207d516843e7f2e4ba93b8ea4ffea7cad1b
2022-09-29 01:20:55 +02:00
Bartosz Dziewoński db82eb0263 ve.init.mw.DesktopArticleTarget: Fix double <div class="mw-parser-output"> after saving
Follow-up to 327bd736c5. .html()
replaces the inner HTML, .replaceWith() replaces the outer HTML.

Change-Id: I3c963c0a54f5aee4179c37a87466dffceb8c6a87
2022-09-29 01:15:13 +02:00
Ed Sanders b8bb53b79d ArticleTarget: Only overwrite title when not loading from view page
The previous implementation tried to do this, but looked
at the query string which can be set to action=edit by VE.

Bug: T318772
Change-Id: I4f0f8d52488a6b259033232afb8ea616458275de
2022-09-28 16:44:35 +01:00
Ed Sanders 596575582c Follow-up Ieba322fd: Don't generate postedit notification now we set config var
Setting the config var then loading mediawiki.action.view.postEdit
will already trigger the notification code, so we can remove this
duplicated code now.

Bug: T240041
Change-Id: If0d1aa4e734dab7cca168e78216f229b9924bab7
2022-09-26 12:08:54 +00:00
daniel 0cd6c90d5a Extract RESTbase client code into VRSParsoidClient.
This makes the "direct" client and the VRS based client
implement the same interface, so the caller doesn't have to know
which one it is using.

It looks like ParsoidHelper will not be needed if we use this approach.

Change-Id: Ib1c1d7355951fc0765227dd01a9edfc554fc448d
2022-09-14 18:20:36 +01:00
Thiemo Kreuz 003f5fc82e Remove redundant/unused CSS for template parameter page
A lot of this just repeats what is already set by some other rule,
e.g. because it is the OOUI default anyway. Warning. This patch is a
little more agressive. I tested it on desktop and mobile, even with
MonoBook, and could not spot a different. Please do some more tests.

Change-Id: I0ee6e70f4f14c20d431643c53031d6d5b8df1aa2
2022-09-12 11:32:39 +00:00
jenkins-bot f153331ee3 Merge "Remove redundant "choose" event handler" 2022-09-12 10:03:52 +00:00
jenkins-bot b3443cd96c Merge "Enable template editor toolbar deeper in the stack" 2022-09-12 09:52:26 +00:00
jenkins-bot 58aacfa046 Merge "Fix parameter labels not being clickable" 2022-09-12 09:50:04 +00:00
jenkins-bot 5d24bea80a Merge "Start with last item when shift+tabbing into parameter list" 2022-09-08 12:40:40 +00:00
jenkins-bot ee9866bfc9 Merge "Make "(undocumented parameter)" part of the parameter label" 2022-09-08 11:52:52 +00:00
jenkins-bot b00c52556b Merge "DesktopArticleTarget.init: Get $targetContainer after jQuery ready" 2022-09-06 22:17:23 +00:00
Jon Robson ecfc3f18e4 DesktopArticleTarget.init: Get $targetContainer after jQuery ready
$targetContainer was calculated at the top of the file,
but it's only guaranteed to be available after jQuery ready event.

Bug: T314952
Change-Id: Id5d0c71433bfc51cb7193ee1b931a7dd8a4324d9
2022-09-04 02:43:19 +02:00
jenkins-bot 4687e27ffa Merge "Fix logic for getting the *available* preferred editor" 2022-09-01 20:41:25 +00:00
Ed Sanders a625d0b7b7 Fix logic for getting the *available* preferred editor
Factor out getAvailableEditPageEditor from getEditModeFromUri
and use instead of getEditPageEditor everywhere.

Bug: T316776
Change-Id: I34bab092b829124c52f8bc0e262a9c3aa17f2c52
2022-09-01 22:25:53 +02:00
Ed Sanders 35138e00be DesktopArticleTarget: Fix popstate handling when action=edit (single edit tab)
This means if you load the editor on a single edit tab wiki,
then press back then forward, the editor will re-open.

Bug: T316869
Change-Id: I1ea33de7d7324a53399be9155c474a14ae21dfe8
2022-09-01 14:56:05 +01:00
Ed Sanders 45b36ad683 Fix broken history management in onEditSectionLinkClick
This code is supposed to be similar to the code in activatePageTarget()
however it was checking if the *link* URL looked like a veaction link,
not the view URL. It also then tried to push this.href as the new state
which was always undefined. This meant:
* If the section edit link was veaction= then nothing happened. The URL
  in the address bar would get updated *after* the editor loaded by code
  in DesktopArticleTarget.
* If the section edit link was edit= (single edit tab wikis) then the
  view URL would get replaced with and edit URL, meaning if you browser-
  backed out of the editor, the URL was stay as the edit URL.

Bug: T316771
Change-Id: Idb5e3c51a22361e0d9916d3c31444daeff310ed2
2022-08-31 13:57:02 +01:00
jenkins-bot 736cca3a18 Merge "DesktopArticleTarget: Set wgPostEdit when redirecting after save" 2022-08-30 22:26:58 +00:00
jenkins-bot 182eb7340e Merge "Fix calling order in template dialog .getSetupProcess()" 2022-08-30 13:28:51 +00:00
Thiemo Kreuz 663936ab6e Fix calling order in template dialog .getSetupProcess()
This fixes two issues:
1. .initializeAllStickyHeaderHeights() is now executed after the
   .ve-ui-mwTransclusionDialog-single-transclusion CSS class is set.
   This is critical because in this mode the sticky header does
   have a different height.
2. We get rid of 2 references to .sidebar that should not have been
   in this class in the first place.

Also bring some more calls in an order that makes sense. This does
not make a difference and is only for readability.

Bug: T315292
Change-Id: I22f6c11de8f693edb03485adcaa186bd4b283b2f
2022-08-30 14:20:42 +02:00
Thiemo Kreuz 337ee1588e Remove redundant "choose" event handler
I'm pretty sure this extra call is just pointless. This "choose"
event is triggered every time a new parameter is added to the list of
parameters. But there is another code path that is triggered in the
exact same situations: the onReplacePart event handler.

As far as I remember this "choose" handler was added very early when
the other events haven't been implemented yet.

This should be fairly easy to test. The only situation where this
could make a difference is:
1. When you have a template with 3 parameters and you add a 4th
   parameter.
2. When you edit an existing multi-part transclusion that contains a
   lot of parameters, but the parameters are initially hidden. The
   widgets are only created when you click "show all" or start
   searching.

Change-Id: I59e3873a4fe6fa5a01d681fce89fbe00756ae815
2022-08-30 12:23:07 +02:00
Thiemo Kreuz e5d6af728e Add missing call to .recalculateStickyHeaderHeight()
This was missing when you:
* Insert a new template and select a template with a lot of
  parameters.
* Same when you edit an existing multi-part template and add a new
  part (Ctrl+D) with many parameters.

Bug: T315292
Change-Id: Icd281c21a1b40d8e29343fa4975e27e8d927cd15
2022-08-30 11:57:23 +02:00
Thiemo Kreuz d92da786a2 Fix parameter labels not being clickable
This is only an issue when a long parameter description is collapsed.
The float is a left over from a time when there was a delete button
on the right side of each parameter label. This is gone.

Bug: T310137
Change-Id: I249f0592de9c73a07af22bd7f86241caf0207770
2022-08-29 17:12:28 +02:00
Thiemo Kreuz 299738307e Make "(undocumented parameter)" part of the parameter label
This makes it possible to click on "(undocumented parameter)"
to focus the input field – the same effect as when clicking the
parameter name.

This also lower-cases the initual "(U…". This is not the beginning of
a sentence.

Change-Id: Ibfa5bbaee39c2b3a4fefbcee33102b85ca3ba9c0
2022-08-29 17:00:23 +02:00
jenkins-bot f606e7c7e3 Merge "Don't focus template input fields (and open keyboard) on mobile" 2022-08-29 07:27:17 +00:00
Thiemo Kreuz d10dd4ded0 Don't focus template input fields (and open keyboard) on mobile
On mobile, tapping anything in the sidebar should only scroll the
corresponding element into view, but not focus the input field. The
reasoning is that an on-screen keyboard should only pop up when the
input field is actually tapped.

By the way, the "jump" issue in T312768 was because of the same
reason. In that case an onFocus happens before we have a chance to
scroll. Unfortunately there is no way to reverse the execution order
of these. Which is why we disabled the animation there.

Bug: T289043
Change-Id: I1c18802b8ff776fa8d9c17e3df8020354690d29f
2022-08-28 14:26:29 +00:00
jenkins-bot ce37169a51 Merge "Don't send missing $wgVisualEditorTabMessages to the browser" 2022-08-26 18:57:07 +00:00
jenkins-bot 5e50db824f Merge "Tweak main toolbar shadow to not leak out from the sides on vector-2022" 2022-08-26 16:49:07 +00:00
jenkins-bot 012458f4ca Merge "Fix a few risky places for a multi-valued rel attributes" 2022-08-25 00:13:22 +00:00
Isabelle Hurbain-Palatin fa58a9e6ec Fix a few risky places for a multi-valued rel attributes
This patch follows the audit made on the extensions to check the usage
of the "rel" attribute and check that it's compatible with multi-values.

Bug: T315209
Change-Id: Ib323736d93ea96c86f9d56599e515c9e6d72a76e
2022-08-23 15:21:41 +02:00
Jon Robson e763f9d2f2 Error logging: Provide additional debugging context
Bug: T314952
Change-Id: Ife8dffd2eb427d60ef4179f382109c7e2a1f0d1e
2022-08-22 11:21:44 +01:00
Thiemo Kreuz c35c1f6813 Dynamically calculate height of toolbar sticky headers
Alternative for Idf4d69d.

Bug: T315292
Change-Id: I15231d66bb832b92d1924881b0df7dbe9f26a921
2022-08-18 17:59:03 +02:00
Thiemo Kreuz e338a3c35d Enable template editor toolbar deeper in the stack
We can do this more in-place instead of reaching into the structure
from the outside.

Change-Id: I1beb5f7dcfef027f811a3bb4d2a2ef323e2535e3
2022-08-17 13:37:48 +02:00
jenkins-bot d81ac62283 Merge "Limit toolbar top border fix to vector-legacy" 2022-08-17 03:39:24 +00:00
jenkins-bot fd71fbe605 Merge "DesktopArticleTarget: Move updateTabs to .init so it can be called sooner" 2022-08-16 23:01:55 +00:00
jenkins-bot f03aa80f95 Merge "ArticleTarget: Move updateTabs implementation to DesktopArticleTarget" 2022-08-16 23:01:53 +00:00
jenkins-bot 16a8dc34a0 Merge "ve.ui.MWTargetWidget: Remove top margin in Vector 2022" 2022-08-16 22:51:35 +00:00
Ed Sanders 0588477b6c DesktopArticleTarget: Set wgPostEdit when redirecting after save
Bug: T240041
Change-Id: Ieba322fd6a33039f6c91868a266b9deefd2e0116
2022-08-16 15:32:45 +01:00
Ed Sanders 1c313eddf1 Follow-up I7fb352fc: Fix scope typo in ArticleTarget
Bug: T315320
Change-Id: Iefbb5ad1cee8069e52f9f62ae2191491e263a73b
2022-08-16 15:13:22 +01:00
Thiemo Kreuz 1926ab7b05 Code cleanup in ExpandableContentElement
This is split off from the unfinished patch I039d6f6. This only moves
existing code around, makes use of chaining and such to make code
more compact and hopefully more readable. Methods are renamed to
reflect better what they actually do. No behavior should change.

Change-Id: I3ba538c8c77ad4455bf0f0aa821ca14feadef7cc
2022-08-15 08:40:11 +00:00
jenkins-bot 254b14f3bf Merge "Chain scroll calls instead of just calling after each other" 2022-08-15 07:50:49 +00:00
jenkins-bot ba00286b13 Merge "Pass empty string to unused argument of pushState/replaceState" 2022-08-12 15:56:24 +00:00
Thiemo Kreuz eb71810b6d Start with last item when shift+tabbing into parameter list
Note this implementation introduces some technical debt: It adds a
little bit of knowledge about what "part widgets" and the toolbar are
to the parameter SelectWidget. I think this is acceptable.
A "cleaner" implementation is probably so complicated that we don't
want it in the code, for such a minor benefit. However, alternative
patches are very much welcome.

Bug: T313703
Change-Id: I957698d58a7622cbe54bcc2ba454388ba9f09537
2022-08-11 18:23:51 +00:00
Thiemo Kreuz 89ace728a4 Chain scroll calls instead of just calling after each other
Change-Id: I420fbd29ab79d6f2e1e9ef02bc3c99050126c3c8
2022-08-11 15:35:45 +00:00
jenkins-bot 54d0268847 Merge "Do not show incompatible skin warning when page is not editable" 2022-08-11 13:43:54 +00:00
Ed Sanders f9ed7066c8 DesktopArticleTarget: Move updateTabs to .init so it can be called sooner
The edit tab should be active as soon as the editor starts loading
(to indicate it doesn't need to be clicked again, and that the read
tab can now be clicked).

Change-Id: I450c53eef64c25e9520d3868b4ecc95204644138
2022-08-11 14:30:48 +01:00
Ed Sanders 9f5944af9e ve.ui.MWTargetWidget: Remove top margin in Vector 2022
Change-Id: I3d079a9e1b44821180c849c2c018a2314b2e089e
2022-08-11 14:27:53 +01:00
Gergő Tisza c697a6d2da
Do not show incompatible skin warning when page is not editable
Bug: T314952
Change-Id: Ie09f2ab5a8ae05cdd95ba1acbe02e978c002f8d6
2022-08-10 23:07:39 -07:00
Bartosz Dziewoński d36d467a82 ve.ui.MWTargetWidget: Suppress the stacking context established by .vector-body
Bug: T314230
Change-Id: I742f0435f279689dbdac8e811a8aeab00cc9086b
2022-08-11 01:47:19 +02:00
Bartosz Dziewoński 4cd18e42ab Tweak main toolbar shadow to not leak out from the sides on vector-2022
Bug: T311311
Change-Id: I847c8b64c5e24e92bf75d206f0815d1be3352292
2022-08-10 20:38:20 +02:00
Ed Sanders 08b3a21b25 Limit toolbar top border fix to vector-legacy
Also move code to .init so it can apply as soon as the
editor starts loading.

Bug: T311311
Change-Id: I87b15a0c56261a9f70291749bdbc37a518506d5d
2022-08-10 20:38:20 +02:00
Ed Sanders 260ee25f3a ArticleTarget: Move updateTabs implementation to DesktopArticleTarget
The .selected class does nothing on mobile, nor are the tabs visible
under the full screen overlay.

Change-Id: I14a6747f4a3274d71b7aa16b2c9b76b62a5253c2
2022-08-10 17:00:17 +01:00
Ed Sanders 686ef07ed3 Pass empty string to unused argument of pushState/replaceState
Per https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
this argument is treated as unused in all the browsers we support.

Change-Id: I83d3e2e8d9d2defa49e7a832f78bfc29f15da719
2022-08-09 13:37:34 +01:00
jenkins-bot 95774e4f2a Merge "Also log EditAttemptStep events via Metrics Platform" 2022-08-06 05:09:24 +00:00
jenkins-bot f842d6fa97 Merge "Rename value state variable" 2022-08-05 09:23:08 +00:00
WMDE-Fisch c66e700469 Rename value state variable
Is more intuitive like that.

Change-Id: Ib36d6fa1bce9a564f5b9a1c027f2573a5775d2c5
2022-08-05 10:07:18 +02:00
WMDE-Fisch 6cfa2e7dd0 Fix typos
Change-Id: Iaa7bf09877f32f7c19217103773657a8d8a81d16
2022-08-05 10:00:54 +02:00
Adam Wight 63c625f261 Remove unused config parameter from forked ControlsWidget
Split from I8eb279f.

Bug: T311296
Change-Id: I1739af4ca3c92a3aab08c61be8f665d2d3997f7c
2022-08-04 20:14:41 +02:00
jenkins-bot e857ded358 Merge "Streamline button margin calculation for outline parts" 2022-08-04 13:05:18 +00:00
WMDE-Fisch 7f4645bbe0 Streamline button margin calculation for outline parts
Generally the default button margin on the parts is 24px. The only
exception are the placeholder and wikitext when they are the last
parts in the outline.

Bug: T312644
Change-Id: Ie513bf1c022b2696cc92aacbbca59ddf6e55043e
2022-08-03 13:09:51 +02:00
jenkins-bot e50c0af860 Merge "Show "no parameters" message only when there are no parameters" 2022-08-03 09:43:50 +00:00
Thiemo Kreuz cdf9a59278 Tweak the hard coded top scroll padding for the parameter list
In Iebfe2e2 we already tweaked this by 1px. Turns out this was not
enough in all relevant situations. I still get random scroll events
just because I move the mouse around. Setting: Firefox, 120% zoom,
multi-part transclusion.

Bug: T312926
Change-Id: I475c1ef029e9721cc663881e40547730389cd26d
2022-08-03 11:15:32 +02:00
jenkins-bot f3f1e9c402 Merge "Tweaks to focus/scrolling code relative to sticky header" 2022-08-03 08:09:47 +00:00
jenkins-bot 13e5ae6997 Merge "Tighten conditions for incompatible skin warnings" 2022-08-02 11:42:24 +00:00
Thiemo Kreuz 5eb1193670 Tweaks to focus/scrolling code relative to sticky header
* Rename method because it turns out it is not only about the sticky
  header, but also relevant when there is no header.
* Move some code to more appropriate places.
* Use 0 as documented in OOUI, not null.
* Set the padding back to 0 when the sticky header is not visible.
  As of now this is an unreachable state because the filters never go
  away after they have been made visible. Still this code was always
  written with this possibility in mind to make it future-proof.
* Performance optimization for the boolean "show filters?" check.

Bug: T312926
Change-Id: Iaba08ccd8bf00360fd26f9268d5be43df4f4fbd8
2022-08-02 11:41:23 +00:00
Thiemo Kreuz 0b28414dff Restore scrolling parameters into view with(out) sticky header
This is a partial revert of Ide45141. Now the scrolling always
happens (again), but properly considers the presence of the sticky
header. It was also not correctly initialized on construction time.

This is a candidate for a backport. The patch is intentionally as
small as possible because of this. Code cleanup will be done in a
later patch.

Bug: T312926
Change-Id: I06425b42566bfb2087846636055ee75e98a05029
2022-08-02 12:29:06 +02:00
Thiemo Kreuz b9376f5990 Show "no parameters" message only when there are no parameters
The message was also shown when a documented template appears as
part of a multi-part transclusion but with zero parameters being
used. You see the filters in this case and can click "show all".
The message is just wrong in this situation.

Bug: T312926
Change-Id: I8d26ceec483e05fd1f69013e506fa1eb4e4c29ed
2022-08-02 11:48:45 +02:00
Thiemo Kreuz 800461efac Scroll below sticky header only if sticky header is present
Bug: T312926
Change-Id: Ide45141f0a21b782f8674ecbed9ee512de985661
2022-08-01 15:37:33 +02:00
jenkins-bot 2f555569ea Merge "Tweak the hard coded top scroll padding for the parameter list" 2022-08-01 13:05:03 +00:00
WMDE-Fisch 8ae4d291df Tweak the hard coded top scroll padding for the parameter list
Currently the sticky size is exactly 114px. With 115px you also can
see an auto scroll effect on multi part transclusions when you hit
that 1px sweat spot at the top of the list.

Bug: T312926
Change-Id: Iebfe2e2c6360c650755cd985157949a26a5287a4
2022-08-01 14:07:31 +02:00
jenkins-bot a1bd30f35d Merge "Simplify partly redundant findFirstSelectedItem implementation" 2022-08-01 11:45:08 +00:00
Thiemo Kreuz d01d1e78c2 Simplify partly redundant findFirstSelectedItem implementation
Introduced via Ibc56abf. But the OOUI SelectWidget does have some
methods for this already.

This patch also updates some @mixins documentation.

Bug: T302965
Change-Id: Iffbb44d41586786a2165f8d7916f94a52ad19122
2022-08-01 11:07:29 +00:00
jenkins-bot ee760ee2a6 Merge "Fix forgotten "setPage" property because of merge conflict" 2022-08-01 09:37:40 +00:00
Thiemo Kreuz cdb9766752 Fix forgotten "setPage" property because of merge conflict
The rename in I5a16ab4 was done the exact same time a new usage was
introduced via Ibb717ca. Neither patch shows a conflict. Still there
is one.

I remove the extra `|| null` line because it is just not needed. We
don't need to set the property to null when it was already null.

Bug: T312213
Change-Id: Id3f025786c9412e8c1946434113c41356da08098
2022-08-01 09:42:25 +02:00
Bartosz Dziewoński b5cdd70508 Tighten conditions for incompatible skin warnings
Previously we could log a warning if the user had the editor enabled,
but the page did not support being edited as wikitext.

Bug: T312632
Bug: T314171
Change-Id: I647cb057ed44c155b4eba1b728d6908f8a7abb69
2022-07-30 15:35:47 +02:00
Andrew Kostka dc91a39f8b Use the same styling for add template and add parameter buttons
Bug: T314052
Change-Id: I62d4e282b0e8f0a32e37e144db358144224119f1
2022-07-28 16:24:15 +02:00
jenkins-bot 6422e69821 Merge "Minor code cleanups in forked BookletLayout and related" 2022-07-28 12:59:10 +00:00
jenkins-bot 13c2a24f6c Merge "Prefer adding parameter to currently focussed template" 2022-07-28 11:34:38 +00:00
jenkins-bot 52c155f43f Merge "Fix "null is not a string" error in event logging code" 2022-07-28 10:41:15 +00:00
Thiemo Kreuz 741dbe5ccf Minor code cleanups in forked BookletLayout and related
E.g. renaming variables and moving code around. No functional change.

Change-Id: I39e76356c62a0d1bcdf1d20bc8215f09604ad07d
2022-07-27 16:04:27 +02:00
jenkins-bot f67033a82d Merge "Log incompatible skin warnings" 2022-07-27 12:47:01 +00:00
jenkins-bot 94268009c9 Merge "Remove dead code, deleting parameters is not possible" 2022-07-27 09:41:51 +00:00
Thiemo Kreuz b085d6cf24 Prefer adding parameter to currently focussed template
Instead of the template that's currently selected. That's confusing,
e.g. when you click one of the search fields, search for a parameter,
can't fine it, and press ctrl+shift+d to add an undocumented
parameter. Or you navigate the list of parameters with the cursor
keys, can't find the parameter you are looking for, and press
ctrl+shift+d to add it.

Still falls back to the selection when the focus is outside of the
sidebar.

We suggest to merge this before UX review, and review it later in
demo time. It's easy to undo if necessary.

Bug: T313388
Change-Id: I9848dd0af4fe821526dafc18bbd7cb1ab0e68cfc
2022-07-27 09:17:23 +02:00
Thiemo Kreuz f09f704364 Don't send missing $wgVisualEditorTabMessages to the browser
This is send as an associative array. Instead of adding elements that
are null we can just not add them.

Bug: T291729
Change-Id: I28d847941eec865cb255779534eca14ec88f588f
2022-07-27 09:13:48 +02:00
Gergő Tisza 591796df12
Log incompatible skin warnings
Log a client error when VisualEditor cannot load because of an
incompatible skin (which is not supposed to happen in practice).

Bug: T312632
Change-Id: I2ccfaa584d7a05e10170a66d446bd4e476dcc775
2022-07-26 17:51:30 -07:00
jenkins-bot 1d34b069ad Merge "ve.init.mw.Target: Use mw.libs.ve.targetSaver.getHtml in getWikitextFragment" 2022-07-27 00:07:35 +00:00
jenkins-bot e06cdeadb1 Merge "ve.ui.MWGalleryDialog: Fix "Alternative text" not being readonly sometimes" 2022-07-26 20:26:17 +00:00
jenkins-bot f7d9da3317 Merge "Start altText as null to avoid empty alt for new gallery images" 2022-07-26 20:00:52 +00:00
jenkins-bot 7e55a99917 Merge "Add a checkbox to use the image caption as the alt text for galleries" 2022-07-26 20:00:48 +00:00
Bartosz Dziewoński d2f7796744 ve.ui.MWGalleryDialog: Fix "Alternative text" not being readonly sometimes
Depending on the order in which this code executed, sometimes the
dialog initialization would overwrite the readonly state set by item
initialization.

They should simply all check both conditions.

Change-Id: I6a18f1e074f118423438c017b3e4e34e75579e5d
2022-07-26 21:50:19 +02:00
jenkins-bot c595901528 Merge "Tab to first template parameter in list, not to the selection" 2022-07-26 14:45:04 +00:00
jenkins-bot 20f255d0f9 Merge "Fix filtering not clearing "currently selected page" state" 2022-07-26 14:36:02 +00:00
jenkins-bot 4997f3d41d Merge "Move getters for the currently selected part to two-pane layout" 2022-07-26 12:30:41 +00:00
Thiemo Kreuz d922c12957 Remove dead code, deleting parameters is not possible
This code was for when the dialog had a trash can icon for every
parameter, and parameters could actually be deleted. It's unreachable
now.

We missed this when removing the old workflow.

Change-Id: Ic94df506ea84009a1e1863a4e9847a70498df448
2022-07-26 13:21:39 +02:00
jenkins-bot 72b3a31571 Merge "Fix Ctrl+D and Ctrl+Shift+Y hotkeys to add parts" 2022-07-26 09:23:50 +00:00
jenkins-bot 2185393d96 Merge "Fix Ctrl+Shift+D hotkey to add undocumented parameters" 2022-07-26 09:20:48 +00:00
Thiemo Kreuz 72c136182c Remove unused pieces of code from two-pane layout
The toggle feature is not used. The method is always called with a
bool.

Bug: T313489
Change-Id: Id05398ea837355f93df597674e817e3e4f0f8481
2022-07-26 10:41:45 +02:00
Arlo Breault 5bfdff2197 Start altText as null to avoid empty alt for new gallery images
Bug: T310624
Change-Id: I26ffb386fa4de5ed6128da8d08da1df2576f3755
2022-07-25 22:43:28 -04:00
jenkins-bot ce2cdc6a1e Merge "ve.ui.MWTemplateDialog: Fix dialog becoming inert" 2022-07-25 16:03:50 +00:00
jenkins-bot 801d017417 Merge "Add missing check to confirmation dialog's "closed" handler" 2022-07-25 15:27:06 +00:00
Bartosz Dziewoński 9e954b7c20 ve.ui.MWTemplateDialog: Fix dialog becoming inert
OOUI support for multiple modal window managers is hacky, and only
works correctly when the managers are attached directly to <body>.
Remove the wrapper that doesn't seem to be necessary.

Bug: T313690
Change-Id: I4134c0f50d28a364dcf15b426bd9b59a4f7a985d
2022-07-25 17:01:12 +02:00
Thiemo Kreuz cbc90ff90a Remove dysfunctional "no outline" mode from template dialog
The dialog is unusable when there is no outline. See T313489 for a
longer explanation.

Bug: T313489
Change-Id: Ib2cc9c363d3596a16f6f1c4aef03ca216abf6b1f
2022-07-25 14:45:18 +00:00