Skip to content

Commit 39442a3

Browse files
authored
Command Palette (#13658)
- Close #13675 (Add Command Palette) - `Ctrl+K` (non-macOS)/`Cmd+K` (macOS) to open, `Escape` to close - Supports icons - Fully reactive (reloads list of entries when changing between Local and Cloud backends, for example) - Uses `fuzzysort` library to search, and highlight matches - Automatically generated from `useMenuEntries` used for menus on the Dashboard; ~~and `registerHandlers` used for registering key bindings on the Project View~~ - (Edit: `registerHandlers` are no longer being used to generate Command Palette entries for now because they should be more finely scoped/thought should be taken to make it more intuitive) # Important Notes >[!NOTE] > *Not* requested by anyone, just opening for feedback
1 parent e0f6b81 commit 39442a3

File tree

30 files changed

+916
-296
lines changed

30 files changed

+916
-296
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252
- [Graph is not moved when showing/resizing side panels.][13557]
5353
- [Add "Invite" button to the top bar when using a team or higher plan][13522]
5454
- ["Welcome Project" is automatically opened for new users][13479]
55+
- [Project and Setting tab may be now closed with shortcut][13498]
56+
(reimplemented in [13604][13604]). On Windows/Linux
57+
<kbd>Ctrl</kbd>+<kbd>W</kbd> or <kbd>Ctrl</kbd> + <kbd>F4</kbd>; on macOS:
58+
<kbd>⌘</kbd> + <kbd>W</kbd>.
59+
- [Command Palette to search for arbitrary actions][13658]
5560
- [Project and Setting tab may be now closed with shortcut][13498][13604]. On
5661
Windows/Linux <kbd>Ctrl</kbd>+<kbd>W</kbd> or <kbd>Ctrl</kbd> + <kbd>F4</kbd>;
5762
on macOS: <kbd>⌘</kbd> + <kbd>W</kbd>.
@@ -88,6 +93,7 @@
8893
[13479]: https://github.com/enso-org/enso/pull/13479
8994
[13498]: https://github.com/enso-org/enso/pull/13498
9095
[13604]: https://github.com/enso-org/enso/pull/13604
96+
[13658]: https://github.com/enso-org/enso/pull/13658
9197
[13685]: https://github.com/enso-org/enso/pull/13685
9298
[13726]: https://github.com/enso-org/enso/pull/13726
9399

app/common/src/text/english.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@
830830
"rootFolderColumnName": "Root folder",
831831
"pathColumnName": "Location",
832832
"hideDevtools": "Hide Devtools",
833-
"ensoDevtoolsShortcut": "Enso Devtools",
833+
"toggleEnsoDevtoolsShortcut": "Toggle Enso Devtools",
834834
"settingsShortcut": "Settings",
835835
"closeTabShortcut": "Close Tab",
836836
"openShortcut": "Open",
@@ -871,6 +871,15 @@
871871
"goForwardShortcut": "Go Forward",
872872
"upgradePlanShortcut": "Upgrade Plan",
873873
"aboutThisAppShortcut": "About Enso",
874+
"goToAccountSettingsShortcut": "Account Settings",
875+
"goToOrganizationSettingsShortcut": "Organization Settings",
876+
"goToLocalSettingsShortcut": "Local Settings",
877+
"goToBillingAndPlansSettingsShortcut": "Billing and Plans Settings",
878+
"goToMembersSettingsShortcut": "Members Settings",
879+
"goToUserGroupsSettingsShortcut": "User Groups Settings",
880+
"goToKeyboardShortcutsSettingsShortcut": "Keyboard Shortcuts Settings",
881+
"goToActivityLogSettingsShortcut": "Activity Log Settings",
882+
"toggleCommandPaletteShortcut": "Toggle Command Palette",
874883
"moveToTrashShortcut": "Move To Trash",
875884
"deleteForeverShortcut": "Delete Forever",
876885
"restoreFromTrashShortcut": "Restore From Trash",
@@ -1013,6 +1022,8 @@
10131022
"downloadDirectoryButtonSettingsCustomEntryAliases": "reset download folder\nreset download directory",
10141023
"accessSettingsTabSection": "Access",
10151024
"billingAndPlansSettingsTab": "Billing",
1025+
"billingAndPlansSettingsSection": "Billing",
1026+
"billingAndPlansSettingsCustomEntryAliases": "billing and plans",
10161027
"membersSettingsTab": "Members",
10171028
"membersSettingsSection": "Members",
10181029
"userGroupsSettingsTab": "User groups",
@@ -1245,5 +1256,15 @@
12451256
"invitationError": "Something went wrong. Please contact the administrator.",
12461257
"pendingInvitationInfo": "You have pending team invitation.",
12471258
"invitationText": "\"$0\" invites you to join",
1248-
"invitationAlert": "All of your assets will be transfered with you. This might take a while."
1259+
"invitationAlert": "All of your assets will be transfered with you. This might take a while.",
1260+
"openBillingPage": "Open Billing Page",
1261+
"bestMatchesBindingCategory": "Best Matches",
1262+
"helpBindingCategory": "Help",
1263+
"otherBindingCategory": "Other",
1264+
"fileManagementBindingCategory": "File Management",
1265+
"editingBindingCategory": "Editing",
1266+
"collaborationBindingCategory": "Collaboration",
1267+
"settingsBindingCategory": "Settings",
1268+
"navigationBindingCategory": "Navigation",
1269+
"developerBindingCategory": "Developer"
12491270
}

