Project

General

Profile

Actions

Bug #105104

closed

Preview button in page module does not focus() preview browser tab/window if same resource

Added by Claus Due about 2 months ago. Updated 17 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2024-09-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
trivial
Is Regression:
Sprint Focus:

Description

In window-manager.js a special condition is added which checks if the browser is trying to open a URL that is already open when a user clicks the "view" button in the page layout module header.

If this is the case, a special logic path is used which reloads that other tab/window's URL - instead of calling window.open().

Unfortunately, this special logic path does NOT call focus() on the target window like the standard code path will do.

The result is that if you're clicking the "view" button but already have a window/tab open with that resource, then that other window/tab is reloaded but is not focused.

(this problem does not exist for the "view" button in the formengine edit form which uses a completely different method for opening the new window/tab).

The behavior should be consistent regardless of which "view" button is clicked and whether or not a window/tab already exists. The good UX solution appears to be that both code paths in window-manager.js should call focus() on the target window.

Code in question:

if (Utility.urlsPointToSameServerSideResource(n, l)) return i.location.replace(n), i.location.reload(), i;

Suggested replacement:

if (Utility.urlsPointToSameServerSideResource(n, l)) return i.location.replace(n), i.location.reload(), i.focus(), i;
Actions #1

Updated by Garvin Hicking about 2 months ago

  • Category set to Backend JavaScript
Actions #2

Updated by Gerrit Code Review about 2 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303

Actions #3

Updated by Gerrit Code Review about 2 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86314

Actions #4

Updated by Garvin Hicking about 2 months ago

Thanks! I think the patch for this is relatively straight-forward, however for me on both Chrome and Firefox on macOS, the tabs were already focussed for me. Could you tell in which browser you can reproduce this, and do you have a specific tab/window configuration for it?

Actions #5

Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303

Actions #6

Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86314

Actions #7

Updated by Gerrit Code Review 18 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303

Actions #8

Updated by Garvin Hicking 18 days ago

@Claus Due Could you maybe check out https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303 if that works for you? Thanks.

Actions #9

Updated by Gerrit Code Review 18 days ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86869

Actions #10

Updated by Garvin Hicking 17 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF