mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add shortcuts item to command quick bar (#24952)
* Add shortcuts item to command quick bar * Remove
This commit is contained in:
parent
74acd7ec38
commit
228acf1fae
@ -5,6 +5,7 @@ import {
|
||||
mdiConsoleLine,
|
||||
mdiDevices,
|
||||
mdiEarth,
|
||||
mdiKeyboard,
|
||||
mdiMagnify,
|
||||
mdiReload,
|
||||
mdiServerNetwork,
|
||||
@ -42,6 +43,7 @@ import { loadVirtualizer } from "../../resources/virtualizer";
|
||||
import type { HomeAssistant } from "../../types";
|
||||
import { showConfirmationDialog } from "../generic/show-dialog-box";
|
||||
import { QuickBarMode, type QuickBarParams } from "./show-dialog-quick-bar";
|
||||
import { showShortcutsDialog } from "../shortcuts/show-shortcuts-dialog";
|
||||
|
||||
interface QuickBarItem extends ScorableTextItem {
|
||||
primaryText: string;
|
||||
@ -736,10 +738,20 @@ export class QuickBar extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
const additionalItems = [
|
||||
{
|
||||
path: "",
|
||||
primaryText: this.hass.localize("ui.panel.config.info.shortcuts"),
|
||||
action: () => showShortcutsDialog(this),
|
||||
iconPath: mdiKeyboard,
|
||||
},
|
||||
];
|
||||
|
||||
return this._finalizeNavigationCommands([
|
||||
...panelItems,
|
||||
...sectionItems,
|
||||
...supervisorItems,
|
||||
...additionalItems,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -816,12 +828,12 @@ export class QuickBar extends LitElement {
|
||||
const categoryKey: CommandItem["categoryKey"] = "navigation";
|
||||
|
||||
const navItem = {
|
||||
...item,
|
||||
iconPath: mdiEarth,
|
||||
categoryText: this.hass.localize(
|
||||
`ui.dialogs.quick-bar.commands.types.${categoryKey}`
|
||||
),
|
||||
action: () => navigate(item.path),
|
||||
...item,
|
||||
};
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user