Skip to content

Commit ae074db

Browse files
committed
Allow navigating to the main workspace from readonly workspaces
1 parent 788237f commit ae074db

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/actions/ws_movement.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@ export class WorkspaceMovement {
6868
/** Move the cursor to the workspace. */
6969
{
7070
name: Constants.SHORTCUT_NAMES.CREATE_WS_CURSOR,
71-
preconditionFn: (workspace) =>
72-
this.navigation.canCurrentlyEdit(workspace),
71+
preconditionFn: (workspace) => {
72+
return true;
73+
},
7374
callback: (workspace) => {
75+
const targetWorkspace = workspace.isFlyout
76+
? workspace.targetWorkspace
77+
: workspace;
78+
if (!targetWorkspace) return false;
7479
keyboardNavigationController.setIsActive(true);
75-
return this.createWSCursor(workspace);
80+
return this.createWSCursor(targetWorkspace);
7681
},
7782
keyCodes: [KeyCodes.W],
7883
},

src/navigation_controller.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ export class NavigationController {
196196
/** Move focus to or from the toolbox. */
197197
focusToolbox: {
198198
name: Constants.SHORTCUT_NAMES.TOOLBOX,
199-
preconditionFn: (workspace) =>
200-
!workspace.isDragging(),
199+
preconditionFn: (workspace) => !workspace.isDragging(),
201200
callback: (workspace) => {
202201
keyboardNavigationController.setIsActive(true);
203202
switch (this.navigation.getState()) {

0 commit comments

Comments
 (0)