Commit graph

1211 commits

Author SHA1 Message Date
Moh'd Khier Abualruz bd7be711df Linting: run npm -s run lint:js -- --fix
reduce the number of warnings on precommit hook

Change-Id: Iad9fa273f9a661614fa3e40e1af6e9aa7697ea42
2023-03-22 20:22:33 +00:00
jenkins-bot 6d2e4d5d37 Merge "Import Codex tokens into mediawiki.skin.variables.less" 2023-03-17 21:34:24 +00:00
jenkins-bot 66c547d452 Merge "styles: Remove obsolete @z-index-sidebar-button variable" 2023-03-17 20:36:47 +00:00
jenkins-bot 6cbb3baa32 Merge "Use clearer folder structure for Vector and Vector 2022 skin variables" 2023-03-16 21:39:58 +00:00
jenkins-bot cefa5eeab9 Merge "Reduce height of the article toolbar" 2023-03-16 20:15:20 +00:00
Roan Kattouw 17a3f91c9f Import Codex tokens into mediawiki.skin.variables.less
I04f9e48a1cf9dee915cf51e1e12b17ff0a595a06 provides neutral values for
the Codex tokens in mediawiki.skin.defaults.less in MW core, and expects
skins to import the appropriate Codex themes in their
mediawiki.skin.variables.less.

For both legacy Vector and Vector 2022, import the Codex tokens for the
wikimedia-ui-legacy theme. We need to use the legacy theme because
Vector and Vector 2022 have a base font size of 14px; the non-legacy
theme assumes a base font size of 16px.

Remove some variable assignments that are now redundant, because their
values are the same as the Codex tokens we're importing.

After importing the Codex tokens, override some of their values where
necessary so that all variables' values stay the same(*). We should
consider whether to remove some of these overrides in a follow-up patch,
but keeping everything the same for now makes this change less
disruptive.

(*) As in the core change, one variable's value does change:
- @max-width-breakpoint-tablet from calc(719px) to 719px
but this change has no visual impact.

Bug: T325237
Depends-On: I3a8c89d8558022077be1f32c6a6f4733b6302948
Change-Id: I3c5c8f9fc4b1841f8f8bdbcf27de82291d1fabbd
2023-03-15 21:15:01 +00:00
jenkins-bot 0433bb9fea Merge "Update how pinnable elements are handled with no-js and gradeC cases" 2023-03-15 21:05:32 +00:00
jenkins-bot 53620bbc50 Merge "Change margin-top element from .mw-body-content to #mw-content-text" 2023-03-15 15:49:36 +00:00
bwang f36c58db2f Update how pinnable elements are handled with no-js and gradeC cases
Bug: T331563
Bug: T331168
Change-Id: Ibd5aaa605c45216783a2707b3813e1e7e2c46b9b
2023-03-14 17:35:59 -05:00
Jon Robson a79fa9f00a Use clearer folder structure for Vector and Vector 2022 skin variables
Follow example in skinStyles and give these their own folders.
The problem with using "legacy" is that it could be interpreted as meaning
legacy LESS variables e.g. deprecated variables.

Change-Id: Ie456dfbd703a0e7a0ad783909ca3ef5e86450d9c
2023-03-14 21:48:58 +00:00
jenkins-bot 860ccc1458 Merge "Ensure the TOC works across all pinned/unpinned cases when JS is disabled" 2023-03-14 19:45:36 +00:00
sushrith bbdc66fcd3 Reduce height of the article toolbar
[Visual change]
Height of the article toolbar is reduced, this is done by reducing the
padding on the top of the tabs and reducing the margin on the
top of the Watchstar and Wikilove icons.

Bug: T316950
Change-Id: Ic2a3146eab901c834712d23f80277e313c42d907
2023-03-14 19:01:16 +00:00
jenkins-bot 637d99918d Merge "styles: Remove outdated fallback width" 2023-03-14 17:55:16 +00:00
Volker E ca9ab0c0b7 styles: Don't include the "jump to" links when copy-pasting article text
They are included in the DOM for screen readers but there's a good
chance the user copy-pasting text from an article does _not_ wish to
copy-paste these visually-hidden-for-most-users accessibility
helper links.

Bug: T295647
Change-Id: I13f4cbb88930becf38bc0f10d4288c8c9c496522
2023-03-14 05:24:19 -07:00
Volker E 593a88f10d styles: Remove outdated fallback width
All browsers that needed the fallback have been excluded from basic
support already.

Bug: T306486
Change-Id: I309c2a2d998af05364974f908f55378e672746f6
2023-03-14 05:19:09 -07:00
Volker E e74e9396e7 styles: Remove obsolete @z-index-sidebar-button variable
Change-Id: I6bd9f4c9b24df2f73fde9951bac0fd21b88656d3
2023-03-14 04:02:50 -07:00
bwang 62da66047f Ensure the TOC works across all pinned/unpinned cases when JS is disabled
- Also consolidates how we hide the pin/unpin buttons into a single CSS block

