Page MenuHomePhabricator

Improve platform detection to make sure the desktop editor is used on the desktop site regardless of the viewport size
Closed, ResolvedPublic

Description

As part of T328936, the confirmation step decides whether to use the desktop or mobile editor depending on the platform. In T337917, fixes were made to make sure that on the mobile site (with a ".m" in the url), the mobile editor is used (even if the viewport is wider).

However, currently on desktop the unified dashboard seems to redirect to editors based on the viewport size. That is, on a narrow window, the user is taken to the mobile editor (to an infinite loading state, maybe because some inconsistencies in the platform detection assumptions).

This ticket proposes to make sure the desktop editor is used on the desktop site regardless of the viewport size. Given that it is not possible to transition seamlessly between the mobile and desktop editors when adjusting the window size, it is preferred to provide each editor based on platform detection.`

Derived Requirement

Ensure that the desktop editor is always used on the desktop site, regardless of viewport size, to prevent incorrect redirections to the mobile editor.

Test Steps

Test Case 1: Ensure desktop editor is used on desktop site regardless of viewport size

  1. Open Wikipedia on a desktop browser and navigate to the desktop site (ensure no ".m" in the URL).
  2. Initiate an edit action to open the editor.
  3. ✅❓❌⬜ AC1: Confirm that the desktop editor loads.
  4. Resize the browser window to a narrow viewport.
  5. ✅❓❌⬜ AC2: Confirm that the editor remains the desktop editor without switching to the mobile editor or entering an infinite loading state.

Test Case 2: Ensure mobile editor is used on mobile site regardless of viewport size

  1. Open Wikipedia on a mobile browser or manually navigate to the mobile site (with ".m" in the URL).
  2. Initiate an edit action to open the editor.
  3. ✅❓❌⬜ AC3: Confirm that the mobile editor loads.
  4. Resize the browser window to a wider viewport.
  5. ✅❓❌⬜ AC4: Confirm that the editor remains the mobile editor without switching to the desktop editor.

QA Results - Test Wiki

Event Timeline

Pginer-WMF moved this task from Backlog to Prioritized on the LPL Hypothesis board.

Change #1122652 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] Select editor based on site (mobile vs. desktop)

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

Change #1122652 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Select editor based on site (mobile vs. desktop)

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

Change #1124141 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20250303

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

Change #1124141 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20250303

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

@SBisson I just have a quick question regarding AC2 and AC4. Is it considered mobile only when the URL adds ".m" or when the Suggestion, In Progress and Published switches to the bottom like a mobile device.

Test Result - TestWiki

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

Test Artifact(s):

Test Steps

Test Case 1: Ensure desktop editor is used on desktop site regardless of viewport size

  1. Open Wikipedia on a desktop browser and navigate to the desktop site (ensure no ".m" in the URL).
  2. Initiate an edit action to open the editor.
  3. AC1: Confirm that the desktop editor loads.

2025-03-12_16-59-47.mp4.gif (818×1 px, 1 MB)

  1. Resize the browser window to a narrow viewport.
  2. ❓*AC2:** Confirm that the editor remains the desktop editor without switching to the mobile editor or entering an infinite loading state.

Is this considered going into mobile mode when Suggestion, In Progress and Published switches to the bottom or is it only when URL adds ".m"?

See AC1

Test Case 2: Ensure mobile editor is used on mobile site regardless of viewport size

  1. Open Wikipedia on a mobile browser or manually navigate to the mobile site (with ".m" in the URL).
  2. Initiate an edit action to open the editor.
  3. AC3: Confirm that the mobile editor loads.

Desktop switches to mobile when you view it on a mobile device

2025-03-12_17-05-50.mp4.gif (690×1 px, 1 MB)

  1. Resize the browser window to a wider viewport.
  2. AC4: Confirm that the editor remains the mobile editor without switching to the desktop editor.

Vice versa, when you have ".m" if you widen it

2025-03-12_17-07-34.mp4.gif (670×1 px, 1 MB)

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to In-progress on the LPL Hypothesis board.

@SBisson I just have a quick question regarding AC2 and AC4. Is it considered mobile only when the URL adds ".m" or when the Suggestion, In Progress and Published switches to the bottom like a mobile device.

For the purpose of this task and others that have been in play recently, "mobile" means that we are on the mobile site. In production, this is visible via the ".m" subdomain in the URL but be aware that this is going away and eventually both mobile and desktop sites are going to be served from the same URL (without the ".m").

If you are using mobile emulation in your browser, it is important to reload the page after switching mode so that the site is in the right mode.

Both dashboards are also responsive and their layout adjusts to the screen width but this is independent from the site mode. For instance, an iPad would be served the mobile site but the dashboard layout may end up being the same as a small laptop, which would get the desktop site.

@SBisson Confirmed that the desktop editor loads even when narrow. Also confirmed mobile stays mobile the whole way through as seen in screenshots and gifs. I will move this to sign-off. Thanks for all your work!

Test Result - TestWiki

Status: ✅ PASS
Environment: TestWiki
OS: macOS Sonoma 15.3.1
Browser: Chrome 134
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure desktop editor is used on desktop site regardless of viewport size

  1. Open Wikipedia on a desktop browser and navigate to the desktop site (ensure no ".m" in the URL).
  2. Initiate an edit action to open the editor.
  3. AC1: Confirm that the desktop editor loads.

2025-03-13_16-16-45.mp4.gif (814×1 px, 2 MB)

  1. Resize the browser window to a narrow viewport.
  2. ✅ *AC2:** Confirm that the editor remains the desktop editor without switching to the mobile editor or entering an infinite loading state.

See AC1

Test Case 2: Ensure mobile editor is used on mobile site regardless of viewport size

  1. Open Wikipedia on a mobile browser or manually navigate to the mobile site (with ".m" in the URL).
  2. Initiate an edit action to open the editor.
  3. AC3: Confirm that the mobile editor loads.

2025-03-12_17-05-50.mp4.gif (690×1 px, 1 MB)

  1. Resize the browser window to a wider viewport.
  2. AC4: Confirm that the editor remains the mobile editor without switching to the desktop editor.
iPad Mini
2025-03-13_16-10-21.mp4.gif (838×1 px, 1 MB)
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.