Shortcut menu instead of buttons

This commit is contained in:
Zef Hemel
2022-06-17 20:17:22 +02:00
parent 763775cdd3
commit 5fe10e441b
10 changed files with 202 additions and 137 deletions
+4 -5
View File
@@ -9,9 +9,8 @@ export type Notification = {
date: Date;
};
export type ActionButton = {
export type ShortcutItem = {
label: string;
tooltip?: string;
orderId?: number;
run: () => void;
};
@@ -35,7 +34,7 @@ export type AppViewState = {
allPages: Set<PageMeta>;
commands: Map<string, AppCommand>;
notifications: Notification[];
actionButtons: ActionButton[];
shortcutItems: ShortcutItem[];
recentCommands: Map<string, Date>;
showFilterBox: boolean;
@@ -61,7 +60,7 @@ export const initialViewState: AppViewState = {
commands: new Map(),
recentCommands: new Map(),
notifications: [],
actionButtons: [],
shortcutItems: [],
showFilterBox: false,
filterBoxHelpText: "",
filterBoxLabel: "",
@@ -80,7 +79,7 @@ export type Action =
| {
type: "update-commands";
commands: Map<string, AppCommand>;
actionButtons: ActionButton[];
shortcutItems: ShortcutItem[];
}
| { type: "show-palette"; context?: string }
| { type: "hide-palette" }