Problem/Motivation

Navigation module does not have a capability to integrate Workspaces. This is how the Drupal 11 workspaces UI looks like with the old toolbar for example:

Proposed resolution

Implement a new design where Workspaces shows at the top of the Navigation. This issue is only for the item shown in the Navigation. Another issue will be created to update the top area UI Workspaces provides. For now, the new "button" should trigger that same area.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork drupal-3425081

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:

Issue fork navigation-3425081

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

KeyboardCowboy created an issue. See original summary.

finnsky made their first commit to this issue’s fork.

finnsky’s picture

Added quick proto here.
I tried to reuse all existing components as much as possible.

I really think it shouldn't be `workspaces only` MR. We need to create some common UI for that panel. And probably for layout builder/announcements etc panels aswell.

So I've added .toolbar-panel in temporary styles.

@ckrina please take a look! Thanks

ckrina’s picture

Adding link to related issue in Workspaces #3096017: Finalize the Workspaces UI.

skaught’s picture

Status: Active » Needs review

@ckrina

#4: I agree we should also take a look around what things other core/contrib will want to add to this tool.
We need to keep in mind that other modules 'opt-in' to using toolbar via hook_toolbar:

  • Workspaces: add a 'tab' (only) and attaches js/css via library api (which opens the top fixed off-canvus drawer that is the Workspaces UI)
  • Acquia Connector: add a tab (only) opens to external hosting tools dashboard.
  • Devel: adds 'tab' and 'tray' of child menu item [see: \Drupal\devel\ToolbarHandler]
  • Env Indicatior: general use cases, add a'tab'
  • demo_umami: adds 'tab' item to say This site is intended for demonstration purposes.

^
- IMO: umami is a good example of a bad use of hook_toolbar. overall message is dont' do what i do at that (:
- I would anticipate that devel would themselves convert to a menu and be placed in within the 'default/main navigation layout section' (left side). However this is reminding of the purpose of top bar: for these such of items!

Propose: Top bar also adds Layout for right/left position.
-> convert 'local tasks' to a plugin to be placed. q: Is NavigationBlock currently flexible enough to also be used this way
-> info and docs about the plugins.

DX:
->how can other modules install their items?
[edit] navigation.block_layout.yml shows structure.

ckrina’s picture

Project: Navigation » Drupal core
Version: 1.x-dev » 11.x-dev
Component: Code » navigation.module
ckrina’s picture

Status: Needs review » Needs work

Moving to Needs work after getting Navigation into core.

ckrina’s picture

Status: Needs work » Postponed
Issue tags: +Needs design

Actually, also postponing it until we have designs for this so nobody else tries to implement something that has to be changed later.

ckrina’s picture

smustgrave’s picture

Following as this also impacts Tour (which is now contrib)

skaught’s picture

Navigation should have a 'pill' plugin item that lets contrib/core components simply add this 'link' for this wider 'task markers'
- contextual 'edit'
- workspaces
- HELP module
- umami 'demo notice link'
- Commerce activity
-admin toolbar 'search'

re: shortcuts #3445184: Fatal error when accessing Navigation Blocks on a minimal profile installation because of the Shortcut block

skaught’s picture

StatusFileSize
new17.94 MB
gábor hojtsy’s picture

Priority: Normal » Major
StatusFileSize
new2.92 MB
new4.04 MB

Came here as I was doing screenshots for Drupal 11's release and the navigation screenshot looks great, but I could only screenshot the stable workspaces module with the old toolbar. So we'll have these two screenshots in the Drupal 11 release.

Toolbar screenshot:

Workspaces screenshot:

Is there an issue for the design that this is postponed on?

gábor hojtsy’s picture

Issue summary: View changes
gábor hojtsy’s picture

Title: Integrate with Workspaces » Navigation does not allow placement of workspaces, tour, contextual editing, Umami, etc. pills
Issue summary: View changes

Expand title and summary.

ckrina’s picture

Title: Navigation does not allow placement of workspaces, tour, contextual editing, Umami, etc. pills » Integrate Navigation with Workspaces
Issue summary: View changes
Status: Postponed » Active
Issue tags: -Needs design
StatusFileSize
new26.26 KB
new18.67 KB
new16.56 KB
new732 bytes

I've updated the first round of designs so the implementation of this can start. This will still miss hover states, for example. I've also added the new icon SVG.

ckrina’s picture

I gorgot to mention that I opened some follow-ups for the rest of the modules to focus this issue only on Workspaces on the Navigation itself, so the rest of the modules have their own issues:

Edit: For other ideas or integration pleas open issues for it so each issue keeps the scope contained.

gábor hojtsy’s picture