Bug: T331176
Change-Id: I359bde8abee48596186486d48fa6e59297094153
2023-03-13 23:48:18 +00:00
Ed Sanders d290b98f56 Fix inconsistencies in sticky header font-size and spacing
* Ensure 8px spacing between all icons and buttons
* Move buttons to separate container, so they aren't
  grouped with -icons.
* Reducing horizontal padding of quiet labelled buttons
  to 5px to match spec.

Bug: T326571
Change-Id: I71c3aee82152f048c347f80747972d526039a8f0
2023-03-13 23:29:35 +00:00
bwang 0006324f55 [cleanup] Factor out bindPinnableBreakpoint for readability, ensure auto unpinning logic doesnt apply to TOC
Change-Id: I3ba6b42ac3a2c79c2ff8018cf929d3153809ffed
2023-03-13 15:58:07 -05:00
ksarabia aba94865c2 Removes old style rule
This patch removes the old style rules for .vector-toc-pinned after one
week of cache.
Also removes 'data-name' which was no longer used

Bug: T325032
Change-Id: I7c8d8e51a61646151706b71a1733b1daac5dbd45
2023-03-10 14:31:44 -06:00
Nicholas Ray 17433b63fc Add hash fragment support to table of contents
Per T325086, the TOC should expand and activate the section that corresponds to
the window's hash fragment.

Additional changes:

* Moves logic  that runs on page load to determine the
intersection from section observer to main.js, since the hash fragment can
take precedence over the scroll position (e.g. when scrolled all the way to the
bottom).

* Make section observer's pause() cancel any pending intersection calculations
so that it doesn't interfere with other async logic.

* Moves onHeadingClick and onToggleClick logic to activate and expand a section
to tableOfContents.js to facilitate unit testing this behavior with clicks and
hash fragment changes.

Bug: T325086
Change-Id: I8a2cf0e6a96467fae97608450b321c181155e424
2023-03-09 00:33:37 -07:00
jenkins-bot 80c75fdafe Merge "Break words for long links" 2023-03-08 10:11:17 +00:00
Jon Robson abb2cc5a48 Break words for long links
Follow the solution we have on Minerva (mobile site)
and break long links in page.

Additional change:
Mostly whitespace updates. Use git diff -w to see.

Bug: T327334
Change-Id: I8d7e6a31b3a76375245da312e99f637766ffff8c
2023-03-08 01:37:03 +00:00
jenkins-bot 0e01a9cad0 Merge "styles: Update opacity values to align with Codex design system" 2023-03-08 00:26:32 +00:00
Volker E fdeb3187d9 styles: Update opacity values to align with Codex design system
Also replacing `opacity-base--disabled` with updated token key
`opacity-icon-base--disabled`.

Depends-On: I68a39002314b9c5a185ffa2856076922bfeab638
Change-Id: I0e28579c92df9880b98cfeb4d4b5c3b8b085965e
2023-03-07 13:42:46 -08:00
David Lynch a5820ff1e9 Change margin-top element from .mw-body-content to #mw-content-text
There's a lot of .mw-body-content out there that shouldn't have this
margin applied. Switch it to #mw-content-text so that it's only applied
to the actual article content.

Bug: T331458
Change-Id: Ia040f85ed484db21129c3673808bc2ad71962ec3
2023-03-07 14:36:26 -06:00
jenkins-bot c0aa8c2a87 Merge "Update scroll threshold to be the same as scroll padding top" 2023-03-07 18:44:27 +00:00
bwang c9389b7dab Update scroll threshold to be the same as scroll padding top
Bug: T317661
Bug: T314419
Change-Id: Ia2d14dca1e3e2069828b201d6d3a053e4df712fc
2023-03-07 18:28:23 +00:00
jenkins-bot a1b8ac9b4e Merge "Increase @scroll-padding-top to 75px" 2023-03-07 18:01:50 +00:00
Ed Sanders 091705df88 Switch order of "Add topic" and language dropdown
Bug: T267444
Change-Id: I09ed155b43665dd13c258e37870778a3c7ce446d
2023-03-07 16:02:36 +00:00
Ed Sanders 2f9cf813fe Fix selector for add topic button
Bug: T267444
Change-Id: Icd75f16c794f6f990a194fd57f99490934ded9de
2023-03-06 22:50:11 +00:00
Jan Drewniak 7e6606b5ef Increase @scroll-padding-top to 75px
Increasing scroll-padding-top on HTML element
to account for TOC button placement on mobile
resolutions.

Bug: T314419
Change-Id: I5c3efa0f20f052ec74e91a6287f561c9e0105f90
2023-03-06 18:28:55 +00:00
Jon Robson 07c12c14fc Register sticky header dropdown as icon capable
Needed by the language team.

Bug: T327369
Change-Id: I9e9022d27a308974f27ea31008fea1adf7c46624
2023-03-03 17:09:41 +00:00
bwang a274c9bcde Add threshold to TOC section observer
- Also renames 'header' to 'stickyHeaderElement' to be more clear

