Commit graph

546 commits

Author SHA1 Message Date
jenkins-bot 2fb87f11e0 Merge "Add option to unify display of VE enable preference" 2023-08-07 15:33:40 +00:00
jenkins-bot 5d079c2012 Merge "Fix conditions for 'visualeditor-autodisable' that depended on WMF config" 2023-08-07 15:31:52 +00:00
Dringsim cce52fae65 Use different tooltips for ca-edit and ca-ve-edit links
Bug: T337653
Bug: T341424
Change-Id: I3aa79fec71ca2c40a0ece3ca73dd934cf6c9d5a8
2023-08-02 16:36:54 +00:00
Derick Alangi 4418b61894 Remove DualParsoidClient::class and related code from VE (p.2)
I've verified that no other extension uses this code apart from VE
and locally tested that with this patch, VE still works and nothing
explodes.

There parent patch takes care of making sure the mode is no longer
injected and we now have just etags with no hacked in modes because
we now use direct mode always.

Bug: T341612
Change-Id: Ib1756bf60104467a3a34be9bbb06d8f63537e550
2023-07-25 09:01:44 +00:00
jenkins-bot b9f0764711 Merge "Prevent JS code from changing 'skin-view-edit-local' message to 'skin-view-edit'" 2023-07-17 23:54:53 +00:00
jenkins-bot 4231c7a328 Merge "Use different titles for "Edit" and "Edit source" links (section headings)" 2023-07-17 23:07:44 +00:00
Derick Alangi daa6861f01
Remove ::injectMode(), prep to remove DualParsoidClient p.1
In order not to break clients who already have VE open with etag
that injects the "mode:direct..." in their etag, let's first stop
injecting the direct mode to subsequent VE sessions (for edits)
and wait for 24hrs+ so that we're sure we've processed all sessions
with the direct mode etag.

After 24hrs of this patch merged and going live, we'll then remove
the DualParsoidClient entirely as the p.2 of this cleanup.

Bug: T341612
Change-Id: Ie4f43089ee6f94f51fc0398e84604a17bc5bebcf
2023-07-17 11:26:47 +03:00
沈澄心 70cb30c2a8 Prevent JS code from changing 'skin-view-edit-local' message to 'skin-view-edit'
Change-Id: I33ab649959226a848e1c57fc7c2b7e95a014e4bd
2023-07-13 02:51:12 +00:00
沈澄心 8523b5a876 Use different titles for "Edit" and "Edit source" links (section headings)
Bug: T337653
Change-Id: I6793d458b7a1573de6752177cab5a9bfae9ffca0
2023-07-13 02:47:50 +00:00
thiemowmde ab2cbb3b70 Change almost all code to use Bcp47Code instead of Language
This patch makes the following assumptions:

1. There is no class outside of this codebase that implements the
ParsoidClient interface. According to CodeSearch this appears to be
correct.

2. It is fine to use the Bcp47Code instead of the internal MediaWiki
language code in the "Accept-Language" HTTP header. As far as I
understand this might even qualify as a bugfix.

Depends-On: If059674597e261039df7f4613a89cb08120c3262
Change-Id: Icd160da2d5555891b9a91a0cb966bd36a55f6fdd
2023-07-12 09:38:16 +02:00
jenkins-bot b804a54ca6 Merge "Use more narrow Bcp47Code interface in DirectParsoidClient" 2023-07-11 21:18:17 +00:00
Derick Alangi f2bb8cf45d Remove VirtualRESTService code from VisualEditor
This follows the event of VE no longer using RESTBase anything. All
actions related to stashing and Parsoid and now handled in MW core.

Bug: T339227
Change-Id: I50b20ed5abb721a6ac8987cac37a6f395a4816dc
2023-07-11 19:38:05 +02:00
jenkins-bot 7ae61934a3 Merge "Remove remains of lossy-switching and discard-switching" 2023-07-11 15:34:52 +00:00
jenkins-bot 93427a6708 Merge "Reload page or redirect when saving an edit creates a temp account" 2023-07-11 15:16:56 +00:00
Bartosz Dziewoński 0dddd98b5f Reload page or redirect when saving an edit creates a temp account
Depends-On: I6cdc014fb39d35ce1f091b53dc3a9c4a3c95f9e9
Bug: T338002
Change-Id: I01e13ce1ebab462eeb0ba3847d4205a88965a127
2023-07-10 19:33:16 +02:00
thiemowmde 44621c6b92 Use more narrow Bcp47Code interface in DirectParsoidClient
Change-Id: I36f6e2f1ca8e3e3d7f98ecbec8b9d62790e579ba
2023-07-07 09:59:23 +02:00
Esanders b33bb734af Revert "Revert "Add tag when reference added to the page""
This reverts commit 235e5aca00.

