fix(automation): keep automation flows usable

Use the appropriate dialog sizes, keep the automation form scrollable, preserve readable automation tables in narrow settings panels, clarify the project-wide scope of global triggers, and remove redundant recipe setup copy.
This commit is contained in:
Carlos Valente
2026-09-12 16:53:45 +02:00
parent 5c6824d1fd
commit 95f04e8efc
7 changed files with 24 additions and 31 deletions
@@ -82,10 +82,12 @@ $card-padding: 2rem;
color: $error-red; color: $error-red;
} }
// tables scroll with the panel rather than owning a nested scroll area, // Tables retain the panel's vertical scroll so sticky headers remain anchored
// which keeps the sticky table head anchored to the panel viewport // to the panel viewport. They may scroll horizontally when their columns need
// more room than a narrow settings panel can provide.
.pad { .pad {
padding: 0 var(--panel-card-padding, #{$card-padding}); padding: 0 var(--panel-card-padding, #{$card-padding});
overflow-x: auto;
} }
.table { .table {
@@ -1,14 +1,3 @@
.form {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}
.formScroll {
height: 100%;
}
.outerColumn { .outerColumn {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -22,7 +22,6 @@ import Input from '../../../../common/components/input/input/Input';
import ExternalLink from '../../../../common/components/link/external-link/ExternalLink'; import ExternalLink from '../../../../common/components/link/external-link/ExternalLink';
import Modal from '../../../../common/components/modal/Modal'; import Modal from '../../../../common/components/modal/Modal';
import RadioGroup from '../../../../common/components/radio-group/RadioGroup'; import RadioGroup from '../../../../common/components/radio-group/RadioGroup';
import ScrollArea from '../../../../common/components/scroll-area/ScrollArea';
import Select from '../../../../common/components/select/Select'; import Select from '../../../../common/components/select/Select';
import Tag from '../../../../common/components/tag/Tag'; import Tag from '../../../../common/components/tag/Tag';
import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings'; import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings';
@@ -245,11 +244,10 @@ export default function AutomationForm({ automation, triggers = [], onClose }: A
onClose={onClose} onClose={onClose}
showBackdrop showBackdrop
showCloseButton showCloseButton
size='wide'
title={isEdit ? 'Edit automation' : 'Create automation'} title={isEdit ? 'Edit automation' : 'Create automation'}
bodyElements={ bodyElements={
<form id={formId} onSubmit={handleSubmit(onSubmit)} className={style.form}> <form id={formId} onSubmit={handleSubmit(onSubmit)}>
<ScrollArea className={style.formScroll} contentClassName={style.outerColumn}> <div className={style.outerColumn}>
<div className={style.innerColumn}> <div className={style.innerColumn}>
<h3>Automation options</h3> <h3>Automation options</h3>
<div className={style.titleSection}> <div className={style.titleSection}>
@@ -474,7 +472,7 @@ export default function AutomationForm({ automation, triggers = [], onClose }: A
</DropdownMenu> </DropdownMenu>
</div> </div>
</div> </div>
</ScrollArea> </div>
</form> </form>
} }
footerElements={ footerElements={
@@ -1,5 +1,9 @@
.table td { .table {
min-width: 42rem;
td {
vertical-align: middle; vertical-align: middle;
}
} }
.tags { .tags {
@@ -89,7 +89,7 @@ function RecipePicker({ onClose, onStartEmpty, onSelect }: RecipePickerProps) {
onClose={onClose} onClose={onClose}
showBackdrop showBackdrop
showCloseButton showCloseButton
size='compact' size='default'
title='New automation' title='New automation'
bodyElements={ bodyElements={
<div className={style.picker}> <div className={style.picker}>
@@ -210,7 +210,6 @@ function RecipeSetup({ recipe, onClose, onBack, onCreated }: RecipeSetupProps) {
onClose={onClose} onClose={onClose}
showBackdrop showBackdrop
showCloseButton showCloseButton
size='compact'
title={recipe.title} title={recipe.title}
bodyElements={ bodyElements={
<div className={style.setup}> <div className={style.setup}>
@@ -262,10 +261,6 @@ function RecipeSetup({ recipe, onClose, onBack, onCreated }: RecipeSetupProps) {
))} ))}
</div> </div>
)} )}
<Panel.Description>
Created as a normal automation, which you can edit or delete like any other.
</Panel.Description>
</div> </div>
} }
footerElements={ footerElements={
@@ -0,0 +1,3 @@
.table {
min-width: 36rem;
}
@@ -5,6 +5,7 @@ import { IoAdd } from 'react-icons/io5';
import { deleteTrigger } from '../../../../common/api/automation'; import { deleteTrigger } from '../../../../common/api/automation';
import { maybeAxiosError } from '../../../../common/api/utils'; import { maybeAxiosError } from '../../../../common/api/utils';
import Button from '../../../../common/components/buttons/Button'; import Button from '../../../../common/components/buttons/Button';
import Info from '../../../../common/components/info/Info';
import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings'; import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings';
import * as Panel from '../../panel-utils/PanelUtils'; import * as Panel from '../../panel-utils/PanelUtils';
import useAppSettingsNavigation from '../../useAppSettingsNavigation'; import useAppSettingsNavigation from '../../useAppSettingsNavigation';
@@ -12,6 +13,8 @@ import { checkDuplicates } from './automationUtils';
import TriggerForm from './TriggerForm'; import TriggerForm from './TriggerForm';
import TriggersListItem from './TriggersListItem'; import TriggersListItem from './TriggersListItem';
import style from './TriggersList.module.scss';
type FormState = { type FormState = {
isOpen: boolean; isOpen: boolean;
trigger?: Trigger; trigger?: Trigger;
@@ -77,10 +80,9 @@ export default function TriggersList({ triggers, automations, isLoading }: Trigg
</Panel.SubHeader> </Panel.SubHeader>
<Panel.Divider /> <Panel.Divider />
<Panel.Section> <Panel.Section>
<Panel.Description> <Info>
Triggers are managed from the automation itself. This list is for naming them, or for pointing several <Info.Body>Actions in this section affect the entire project runtime, not just a single event.</Info.Body>
differently named triggers at the same automation. </Info>
</Panel.Description>
{duplicates && ( {duplicates && (
<Panel.Error> <Panel.Error>
You have created multiple links between the same trigger and automation. Duplicate combinations will only You have created multiple links between the same trigger and automation. Duplicate combinations will only
@@ -94,7 +96,7 @@ export default function TriggersList({ triggers, automations, isLoading }: Trigg
: `${orphans} triggers point at automations that no longer exist and will never run.`} : `${orphans} triggers point at automations that no longer exist and will never run.`}
</Panel.Error> </Panel.Error>
)} )}
<Panel.Table> <Panel.Table className={style.table}>
<thead> <thead>
<tr> <tr>
<th style={{ width: '35%' }}>Title</th> <th style={{ width: '35%' }}>Title</th>