Commit graph

1263 commits

Author SHA1 Message Date
jenkins-bot 2b77c02639 Merge "tests: Adopt private require() for skins.minerva.scripts (take 2)" 2024-08-29 23:58:39 +00:00
Timo Tijhof 4ca4febd89 tests: Adopt private require() for skins.minerva.scripts (take 2)
Resubmission of Ib68f45d93a (548e94da98), which caused an error due
to `require('../../`)` not working outside the module base directory.
This is fixed with regression test in T373065.

Further confirmed in this repo by viewing
`/wiki/Special:CreateAccount?campaign=loginCTA&useskin=minerva`
with this patch applied. Without the T373065 fix, the console warns:
> Error: Cannot require undefined file …/ToggleList.js

-------

Support for private require() in tests is available since MW 1.41:
https://mediawiki.org/wiki/RL/PKG#Private_export_and_import
https://mediawiki.org/wiki/RL/PKG#Virtual_files_in_traditional_modules

This fixes a confusing assertion in page-issues/index.test.js,
where for "insertBannersOrNotice()" it was asserting that the HTML
contain "⧼skin-minerva-issue-learn-more⧽", where the ⧼ character
indicates the message is not found (i.e. an error).

The test had to be written this way in order to pass, because
the skins.minerva.scripts module was not actually loaded, and thus
its templates and messages are not present either. This lack was
filled in by index.js for mw.templates, but not mw.messages.

By adopting private require(), these workarounds can all be removed.

== Motivation ==

In change I3a4024ccf90e505581, I'm working on improving the testrunner
config to enforce uselang=qqx on all tests. This is passing except
for GrowthExperiments and Minerva, both of which have the above
workarounds in place that caused a message to be undefined, and then
kept in the assertion expectation. When using uselang=qqx, values are
returned as (key) instead of ⧼key⧽, which exposes these message
existence errors.

By removing this workaround, the test will simply import the module
in the test as normal, thus the messages will exist, and thus it
will expect (key), and thus it will continue to pass even after
enforcing uselang=qqx.

Bug: T373482
Depends-On: I777f2c12e845a738edeac00e19818d4c939a1ef1
Change-Id: I6348e5ae00776c2c01d91fa90a431b6ffe3da25d
2024-08-29 20:34:16 +00:00
jenkins-bot 105b6fc266 Merge "Add a tag to mw.notify" 2024-08-29 16:58:11 +00:00
Jdrewniak dbe79167e5 Revert "tests: Adopt private require() for skins.minerva.scripts"
This reverts commit 548e94da98.

Reason for revert: The patch was causing the following error on pageload

    Error: Cannot require undefined file includes/Skins/ToggleList/ToggleList.js
    require startup.js:1006

Bug: T373482
Change-Id: I22751109c124795af7d2e0ad6c4104745b2d6632
2024-08-27 20:06:24 +00:00
Fomafix 8a78d01763 Add a tag to mw.notify
This prevent multiple notifications for the same message.

Change-Id: I6487852350497a48e1710fb04d3af01fc5c18116
2024-08-27 13:03:10 +00:00
Timo Tijhof 548e94da98 tests: Adopt private require() for skins.minerva.scripts
Added to MediaWiki core last year with I9fca9fdf9b7623b1.

This fixes a confusing assertion in page-issues/index.test.js,
where for "insertBannersOrNotice()" it was asserting that the HTML
contain "⧼skin-minerva-issue-learn-more⧽", where the ⧼ character
indicates the message is not found (i.e. an error).

The test had to be written this way in order to pass, because
the skins.minerva.scripts module was not actually loaded, and thus
its templates and messages are not present either. This lack was
filled in by index.js for mw.templates, but not mw.messages.

By adopting private require(), these workarounds can all be removed.

== Motivation ==

In change I3a4024ccf90e505581, I'm working on improving the testrunner
config to enforce uselang=qqx on all tests. This is passing except
for GrowthExperiments and Minerva, both of which have the above
workarounds in place that caused a message to be undefined, and then
kept in the assertion expectation. When using uselang=qqx, values are
returned as (key) instead of ⧼key⧽, which exposes these message
existence errors.

By removing this workaround, the test will simply import the module
in the test as normal, thus the messages will exist, and thus it
will expect (key), and thus it will continue to pass even after
enforcing uselang=qqx.

Change-Id: Ib68f45d93a7054ed8bd35fc5644e2852f2f90248
2024-08-23 19:04:36 +00:00
Jdrewniak 83e7a06a52 Prevent dark-mode styles from affecting print media
Prevents dark-mode styles from affecting print media
by adding `@media screen` to dark-mode related styles.

Bug: T371331
Change-Id: Ieeca30d086d8b8705aba96441a576e3d8e127838
2024-08-08 14:27:30 -04:00
Jon Robson 811e770e9c Dark mode: Images should have background
Bug: T370074
Change-Id: I694778f6458ab13266bee4b88622a914f21c6b50
2024-08-08 12:04:08 +00:00
bwang a38fa06b5d Migrate bare division math to parens division
Bug: T369669
Change-Id: I37c84769edbae8bbb843e9be1846394753c126c8
2024-08-02 13:33:00 -05:00
jenkins-bot bb57b22eb3 Merge "Hooks: change wikipedia is made for you warning to a notice message" 2024-08-02 17:19:51 +00:00
libraryupgrader 842a91590a build: Updating npm dependencies
* eslint-config-wikimedia: 0.27.0 → 0.28.2
  The following rules are failing and were disabled:
  * tests/selenium:
    * implicit-arrow-linebreak
    * no-mixed-spaces-and-tabs
* grunt-banana-checker: 0.11.1 → 0.13.0
* stylelint-config-wikimedia: 0.16.1 → 0.17.2
  The following rules no longer exist and were removed:
  * stylistic/selector-list-comma-newline-after
* braces: 3.0.2 → 3.0.3
  * https://github.com/advisories/GHSA-grv7-fg5c-xmjg

Change-Id: Ia94454c1da778f241085714e1601a0233d547570
2024-08-01 15:27:33 +01:00
Sergio Gimeno 73fe281d50 Hooks: change wikipedia is made for you warning to a notice message
The message box is changed from warning to
notice for the following messages:
 - mobile-frontend-generic-login-new
 - mobile-frontend-watchlist-purpose
 - mobile-frontend-watchlist-signup-action

Bug: T366127
Depends-On: I358ee59a1a0b7a5bb94e66bca9a2437517f40141
Change-Id: Ifa4418cbecda38011a6ee4d09c03db3ded7a9eb9
2024-08-01 13:22:36 +02:00
Ebrahim Byagowi 6a6872264a Use CSS Logical instead to remove uses of mw-content-{ltr,rtl}
It keeps fallback definitions which will work for most of the
cases in older browser as the transformations provided by
CSS Janus.

Bug: T371265
Change-Id: I0df37ca675533cf72c5636747cd40bbb4fb7497a
2024-07-30 23:06:03 +03:30
Ebrahim Byagowi f6165152a2 Make dd, ol and ul spacing values direction aware
This is akin to I404710209d59241991716bb7180bcaabcafffcec which
was for the most of desktop skins but since Minerva doesn't have
any dependency to `elements` and `i18n-all-lists-margins` it
should have it's own implementation of the change.

Bug: T371082
Change-Id: I1b98ced874a1caf049e7e09dbb678105d4d9e4d4
2024-07-26 13:02:10 +03:30
Volker E. 9380b86c2b styles: remove outdated feature phone font size rules
Nowadays even Apple iWatch has a minimum resolution of 352 pixels,
so we can safely remove the outdated feature phone font rules and
save bytes down-the-wire for users.

Bug: T369247
Change-Id: Ib482a32b0ed288ae1ea4e0b9dca5f6fdf74eb845
2024-07-04 01:34:02 +00:00
jenkins-bot 207ef7bd71 Merge "Force light theme in print styles" 2024-07-03 19:49:40 +00:00
jenkins-bot 00e4af30fc Merge "Definition list has no left margin, only definition items do" 2024-07-03 16:24:41 +00:00
Jon Robson 853dcf1917 Force light theme in print styles
Bug: T366362
Change-Id: I9e10577aa2a88e96d111cdd29f9fa7baafff87d8
2024-07-03 16:05:19 +00:00
jenkins-bot 906a68b44c Merge "Do not invert images that have been tagged with no invert classes" 2024-07-01 18:43:52 +00:00
Jon Robson 38534a5b0b Do not invert images that have been tagged with no invert classes
Bug: T368483
Change-Id: I6aefbf16bd95dbb3c9b0fdd46be6e6f026ca46bf
2024-07-01 11:08:51 -07:00
Novem Linguae 0cc0a1e16b JSDoc: fix double @ignore
Change-Id: I972019c22d18c0f276bf6240dafeb78122571fba
2024-07-01 17:15:29 +00:00
Ed Sanders 2be7b9f919 build: Update jsdoc-wmf-theme to 1.1.0
Additional changes:
* Update Minerva so that it doesn't output any APIs
to the documentation - this is intentional as Minerva does
not have any public facing APIs.

Bug: T368081
Change-Id: Ie1a3ea30cbf35663c7fdd2494c1698044882969e
2024-06-28 12:38:54 -07:00
Ed Sanders 527e018af1 Remove all use of IIFEs across Minerva codebase
These will make JSDoc easier to configure later and is
better suited to ES6 module format.
The dependency injection pattern can be retained by moving
the import to the top of the file.

Change-Id: I0fe692eb7066e52815ef3d21724c7439d82b2c5f
2024-06-28 18:54:38 +00:00
Bartosz Dziewoński b3f1fb5313 Definition list has no left margin, only definition items do
This matches how the indents are applied by other skins.

Bug: T367092
Change-Id: I7cf78065bd8ddd6c97a242dfcce586704029ccc1
2024-06-21 23:34:24 +02:00
Saint Johann 514f26ff5e Fix float issues with headings in Minerva
Bug: T316670
Change-Id: I531bbced68a2a9cbf75ffe44321beef05eee47c6
2024-06-21 00:10:49 +00:00
Bartosz Dziewoński 2a44123f3f Fix styles for new heading HTML
Do not apply 'display: flex' to all 'h1, h2, h3, h4, h5, h6' elements,
because it results in bad text layout within modern headings.

However, to support desktop Minerva with legacy headings, and avoid
incorrect styles being applied to unwrapper headings, we must
apply it to 'h1, h2, h3, h4, h5, h6' elements that may contain a
'.mw-headline'. Add a separate rule for that.

Bug: T367468
Change-Id: I87372907c38aa64b296634f6a5583a890f7fe9b2
2024-06-14 21:33:12 +00:00
jenkins-bot 1e75fbcd33 Merge "styles: Fix code padding" 2024-06-12 23:29:47 +00:00
Jon Robson 72bcebeba8 Use upstream codex variables for diffs and red links
Bug: T361717
Bug: T363743
Change-Id: I4e49a07f9f092ab00e2b2d12fcb146c91a21d8d8
2024-06-12 10:16:59 -07:00
Volker E 6d037d4e9f styles: Apply inversion on certain OOUI icons and indicators
In order for most OOUI grayscale icons and indicators to be inverted
correctly, we need to apply the inversion to a limited number of
elements by a general class.
Applying here to keep OOUI library MediaWiki agnostic.

Bug: T365764
Depends-On: Ib183cd7c28ea3fb68a6614b38362325560b426f8
Change-Id: I437db61c34cdcce8d3602b1354fa4addc98530fd
2024-06-12 10:15:40 -07:00
jenkins-bot 91fd8a977b Merge "Improve Minerva drop-shadows in dark-mode" 2024-06-12 16:02:29 +00:00
Jan Drewniak 98eaa00cd5 Improve Minerva drop-shadows in dark-mode
Converts several drop-shadows to use standard Codex values:
- `.search-box .search` uses `@box-shadow-drop-small`
- `.drawer, .toast` uses `@box-shadow-drop-xx-large`
- `.toggle-list__list--drop-down` uses `@border-color-base`

Bug: T364425
Change-Id: Id00e525655d3a7138aa65f424fd6ab2ff82290c8
2024-06-12 04:05:30 +00:00
Steph Toyofuku 6f98cc6460 (Almost) no more CSS variables in minerva
Remove direct usage of CSS variables in Minerva, and replace them with
codex design tokens again.  Document this decision in the original ADR

Note: there are still a small number of CSS variables in use, including
most notably the --color-link-red fix, which broke when I removed it,
but this change takes care of all the ones that could be easily replaced

Bug: T363743
Change-Id: I7d3a9dceb908167078987de1733774c8bd4bea2f
2024-06-11 11:44:47 -07:00
Volker E. 7fc19a5ad2 styles: Fix code padding
With the change to `rem` the padding got oversized, now relying on
pixel based spacing tokens instead.

Change-Id: I8eff33a606094285e07ff7afb94687b91d4aec67
2024-06-11 10:19:22 +02:00
Volker E dd154b4ea7 styles: Replace deprecated breakpoints
The values have slightly changed:
- Tablet breakpoint is decreased by 80px,
  pushing lesser devices into a mobile only experience but
  should make barely a difference to vast majority of our users.
- Biggest difference is in `min-width-breakpoint-desktop`,
  which is increased by 120px in comparison to
  `@width-breakpoint-desktop: 1000px`

Also removing one out-dated feature phone clause.

TECHNICAL CHANGES:
* The previous breakpoint was tied to the maximum content width.
The previous maximum content width is preserved, and several media
queries are adjusted to make use of it.
* The header (logo) is not optimized for  640px-720px. For now
a temporary fix is but in place which will be investigated as part
of T366859

VISUAL CHANGES:
* 6 visual changes which improve alignment in language and
visual editor overlay and diffs (where wikidiff2 is not
installed)

Bug: T349793
Depends-On: I3afba8c51f60de9271054499bfa3ffbcc1a9d779
Change-Id: I9552d8ad7509aae90e15edda26e786465773d3ac
2024-06-07 12:52:39 -07:00
Jdlrobson c6209b906b Merge "Add skin-invert-image class" 2024-06-06 17:58:37 +00:00
bwang f99aaddd48 Add skin-invert-image class
Bug: T365102
Change-Id: I76a42a6a957223daf12d884169dad368dcca0300
2024-06-06 11:02:02 -05:00
Ed Sanders a6ab8d6da3 Prefer arrow callbacks (ESLint autofix)
Change-Id: I52b2feacd6216e99e04f193ba963e897b3e1a771
2024-06-04 08:01:54 -07:00
Ed Sanders 5732926921 ESLint: Enforce no-underscore-dangle
The rule is only broken once in reference to a MF class,
so just switch those to inline disables.

Change-Id: I96ebd7f034246da13788b8c8673bff203c18b2db
2024-06-03 12:59:48 +01:00
Ed Sanders a5c9a506c9 ESLint: Remove unnecessary config no-var:error
This is the upstream default.

Change-Id: I09797b9e9243707f0b2a7942d34d27b1271d9eb4
2024-06-03 12:56:30 +01:00
jenkins-bot 6ff97b564c Merge "fix(minerva): Fix notification & menu shadows in night mode" 2024-05-28 13:39:39 +00:00
Fomafix a16f637fdc SECURITY: Prevent JavaScript injections by messages
This change prevents the possibility to inject JavaScript by
skin-minerva-night-mode-launch messages introduced by change
I3cfa9517a387df636534a3940e09289e4d7a1e5b.

Change-Id: Ib43bcff1413e6b70cedb7db4fa2c68148c4f13f5
2024-05-25 10:48:43 +00:00
jenkins-bot c3d07acc78 Merge "Remove margin reset on <pre> tags" 2024-05-24 22:11:57 +00:00
Moh'd Khier Abualruz 1cf4a9866d fix(minerva): Fix notification & menu shadows in night mode
Updates shadow colours to respect user's night mode preference by
using standardized design token.

Bug: T364425
Change-Id: Iebf756c7c9adfdf79d7fee203ee6f02168a636f7
2024-05-24 20:28:42 +00:00
jenkins-bot 565f89e376 Merge "Create dark-mode launch banner component" 2024-05-24 20:22:56 +00:00
Jan Drewniak 903fbda3b0 Create dark-mode launch banner component
Creates a launch banner component for dark-mode
using the CSS-only Codex Dialog component.

This banner is currently not loaded on any page,
but can be invoked using mw.loader:

    mw.loader.using( 'skins.minerva.DarkModeLaunchBanner', r => r( 'skins.minerva.DarkModeLaunchBanner')() );

Bug: T361047
Change-Id: I3cfa9517a387df636534a3940e09289e4d7a1e5b
2024-05-24 14:56:49 -04:00
Steph Toyofuku de3f85bac7 Fix inverted text in (recently) last modified bar
Currently we are using the --color-inverted token, which is double
inverted in night mode, yielding insufficient color contrast with the
blue (progressive) background when the page has been recently modified.
Instead, use the @color-inverted-fixed token, which stays white in night
mode for backgrounds which are darker regardless of mode (additionally,
switch back to using LESS variables as this is the new recommendation)

Visual change due to bugfix

Bug: T364123
Change-Id: Ib284abffd6907272e580986fb08c2b8dee5a1a47
2024-05-17 14:15:39 -07:00
Jon Robson 2adf0b3ed7 Temporarily define color-link-new in Minerva like in Vector
Since there is an open bug on Codex let's temporary set this
color as we do in Vector.

Bug: T363778
Change-Id: I1234825164e5cdcfd4e9c01de6971c64268af236
2024-05-17 16:54:28 +00:00
Func 1bac80cd59 styles: Stop using SkinModule in skins.minerva.mainPage.styles
Follow-up to commit 95c4454 and dd424cb.

This has become a plain style module since 95c4454 and doesn't need to
use SkinModule anymore.

Also, cleaned up the unused import of the less variables.
 * mainPage: apparently never used, dated back to 2cc9516
 * userpage: unused since 196fb20

Bug: T360988
Change-Id: I49304c64cd2bbc5f791164127a5169e60a43058a
2024-05-15 14:49:37 +00:00
Fomafix 7f4c7d2db2 Add eslint-disable-next-line security/detect-non-literal-regexp
Change-Id: Ie85cdab8d2407fd432ae420ae46970490c2f693d
2024-05-14 12:41:50 +00:00
Steph Toyofuku b7e54644b7 Make language selector disabled state accessible contrast
Remove the opacity filter and indicate a disabled state using the
disabled color for both text and the icon.  Add a new disabled icon
variant to accomplish this

Also fixes a small issue where the toast notification was unreadable in
night mode due to using --color-inverted.  Switch this to
--color-inverted-fixed, which was added for this purpose

Visual change for the language selector button, when there are no other
languages available

Bug: T361693
Change-Id: Id2f80028d967bf644673f651bb89718fa8723d22
2024-05-13 22:13:33 +00:00