Reason for revert: Re-applying with fixes

Change-Id: I9dc5a77045ea5f15c90cf84a15815e13dffd5739
2023-07-06 17:50:08 +01:00
Bartosz Dziewoński 235e5aca00 Revert "Add tag when reference added to the page"
This reverts commit d4460219bd.

Bug: T341202
Change-Id: I8e608a5a34a3bb18d1994d5c182c3918e6d6f89d
2023-07-06 11:35:50 +00:00
Ed Sanders d4460219bd Add tag when reference added to the page
Bug: T325713
Change-Id: Ia4abe256c7ffffa749ad6cdb537dd26091ea07da
2023-07-03 15:09:12 +00:00
Ed Sanders d7d344035c Add tag when content added, according to EditCheck heuristic
Bug: T333714
Change-Id: Id806e6d4d856aead4af98d43078c534d4d46c7f0
2023-07-03 14:43:14 +01:00
Bartosz Dziewoński be0b140965 Add option to unify display of VE enable preference
Setting `$wgVisualEditorUnifiedPreference = true` makes the VE enable
preference appear consistently on the preferences page, while still
being backed internally by the old 'visualeditor-enable' and
'visualeditor-betatempdisable' preferences.

(It effectively overrides `$wgVisualEditorEnableBetaFeature`, which
needs to remain unchanged to use the values from the right preference.)

Bug: T335056
Change-Id: Iad710a769c7176c4673c475d540dff2b7782e159
2023-06-29 01:33:51 +02:00
Bartosz Dziewoński e1cdab7931 Fix conditions for 'visualeditor-autodisable' that depended on WMF config
Previously, this code relied on 'visualeditor-enable' being set to '1'
when VE was opt-out (so not using that preference). That default does
not make sense for a beta feature (which uses that preference), so WMF
config was overriding it to 0 when the beta feature mode was wanted.

Instead of making assumptions about the default values of preferences
that depend on whether beta feature mode is enabled, just check the
beta feature config.

I also added and updated comments documenting this preference.
Previously I never really understood what it was for, and I think
I figured it out now.

Bug: T340696
Change-Id: I45eef42939149ff5be63bf299c48ef70ee535e76
2023-06-29 01:25:59 +02:00
Bartosz Dziewoński b986645d0a Fix trying to get a PageRecord for a non-existent page
This reverts a change from 5a792b6558. The hook only requires
a PageIdentity, and we only used toPageRecord() because it takes
a parameter to read latest data, and toPageIdentity() does not.
Instead call another method to update the internal data within the
Title instance. Maybe it's not great to rely on this side-effect…

Bug: T340568
Change-Id: If9cbd95eb84b6c39bf50af4564710839628a9bc3
2023-06-28 21:58:31 +02:00
jenkins-bot f22f0d4c68 Merge "React to hooks that are fired when inline switch is present" 2023-06-26 05:29:44 +00:00
hmonroy 4a028f1336 React to hooks that are fired when inline switch is present
React to hooks fired by core when the inline diff type switch is
present. VE needs to be able to disable the inline switch
when 'visual' mode is selected and enable the switch when 'wikitext'
mode is selected. When the 'wikitext' mode is selected and there is an
inline switch, the interface needs to show the diff type format previously
selected.

Toggle using new `mw-diff-element-hidden` class that is used by core so
that there's no clashes when hidding and showing the diffs.

Bug: T331589
Depends-On: Ie6a48e495f2bb299d8b984e7c40363d534c7915b
Change-Id: I4f790370dbfeb521f3b61c4d604245f77094abe9
2023-06-26 04:20:16 +00:00
Bartosz Dziewoński 34c6d3e1a3 Remove remains of lossy-switching and discard-switching
After the demise of RESTBase we are always able to switch from
wikitext to visual mode with changes, and we no longer need to
support these two poor experiences.