This looks great. I think workspaces has three icons as shown in the screenshot (https://git.drupalcode.org/project/drupal/-/tree/11.x/core/modules/works... has the yellow and green page layout and the dimensional layers image), but the one in the toolbar is similar to the one you are proposing here, so that looks good too.

ckrina’s picture

@Gábor Hojtsy yes, those other icons are used on the internal Workspaces UI we're still working on. :)

amateescu changed the visibility of the branch 3425081-integrate-with-workspaces to hidden.

amateescu’s picture

Category: Feature request » Task
Status: Active » Needs review

Thanks @ckrina for posting the designs, I also think they look good! My initial impression was that the workspace switcher is a "contextual operation", so the top bar would've been better suited for it, but I suppose there was enough thought put into the current proposal so I'm not going to argue about it :)

I've opened a MR with my initial attempt at this integration. No screenshot needed because it looks just like the existing ones.

gábor hojtsy’s picture

This currently adds an alter hook, but otherwise the items in navigation are standard blocks. Should this be a block that is shipped with Workspaces instead?

amateescu’s picture

@Gábor Hojtsy, the MR provides a Workspaces block as well. The hook is needed so modules can add blocks to the navigation without user intervention, basically what #3463142: Allow modules to hook into top of content section of new core navigation is also asking for.

smustgrave’s picture

Status: Needs review » Needs work

Believe the new library has to be added to the Stable9 override list.

mherchel’s picture

Discussed during meeting today.

Per @m4olivei:

It looks like this adds an alter hook that allows the form to be able to placed within the navigation module. We need to do two things:

  • Does this solve our issue and allow us to place the form?
  • Will this new hook work for other modules that want to do similar?

@m4olivei will work on this.

amateescu’s picture

@mherchel, the purpose of the hook is described in #25..

finnsky’s picture

I've added couple of comments in that MR

We need something like this
Styles and markup in Navigation and functional from Workspaces.
https://www.drupal.org/project/drupal/issues/3441100#comment-15770402

ckrina’s picture

Just to confirm that this issue should only take care of the item placed on the Navigation itself. Nothing related to the form should be changed, since it really complicates the implementation and we need this issue fixed to get Navigation into stable. So as long we can trigger the old form from the new Navigation we can move any work to a followup (in Workspaces, and discussed & agreed with the Workspaces maintainers).

So, for this MR it'd be great if the color green used is closer to the one from the designs (the green chosen is darker and forces using white text).

m4olivei made their first commit to this issue’s fork.

finnsky’s picture

1. we need to fix top displace
https://gyazo.com/668eaf04133ec59fd1c4026f89ef8e18

2. we need to fix use-ajax animation
https://gyazo.com/cfcc223672e9e4e5be6ecf24d0edc0ba

3. weird behaviour on mobile
https://gyazo.com/c8c93d79ba2ccdb6f9689907096263a9

4. it also has bigpipe replacement same as shortucts
https://gyazo.com/547da9f049c003ddfd371941b77046cd

finnsky’s picture

To do it in good way, abstract buttons and css variables we will beed to update toolbar-button itself.
To avoid double work i would like to have https://www.drupal.org/project/drupal/issues/3458215 landed first.
It is also stable blocker.

pjudge made their first commit to this issue’s fork.

amateescu’s picture

Status: Needs work » Needs review

Fixed most of the threads, there's only one remaining where we need a reply from @finnsky.

amateescu’s picture

Points 1, 2 and 3 from #32 are still outstanding, but they're "general" problems with Navigation, not with the workspaces integration that we're trying to do here :)

finnsky’s picture

Points 1, 2 and 3 from #32 are still outstanding

Yes. But scope of the current issue is navigation module. So i think we should fix it here aswell.

finnsky’s picture

Also should this block be also configurable from UI?
Like
https://gyazo.com/71f405fd6ea357cc707056a5c3fc8bde

finnsky’s picture

@crina could you please define animation icon
https://gyazo.com/86a2d286fe3d5bdb54d75e7619f6f107

finnsky’s picture

I've fixed all issues from #32

But one important thing.

We have yet another issue. https://www.drupal.org/project/drupal/issues/3441100

Where we add messages into navigation via theme hook(s).
I would like to get backender review of both issues. to get best and simplest way to extend navigation.

Here for example we ignore that buttons(messages) can be displayed as list.

So before we will extend Navigation by other modules let's have universal extending mechanism

finnsky’s picture

Status: Needs review » Needs work
amateescu’s picture

Ok, moved everything to the Navigation module.

Re #42: what kind of tests are needed?

arunkumark made their first commit to this issue’s fork.

finnsky’s picture

I don't think that in this issue we should change core code. Let's create core issue about that parent class functions?

amateescu’s picture

There's currently a single failing (Nightwatch) test left, and the problem seems to have been introduced in this commit https://git.drupalcode.org/project/drupal/-/merge_requests/9116/diffs?co.... No idea how to fix it, hoping that @finnsky can help :)

