Commit graph

462 commits

Author SHA1 Message Date
bwang 95c4454cf9 Remove MinervaKnownTemplateHacks
Bug: T362727
Change-Id: Iccb2e15df25f35d625d88ec4e39a16f97f84b505
2024-04-22 17:33:01 +00:00
Moh'd Khier Abualruz cd95f34687 Replace codex-search-styles with CodexModule
Enhance MinervaNeue Skin with Codex Integration and Style Refinements. This update to the MinervaNeue skin introduces enhancements aimed at integrating with Codex UI components and the optimisation of skin-specific styles. These changes are in direct response to the objectives set forth in Phabricator task T356678, focusing on modernising the skin's aesthetics and functionality.

Changes:
- Enhanced skin.json to include new 'scripts' and 'styles' configurations, incorporating Codex UI components such as 'CdxButton' and a variety of Minerva-specific styles like 'skins.minerva.base.styles' and 'skins.minerva.content.styles.images'.
- Refined `includes/Skins/SkinMinerva.php` by restructuring the method of loading skin and feature-specific styles. The update simplifies style management, allowing for a more granular approach to style application. This includes separating page-specific styles from feature-specific styles.

Rationale:
The implementation of Codex UI components within the MinervaNeue skin is to leverage modern web design principles, enhancing usability and aesthetic appeal. By refining the skin's style loading mechanism, we aim to at least maintain if not reduce the overhead, improve page load times, and offer a more customisable appearance, ultimately benefiting both end-users and developers.

Bug: T356678
Change-Id: Ia96f58397c23126e940cc9263b30e0da88c90a29
2024-04-03 13:28:02 +00:00
Fomafix 05eb2ac47d Integrate service 'Minerva.Menu.MainDirector' into SkinMinerva
The service 'Minerva.Menu.MainDirector' is bad because it depends
on the global state.

Change-Id: I170653006356932ecdd909b14c193f42c4a5f511
2024-03-28 17:33:18 +00:00
Fomafix c50069252d Integrate service 'Minerva.Menu.UserMenuDirector' into SkinMinerva
The service 'Minerva.Menu.UserMenuDirector' is bad because it depends
on the global state.

Change-Id: Ife13188745b39844356e7976379582d5f451f5a3
2024-03-28 17:32:42 +00:00
Fomafix 86fb2a8d18 Inject service 'Minerva.SkinUserPageHelper'
Change-Id: I91d8066ea860bd4aa5f19f4c326fad032be5b9d0
2024-03-28 17:30:01 +00:00
jenkins-bot e46e0bbf6f Merge "Inject service 'Minerva.LanguagesHelper' into SkinMinerva" 2024-03-28 02:31:21 +00:00
jenkins-bot 045da4ce5b Merge "Inject service 'Minerva.Permissions' into SkinMinerva" 2024-03-28 02:24:15 +00:00
jenkins-bot 3bfc204f85 Merge "Inject service 'Minerva.SkinOptions' into SkinMinerva" 2024-03-28 02:20:24 +00:00
Fomafix 220bf6ff89 Inject service 'Minerva.LanguagesHelper' into SkinMinerva
Change-Id: Ie81195f31194bab819491576681b02660ec057b4
2024-03-25 22:36:07 +00:00
Fomafix 57d1f15d64 Inject service 'Minerva.Permissions' into SkinMinerva
Change-Id: Ie68691d7030ea622f2bc232fea2df49b70484e19
2024-03-25 21:44:13 +00:00
Fomafix 999f04c366 Inject service 'Minerva.SkinOptions' into SkinMinerva
Change-Id: Ia7e7660c55e16731366bdf6332d5237188e9bbb1
2024-03-25 13:17:32 +00:00
Jon Robson 8f8fd6a1e4 Minerva should use content-tables ResourceLoaderSkinModule feature
The styles in Minerva are identical to the preset in core with the
own exception being padding. Therefore use the upstream styles
and retain only the override.

Bug: T357998
Depends-On: I206e91dac7e14d80a5ffc6b533255b54dafca29a
Change-Id: I3eb07a03b3b4e2a7544e5b07de6af9f67a1c965f
2024-03-21 22:49:14 +00:00
jenkins-bot 978702f3be Merge "Revert "The new class should be present alongside the old class for all page views"" 2024-03-20 16:15:18 +00:00
Jdlrobson b6ffc85cd4 Revert "The new class should be present alongside the old class for all page views"
This reverts commit bca9223bb1.

