Page MenuHomePhabricator

Update mobile search overlay for night mode
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

The mobile search overlay, in particular the image placeholder is not friendly with night mode. Given our work making Codex night mode friendly rather than revising the code to make it work in night mode, I think it is a good idea to align our designs for desktop and mobile a little more.

Rather than re-implementing the whole thing in mobile, I think it would be a good idea to revise the existing PageList markup to use Codex.

User story

As a user on mobile I want a working consistent search experience with the desktop site that works in night mode.

Requirements

  • When an article has no image the placeholder should be visible in both light and night themes.
  • The article search icon should be visible (currently not shown at all)
  • resources/mobile.pagesummary.styles/noimage.svg should be removed in favor of a Codex icon image
  • The designer should be happy with the alignment of icons
  • The search icon should not change color when focused (context: T356822#9614063)
  • The search in pages icon should be replaced with codex icon articlesSearch

[] The codex search bar iconbuttonOnly variant should be used

  • Inner shadow effects should be replaced with bottom borders
  • Overlay component colours should use codex design tokens

BDD

Feature: Enhance Search Overlay with Proper Visuals and Functionality in Mobile (Minerva)

  Scenario: Display placeholder in search overlay for articles without images
    Given the user is performing a search on Wikipedia
    When the search overlay appears
    And the article in the search results does not have an image
    Then a placeholder image should be visible in both light and night themes for that article

  Scenario: Ensure visibility of the article search icon in the search field
    Given the user is on any Wikipedia page with a search field
    When the user focuses on the search field
    Then the search icon should be consistently visible

  Scenario: Replace noimage.svg with a codex icon in search results
    Given the user has initiated a search and results are displayed
    When an article without an image appears in the results
    Then the noimage.svg placeholder should be replaced with a codex icon image in the search overlay

  Scenario: Maintain search icon color on focus
    Given the user has clicked into the search field on Wikipedia
    When the search field is in focus
    Then the color of the search icon should not change

  Scenario: Replace 'search in pages' icon with 'articlesSearch' Codex icon
    Given the user is using the search functionality on Wikipedia
    When the search overlay is active
    Then the 'search in pages' icon should be replaced with the 'articlesSearch' Codex icon in the overlay

  Scenario: Update search overlay icons to be properly aligned
    Given new icons are used in the search overlay
    When the search overlay is displayed
    Then all icons should be properly aligned as per the design specifications

  Scenario: Replace inner shadow effects with bottom borders in search overlay
    Given the search overlay is visible
    When the user examines the overlay elements
    Then inner shadows should be replaced with bottom borders

  Scenario: Use codex design tokens for overlay component colors
    Given the search overlay is active
    When the overlay is displayed
    Then all overlay component colors should utilize codex design tokens

Test Steps

Test Case 1: Placeholder Visibility in Search Overlay
Open Wikipedia in mobile (Minerva skin) click search and type a query that includes articles known to lack images.
AC1: Confirm that a placeholder image is visible for each article without images in light theme.
Switch to night theme and perform the same search.
AC2: Confirm the same placeholder is still visible in the search overlay for each article without images.

Test Case 2: Article Search Icon Visibility
Access any Wikipedia page that includes a search field.
AC3: Ensure the article search icon is visible when the search field is focused.

Test Case 3: Replace noimage.svg with Codex Icon
Perform a search to generate results that include articles without images.
AC4: Verify that in the search overlay, the noimage.svg is replaced with a Codex icon for articles without images.

Test Case 4: Maintain Search Icon Color on Focus
Click into the search field at the top of any Wikipedia page.
AC5: Check that the color of the search icon does not change upon being focused.

Test Case 5: Replace 'Search in Pages' Icon
Use the search field on Wikipedia to perform a search.
AC6: Confirm that the 'search in pages' icon in the search overlay is replaced with the 'articlesSearch' Codex icon.

Test Case 6: Proper Alignment of Icons in Search Overlay
Trigger the search overlay by performing a search.
AC7: Inspect the alignment of all icons within the overlay, including search and placeholder icons, ensuring they are aligned properly as per design specifications.

Test Case 7: Inner Shadow Effects Replaced with Bottom Borders
Activate the search overlay by using the search function.
AC8: Confirm that all UI elements that previously had inner shadow effects now feature bottom borders.

Test Case 8: Codex Design Tokens for Overlay Component Colors
Engage the search overlay through a search action.
AC9: Ensure that the colors of all overlay components utilize Codex design tokens, reflecting the updated design standards.

Design

Current experience

existing.png (664×384 px, 45 KB)
Screenshot 2024-03-01 at 11.09.08 AM.png (1×898 px, 115 KB)

Proposed experience

image.png (664×384 px, 57 KB)
image.png (664×384 px, 57 KB)

Dev-mode Figma file for inspecting colours

Acceptance criteria

  • resources/mobile.pagesummary.styles/noimage.svg should be removed in favor of a Codex icon image
  • Colours match design spec
  • no colour contrast errors

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

QA Results - Beta

QA Results - Prod

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Updated with a design spec. Unassigned myself, removed priority, and moved to incoming for next sprint for triage, estimation, and implementation. There's lots of fiddly colours in this one, so I included the dev spec figma file for folks to look at.

@Catrope let me know:

it looks like this IconButtonOnly variant isn't implemented at all! The SearchInput Vue component doesn't let you have an icon-only button (or even an icon+text)

Not sure if this impacts scope/implementation.

@JScherer_WMF I'm looking at the proposed design, aside from fixing icon colors in dark mode, I'm seeing a change where the search icon is moved from the left to the right and the removal of the "x" clear button? This is different from both the current mobile search experience and the codex search, is this intended?

Screenshot 2024-03-22 at 6.13.06 PM.png (244×792 px, 26 KB)

@Jdlrobson I know the technical goal behind this task is to investigate if Codex can be leveraged for this task, but is this possible given the design differences?

@JScherer-WMF also, is the intent behind moving the search icon to the right to make it into a search button? Because that would also increase the scope of this work, and relates to previous design decisions to move away from that pattern. I dont have a whole lot of context behind this, but i believe Typeahead search used to do this, and moved away from it for some design/accessibility reasons? This is how the legacy search works as well

Screenshot 2024-03-22 at 6.23.51 PM.png (138×774 px, 32 KB)

@JScherer-WMF also, is the intent behind moving the search icon to the right to make it into a search button? Because that would also increase the scope of this work, and relates to previous design decisions to move away from that pattern. I dont have a whole lot of context behind this, but i believe Typeahead search used to do this, and moved away from it for some design/accessibility reasons? This is how the legacy search works as well

Screenshot 2024-03-22 at 6.23.51 PM.png (138×774 px, 32 KB)

Yes, the intention was to use the codex search component to replace the one that's in there now.

I just took the small icon only button variant from Codex because that's what they have spec'd in the Figma components, but it turns out that it hasn't been implemented anywhere. @ovasileva do you have any context around why having a search button in the field would be non-accessible?

Yes, the intention was to use the codex search component to replace the one that's in there now.

@JScherer-WMF Ah I see. My analysis is that that goal requires 2 larger tickets: first one for implementing the "mobile version" of the typeahead search component in Codex (i imagine this would likely need coordination with DST as im not sure if our proposed design is a general solution), and a second for using typeahead search inside Minerva. I know @Jdlrobson you were hoping there would be a lower lift way we could transition to that goal, but Im not sure if thats really possible given the design changes and the fact that its already a decent chunk of work to replace the search code in Minerva with Codex

My suggestion for this task would be to simplify it as much as possible, to just getting search to work with dark mode (i.e. no moving of the search icon, no adding/removing buttons, no changes to functionality). This is with the assumption this task will be modifying Minerva search code that we want to throw away down the line

Yes, the intention was to use the codex search component to replace the one that's in there now.

@JScherer-WMF Ah I see. My analysis is that that goal requires 2 larger tickets: first one for implementing the "mobile version" of the typeahead search component in Codex (i imagine this would likely need coordination with DST as im not sure if our proposed design is a general solution), and a second for using typeahead search inside Minerva. I know @Jdlrobson you were hoping there would be a lower lift way we could transition to that goal, but Im not sure if thats really possible given the design changes and the fact that its already a decent chunk of work to replace the search code in Minerva with Codex

My suggestion for this task would be to simplify it as much as possible, to just getting search to work with dark mode (i.e. no moving of the search icon, no adding/removing buttons, no changes to functionality). This is with the assumption this task will be modifying Minerva search code that we want to throw away down the line

I think that's a fair reduction in scope. I'll update the ticket accordingly so that it's just icons and colours changing.

We do want the codex search in there eventually, though, right? That would give us a responsive search across Vector and Minerva. cc @ovasileva .

This is the non-codex version. I will update the reqs to include it as the recommended experience.

image.png (664×384 px, 57 KB)

JScherer-WMF renamed this task from Update mobile search overlay for night mode and make consistent with day mode to Update mobile search overlay for night mode.Mar 26 2024, 5:09 PM
JScherer-WMF updated the task description. (Show Details)

If we used the whole TypeAheadSearch component as it's spec'd in Codex. It would look like this:

image.png (1×768 px, 326 KB)
image.png (664×384 px, 56 KB)

Would it be more or less work to do it this way @bwang ?

We do want the codex search in there eventually, though, right? That would give us a responsive search across Vector and Minerva. cc @ovasileva .

We do want the codex search eventually. I think the plan was to do that work as we're looking into the search empty state so that we can combine efforts across desktop/mobile. I can set up a separate goal ticket that can collect all the work related to that.

This is the non-codex version. I will update the reqs to include it as the recommended experience.

image.png (664×384 px, 57 KB)

thank you, this looks good and ill use this for QA for this task

If we used the whole TypeAheadSearch component as it's spec'd in Codex. It would look like this:

image.png (1×768 px, 326 KB)
image.png (664×384 px, 56 KB)

Would it be more or less work to do it this way @bwang ?

I think this could be possible, we could hide the big "Search" button since its too big, and i guess the current search on mobile doesnt have one anyway. The big difference in functionality is the lack of the clear and close button. In my in mind the close button seems pretty important at the very least, not sure about clear, but it seems like these warrant some discussion/research.

We do want the codex search in there eventually, though, right? That would give us a responsive search across Vector and Minerva. cc @ovasileva .

We do want the codex search eventually. I think the plan was to do that work as we're looking into the search empty state so that we can combine efforts across desktop/mobile. I can set up a separate goal ticket that can collect all the work related to that.

Thank you for making that ticket olga! that makes sense to me considering theres some design decisions to be made, and at least 1 other separate task for adding typeahead search to minerva

@bwang we lost the estimation on this. Can you add points to it?

Jdrewniak set the point value for this task to 2.Mar 28 2024, 5:16 PM

Change #1015636 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/extensions/MobileFrontend@master] Update mobile search for dark mode

https://gerrit.wikimedia.org/r/1015636

@JScherer-WMF I'm a bit confused about the colors in the figma. When I look at the variables used in the figma and their associated values, I see its entirely different than what we have defined in the code. Could you clarify what variables I should be using and where these values are coming from?

In figma

Screenshot 2024-03-29 at 12.30.51 PM.png (284×620 px, 30 KB)

In code (dark values)
Screenshot 2024-03-29 at 12.31.03 PM.png (388×832 px, 95 KB)

@DTorsani-WMF ^^ did we change the figma colours since we implemented the palette?

For now @bwang please go by the variable names for what we have in prod to unblock dev. I will make sure to double check them in QA.

@JScherer-WMF The biggest discrepancy between the figma colors and prod is with background-color-interactive-subtle, which is applied to the "Search within pages" button

Dark mode
Using the CSS variable:

Screenshot 2024-04-02 at 1.28.51 PM.png (392×2 px, 250 KB)

Without any change,, no CSS variable:
Screenshot 2024-04-02 at 1.28.57 PM.png (388×2 px, 250 KB)

Light mode
Using the CSS variable:

Screenshot 2024-04-02 at 1.29.20 PM.png (422×2 px, 276 KB)

Without any change, no CSS variable:
Screenshot 2024-04-02 at 1.36.31 PM.png (344×2 px, 219 KB)

@bwang I updated the figma file, and that should fix the discrepancy. If you come across any other discrepancies like this, please take note of them, but you need not let them block development. You can continue based on the variable names if there are discrepancies in the hex values and I will check everything during QA.

Assigning back to you and moving back to ready for dev.

bwang removed bwang as the assignee of this task.Wed, Apr 3, 5:18 PM
bwang moved this task from Doing to Code Review on the Web-Team-Backlog (FY2023-24 Q3 Sprint 6) board.

Change #1015636 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Update mobile search for dark mode, remove unused functions in MobilePage.php

https://gerrit.wikimedia.org/r/1015636

Jdlrobson added a subscriber: Edtadros.

Change #1019178 had a related patch set uploaded (by Jdlrobson; author: Bernard Wang):

[mediawiki/extensions/MobileFrontend@master] Second attempt at "Update mobile search for dark mode, remove unused functions in MobilePage.php""

https://gerrit.wikimedia.org/r/1019178

Change #1019178 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Second attempt at "Update mobile search for dark mode, remove unused functions in MobilePage.php""

https://gerrit.wikimedia.org/r/1019178

We do want the codex search in there eventually, though, right? That would give us a responsive search across Vector and Minerva. cc @ovasileva .

We do want the codex search eventually. I think the plan was to do that work as we're looking into the search empty state so that we can combine efforts across desktop/mobile. I can set up a separate goal ticket that can collect all the work related to that.

@ovasileva did you ever get the chance to make the goal for replacing the Mobile search with codex?

@Jdlrobson please take a look at the ❓ 's below.

Test Result - Beta

Status: ✅ PASS / ❓Need More Info
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

Test Case 1: Placeholder Visibility in Search Overlay
Open Wikipedia in mobile (Minerva skin) click search and type a query that includes articles known to lack images.
AC1: Confirm that a placeholder image is visible for each article without images in light theme.

screenshot 219.png (1×741 px, 198 KB)

Switch to night theme and perform the same search.
AC2: Confirm the same placeholder is still visible in the search overlay for each article without images.

screenshot 220.png (1×741 px, 91 KB)

Test Case 2: Article Search Icon Visibility
Open Wikipedia in mobile (Minerva skin) click search.
AC3: Ensure the article search icon is visible when the search field is focused.

screenshot 28.mov.gif (1×740 px, 270 KB)
screenshot 29.mov.gif (1×740 px, 235 KB)

Test Case 3: Replace noimage.svg with Codex Icon
Perform a search to generate results that include articles without images.
AC4: Verify that in the search overlay, the noimage.svg is replaced with a Codex icon for articles without images.
Is this what you are looking for?

screenshot 221.png (1×1 px, 391 KB)

Test Case 4: Maintain Search Icon Color on Focus
Click into the search field at the top of any Wikipedia page.
AC5: Check that the color of the search icon does not change upon being focused.

screenshot 30.mov.gif (240×428 px, 97 KB)
screenshot 223.png (205×314 px, 19 KB)
screenshot 222.png (205×322 px, 21 KB)
screenshot 224.png (357×741 px, 83 KB)

Test Case 5: Replace 'Search in Pages' Icon
Use the search field on Wikipedia to perform a search.
AC6: Confirm that the 'search in pages' icon in the search overlay is replaced with the 'articlesSearch' Codex icon.
Is this what you are looking for?

screenshot 225.png (202×487 px, 20 KB)

Test Case 6: Proper Alignment of Icons in Search Overlay
Trigger the search overlay by performing a search.
AC7: Inspect the alignment of all icons within the overlay, including search and placeholder icons, ensuring they are aligned properly as per design specifications.
Alignment looks good. See AC1, AC2, AC3.

Test Case 7: Inner Shadow Effects Replaced with Bottom Borders
Activate the search overlay by using the search function.
AC8: Confirm that all UI elements that previously had inner shadow effects now feature bottom borders.

screenshot 226.png (900×1 px, 192 KB)

Test Case 8: Codex Design Tokens for Overlay Component Colors
Engage the search overlay through a search action.
AC9: Ensure that the colors of all overlay components utilize Codex design tokens, reflecting the updated design standards.
How can this be verified?

We do want the codex search in there eventually, though, right? That would give us a responsive search across Vector and Minerva. cc @ovasileva .

We do want the codex search eventually. I think the plan was to do that work as we're looking into the search empty state so that we can combine efforts across desktop/mobile. I can set up a separate goal ticket that can collect all the work related to that.

@ovasileva did you ever get the chance to make the goal for replacing the Mobile search with codex?

Discussed this within the steering group and think we might need more planning for the empty search state for next FY before setting up the work. Once we're committed and ready to begin that work, replacing mobile search would be considered a technical enabler (subtask) of that epic.

Everything looks good, resolving

@Jdlrobson please take a look at the ❌ and ❓ below.

Test Result - Prod

Status: ✅ PASS / ❓Need More Info
Environment: enwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

Test Case 1: Placeholder Visibility in Search Overlay
Open Wikipedia in mobile (Minerva skin) click search and type a query that includes articles known to lack images.
AC1: Confirm that a placeholder image is visible for each article without images in light theme.

screenshot 255.png (1×730 px, 157 KB)

Switch to night theme and perform the same search.
AC2: Confirm the same placeholder is still visible in the search overlay for each article without images.

screenshot 256.png (1×730 px, 155 KB)

Test Case 2: Article Search Icon Visibility
Open Wikipedia in mobile (Minerva skin) click search.
AC3: Ensure the article search icon is visible when the search field is focused.
see AC1 and AC2

Test Case 3: Replace noimage.svg with Codex Icon
Perform a search to generate results that include articles without images.
AC4: Verify that in the search overlay, the noimage.svg is replaced with a Codex icon for articles without images.

screenshot 257.png (1×730 px, 230 KB)

Test Case 4: Maintain Search Icon Color on Focus
Click into the search field at the top of any Wikipedia page.
AC5: Check that the color of the search icon does not change upon being focused.
✅ Light Mode

screenshot 261.png (510×695 px, 173 KB)
screenshot 262.png (504×696 px, 91 KB)

❌ Dark Mode

screenshot 259.png (502×690 px, 162 KB)
screenshot 260.png (521×711 px, 79 KB)

Test Case 5: Replace 'Search in Pages' Icon
Use the search field on Wikipedia to perform a search.
AC6: Confirm that the 'search in pages' icon in the search overlay is replaced with the 'articlesSearch' Codex icon.

screenshot 263.png (490×735 px, 61 KB)

Test Case 6: Proper Alignment of Icons in Search Overlay
Trigger the search overlay by performing a search.
AC7: Inspect the alignment of all icons within the overlay, including search and placeholder icons, ensuring they are aligned properly as per design specifications.
Alignment looks good. See AC1, AC2.

Test Case 7: Inner Shadow Effects Replaced with Bottom Borders
Activate the search overlay by using the search function.
AC8: Confirm that all UI elements that previously had inner shadow effects now feature bottom borders.

screenshot 264.png (886×884 px, 201 KB)

Test Case 8: Codex Design Tokens for Overlay Component Colors
Engage the search overlay through a search action.
AC9: Ensure that the colors of all overlay components utilize Codex design tokens, reflecting the updated design standards.
How can this be verified?