Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate todo panel title, update assist title/icon #18442

Merged
merged 5 commits into from
Oct 27, 2023
Merged
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
4 changes: 4 additions & 0 deletions src/components/ha-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export class HaButton extends Button {
.trailing-icon {
display: flex;
}
.slot-container {
width: 100%;
overflow: hidden;
}
`,
];
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/ha-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export class HaDialog extends DialogBase {
}
.mdc-dialog__title {
padding: 24px 24px 0 24px;
text-overflow: ellipsis;
overflow: hidden;
}
.mdc-dialog__actions {
padding: 12px 24px 12px 24px;
Expand Down
35 changes: 26 additions & 9 deletions src/panels/todo/ha-panel-todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { ResizeController } from "@lit-labs/observers/resize-controller";
import "@material/mwc-list";
import {
mdiChevronDown,
mdiCommentProcessingOutline,
mdiDelete,
mdiDotsVertical,
mdiInformationOutline,
mdiMicrophone,
mdiPlus,
} from "@mdi/js";
import {
Expand Down Expand Up @@ -173,11 +173,13 @@ class PanelTodo extends LitElement {
.x=${this.mobile ? 0 : undefined}
>
<ha-button slot="trigger">
${this._entityId
? this._entityId in this.hass.states
? computeStateName(this.hass.states[this._entityId])
: this._entityId
: ""}
<div>
${this._entityId
? this._entityId in this.hass.states
? computeStateName(this.hass.states[this._entityId])
: this._entityId
: ""}
</div>
<ha-svg-icon
slot="trailingIcon"
.path=${mdiChevronDown}
Expand All @@ -190,7 +192,7 @@ class PanelTodo extends LitElement {
${this.hass.localize("ui.panel.todo.create_list")}
</ha-list-item>
</ha-button-menu>`
: "Lists"}
: this.hass.localize("panel.todo")}
</div>
<mwc-list slot="pane" activatable>${listItems}</mwc-list>
<ha-list-item graphic="icon" slot="pane-footer" @click=${this._addList}>
Expand All @@ -216,8 +218,9 @@ class PanelTodo extends LitElement {
: nothing}
<li divider role="separator"></li>
<ha-list-item graphic="icon" @click=${this._showVoiceCommandDialog}>
<ha-svg-icon .path=${mdiMicrophone} slot="graphic"> </ha-svg-icon>
${this.hass.localize("ui.panel.todo.start_conversation")}
<ha-svg-icon .path=${mdiCommentProcessingOutline} slot="graphic">
</ha-svg-icon>
${this.hass.localize("ui.panel.todo.assist")}
</ha-list-item>
${entityRegistryEntry?.platform === "local_todo"
? html` <li divider role="separator"></li>
Expand Down Expand Up @@ -335,11 +338,18 @@ class PanelTodo extends LitElement {
:host([mobile]) .lists {
--mdc-menu-min-width: 100vw;
}
:host(:not([mobile])) .lists ha-list-item {
max-width: calc(100vw - 120px);
}
:host([mobile]) ha-button-menu {
--mdc-shape-medium: 0 0 var(--mdc-shape-medium)
var(--mdc-shape-medium);
}
ha-button-menu {
max-width: 100%;
}
ha-button-menu ha-button {
max-width: 100%;
--mdc-theme-primary: currentColor;
--mdc-typography-button-text-transform: none;
--mdc-typography-button-font-size: var(
Expand All @@ -360,6 +370,13 @@ class PanelTodo extends LitElement {
);
--button-height: 40px;
}
ha-button-menu ha-button div {
text-overflow: ellipsis;
width: 100%;
overflow: hidden;
white-space: nowrap;
display: block;
}
`,
];
}
Expand Down
5 changes: 2 additions & 3 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4520,7 +4520,6 @@
"never_triggered": "Never triggered"
},
"todo-list": {
"lists": "To-do Lists",
"checked_items": "Checked items",
"clear_items": "Clear checked items",
"add_item": "Add item",
Expand Down Expand Up @@ -5094,7 +5093,7 @@
"description": "The Sensor card gives you a quick overview of your sensors state with an optional graph to visualize change over time."
},
"todo-list": {
"name": "Todo list",
"name": "To-do list",
"description": "The to-do list card allows you to add, edit, check-off, and clear items from your to-do list.",
"integration_not_loaded": "This card requires the `todo` integration to be set up."
},
Expand Down Expand Up @@ -5515,7 +5514,7 @@
}
},
"todo": {
"start_conversation": "Start conversation",
"assist": "[%key:ui::panel::lovelace::menu::assist%]",
"create_list": "Create list",
"delete_list": "Delete list",
"information": "Information",
Expand Down
Loading