Bug: T339871
Bug: T339872
Change-Id: I2be4068447b21e16c87db0e56d6422ea64ba4708
2023-06-25 09:16:45 +00:00
Bartosz Dziewoński 5a792b6558 ApiVisualEditorEdit: Allow not returning the new revision content
Sometimes we call this API and then reload the page (or navigate to
another URL), without using the page content it returns. Save some
work and some data transfer and don't generate it in those cases.

Change-Id: Ic5fac61f3ef9b2dfce6ff757f1d414a9f41f217d
2023-06-22 21:08:15 +00:00
jenkins-bot ac4032eff5 Merge "Stop collecting stats per wiki" 2023-06-20 11:39:26 +00:00
daniel 4a2b3b580f Stop collecting stats per wiki
Having per-wiki statistics is neat but expensive. Now that VE has been
switched to not use RESTbase on all wikis, Go back to collecting
all stats under a single key. The relevant dashboards have already been
adjusted accordingly.

Change-Id: I9666bfa3fed547f3f619a9e0c9c24b9240edc359
2023-06-19 21:19:35 +00:00
Bartosz Dziewoński 8573df0233 ApiVisualEditorEdit: Remove unnecessary check
There are no occurrences of the error message in our error logging
data, so it most likely can never happen.

https://superset.wikimedia.org/superset/sqllab/
```
select count(*)
from editattemptstep
where event.save_failure_message = 'visualeditor-docserver'
```

Change-Id: I8172564057418283468c657cbc6d42ce8ddb35f4
2023-06-12 17:56:13 +00:00
jenkins-bot 9c4e8c4805 Merge "Always use the strict equality flag when using in_array" 2023-06-09 16:27:03 +00:00
jenkins-bot 550f73468e Merge "Bump requested Parsoid HTML version to 2.8.0" 2023-06-09 03:23:32 +00:00
jenkins-bot b9dc193037 Merge "Ensure a compatible Parsoid output version for direct client" 2023-06-09 03:22:18 +00:00
Ed Sanders f99c580aff Always use the strict equality flag when using in_array
Change-Id: Ic9d4d97cc95baf2b312a6a1d83b58ab410bcf504
2023-06-07 13:26:10 +01:00
jenkins-bot f1ce07c29d Merge "Move the diff-mode selector to the new TextSlotDiffRendererTablePrefix hook" 2023-06-06 18:26:57 +00:00
Arlo Breault 7d5b964507 Bump requested Parsoid HTML version to 2.8.0
This will ensure that media have the mw-file-element classes so that the
styling changes in I70c61493fe492445702f036e5b24ef87fc3bdf43 apply.

Older 2.7.0 content still in storage is missing the classes and doesn't
render correctly.

Note that I545ed75ed3c87e88b5e776696754e23c05645f81 made sure that
editing of both versions was always compatible.

Bug: T337596
Depends-On: Ia70f819df79fbb12a5b1dd6a98bfe0b968808d18
Change-Id: I40ed887e03f983e0737e1ee7cba5a4012fea31db
2023-05-31 12:12:59 -04:00
Arlo Breault e7e5241802 Ensure a compatible Parsoid output version for direct client
Presumably VE will move in lock step with the Parsoid library but this
retains the ability to negotiate even at this level.

Change-Id: Ice3beabcb1a475f2de9ad61e0f234a9cc23f80bd
2023-05-31 12:08:28 -04:00
Sam Wilson 137124a837 Move the diff-mode selector to the new TextSlotDiffRendererTablePrefix hook
Use the new hook to add the diff-mode selector to the area directly before
the diff table.

Also toggles the new inline-diff legend, when the initial diff-type is 'inline'.

Depends-On: I2a3c67bcfa47313dee597e602a62073e4e298cd2
Bug: T324759
Change-Id: I1584a84b3caea9eb142afba976c6ff47650c3832
2023-05-31 15:45:22 +10:00
Bartosz Dziewoński c37633bb83 Hide 'editnotice-notext' message in VE (and mobile apps)
Bug: T337633
Change-Id: I142edff12492e80b9c281353e6a53efc3339159c
2023-05-29 02:07:19 +00:00
Ed Sanders fe14ffb76b Output config var when VE disabled by hook
Currently we only disable the desktop init code when this hook
returns false, but other integrations may want to know about this,
e.g. MobileFrontend.

