Commit Graph

614 Commits

Author SHA1 Message Date
Jan Drewniak c9c5c9e5a4 Followup to 33a6fb6 - remove is-title-above-tabs from template
The configuration for this feature was removed, so the conditional
in the skin.mustache template should be removed as well.

Bug: T311773
Change-Id: I6a8e671c5f08d9af73145b900398b185febb3bc7
2022-07-18 10:43:36 -04:00
Ed Sanders e2d70c383e Move code for adding sticky header class to SkinVector22.php
Per the comment at the top of the file, much more of this code
needs to be moved to SkinVector22.php, but this is causing a specific
regression, so can be moved now.

Bug: T312782
Change-Id: Ief7581782f1e4eefc7474cceb81830783dff99a8
2022-07-11 16:11:58 +01:00
Jon Robson 2a4ac3152b Move Vector menu class logic into Menu mustache template
Cleaned 'vector-menu' in SkinVector file, updated
includes/templates/Menu.mustache and includes/templates/legacy/Menu.mustache.

Bug: T290281
Change-Id: I7286fa82abfd437a228b9ac07ac781210d7cd98f
2022-07-07 12:34:23 -05:00
Jon Robson 33a6fb6028 Layout: Title should always be above tabs
**UI CHANGES**
- This change will result in expected UI changes so will flag problems
with Pixel.
- Before merging please confirm Pixel reports 31 passed, 47 failed
- After merging, we should update LocalSettings.php to reset these
changes.

Bug: T310054
Change-Id: Ib35c6bfa5493f7dc81b63c42e7fedb8f1e47226b
2022-07-06 15:25:42 +00:00
Jdlrobson e16a8e4775 Revert "Layout: restore sticky toc behavior by adding additional TOC container"
This reverts commit 3a26cc220c.

Reason for revert: Pixel flagged a UI regression relating to this change https://phabricator.wikimedia.org/F35291665

Change-Id: Id0b3d13da7dfbd8a55605e9f1fae157fe45abd2f
2022-06-30 22:53:19 +00:00
bwang 3a26cc220c Layout: restore sticky toc behavior by adding additional TOC container
Fix sticky behavior changed by impacted by e23fc1f

Change-Id: I7ead5e1d5954f772a533e1116f8c55d2d9cfd143
2022-06-30 21:40:14 +00:00
bwang e23fc1fe11 Grid: fix footer styles
Fixes https://phabricator.wikimedia.org/F35289862

Change-Id: If14bfb357d077ebd3886ce7290f0d46d19588dc6
2022-06-30 13:34:25 -05:00
Jon Robson 11618b5d81 Grid: Add table of contents to grid
Bug: T303484
Change-Id: Ic854b34b739b59e2d1efd864a711c961548f079f
2022-06-29 00:00:06 +00:00
bwang 4ab798441e Refactor SkinVector to use Hooks::updateMenuItems code to process menu data
SkinVector and Hooks both had code to add classes and handle Vector specific template data. This patch simplifies the way we handle menu data to always use Hooks:updateMenuItem. This has an additional side effect of removing instances of mw-ui-icon-before.

Bug: T306628
Change-Id: I73514a0eada4d92705b70e7c2ebd91092fc12544
2022-06-28 21:53:51 +00:00
jenkins-bot a47f46009e Merge "Attach VE to `#content` while title-above-tabs feature is disabled." 2022-06-27 20:15:35 +00:00
Jan Drewniak 05a1c330fe Attach VE to `#content` while title-above-tabs feature is disabled.
Limits the usage of the `data-mw-ve-target-container` attribute,
which changes the position of VE, to be enabled only when the
title-above-tabs feature is enabled.

Bug: T310197
Change-Id: I846135a88acf713bed608ad4f147f7602ce7cc2b
2022-06-27 15:44:19 -04:00
Jon Robson 6efcf775c0 Technical: Use unambigious menu template
Follow up to 49c8b5f514
Our PHP parser resolves >Menu to the parent directory which
differs from the frontend Mustache library.

Best to have different names for these files to avoid this problem.

Bug: T311319
Change-Id: Iea708718a0b928c4902dc7bac0c5ee304b89f961
2022-06-27 12:29:03 -07:00
Jon Robson 5beadc4bc2 Layout: Don't hide footer < 1000px when sidebar closed
The 'mw-workspace-container' class is present on both
the footer and the sidebar. The CSS rule should only hide
the latter.

When there is no table of contents on the page, and the sidebar
is closed, the content
should always span the grid columns and the sidebar container
closed.

