Commit graph

839 commits

Author SHA1 Message Date
jenkins-bot ffc69eca91 Merge "SkinVector22.php: Add missing typehints" 2023-02-23 23:34:51 +00:00
Ed Sanders 01e11d68b9 SkinVector22.php: Add missing typehints
Change-Id: Iebb92f74809de5945186716ae707fc85c3ad8e05
2023-02-23 11:21:59 +00:00
jenkins-bot ebee74c578 Merge "Rename IconLink to Link" 2023-02-22 22:45:17 +00:00
jenkins-bot 4c8f7a5652 Merge "Revert "Updates for core temp user autocreation feature"" 2023-02-22 22:41:02 +00:00
bwang 0e5ef398b2 Rename IconLink to Link
Now that there is a Link.mustache, I think other components like Button, Link should use the Icon template, and not include icon in the name, as its possible to have a link or button that doesnt use an icon as well.

Change-Id: I6d8a17dd956f09bb3df7a2503f55d255599874f8
2023-02-22 22:00:24 +00:00
jenkins-bot 874883536b Merge "Fix dropdown icon markup to match Codex button" 2023-02-21 22:52:20 +00:00
Moh'd Khier Abualruz efe33d5d76 Ensure ToC is always accessible via landmark region (<nav>)
- We had to add nav element to wrap TOC in all places
- Make sure proper nav is only displayed so landmark do not get confused
- Remove Eslint block on rules compat/compat for no support IE 11, this was blocking commit
- Run lint:fix:js and lint:fix:styles
- Fix maxSize in bundlesize.config.json