Reason for revert: This is now longer needed following the work
in Ia253de68f94236e7fe2219b736dd6084c64ce838.

Bug: T359983
Change-Id: Ibd3013169f26531a0cd879c143692e7030709808
2024-03-19 23:23:54 +00:00
Moh'd Khier Abualruz 5d6b866890 Rename the skin night mode classes to more readable classes
The classes:
- skin-night-mode-clientpref-0
- skin-night-mode-clientpref-1
- skin-night-mode-clientpref-2
is being replaced with
- skin-theme-clientpref-day
- skin-theme-clientpref-night
- skin-theme-clientpref-os
- Moved $forceNightMode to be a text parameter (dat|night|os)
- Keep adding the old classes to the html element, to give the ability of gradual deployment

The preference is renamed from minerva-night-mode to minerva-theme (a follow up to consider
migrating existing values will follow).

The query string minervanightmode continues to behave the same but now
accepts other values such as day, night and os.

Bug: T359983
Change-Id: Ia253de68f94236e7fe2219b736dd6084c64ce838
2024-03-19 23:12:59 +00:00
Jon Robson bca9223bb1 The new class should be present alongside the old class for all page views
Bug: T359983
Change-Id: Id0bcb3c9b0d37aef84886fe2efb907f8ebd1cfd9
2024-03-18 21:43:44 +00:00
Fomafix 3fc7f0d542 Inject service Minerva.SkinOptions into Hooks and MobileFrontendHooks
Change-Id: Id343ae4cb8d1a73cfb647bfe440f2909e3835037
2024-03-12 19:44:53 +00:00
Fomafix b9eca74ff0 Use "optional_services" in skin.json
Change-Id: Idab8a934e4c8f547d018907cb427effcab1d0f3f
2024-03-12 19:44:06 +00:00
Jan Drewniak 649cb10622 Integrate Codex experimental design token build
Use the Codex experimental design token build to
providing CSS custom property version of design tokens
for night mode.

The build also provides Less variables which are
references to the CSS custom properties. These are
pulled into the mediawiki.skin.variables.less file
and propagated across core and extensions.

Bug: T358059
Change-Id: I78558f6cc1de91d62fb9f8cbf571f73b51eae8ca
2024-03-04 23:04:57 +00:00
jenkins-bot a46ac64378 Merge "Inject services in SkinMinerva" 2024-03-01 19:24:58 +00:00
jenkins-bot ff82ad0428 Merge "Inject services in Hooks and MobileFrontendHooks" 2024-03-01 18:58:40 +00:00
Fomafix 4e6c1a87b3 Inject services in SkinMinerva
Change-Id: I17ae52ab9bb251a501d9de38f8a7051118f9622e
2024-02-29 21:34:15 +00:00
Jon Robson 18620a4499 Default to day mode
Bug: T358811
Change-Id: Iadf061b85e3cff4b2e1fc6bda6ff034b5f71b918
2024-02-29 13:30:40 -08:00
Jon Robson 55ea39bb30 Main page should work in night mode
Note: You need to enable wgMinervaApplyKnownTemplateHack in LocalSettings.php
for these styles to work.

Editors can opt out of these rules by using the already popularized
"notheme" class.

Bug: T357722
Change-Id: I32f3968b74bded987bb60e85a902e551727db545
2024-02-28 22:29:08 +00:00
Fomafix 0f8800ac42 Inject services in Hooks and MobileFrontendHooks
Change-Id: I8e0673689c2dbe14a385bbd1fe1725d203386bde
2024-02-27 10:15:03 +00:00
Jon Robson a30b575271 Map color-based skin variables to CSS variables
Additional changes:
* Separate CSSCustomProperties.less from skin.less so that
we can obtain the unmodified original values for the colors