Bug: T317661
Change-Id: Iad519036d4622ff28115abb7de544f69fe8eb597
2023-03-01 16:26:42 -06:00
jenkins-bot 5f6932c605 Merge "Increase scroll-padding-top for page sections" 2023-03-01 19:46:33 +00:00
jenkins-bot 16e9c8c40d Merge "Remove TableOfContents mustache template and mark layout rules" 2023-03-01 17:10:02 +00:00
ksarabia 74addde337 [WIP] Removes the TOC class in body and adds in html
Adds new constants for TOC and registers feature.

Bug: T325032
Change-Id: I5e0f5f3a6d186b245bdbc98c2bb9e4cc17a03fdb
2023-02-28 17:21:16 -06:00
Jan Drewniak cfc454f615 Increase scroll-padding-top for page sections
This introduces a general scroll-padding-top value of 50px
for Vector 2022's HTML element.

This changes makes it so that when navigating sections via the
TOC, the section headings are 50px lower on the screen.

This change has been synced with the ToC active sections as well,
so that active sections become active at the same offset.

Bug: T314419
Change-Id: I99e5fe2047f5ad1e61ef51b6ba7e76a6cac36fc5
2023-02-28 14:48:31 -05:00
Jon Robson d4903b8e57 Remove TableOfContents mustache template and mark layout rules
Follow up to I3484a790ce8ebadf21054ac1d222d5632b2dc5a4

__Template__

The template is not particularly useful - it is only ever
used once in this context and features a static ID which means
it can never be reused. It is also tied to the #vector-toc-collapsed-checkbox
element. In current form it doesn't make sense to have this template.

Maybe in future, I could see an argument for a PinnableTableOfContents component
that wrapped the checkbox and nav element, and generalized the IDs but
currently there's no pressing need or value for that.

__Layouts__

The existing Pinned and Unpinned stylesheets are concerned with how the table
of contents is layed out holistically with regards to other components and
features enabled on the page. I think these should therefore be organized as such.
The way I reason with this, is these styles would be irrelevant in a component
library if the component was rendered in isolation.

Bug: T328719
Change-Id: I9ff0e0eeb35f215a8cae5950d08dc1277b662a71
2023-02-28 00:27:31 +00:00
jenkins-bot 605a63a998 Merge "Vector: Break long bare external links" 2023-02-27 23:25:05 +00:00
Derk-Jan Hartman e7a8d0f469 Vector: Break long bare external links
Break bare external links, which potentially would cause the
viewport or width restricted content to overflow.

Bug: T327334
Change-Id: Ia83e2cde7646670de0a1b09ba9457e1cfc47ce0f
2023-02-27 23:06:53 +00:00
jenkins-bot 53ea14904d Merge "2010: IP masked user icon should differ" 2023-02-26 23:58:50 +00:00
jenkins-bot eaf0e2d57e Merge "Table of contents: FIXME cleanup" 2023-02-24 20:55:28 +00:00
Jon Robson 28e5d9acb1 2010: IP masked user icon should differ
Per figma mock [1] the icon should be different for IP
masked users. Icon and text should also be gray.

[1] https://www.figma.com/file/xECM2hD7vEemP91M9YAQBC/IP-Masking?node-id=11%3A4681&t=iaM6G4xvjrBvkjlh-0

Bug: T328725
Change-Id: Ia8a06c3fd0bffb70e0dd0c26bcabbf02ab176994
2023-02-24 09:04:25 -08:00
Ed Sanders d90d1d17b1 Promote "Add topic" button to PageTitlebar
Bug: T267444
Change-Id: I813908d65640566a61eac51d6f55a3b4d3e9537d
2023-02-24 01:33:47 +00:00
Jon Robson c06c547b02 Table of contents: FIXME cleanup
Follow up to Ib42d532d4e900c01061e1c5e39c03b17f0619c46

Hoist hook binding into main.js and update tests

main.js now only tests hook wire up.
tableOfContents calls reloadTableOfContents directly.

Bug: T316025
Change-Id: Ia06feab7cfb47a64ac3519bd7bd0428dc661045a
2023-02-24 01:16:20 +00:00
jenkins-bot e40caf0c85 Merge "SectionObserver should be updated at certain points in MediaWiki lifecycle" 2023-02-23 20:16:28 +00:00
jenkins-bot af2c9c61c6 Merge "Revert "Only apply vertical margin to #siteNotice content when non-empty"" 2023-02-23 19:57:05 +00:00
Bernard Wang 41bd9569cf Revert "Only apply vertical margin to #siteNotice content when non-empty"
This reverts commit ff8a5bc034.

Reason for revert: T325219 is expected

Change-Id: Id153bcd5d365263dfa84e7c2e45d69d1c72fabdd
2023-02-23 19:32:54 +00:00
jenkins-bot 87e8137ba3 Merge "Update naming convention for TOC" 2023-02-23 17:39:43 +00:00