Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dialogs/shortcuts/dialog-shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ const _SHORTCUTS: Section[] = [
descriptionTranslationKey:
"ui.dialogs.shortcuts.searching.search_in_table",
},
{
shortcut: ["N"],
descriptionTranslationKey:
"ui.dialogs.shortcuts.searching.new_in_table",
},
],
},
{
Expand Down
15 changes: 15 additions & 0 deletions src/layouts/hass-tabs-subpage-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,21 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
};
}

protected supportedSingleKeyShortcuts(): SupportedShortcuts {
if (this.hasFab) {
return {
n: () => {
const fab = this.querySelector<HTMLElement>('[slot="fab"]');
if (fab) {
fab.click();
}
},
};
}

return {};
}

private _showPaneController = new ResizeController(this, {
callback: (entries) => entries[0]?.contentRect.width > 750,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,12 @@ class HaConfigIntegrationsDashboard extends KeyboardShortcutMixin(
};
}

protected supportedSingleKeyShortcuts(): SupportedShortcuts {
return {
n: () => this._createFlow(),
};
}

static get styles(): CSSResultGroup {
return [
haStyle,
Expand Down
11 changes: 10 additions & 1 deletion src/panels/config/zone/ha-config-zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ import { configSections } from "../ha-panel-config";
import { showHomeZoneDetailDialog } from "./show-dialog-home-zone-detail";
import { showZoneDetailDialog } from "./show-dialog-zone-detail";
import { slugify } from "../../../common/string/slugify";
import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin";

@customElement("ha-config-zone")
export class HaConfigZone extends SubscribeMixin(LitElement) {
export class HaConfigZone extends KeyboardShortcutMixin(
SubscribeMixin(LitElement)
) {
@property({ attribute: false }) public hass!: HomeAssistant;

@property({ attribute: "is-wide", type: Boolean }) public isWide = false;
Expand Down Expand Up @@ -537,6 +540,12 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
});
}

protected supportedSingleKeyShortcuts(): SupportedShortcuts {
return {
n: () => this._createZone(),
};
}

static styles = css`
hass-loading-screen {
--app-header-background-color: var(--sidebar-background-color);
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,8 @@
"search_command": "search command",
"search_entities": "search entities",
"search_devices": "search devices",
"search_in_table": "to search in tables"
"search_in_table": "to search in tables",
"new_in_table": "to create a new item in tables"
},
"assist": {
"title": "Assist",
Expand Down
Loading