trackleft2’s picture

FYI the throbber doesn't work correctly when the navigation is collapsed on the front end theme.

amateescu’s picture

Issue tags: -Needs tests

Discussed with @plopesc and agreed that we should leave the "add the workspace navigation block by default" part to #3463142: Allow modules to hook into top of content section of new core navigation. I'm not doing that myself right now because I see @finnsky is actively working on the MR :)

We also discussed test coverage, and since the current MR is just adding a button that does the same AJAX action as the one from the Toolbar, there's nothing really testable at this point. Test coverage will be needed when we get to work on the full solution that will open the workspace switcher in the navigation popover.

amateescu’s picture

Addressed the last feedback but this is sadly still blocked on a nightwatch fail that I've no idea how to fix.

trackleft2’s picture

Nightwatch fail says

   Timed out while waiting for element <.admin-toolbar__expand-button[aria-expanded=true]> to be present for 5000 milliseconds. - expected "visible" but got: "not found" (5157ms)

Test file can be found here: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/navig...

amateescu’s picture

Status: Needs work » Needs review

Thanks @plopesc for fixing the test! This is finally ready for review now :)

finnsky’s picture

I would like to have it merged. It has some improvements about buttons and events.
On my side RTBC + 1

plopesc’s picture

Title: Integrate Navigation with Workspaces » [PP-1] Integrate Navigation with Workspaces
Status: Needs review » Postponed

I would really like to have it merged as well, but I'm afraid we need to get #3463142: Allow modules to hook into top of content section of new core navigation in first.

Postponing this one on it to make it more explicit and have a better picture of the relationships between the issues.

Once we have #3463142: Allow modules to hook into top of content section of new core navigation merged, it will be only necessary to implement the hook to have the Workspaces block visible in the new Navigation.

finnsky’s picture

Probably we will need to backport valuable CSS/JS changes from this MR then.
Currently we have bug with anything displaced from top.
Not only workspaces.

Also Ajax issues from #32 are global. So this prio maybe higher.

amateescu’s picture

Title: [PP-1] Integrate Navigation with Workspaces » Integrate Navigation with Workspaces
Status: Postponed » Needs review

Updated the MR to use the new content_top region from #3491081: Allow other modules to include their own Navigation blocks during installation. Another artificial dependency down...

plopesc’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new7.4 MB

Code looks great and all the comments have been addressed.
Marking as RTBC.

Attaching screenshot to demonstrate the new behavior:

Thank you!

moshe weitzman’s picture

I apologize for chiming in at the end here. The interaction looks awkward to me. Specifically, there are 3 areas involved. The toolbar with the green Live, the expanding header where you begin the workspace selection. And then confirm dialog. This is a lof of jumping. Did we consider doing this all in one expanding menu, and doing away with the confirm dialog? Its not actually destructive to change your workspace. Its just your personal view of the content.

Please disregard this comment if the team disagrees,.

amateescu’s picture

Did we consider doing this all in one expanding menu, and doing away with the confirm dialog?

Yup, that's the long-term plan per #30 :) While this issue is only focused on exposing Workspace's current switcher (with all its problems), in a followup we'll handle both suggestions. There's a screenshot in this comment #3457688-29: Support for core navigation module which shows the WIP design for the full Workspaces navigation UI.

ckrina’s picture

What @amateescu said :)

All the early explorations we did trying to improve the workflow with Workspaces showed that we need to think about several existential interactions and UIs beyond the top dialog. That's why we kept this as "it only triggers the existing dialog" so we can get Navigation to Stable soon and not get into a way longer discussion that will block Navigation.

pameeela’s picture

Looks "good enough" to me! Certainly better than now, which is no integration at all.

  • catch committed 86f05f5d on 11.x
    Issue #3425081 by amateescu, finnsky, plopesc, m4olivei, pjudge,...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

Do we actually have a follow-up issue open for the UX changes? Would be good to open that and maybe attach the most relevant screenshots from here. Tagging for that.

Opened one more follow-up based on the placeholder discussion in the MR: #3499871: Try to use a placeholder for the workspaces toolbar destination parameter.

Can't review the CSS here usefully, and only just about bits of the JavaScript, but other people have done that, and the PHP looks fine.

Committed/pushed to 11.x, thanks!

nicxvan’s picture

This may have potentially changed navigation performance tests.
After rebasing #3490841: Create hook_runtime_requirements() and hook_runtime_requirements_alter() I am getting failures for the navigation js performance test.

$this->assertLessThan(90000, $performance_data->getStylesheetBytes());

Added: #3500293: Add headroom to the navigation performance test

Status: Fixed » Closed (fixed)

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