Skip to content

Conversation

@torchiaf
Copy link
Member

@torchiaf torchiaf commented Sep 17, 2025

Summary

Fixes #15505
Fixes #15527

Technical notes summary

It adds the multiple side windows and tabs dragging support.

Areas or cases that should be tested

  • Usage
  this.$store.dispatch('wm/open', {
    id:         `kubectl-console-id`,
    label:      'Kubectl',
    icon:       'terminal',
    component:  'KubectlShell',
    attrs:      {},
    position:   'right',
    layouts:    ['default', 'home'], // the layouts where we want to show the side windows 
    showHeader: true, // Header can be disabled
  }, { root: true });
  
  // tabs dragging and default pin can be locked by position 
  this.$store.commit('wm/setLockedPositions', ['right', 'bottom', 'left']);
 

Areas which could experience regressions

Screenshot/Video

Screencast.from.2025-10-06.09-58-04.webm

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility

@torchiaf torchiaf force-pushed the extensions-window-manager-api branch 2 times, most recently from 57e26e2 to 6705638 Compare September 19, 2025 14:58
@torchiaf torchiaf marked this pull request as ready for review September 23, 2025 14:32
@torchiaf torchiaf added this to the v2.13.0 milestone Sep 23, 2025
@torchiaf torchiaf force-pushed the extensions-window-manager-api branch from 00ef10e to 43968c5 Compare September 23, 2025 15:00
@@ -0,0 +1,291 @@
<script lang="ts" setup>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core changes are here. It adds the new side window

'../store/type-map.js',
'../store/uiplugins.ts',
'../store/wm.js',
'../store/wm/index.js',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core changes are here. It adds the new wm/secondary store.


export function resolveWindowComponent(key) {
return require.resolve(`@shell/components/nav/WindowManager/${ key }`);
return require.resolve(`@shell/components/Console/${ key }`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decoupling Kubectl components from Primary window

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest using Window rather than Console - this is the auto-import of Vue components that can be shown in the window manager, I don't think its specifically console.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left another round of comments. One thing to note with regards to accessibility - we will need to ensure that focus is set to an element within the secondary panel when it is opened.

Comment on lines 43 to 48
// This should work at tab level, not global
// if (!!component.value || componentName.value === name) {
// _warn(`component is already loaded`, name, extensionId);
// return;
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove commented code

@nwmac
Copy link
Member

nwmac commented Oct 1, 2025

I think we could do this with less change.

My thoughts on what we should do:

  • Have the notion of Horizontal and Vertical panels, managed by a window manager.
  • Horizontal panel is pinned to the bottom of the browser window, Vertical is pinned to the right-hand side
  • The API for opening a window with the window manager takes an optional arg of which panel to open in - by default, it will open in the bottom, horizontal panel.
  • (future) Windows can be moved between the horizontal and vertical panels

Not sure about renaming 'wm' to 'console' - I think the term 'console' is perhaps to specific.

this.$dispatch('wm/open', {
id: `kubectl-${ this.id }`,
label: this.$rootGetters['i18n/t']('wm.kubectlShell.title', { name: this.nameDisplay }),
label: this.$rootGetters['i18n/t']('console.kubectlShell.title', { name: this.nameDisplay }),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think keeping wm is fine - rather than console.

@dragend="$refs.draggableZone.onDragEnd($event)"
>
<WindowManager @draggable="draggable=$event" />
<PrimarySideWindow @draggable="draggable=$event" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest naming HorizontalWindowManager

<WindowManager @draggable="draggable=$event" />
<PrimarySideWindow @draggable="draggable=$event" />
</div>
<SecondarySideWindow />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest naming VerticalWindowManager

@nwmac
Copy link
Member

nwmac commented Oct 1, 2025

Also, I'd be okay with disabling the window dragging for now (if that helps keep this simpler) and bringing it back when we re-factor to a cleaner single window manager.

@torchiaf torchiaf force-pushed the extensions-window-manager-api branch from cd44c23 to 3b9ee62 Compare October 2, 2025 10:17
- Decouple PrimarySideWindow from Console components
- code refactoring - use Composition APIs
- Extensions API - handle async enabling actions
- Improve PrimarySideWindow resize
- Add grab cursor to primary window

Signed-off-by: Francesco Torchia <[email protected]>
@torchiaf torchiaf force-pushed the extensions-window-manager-api branch from 34dc648 to 3e33d8e Compare October 6, 2025 07:46
@torchiaf
Copy link
Member Author

torchiaf commented Oct 6, 2025

@nwmac @rak-phillip I decided to re-implement the WindowManager functionality to fully support multiple windows and tabs dragging.
I also updated the description with new enhancements notes, please take a look.

@torchiaf torchiaf requested review from nwmac and rak-phillip October 6, 2025 08:00
@torchiaf torchiaf changed the title Secondary side panel Window Manager enhancements Oct 6, 2025
@torchiaf torchiaf force-pushed the extensions-window-manager-api branch 3 times, most recently from 60b7150 to ac9f77c Compare October 6, 2025 11:33
@torchiaf torchiaf force-pushed the extensions-window-manager-api branch from ac9f77c to 7d17f89 Compare October 6, 2025 11:46
Copy link
Member

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a distinct change in behavior now. The previous implementation would allow dragging all tabs together to pin the entire group - this allowed for inactive tabs to be a drag target.

The new implementation allows individual tabs to be pinned to different areas, but only the active tab can be dragged.

}
height = Math.min(height, 3 * windowHeight / 4);

setDimensions({ height });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getters should be side-effect free. Both getters for width and height will commit a mutation. Perhaps, it would be better to initialize dimensions using the mounted hook or some other mechanism.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this is mostly legacy code and it needs to be cleaned up.
However, the logic there is a bit complex, so I would leave this kind of refactoring for later to avoid the risk of breaking the set-dimensions behavior, if you are fine with that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's create a new issue so we can follow up and address in a separate PR. This will also help to manage the scope of this change as well.

Signed-off-by: Francesco Torchia <[email protected]>
@torchiaf torchiaf requested a review from rak-phillip October 23, 2025 10:16
Copy link
Member

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - The dragging functionality looks good and I think it's an overall improvement, especially with regards to flexibility.

@torchiaf torchiaf merged commit 3f81db4 into rancher:master Oct 24, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge Primary and Secondary side windows in a single component Support secondary side window

3 participants