Problem/Motivation

The lupus_decoupled_responsive_preview module adds a "Preview link" to the responsive preview toolbar tab on layout builder pages, allowing editors to open the frontend preview in a new browser tab. This was implemented via hook_toolbar_alter().

With Drupal core's new Navigation module replacing the Toolbar module, hook_toolbar_alter() no longer fires and the preview link is lost.

Proposed resolution

Port the preview link feature to the Navigation module's top bar

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

arthur_lorenz created an issue. See original summary.

arthur_lorenz’s picture

Status: Active » Needs review
fago’s picture

Status: Needs review » Needs work

thx. Please make sure there are no static analysis warnings left + to add a kernel test to proof its working fine. we can add navigation to require-dev if needed.

arthur_lorenz’s picture

Status: Needs work » Needs review

Added tests and addressed phpstan warnings.

fago’s picture

Status: Needs review » Needs work

thx!

works fine, but we run into some space issues in the top-bar now, what seems to be a larger problem.
I also add a couple for remarks to the PR, please take a look at those.

arthur_lorenz’s picture

Status: Needs work » Needs review

Thx, I addressed your feedback in the MR.

The issues in the top bar should imo be handled upstream in responsive_preview to make the tool collapsible, with or without our extra link. I will create a ticket for it.

fago’s picture

Status: Needs review » Reviewed & tested by the community

reviewed, PR seems solid. I'll give it another test, but seems ready.

  • fago committed 616831bd on 1.x authored by arthur_lorenz
    feat: #3582576 Add "Preview in new tab" link to Navigation top bar for...
fago’s picture

Status: Reviewed & tested by the community » Fixed

works great, merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.