Bug: T293443
Change-Id: I852b9024fbd21339b7c78dbb4deba811ab17c7e7
2022-06-25 00:03:41 +00:00
Jan Drewniak 6e96a8e936 Rename `data-ve-target-container` attribute to `data-mw-ve-target-container`
Updates the data attribute for placing VE on the pages.

Bug: T310197
Depends-On: Ia6f87535f11ccc7aadb26b7dd9e1ac8a867c377c
Change-Id: I081d5e23a15902e1429e68ac4ae191e498e6aba6
2022-06-23 10:53:44 -04:00
Jan Drewniak 97783e5bd8 Use the data-ve-target-container attribute to position VE
Uses the data attribute `data-ve-target-container` to determine where
on the page to insert VisualEditor. Also moves the #siteSub back into
the #bodyContent container. This makes the SiteSub match the font-size
it had in legacy Vector & positions the VE toolbar between the tabs
and the tagline.

Bug: T310197
Bug: T310839
Depends-On: Idae6755c90eacaab1a9daa88c6e28850d427810c
Change-Id: Idb2a743c93316786d6d36e1989cf6620a6092281
2022-06-23 00:39:19 +00:00
Jon Robson 49c8b5f514 [Fix] Adjustment to legacy menu templates
Follow up to c5cfd4d

1) Partial paths are incorrect
These are not a problem with our current Mustache template
parser but could break with any changes in our PHP implementation

2) Add dedicated class to legacy menus

On the longer term this will allow us to further separate the
old and new CSS.

Change-Id: I056b033855c28f919a4af99784620503f10b9dcb
2022-06-22 22:42:39 +00:00
bwang f473129485 Add support for floating TOC lower down the page
This patch only handles the first case listed in the task description

Bug: T308689
Change-Id: I4e7dbded7a8206633a98653aaf4ced3fd2b6f69d
2022-06-21 16:02:11 +00:00
Jon Robson 64ee3686b8 Cached CSS is no longer a problem
The !important is retained for cached HTML and will be retained
for another release cycle

Cached HTML will continue to be a problem until next deploy. The CSS
cleanup will thus be fixed in a follow up
(I47b7a0bc9c5dad5451f1dbb5e32e513643a1534b)

Bug: T307900
Change-Id: I47b7a0bc9c5dad5451f1dbb5e32e513643a1534b
2022-06-16 17:48:29 +00:00
jenkins-bot d529efeaf8 Merge "Follow-up: Update menu label elements" 2022-06-13 14:37:25 +00:00
bwang 93e8cfcd90 Collapse ToC into page title at narrow view ports with CSS/template changes only
Bug: T307900
Change-Id: I72607ec9d8b46401468de5815cf47dac9f4612a5
2022-06-10 15:49:06 -06:00
Jon Robson 664b6c5cc5 [Grid] Vector 2022 layout uses CSS grid
It gracefully degrades to a single column
layout on grade C browsers, IE11, and Safari 9.

Bug: T303484
Change-Id: Iaa3c1bee146dc39b1259a1ce712a29c6b22305d1
2022-06-07 17:23:08 +00:00
bwang 467d994123 Follow-up: Update menu label elements
- Update the modern menu template to avoid using aria-hidden on the `label` element, and avoid using a `label` element when no checkbox is present.
- Revert legacy menu template to use h3 elements


Bug: T301051
Change-Id: I6ab10e35f0d67d70877e55cca5a512c2af4cb972
2022-06-06 23:59:13 +00:00
Jon Robson a018a909d9 [Grid] Minor HTML restructure for grid
Make the sidebar and content siblings of the header element. This
will allow us to easily apply grid column and rows to these elements.

Bug: T303484
Change-Id: I0a91eddbddbe58781892eddb93edfc3d58777968
2022-06-06 14:58:20 -07:00
Jon Robson 02fb90531b [Grid] Add TableOfContentsContainer
In preparation for grid work where the table of contents will
be moved into a new container.

Bug: T303484
Change-Id: I931d5148e314c1c05f0474b47be5efd7c166144d
2022-06-03 22:27:22 +00:00
jenkins-bot f94c86c3e0 Merge "Exclude from max-width via query string patterns" 2022-06-01 16:15:01 +00:00
jenkins-bot 54991e1d13 Merge "Remove unnecessary inner-tag whitespace and self-closing tags" 2022-06-01 15:05:50 +00:00
Sam Wilson 87e4ca9a21 Exclude from max-width via query string patterns
Add action=edit to the exclusions in $wgVectorMaxWidthOptions
and update the parsing of the query string values for that config
variable to accept a regex.