Bug: T324505
Change-Id: I36d26240b87de33318ff1edf97a410872a438103
2023-02-21 22:19:52 +01:00
bwang 8db112ddb3 Fix dropdown icon markup to match Codex button
- Fixes TOC button being transparent (https://jmp.sh/jbuivqlM). FYI the fixed width toggle button has the same issue.
- Add replace `html-vector-heading-icon` with Icon.mustache

Bug: T320453
Depends-on: I9a990ea8de63fb336391bea11b4503d447fb9d4f
Change-Id: I39397f8e98f79a2fdde9a8d785690133ea5a2619
2023-02-21 12:41:44 -06:00
Jon Robson f2fb827630 Revert "Updates for core temp user autocreation feature"
This reverts commit 8d0659b1e6.
The logic for temporary users is now centralized inside
MediaWiki core, so Vector has no need to check whether a user
is temporary and instead work with the data it's given.

Depends-On: I36815aaef81ec7368e240a780e90bd574785df74
Bug: T328725
Change-Id: Ie30dd6a77ef391f74a435e0b9df74793ffdf73bb
2023-02-21 11:30:27 -06:00
bwang 159d298aaa Reduce verbosity of menu dropdown with aria-hidden
Bug: T325026
Change-Id: I9cd919b083dcbd0ca417cde3488968be9e2c503e
2023-02-16 15:21:53 -06:00
bwang fca03c873b Update user links dropdown id
- Update naming convention to use dropdown instead of menu

Follow-up: Iac0586893fec26a8a6c2c904ce08fbf1e19b339c
Change-Id: Ie51f7fc280eeef8470613c07850dad83e4435ee8
2023-02-16 11:21:56 -06:00
jenkins-bot 07b529bb97 Merge "Add label text to TOC toggle buttons" 2023-02-16 16:10:12 +00:00
Jan Drewniak 696c2c902e Add label text to TOC toggle buttons
Adds a label to the TOC toggle (i.e. hamburger)
buttons near page title and in the sticky header.

Bug: T328584
Change-Id: I9c6e62715eaa4eca05b7fb53385c5ab8cf2431e3
2023-02-16 09:09:03 -05:00
Moh'd Khier Abualruz fbfd887e80 Table of contents subsection toggle buttons missing label
- Reassign the edit sections array to tocData array

Bug: T328682
Change-Id: I5c0829f5361f0246fe9bc76688901b1cfb8d1486
2023-02-15 17:47:17 +01:00
bwang 9e4bdd00bf Remove custom handling of user links menu items and handle case when anon editor links are disabled
Rather than try to build individually build login, logout, and create account menu items, we handle them the same as all other user links menu items in Hooks.php. While Hooks isnt ideal, there currently isnt a good path for moving that code to SkinComponents until core provides menu data. In the meantime, this patch reduces code complexity and prevents bugs like T324638.
This approach also allows us to move user links logic from SkinVector22 to VectorComponentUserLinks.php, and ensures the user links dropdown contains multiple menus, which allows us to reuse styles from page tools dropdowns.

Expected 11 visual changes:
* minor visual change where the user links dropdown has an
additional 4px vertical padding.
This padding was originally added to the page tools dropdowns
per Alex's request, but Alex also said that dropdowns should share
the same spacing. This change makes the styles all consistent
* Order of talk and contribution links have been swapped

Bug: T289212
Bug: T319356
Bug: T328954
Change-Id: Iac0586893fec26a8a6c2c904ce08fbf1e19b339c
2023-02-09 13:37:17 -06:00
Jon Robson d2eb3c4e55 Disable languages on history page
Bug: T328996
Change-Id: I895bea1e7d3e0c23bcc60395e562297e016d1f5a
2023-02-07 19:27:56 +00:00
jenkins-bot d4a88d2bd2 Merge "Remove button styling from log in link" 2023-02-07 18:02:11 +00:00
bwang c6f1153bcc Remove button styling from log in link
Bug: T289212
Change-Id: If0181aa07cf30ffa6e67a73a983b23be4d6a7064
2023-02-07 15:57:39 +00:00
jenkins-bot 137a8fb6be Merge "Languages should be in HTML at top whenever languages are added to page" 2023-02-06 23:52:36 +00:00
bwang 766249492f Move Log in link to overflow menu
Bug: T289212
Change-Id: I585bf644eeb68832cb0db079abd9f34256c0a1fe
2023-02-06 17:15:49 -06:00
bwang fcc3d3c9a9 Rename data-user-menu prefix to data-user-links, matching the template and component naming convention, create UserLinksDropdown.mustache
Change-Id: I6f0de836e39ba6bdcd5a8ff832e951164d69e586
2023-02-06 13:01:01 -06:00
Jon Robson dcec7a3f1d Languages should be in HTML at top whenever languages are added to page
Use CSS to decide whether to show the button or not. This retains the
existing logic for hiding the button on any page where the action is not
view.

Bug: T327795
Change-Id: If74246418f87c871c01cb7b2b62f6c59263bf976
2023-02-06 17:34:00 +00:00
jenkins-bot 7812db242e Merge "Make sticky header edit the default" 2023-01-30 19:02:31 +00:00
Jan Drewniak 1bcd760ecf Add missing ID param to VectorComponentMenuListItem constructor
Bug: T324638
Change-Id: I6aa81f9f9166a23100da8920069235ecba4f7594
2023-01-26 22:08:04 +00:00
jenkins-bot 57c8e24b35 Merge "Remove VectorComponentTableOfContentsContainer in favor of directly using VectorComponentPinnableContainer," 2023-01-25 19:38:20 +00:00
Jon Robson 55bb37f2ab Moves feature classes from BODY element to HTML element
Move feature classes to HTML element - this is significant
for anonymous as placing the classes on the body tag breaks
the browser's ability to parse the article concurrently
with the stylesheet download, because inline scripts
are spec'ed to be able to see document.styleSheets.

Changes:
* Feature classes are moved from BODY tag to HTML tag
* For now disable localStorage storage until we've worked out
the storage mechanism in core.

Bug: T321498
Change-Id: Id5afe2c60dc0067e7c74433eda5cd7858f54b0d7
2023-01-24 18:22:13 -06:00
Jon Robson 93c833030b Make sticky header edit the default
In production this is always true, so remove feature flag.
Retain A/B testing code in case it is still needed.

Bug: T324799
Change-Id: Ia2057eb69d0a8d3e6e51acb5729a4399fb17a18b
2023-01-24 19:48:48 +00:00
jenkins-bot 1d1c4e8e2b Merge "Update displaying DiscussionTools TOC additions after parser changes" 2023-01-19 21:37:07 +00:00
Jon Robson 7b306db912 Personal tools accessibility label should not be "Foo"
Change-Id: I49eaae240c7df5f93570d4270bcd1c25403d8eb3
2023-01-19 08:37:41 -08:00
Ed Sanders 7323d6af4e Use tabs consistently in .mustache files
Change-Id: I3874b8a03f8a512a4d31f4c85a030de63cbc3c69
2023-01-17 11:48:34 +00:00
bwang 128a01bd35 [Clean up] Remove CSS and HTML from cached TOC html
Follow-up: I5b9228380f5c4674ef424d33127a5cb4010822da
Change-Id: I2a1167278c5ece9c0540cff9b5c06fcf185bc64d
2023-01-16 17:21:12 -06:00
bwang 0032b7b970 Remove VectorComponentTableOfContentsContainer in favor of directly using VectorComponentPinnableContainer,
- Remove all TOC components from markup when TOC isnt available
- Ensure TOC components have a consistent naming convention

Follow-up: Icd871e1bdf4ab0c7aa5b906b913416f4b1747750
Change-Id: I63519b5e5392b9eb546876e7eea060b9a6c147dc
2023-01-16 17:20:03 -06:00
Bartosz Dziewoński d2e34ce079 Update displaying DiscussionTools TOC additions after parser changes
Depends-On: Id59b946f4a3618a75dfaaef8a0043423b768b21c
Bug: T326677
Change-Id: I0f49c9c92d30fbfeefb547ba13312f740d7f5b2d
2023-01-16 19:07:17 +00:00
Moh'd Khier Abualruz 29a2254b9a Update tableOfContents.js to rerender only the TOC contents rather than the entire pinnable element
Extra:
- Reactivated active list element, This still does not work if the current active gets edited.
- Removed pinning event reattach as we do not replace teh full element anymore.

Known Issues:
 - Collapse/Expand not working

Bug: T326839
Change-Id: I2ce251f5312659b827ac2941d789248473bb0ef5
2023-01-16 12:39:05 +01:00
jenkins-bot 70ddd1f3f7 Merge "[Clean up] Remove unnecessary container and CSS in sticky header" 2023-01-13 20:57:24 +00:00
bwang 787b065f99 [Clean up] Remove unnecessary container and CSS in sticky header
Change-Id: I7a1f75e8997ea6c87955f72c971f6d1d08e6ab22
2023-01-13 20:11:21 +00:00
jenkins-bot 21996f5bc5 Merge "Table of contents elements should not be rendered where none available" 2023-01-13 18:15:31 +00:00
Func a874eb1096 LanguageDropdown: Check if the page is in talk namespaces instead
$wgContentNamespaces is default to only contain the main namespace,
we should check whether the page is a talk page instead.

Also use the term "subject page" to align with existing functions
of Title and NamespaceInfo.

Bug: T316559
Bug: T326788
Change-Id: I873283195d5c503818b2056c87c25ecc77d2915a
2023-01-13 14:44:49 +08:00
Jon Robson 853ed72cd6 Table of contents elements should not be rendered where none available
Follow up to  0c0ce631ee

Bug: T319355
Change-Id: I6b01a7dfef8f2cd124e090e25f63bd41579d9c08
2023-01-12 22:47:15 +00:00
Jon Robson 67cde518cd Use correct ID for table of contents in sticky header
Follow up to  0c0ce631ee

Bug: T319355
Change-Id: I525160e8041ba74c9aed94dd667a4aad53918032
2023-01-12 20:40:48 +00:00
Jon Robson 7f0b5fe305 Dead code elimination: updateDropdownMenuData
* updateDropdownMenuData is removed. Although it was running
inside legacy Vector, it didn't do anything as legacy Vector has
no concept of collapsible items or icons.
* updateLinkData is no longer used.

Also:
Document where other methods are being used.

Bug: T320927
Change-Id: I5b40075db91b1d0f20c21bd7cf858fdfcff96538
2023-01-12 00:33:28 +00:00
Jon Robson eea5373940 Components: StickyHeader
complete the migration to components.

Changes:
* shouldHideLanguages only used inside SkinVector22 so abstract method
and legacy implementation removed.
* Move isLanguagesInContent method to SkinVector22, updating one usage
in SkinVectorLegacy which is always falsey (languages are always portals
in legacy Vector)
* Remove unused isLanguagesInContentAt method from SkinVectorLegacy
and move getLanguagesCached, isULSExtensionEnabled,
canHaveLanguages, isLanguagesInContentAt to SkinVector22
* runOnSkinTemplateNavigationHooks copied to both Vector skins
* isResponsive moved to Vector22. In Legacy Vector it has no
real use since legacy Vector has no responsive styles.
* SkinVector class now (empty), is removed.

Bug: T319355
Change-Id: Ib5df956cecb841b7c97264975d137af32e5da4ab
2023-01-12 00:32:35 +00:00
Jon Robson 0c0ce631ee Components: Model table of contents in title bar.
Bug: T320927
Change-Id: Icd871e1bdf4ab0c7aa5b906b913416f4b1747750
2023-01-11 15:42:23 -08:00
Jon Robson bfeb729f84 Component: VariantsMenu
Bug: T319355
Change-Id: I10a8e796f6f6744fcc79ff6b1eb8f1d42389acba
2023-01-11 23:05:41 +00:00
Jon Robson e153561255 Component: UserLinks
Simplify the user links component
Introduce MenuListItem and IconLink components.

HTML changes:
* Logout, login and account links are now wrapped in a ul and li tag
instead of a DIV for consistent with other menus (this occurs due
to use of MenuContents). Code reviewer can see tests
for an understanding of how the template data and markup has changed.

VISUAL CHANGE:
* Increased margins in user links menu relating to change from DIV to
UL / LI tags.

Bug: T320927
Change-Id: Ia24be48105e1ff85da227883abb5dddb3d54388d
2023-01-11 21:48:11 +00:00
jenkins-bot d0458b885a Merge "Remove vector-menu-dropdown-noicon class" 2023-01-11 01:12:11 +00:00
Jon Robson e032d68703 Remove vector-menu-dropdown-noicon class
No longer needed.

Change-Id: I3a0e7f7f2a467fc55b138fc3a9d06096c84a8f8e
2023-01-10 23:48:05 +00:00
Jon Robson 5508712d33 Refactor: Remove unnecessary function getULSButtonData
Change-Id: I85aaf6087a04376ed0191395413d0ef1ba575a27
2023-01-09 22:52:17 +00:00
jenkins-bot 09ede0dc9f Merge "Update language dropdown for pages not supported in other languages" 2023-01-09 05:02:55 +00:00
NikG d39b5c958a Update language dropdown for pages not supported in other languages
Pages that are not supported in other languages should not display the
ULS when the language button is clicked. Instead, a simple message
explaining that the page contents are supported in other languages
should be displayed inside the dropdown. Additionally, the language
button should be modified for these non-content pages, to non include
any label and be quiet instead of progressive.

This patch implements these specifications by appropriately modifying
the mustache templates and the underlying skin classes.

Bug: T316559
Change-Id: I37d8e61a1287b31d1a304d2a955f532b9b8fa505
2023-01-06 16:40:36 +00:00