Depends-On: I363a97d33d85a9033da753f2a8fe730d80206639
Depends-On: I148eaca747352ffdc9d1423f20d34bd5a1d0e447
Bug: T356427
Change-Id: I916450c276cabb0c7c871525c50f95fb87f498ad
2024-02-21 00:36:13 +00:00
Jon Robson 8de0d99882 Disable Extension:DarkMode on Minerva
Bug: T357598
Change-Id: I590ebe574c4c23507525a118cd99cbe31af022db
2024-02-15 01:39:43 +00:00
Jon Robson 145db70286 Reset: Drop p and div inside overlays
Required for proper presentation of page issues overlay
and multimedia viewer.

The div rules were unnecessary.

Bug: T205341
Change-Id: I6fea0f2013a11e5248b71619b795d794c8ed18ad
2024-02-14 22:20:43 +00:00
Jon Robson b079031b0a Send a toast notification if night mode is not available
Add a skin-night-mode-page-disabled class to the HTML element when
a page was disabled by the new MinervaNightModeOptions configuration
flag.

Bug: T356653
Change-Id: I7a6582ef8f66e78cc6f07da06bc4d2a3277cfcf0
2024-02-14 01:51:23 +00:00
Jon Robson 967e0b1e1b Restore night mode on history and diff pages
Follow up to I0fa0eab3bfa57cc6864dbdd2d6aeaa5582767c3c
Initially we want to enable night mode on all pages
This config should therefore not apply to any pages initially.

Bug: T355705
Change-Id: I2ca6d4a971d00d163fa82e93ac99959e41c87b91
2024-02-08 14:48:50 -08:00
jenkins-bot bc22880bfe Merge "Allow pages to not appear in night mode" 2024-02-08 21:48:07 +00:00
jenkins-bot 8dbb6d0be6 Allow pages to not appear in night mode
- Add config to skin.json
- Add the function in SkinMinerva.php to check exclusion of pages and namespaces.

Bug: T355705
Change-Id: I0fa0eab3bfa57cc6864dbdd2d6aeaa5582767c3c
2024-02-08 21:28:14 +01:00
jenkins-bot ec453ac037 Merge "Replace reset with SkinModule normalize" 2024-02-07 14:38:30 +00:00
Steph Toyofuku ef46f238a7 Set up user option for night mode
Add a new user option, `minerva-night-mode`, and configure it with a
default value of 2 (automatic based on OS).  Rework the code in
`getHtmlElementAttributes` to set the initial class value according to
the user option, which will be set and saved inside of MobileFrontend

Bug: T355118
Change-Id: I4b0d63a186f490ba10b7655b3af4dcb8b64bd400
2024-02-02 13:28:35 -08:00
Jon Robson 7c9304cbf4 Replace reset with SkinModule normalize
Retain the existing font,
margin and padding values as without
these we would trigger a visual regression.

Visual change: Four minor visual regression with this change
relating to the button in the AMC CTA Drawer and suggested
edits overlay heading. All are acceptable.

Bug: T205341
Change-Id: I6331d88e5b7301fd13249414350a539738cfae53
2024-02-02 18:00:45 +00:00
Steph Toyofuku f614ce6687 Add feature flag for night mode
Adds a config flag, `MinervaNightMode`, and wires it up as a skin option
for enabling/disabling the night mode toggle (sold separately)

Additionally, allow this feature to be enabled via the
`minervanightmode` query param

For now, turning the flag on will result in the class
`skin-nightmode-clientpref-1` being added to the HTML element, but in a
later change this will be updated to switch values based on the
forthcoming client pref

Bug: T355118
Change-Id: I35848ab80ee75d324ceb35d17794e2d3e620cc19
2024-01-31 00:38:51 +00:00
Moh'd Khier Abualruz 41a5ac75c5 Update modules to not use data URIs to reduce bundle size
- Add "useDataURI": false to following modules:
 -- skins.minerva.mainMenu.advanced.icons
 -- skins.minerva.personalMenu.icons
 -- Remove .mw-ui-icon-mf-next-invert old class kept for caching from edit.page.js

Bug: T346162
Change-Id: I362fdc9c68a7483c182e3540cba6501d9b12959d
2023-12-06 00:24:22 +00:00
Fomafix 698a3ea2e3 Use namespaced ResourceLoader classes
The old class names are deprecated since 1.39.