Bug: T307725
Change-Id: Iba526033d45e18cb340a2648378d3d90ef3ae3c6
2022-06-01 10:00:39 +08:00
Jan Drewniak a3cef30154 Move page title above article toolbar menus
Moves the page's title above the article toolbar (i.e. tabs) based
on the VectorTitleAboveTabs config option. This feature remains
off by default, but can be accessed via the query parameter `vectortitleabovetabs`.

Removes the Navigation.mustache template since it's just a wrapper
for the sidebar + tabs elements, which, with this change, are placed
in different locations in the DOM and don't need a common parent element.

Bug: T303549
Change-Id: Id4816b753a1b2133c53c3b1d390b45631c704daf
2022-05-31 18:06:11 -04:00
Sam Wilson c32c64481d Use new ResourceLoader namespace
To fix Phan errors with the now-deprecated ResourceLoaderContext
class alias.

Bug: T308718
Change-Id: Ifd265d29cee5f8a68e7b3036deaf2ba2b6c49d2e
2022-05-25 10:36:40 +00:00
Volker E 06708ba198 Remove unnecessary inner-tag whitespace and self-closing tags
Self-closing tags are so XHTML. HTML5 allows them on some elements, but
doesn't require them. Cleaning up for consistency and for a few bits
saved to clients.

Change-Id: I781b8d79bbd5dd1ee75a167718964c1142ecfc5d
2022-05-24 14:46:37 -07:00
jenkins-bot dafe3c8fd4 Merge "Handle accessible labels differently for dropdown and portal menus" 2022-05-24 15:09:04 +00:00
Mo Abualruz e46eef19d0 Normalise PHP namespaces used in Vector
- `MediaWiki\Skins\Vector\Tests` is now the prefix for all tests in the skin
- we followed PSR conventions of following folder structure after the prefix
- Optimize imports/use order
- update namespace in skin.json

Bug: T303102
Change-Id: Ib76374d81d973c83adfd6c8e7863ff6d797e655d
2022-05-23 09:32:40 +02:00
Jon Robson d74890df63 [Grid preparation] Add feature flag for grid
Additional changes:
* Make the query string parameter optional and if not defined set it
to lowercase configuration name. I think this makes it more predictable
as some configuration flags are prefixed with vector and some without.

This has the following consequences:
languageinheader => vectorlanguageinheader
languageinmainpageheader => vectorlanguageinmainpageheader
languagealertinsidebar => vectorlanguagealertinsidebar
titleabovetabs => vectortitleabovetabs

Note since table of contents query string is used in the A/B test
I've kept that as tableofcontents for now.

Bug: T303484
Change-Id: Iaca026ef5f32836098dc3b6f0f18632fe84fa8d0
2022-05-13 15:21:52 +00:00
bwang 9e665f9034 Handle accessible labels differently for dropdown and portal menus
An issue was found in QA where certain browser/screenreader combos could not read `aria-labelledby`+`aria-label`. Instead, we avoid using `aria-labelledby` and the `label` element entirely and apply the accessible label directly to the `input`. This great simplifies our labelling and improves screenreader support, while also allowing us to hide the `label` element to reduce verbosity.
Because the `label` element is used differently in the portal menu, we use the `is-portal` variable to maintain the old markup for portal menus

Bug: T301051
Change-Id: I5a0f7d5d78838fabe561095b33176e7162b31aea
2022-05-12 22:11:22 +00:00
Jon Robson 78369c51d3 Omit ArticleToolbar in Navigation when title above tabs
Change-Id: Ib3d9c28e4dbbf1deb85adccec84f208f086c1a04
2022-05-12 11:04:10 -07:00
jenkins-bot ef42ef7e66 Merge "Create feature flag for VectorTitleAboveTabs feature" 2022-05-11 19:53:11 +00:00
jenkins-bot 8d1dbab356 Merge "Simplify TOC spacing styles/logic by reusing the visible sticky header class" 2022-05-10 22:18:26 +00:00
bwang 2f32d1378c Fix personal tools navigation landmark label
Bug: T291304
Change-Id: I62c24cf739048b794cc33045cbe2333ecb51efdb
2022-05-10 17:12:46 +00:00
Jan Drewniak 29d938b0f9 Create feature flag for VectorTitleAboveTabs feature
Adds a feature called VectorTitleAboveTabs that will be used to
toggle a forthcoming feature that moves the page title above the
tabs (the ones that link to talk/history etc).

Bug: T303549
Change-Id: Ibadb4293eca16a83e5e7a9f90ddcf51fab0a0e41
2022-05-10 12:53:31 -04:00
bwang 91e2e55a10 Simplify TOC spacing styles/logic by reusing the visible sticky header class
- 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
2022-05-10 11:39:05 -05:00
jenkins-bot b6847038f8 Merge "[HTML] Refactor Content header templates" 2022-05-06 18:43:34 +00:00
Jan Drewniak 1288c97179 [HTML] Refactor Content header templates
Creates two new templates:
- ContentHeader.mustache containing the site header and indicators or languages
- ContentSubheader.mustache containing site tagline and conditionally indicators

