mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 12:56:37 +00:00
Align "option" wording and show user-friendly option index in trace timeline (#10059)
This commit is contained in:
parent
c0f3215340
commit
0adc4b33ef
@ -82,7 +82,7 @@ export class HaTracePathDetails extends LitElement {
|
||||
] as ChooseActionTraceStep[];
|
||||
|
||||
if (parentTraceInfo && parentTraceInfo[0]?.result?.choice === "default") {
|
||||
return "The default node was executed because no choices matched.";
|
||||
return "The default action was executed because no options matched.";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -325,13 +325,15 @@ class ActionRenderer {
|
||||
if (defaultExecuted) {
|
||||
this._renderEntry(choosePath, `${name}: Default action executed`);
|
||||
} else if (chooseTrace.result) {
|
||||
const choiceNumeric =
|
||||
chooseTrace.result.choice !== "default"
|
||||
? chooseTrace.result.choice + 1
|
||||
: undefined;
|
||||
const choiceConfig = this._getDataFromPath(
|
||||
`${this.keys[index]}/choose/${chooseTrace.result.choice}`
|
||||
) as ChooseActionChoice | undefined;
|
||||
const choiceName = choiceConfig
|
||||
? `${
|
||||
choiceConfig.alias || `Choice ${chooseTrace.result.choice}`
|
||||
} executed`
|
||||
? `${choiceConfig.alias || `Option ${choiceNumeric}`} executed`
|
||||
: `Error: ${chooseTrace.error}`;
|
||||
this._renderEntry(choosePath, `${name}: ${choiceName}`);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user