AFAICT the `setInnerHTML` param that was part of the reloadPartialHTML
method was always true. Thus, much of the code contained in this method
can be removed and the `setInnerHTML` param can also be removed.
Bug: T316571
Change-Id: I82e99f902eadba8a9df2166c4f89ba1f1d747a47
* majorly done in VE by VE team by sending empty array,
since firing an event in beneficial for removing the TOC if needed
Bug: T315863
Bug: T315862
Change-Id: I128c550f039a812dde36fcefa56334842e36fbe2
* This was fixed by removing the reattachment of `SubsectionToggleListeners`, as it seems to be already attached and was double toggling on click.
* This will not work with full TOC collapse `CollapseToggleListeners` it has to be reattached for it to work
Bug: T316033
Change-Id: I756b2a929fd94d9167a7b56df668b1202e695a38
Visual changes:
- TOC icon in sticky header
- Small update to the narrow screens collapsed TOC spacing when open
Bug: T311103
Depends-on: Ic94fda79bd14856ccda14985d5860aa54d3118d0
Change-Id: I977092f951ba2843816609e706bce4b99583f623
- Include temporary feature requirement for TOC A/B test.
- Assumes 100% of logged-in users with even/odd user ids
being assigned to treatment/control buckets respectively.
- Sampling rates passed in by config are not considered
during bucketing.
- Update hook for adding needed TOC A/B test body classes.
- Add test for temp feature.
Note: the temporary feature requirement and associated hooks
should be removed once the 2nd TOC A/B test concludes.
Bug: T313435
Change-Id: If9c75235614af289cd50182baab29bec3155eb81
For idwiki/viwiki, we wish to run the sticky header edit button AB
test so that treatment1 group sees the sticky header without edit
buttons, treatment2 groups sees the sticky header with edit buttons,
and the control/unsampled groups see no sticky header at all.
This patch overrides the configuration to make the sticky header
w/o edit buttons for treatment1, sticky header w/ edit buttons for
treatment2, and hides sticky header for everyone else. This depends
on a configuration with the treatment groups having "treatment1"
and "treatment2" as substrings in their bucket names.
The full configuration for idwiki/viwiki would be something like
the following:
```
$wgVectorStickyHeader = [
"logged_in" => true,
"logged_out" => false,
];
$wgVectorStickyHeaderEdit = [
"logged_in" => true,
"logged_out" => false,
];
$wgVectorWebABTestEnrollment = [
"name" => "vector.sticky_header_edit",
"enabled" => true,
"buckets" => [
"unsampled" => [
"samplingRate" => 0
],
"noStickyHeaderControl" => [
"samplingRate" => 0.34
],
"stickyHeaderNoEditButtonTreatment1" => [
"samplingRate" => 0.33
],
"stickyHeaderEditButtonTreatment2" => [
"samplingRate" => 0.33
]
],
];
```
Bug: T312573
Change-Id: I15c360fdf5393f5594602acc33b5b916e904016d
The subject link does not have a consistent ID like the talk link,
so it needs to be computed from the canonical namespace name.
Something similar is done in VE.
Bug: T309424
Change-Id: Ie82ca61aef30204edd09793963b25464febb17fe
- Update related selectors, styles.
- Remove unneeded styles.
- Remove link hijack js.
- Simplify hook to only add experiment name to body.
Bug: T310527
Change-Id: I25527261d529a16e28f1b90f2f5af234d26fd40f
[Visual changes]
This should result in 9 visual regression failures relating to
increased height of search results and loading bar
[More details about change]
- Migrate search app from Vue 2 to Vue 3; update tests
accordingly
- Remove dependence on WVUI and use Codex instead, via the special
`@wikimedia/codex-search` package
- Update search app to use CdxTypeaheadSearch, which no longer
takes in props related to the search client or fetch start/end
instrumentation. Instead, directly use the restSearchClient
and call fetch start/end events in the search app.
- Handle hideDirection in the search app/API response formatting
code, not within the TypeaheadSearch component
- Handle showing/hiding the search button in the app
- Move the WVUI URL generator into Vector
- Update server-rendered search box styles to match design updates
included with CdxTypeaheadSearch
- Replace references to WVUI with references to Codex
- Update values of various LESS variables to match Codex, and update
searchBox styling to prevent jankiness when the searchBox is replaced
with the Codex TypeaheadSearch component
The VectorWvuiSearchOptions config variable has been maintained and
will be updated to a code-agnostic name in a future patch.
Bug: T300573
Bug: T302137
Bug: T303558
Bug: T309722
Bug: T310525
Co-Authored-By: Anne Tomasevich <atomasevich@wikimedia.org>
Change-Id: I59fa3a006d988b14ebd8020cbd58e8d7bedbfe01
Briefly add it onto the originals when the click is being proxied so
that VE can pick up on it.
Bug: T309364
Change-Id: I871494b6e783018b1433f294e09b0d53dded6c3d
When the vector-sticky-header-enabled class is removed from the body
it means the feature is not enabled, it doesn't mean the sticky header
should be invisible.
Call the hide method instead, and move it out of the function given
its a side effect
Bug: T308343
Change-Id: I4ecd6524146f203af926847812e20275c9573cab
Adds behaviour for conditionally adding the edit button
to the sticky-header based on A/B test bucketing.
This behaviour depends on having the `$wgVectorStickyHeaderEdit` config
set to true for logged-in users:
$wgVectorStickyHeaderEdit = [
"logged_in" => true,
"logged_out" => false
];
as well as an AB test configured with the following buckets:
$wgVectorWebABTestEnrollment = [
'name' => 'vector.sticky_header_edit',
'enabled' => true,
'buckets' => [
'unsampled' => [
'samplingRate' => 0
],
'stickyHeaderEditButtonControl' => [
'samplingRate' => 0
],
'stickyHeaderEditButtonTreatment' => [
'samplingRate' => 1
]
]
];
With that config, this change hides the sticky header for all users
except those in the stickyHeaderEditButtonTreatment bucket.
NOTE: This patch address the sticky header being visible on incorrect
namespaces when the AB test is enabled and the revert of
42b808738a.
Bug: T299959
Bug: T309370
Change-Id: I3effbb3e5f0bb1c8663255936458e3849511dfca
This reverts commit 42b808738a.
Reason for revert: The sticky header is now showing up in unexpected
places e.g. special pages.
Bug: T299959
Bug: T309370
Change-Id: Ie7f224d84440279ba28e031e13d05984c81a3ad4
Adds behaviour for conditionally adding the edit button
to the sticky-header based on A/B test bucketing.
This behaviour depends on having the `$wgVectorStickyHeaderEdit` config
set to true for logged-in users:
$wgVectorStickyHeaderEdit = [
"logged_in" => true,
"logged_out" => false
];
as well as an AB test configured with the following buckets:
$wgVectorWebABTestEnrollment = [
'name' => 'vector.sticky_header_edit',
'enabled' => true,
'buckets' => [
'unsampled' => [
'samplingRate' => 0
],
'stickyHeaderEditButtonControl' => [
'samplingRate' => 0
],
'stickyHeaderEditButtonTreatment' => [
'samplingRate' => 1
]
]
];
With that config, this change hides the sticky header for all users
except those in the stickyHeaderEditButtonTreatment bucket.
Bug: T299959
Change-Id: If252956bc530d8ce54eeda61f42a93ffa48255cb
- Remove the 'vector-scrolled-below-table-of-contents' class, reducing the number of classes added with JS and simplifying the scrollObserver logic
- Move the 'vector-sticky-header-visible' class from the sticky header element to the body element. Hopefully, this is where other feature specific classes can go in the future
- This approach means the TOC will not need JS to update it's spacing when the sticky header is not enabled
Bug: T307345
Change-Id: I1084defc7025f5c946e22a36d373224fae6f8bd6
Previously, we relied on setting pointer-events:none on all child
elements of ToC links.
This propagated the click event up to the link itself in Javascript
and allowed us check if an element with the class `.sidebar-toc-link`
was clicked.
Unfortunately as of Chromium 101 this approach causes the entire link
in the sidebar to be unclickable.
Instead, this patch checks if the ToC link or any of it's children
have been clicked (using the less efficient `Element.closest()` ).
Bug: T307271
Change-Id: I2264b7862f6e1ef50c5c722daee81acc39eea54e
When browser preference for reduced motion is enabled:
* Disables bolding of table of contents
* Disables sticky header transition
Bug: T254399
Change-Id: I8ef9e59b258fed977ce370da352b1924832d842b
* Bucket and sample on server by using the
`WikimediaEvents.WebABTestArticleIdFactory` service from
WikimediaEvents (soft dependency)
* Add linkHijack.js so that users bucketed in one group have the
possibility of remaining in that group if they click a link to another
page.
Bug: T302046
Depends-On: Ie6627de98effb3d37a3bedda5023d08af319837f
Change-Id: Iff231a976c473217b0fa4da1aa9a8d1c2a1a19f2
Headings can also appear in templates inside divs and subtitles.
These do not
get rendered in the table of contents and should not be tracked.
This also excludes headings from the legacy table of contents which
may be in the article during the A/B test
See English Wikipedia examples [[Portal:Biography]] and [[Main page]]
Change-Id: I4ca8933a0e7736157f80e5e68077b153e5bfc81d
- Remove isStickyHeaderAllowed() from stickyHeader.js, move to main.js
- Rename variables in stickyHeader.js to be consistent
Bug: T301429
Change-Id: Ib445a19cbfab52a008b749ea63cef178d6288e6a
- Leverage scrollObserver to use for TOC scroll events.
- Add new hooks to target legacy TOC intersection.
- See corresponding changes (not strict dependency) in related
WME patch 773628 for capturing scroll events from Vector TOC:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/773628
- Dependency on https://github.com/wikimedia/typescript-types/pull/30
which updates mwHookInstance interface with fire property to prevent
TS error on fire method of mw.hook in scrollObserver.
Bug: T303297
Change-Id: I5c2dd5f3a25ffcb0ed03b76ae28e65eb18ad8d33
- Remove some @ts-ignore statements.
- Update invocation of mw.util.debounce to have correct order of
parameters.
Bug: T303297
Change-Id: I4bb795fbd4d026c21c66e9a3d161afff4d7ef09f