app/gui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"dotenv": "^16.4.7",
8484
"enso-common": "workspace:*",
8585
"events": "^3.3.0",
86+
"fuzzysort": "3.1.0",
8687
"hash-sum": "^2.0.0",
8788
"idb-keyval": "^6.2.1",
8889
"input-otp": "1.2.4",

app/gui/src/App.vue

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,15 @@ const { globalEventRegistry } = provideGlobalEventRegistry()
7777
useEvent(window, 'keydown', bindingsHandlers)
7878
useEvent(globalEventRegistry, 'pointerdown', (e) => interaction.handlePointerDown(e))
7979
80-
const platformClass = (() => {
81-
switch (platform()) {
82-
case Platform.windows:
83-
return 'onWindows'
84-
case Platform.macOS:
85-
return 'onMacOs'
86-
case Platform.linux:
87-
return 'onLinux'
88-
case Platform.windowsPhone:
89-
return 'onWindowsPhone'
90-
case Platform.iPhoneOS:
91-
return 'onIPhoneOs'
92-
case Platform.android:
93-
return 'onAndroid'
94-
default:
95-
return undefined
96-
}
97-
})()
80+
const platformClass = {
81+
[Platform.windows]: 'onWindows',
82+
[Platform.macOS]: 'onMacOs',
83+
[Platform.linux]: 'onLinux',
84+
[Platform.windowsPhone]: 'onWindowsPhone',
85+
[Platform.iPhoneOS]: 'onIPhoneOs',
86+
[Platform.android]: 'onAndroid',
87+
[Platform.unknown]: undefined,
88+
}[platform()]
9889
9990
onMounted(() => {
10091
if (config.params.window.vibrancy) {

app/gui/src/components/AppContainer.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts">
22
import { Dashboard as DashboardReact, type DashboardProps } from '#/pages/dashboard/Dashboard'
33
import { EnsoPath } from '#/services/Backend'
4+
import CommandPalette from '$/components/CommandPalette.vue'
45
import { useBackends } from '$/providers/backends'
56
import { provideContainerData } from '$/providers/container'
67
import { provideOpenedProjects } from '$/providers/openedProjects'
@@ -54,8 +55,10 @@ const openedProjectsStore = provideOpenedProjects()
5455
provideAsyncResources(openedProjectsStore)
5556
provideContainerData()
5657
</script>
58+
5759
<template>
5860
<div class="TabView">
61+
<CommandPalette />
5962
<ContainerDataProviderForReact>
6063
<Dashboard v-bind="props" />
6164
</ContainerDataProviderForReact>

0 commit comments

Comments
 (0)