Bug: T174180
Change-Id: I0268239cc9ea2d397140e617fcb6e4e104a75f31
2023-05-26 18:42:19 +00:00
David Lynch 50c646050d Update VE core submodule to master (fd2f048e4)
Also supporting changes to support the new HelpCompletionAction,
including adding a preference to disable it if required.

New changes:
985b553cc Localisation updates from https://translatewiki.net.
aa26e27dc Localisation updates from https://translatewiki.net.
4cdc753ab Update OOUI to v0.47.0
bfc96a7ee Completions: always abandon if the first input is a space
616a6458f Fuzzy command bar
92b6525a2 Tweak the fuzzy command bar's behavior
fd2f048e4 Fuzzy bar: change how command groups are generated

Change-Id: Ic77b8822baecf5ad1ab466d94df29bb945172b55
2023-05-20 22:04:27 +03:00
jenkins-bot d6803f2533 Merge "Use edit intro messages and preloaded content from MediaWiki core" 2023-05-19 13:23:21 +00:00
jenkins-bot 1c5dbf6f79 Merge "Revert "onDifferenceEngineBeforeDiffTable: Return early on Special pages"" 2023-05-18 17:20:49 +00:00
HMonroy d88cd64e52 Revert "onDifferenceEngineBeforeDiffTable: Return early on Special pages"
This reverts commit f693822f64.

Reason for revert: Reworking

Depends-On: Idc96036564291a3887935dbff4ec476f4ad07068
Change-Id: Iee3f41c1b096b82ee61ecca9ddc5fcd044f1237c
2023-05-18 16:45:15 +00:00
HMonroy ba687994d3 Revert "onDifferenceEngineBeforeDiffTable: Update comment"
This reverts commit d7262d8483.

Reason for revert: Reworking

Change-Id: Idc96036564291a3887935dbff4ec476f4ad07068
2023-05-18 16:45:11 +00:00
Samtar 09bb8f9168
Revert "Move the diff-mode selector to the new DifferenceEngineBeforeDiffTable hook"
This reverts commit 7dbe385773.

Reason for revert: Reworking

Change-Id: I60784afa0d47e22acd9e8a981092784c84b250eb
2023-05-18 15:36:38 +01:00
TheresNoTime d7262d8483 onDifferenceEngineBeforeDiffTable: Update comment
Bug: T336582
Follows-up: I251db11e8cb5b785744ee2c111d20a346937b78c
Change-Id: Ic1a6a3d1fe50aab163ce0fb17ae7379bff172adb
2023-05-16 17:38:05 +00:00
TheresNoTime f693822f64
onDifferenceEngineBeforeDiffTable: Return early on Special pages
Add a check of `$diff->getTitle()->getNamespace()` to ensure early
return on NS_SPECIAL pages.

Bug: T336582
Change-Id: I251db11e8cb5b785744ee2c111d20a346937b78c
2023-05-16 12:39:19 +01:00
Bartosz Dziewoński a88084509d Use edit intro messages and preloaded content from MediaWiki core
Use MediaWiki core helpers to provide intro messages (including edit
notices), initial page content, and CSS classes for the edit area.

The following intro messages were previously unimplemented,
and will be shown now:
* 'sharedupload-desc-create'
* 'sharedupload-desc-edit'

The following intro messages were previously unimplemented,
but they only apply to pages where VE should never be available,
and will be shown now when editing those pages with 2017WTE:
* 'code-editing-intro'
* 'talkpagetext'

The following intro messages were previously unimplemented,
and are now explicitly skipped:
* 'editpage-head-copy-warn'

The following intro messages were previously unimplemented,
but they only apply to pages where neither VE nor 2017WTE should
ever be available:
* 'userinvalidconfigtitle'
* 'usercssyoucanpreview'
* 'userjsonyoucanpreview'
* 'userjsyoucanpreview'

Depends-On: If0b05710cb52a977bf4e85947d72d68683a0a29e
Bug: T201613
Change-Id: If26e39e383b983f7ee834ed6dd73b80e0545b068
2023-05-16 02:34:35 +02:00
Sam Wilson 00abad4861 Don't show the diff-mode selector if not viewing a diff
The DifferenceEngineBeforeDiffTable hook is run when viewing a
diff after switching from visual to source editing, but the
mode selection widget shouldn't be shown then.

Bug: T324759
Change-Id: Ieb8a1b77928201a45635af46635b902cac01a36d
2023-05-10 18:53:37 +00:00