Change-Id: Ie24b28ba27c5ce3c98e57a14117f01f4ca42824f
2023-12-01 13:35:19 +00:00
gerritbot 6419c847e9 Update UserOptionsLookup's FQN
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: I5a540772aafd2c4686e02f748b5fc61155920397
2023-11-29 12:41:59 +00:00
Jdlrobson ca28efc9c7 Drop mw.mobileFrontend references
This restores the previously reverted patchset
If5b76245bf60bfa9cf977cdbf37ee0d6bb65f9d9

Changes since original:
* Added Depends-On to MobileFrontend
* Uses OOUI classes for page issues rather than es6 classes - ES6
classes do not support modifications to class prior to running
super so MobileFrontend's View class is not compatible without
significant refactors.

Depends-On: I24ad75adf8519102ca356d64d99d765ab69180cc
Bug: T348807
Change-Id: I4ff82af0251254c846f2caee330af5af738f6029
2023-11-10 01:30:52 +00:00
Jdlrobson 2ee3e27406 Revert "Drop mw.mobileFrontend references"
This reverts commit 19ea6328b0.

Reason for revert: Breaks page issues and image overlay. I
will break this up into smaller less risky patches.

Change-Id: If5b76245bf60bfa9cf977cdbf37ee0d6bb65f9d9
2023-11-03 19:26:16 +00:00
Jon Robson 19ea6328b0 Drop mw.mobileFrontend references
Bug: T348807
Change-Id: Ib71b43005e5788d0e29917a165281faa84926414
2023-10-31 21:54:26 +00:00
Jon Robson db8e3b09af Document messages and add hours and minute units
Follow up to I5a4a2588da3d701be87690038c2c9b2bc1aa0365

Change-Id: I6ea2b98bd3d03e586cc58307d3f2f0f1119059e3
2023-10-30 23:37:12 +00:00
jenkins-bot 3a4b1f1082 Merge "Style the desktop diff and history page of Minerva to look like mobile pages" 2023-10-30 14:53:32 +00:00
Jon Robson 0c8caebfc6 Generate section edit links via SkinMustache
Bug: T346944
Depends-On: Ief6a6ee03ada8207fc5c60ea438412fa2d529022
Change-Id: I9f768706c0a0f14f14ee4b3812288218bef36018
2023-10-23 23:17:43 +00:00
Jon Robson a3f03245fd Style the desktop diff and history page of Minerva to look like mobile pages
Depends-On: Ie8ac1aab6d2fe5f4575a6891c36efe497458e093
Bug: T305113
Bug: T240624
Change-Id: I5a4a2588da3d701be87690038c2c9b2bc1aa0365
2023-10-20 18:35:10 +00:00
Jdlrobson a90cc7ba4c Revert "icons: Register 'flag' in the wikimedia icons group"
This reverts commit 2696ced732.

Reason for revert: Icons should be defined by the extension
providing them. The icon is already incorrectly defined in
that extension but can easily be corrected.

Depends-On: Iff3aa23604442011062a67a8e165fc4a1b5b2d47
Change-Id: I22a114d41e2cadb97d46c299709496cd04299cf6
2023-10-10 16:17:26 +00:00
Kosta Harlan 2696ced732
icons: Register 'flag' in the wikimedia icons group
Why:

- The recently-introduced "Report" menu item in Extension:ReportIncident
  needs a flag icon

What:

- Register the "flag" icon in the wikimedia icons group

Bug: T348455
Change-Id: I4caa3a84583349a19603a2ad86471d79671f4b6a
2023-10-09 17:19:39 +02:00
Jon Robson 05231bb254 Support extension of page actions via hook and addPortletLink
This adds support for:
mw.util.addPortletLink('p-views', '#', 'text', 'fooz',null,
  null,'#page-actions-overflow' )

and adding multiple edit icons via hooks.

Depends-On: I655097769620301143140ded1cde4c7a16879ef4
Depends-On: I401805224c0f387ac85b52b50c1f298b83c03a91
Bug: T346944
Change-Id: I3c9d59f49f1b939981a7b2b450448db6736d5958
2023-10-04 22:15:47 +00:00
bwang 47b2744609 Clean up icon selectors from cached HTML
Bug: T344022
Change-Id: I170d86b52345b94a81e74f03b82aef7b522bbb39
2023-09-12 08:45:58 -07:00