This changes DOM order.
- It adds the `<header class="mw-body-header">` to all pages,
  including special pages & edit pages, not just pages with the language button.
- It moves the #siteSub element (tagline) outside of the
  `<div id="bodyContent">` element.
- Adds a clearfix (or margin-collapse fix) to `.vector-body`.

This changes causes a minor difference (perhaps improvement) where on special pages,
the beginning of the content, starting with the `mw-specialpage-summary` element,
was positioned closer to the page title than on regular pages.

The clearfix ensures that the height between the page title and content is consistent across all pages.

Bug: T303549
Change-Id: I29ba337dbd6f9b0cf58c9a0ca517a9ba59cef414
2022-05-06 15:37:04 +00:00
Jon Robson 305fbdacf8 [Grid preparation] ArticleToolbar component
Structural change to prepare for CSS grid usage.
ArticleToolbar component is defined and self contained with
all layout rules relating to toolbar

UI regression testing suite shows 6 failures due to pixel alignment
changes to tabs. When comparing to the current release, you should
see 34 failures before /and/ after this change.

Notable changes:
- #mw-head element is no longer present in modern Vector skin
to allow us to distinguish between cached HTML and modern HTML

Bug: T303484
Change-Id: Ia261ea53931217f32a21b33c2ab3d4ec64efa48a
2022-05-05 21:13:01 +00:00
Jon Robson 9a2b3d6275 [Grid preparation] Structure the header
Restructure the header to have two child elements

Change-Id: Ib5b7f31419ae6b62f62878947651b8ab843a3955
2022-05-05 17:54:28 +00:00
jenkins-bot ff3d879ee2 Merge "Remove nav element from Vector menus and only render label elements in Vector menus when needed. Add new nav landmarks corresponding to user links, main site nav, and article editing tools. Split out legacy Menu template." 2022-05-03 15:42:02 +00:00
Jon Robson a1e5fd5fcc On special page do not show empty more menu to low resolutions
This is a follow up to I34ace0aeb3e23d8f6a8c5a8680bb492f37e343ad
On Special:Userlogin a "more" menu appears that's visible but empty
that should not

 Bug: T306229
Change-Id: I9384b3015de9991db41bde8ccc8f404ac533f198
2022-05-02 20:22:44 +00:00
Tim Starling 8d0659b1e6 Updates for core temp user autocreation feature
* Use pt-tmpuserpage for the temp user name.
* Use the userAnonymous icon for the temp user personal tools menu.
* Suppress the logout menu item for temp users.

Depends-On: Ib14a352490fc42039106523118e8d021844e3dfb
Bug: T300263
Change-Id: I8ac5de82f76a9ec58b0fbef85546bc7fd5b793d2
2022-04-28 20:32:53 +00:00
Jon Robson 64df4fde20 Remove dancing tabs with CSS only solution
Remove JavaScript that collapses tabs and replace with an easier
to maintain breakpoint based solution.

Tabs will now collapse below the tablet breakpoint

Note: In the case of mw.util.addPortletLink, to add items to the
`views` menu, these will not be collapsed into the more menu and
must now be explicitly added to both menus, ie. if the window is
resized these will hide and not appear in the more menu.

However, when mw.util.addPortletLink attempts to add to `views` menu
when there is not available space, we will redirect those links to
the more (`cactions`) dropdown menu.

Bug: T306229
Change-Id: I34ace0aeb3e23d8f6a8c5a8680bb492f37e343ad
2022-04-28 17:57:10 +00:00
bwang d54029a523 Remove nav element from Vector menus and only render label elements in Vector menus when needed. Add new nav landmarks corresponding to user links, main site nav, and article editing tools. Split out legacy Menu template.
Bug: T291304
Bug: T301051
Change-Id: I35c20103e4b45139ef1d3f73c23f6a744aa87a3c
2022-04-27 16:52:20 +00:00
Derick A 80b60c153a
Hooks: Migrate Vector skin hooks to the new MediaWiki hook system
Per https://www.mediawiki.org/wiki/Manual:Hooks#Handling_hooks_in_MediaWiki_1.35_and_later,
MediaWiki provides a new hook system. Vector is able to utilize this new
hook system because it requires a MW version >= 1.35, hence the migration.

Bug: T271009
Change-Id: I6e01b151751485339a0d6a6dc6a843f7141d54bb
2022-04-26 23:58:13 +01:00