Файли
openidea/src/features/agents/Automations.module.css
T
Deng Liuтаdengliu 43dac21ac3 fix(automations): support One-shot self-chaining and preserve agent schedule overrides (#7602)
Firing a OneShot automation with allowAgentSchedule disabled it before the agent turn started, so the agent's schedule_next_run failed with "The automation is disabled". Self-scheduling OneShot automations now stay enabled while their run is active and are disabled when the run finishes (or is abandoned) without a future seed or agent override. Saving non-schedule edits no longer wipes a pending agent override: it is kept unless the trigger changed, the automation or self-scheduling was turned off, maxRuns/disableAfter invalidates it, or the user clears it. The Edit dialog, dashboard and session banner show the agent-scheduled next run, with Clear/Keep override in the dialog.

Co-authored-by: dengliu <[email protected]>
2026-12-03 04:49:17 +08:00

749 рядки
13 KiB
CSS

/* Agent Automations editor tab, creation dialog, and status widgets (Islands style). */
.editor {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
overflow-y: auto;
background: var(--bg-editor);
color: var(--fg);
font-size: var(--fs-ui);
}
.column {
display: flex;
flex-direction: column;
flex: 1;
width: 100%;
max-width: 820px;
margin: 0 auto;
padding: 20px 28px 24px;
box-sizing: border-box;
min-height: 0;
}
.header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: var(--space-3);
padding-bottom: 14px;
}
.headerMain {
display: flex;
flex-direction: column;
gap: var(--space-1);
min-width: 0;
}
.headerTitle {
margin: 0;
font-size: 16px;
font-weight: 600;
letter-spacing: -0.01em;
line-height: 1.3;
color: var(--fg-strong);
}
.headerActions {
display: flex;
align-items: center;
flex-shrink: 0;
gap: var(--space-1);
}
.hostMeta {
display: inline-flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
color: var(--fg-muted);
font-size: var(--fs-small);
line-height: 1.4;
}
.statusDot {
width: 7px;
height: 7px;
border-radius: 50%;
flex-shrink: 0;
background: var(--control-off);
}
.statusDotOn {
background: var(--success);
}
.statusDotWarn {
background: var(--warning);
}
.statusDotErr {
background: var(--danger);
}
/* Compact navigation tabs and inline search/filter on one hairline row. */
.navRow {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: var(--space-2);
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.navControls {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
margin-left: auto;
}
.searchWrap {
width: 220px;
max-width: 100%;
min-width: 150px;
}
.tabBadge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 16px;
height: 16px;
padding: 0 3px;
color: var(--fg-muted);
font-size: var(--fs-tiny);
font-variant-numeric: tabular-nums;
line-height: 1;
}
.bannerWarn {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
margin-bottom: 12px;
padding: 8px 12px;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--warning);
color: var(--fg-strong);
font-size: var(--fs-small);
}
.bannerLeft {
display: flex;
align-items: center;
gap: var(--space-1-5);
min-width: 0;
}
.body {
flex: 1;
display: flex;
flex-direction: column;
gap: var(--space-3);
padding: 16px 0 20px;
min-height: 0;
}
/* Framed list with hairline dividers, matching Settings > Agents > Skills. */
.listFrame {
display: flex;
flex-direction: column;
border-radius: var(--radius-control);
background: var(--bg-editor);
box-shadow: inset 0 0 0 1px var(--border);
overflow: hidden;
}
.row {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: var(--space-3);
padding: 10px 12px;
}
.row + .row {
box-shadow: inset 0 1px 0 var(--border);
}
.row:hover {
background: var(--bg-hover);
}
.rowFocused {
background: var(--bg-hover);
box-shadow: inset 2px 0 0 var(--accent);
}
.rowLeft {
display: flex;
align-items: flex-start;
gap: var(--space-2);
flex: 1;
min-width: 0;
}
.rowContent {
display: flex;
flex-direction: column;
gap: var(--space-1);
min-width: 0;
flex: 1;
}
.rowTitleLine {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
min-width: 0;
}
.rowTitle {
font-weight: 600;
color: var(--fg-strong);
overflow: hidden;
text-overflow: ellipsis;
}
.rowSchedule {
color: var(--fg-secondary);
font-size: var(--fs-small);
white-space: nowrap;
}
.rowPrompt {
color: var(--fg-muted);
font-size: var(--fs-small);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.rowMeta {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
font-size: var(--fs-tiny);
color: var(--fg-subtle);
}
.tag {
display: inline-flex;
align-items: center;
gap: var(--space-1);
height: 18px;
padding: 0 6px;
border-radius: var(--radius-small);
background: var(--bg-elev);
color: var(--fg-secondary);
font-size: var(--fs-tiny);
white-space: nowrap;
}
.tagWarn {
color: var(--warning);
}
.tagUnread {
background: var(--accent);
color: #fff;
font-weight: 600;
}
.mono {
font-family: var(--font-mono);
}
.diffAdded {
color: var(--success);
font-family: var(--font-mono);
}
.diffRemoved {
color: var(--danger);
font-family: var(--font-mono);
}
.rowActions {
display: flex;
align-items: center;
gap: var(--space-1);
flex-shrink: 0;
}
/* Open, cardless empty state with a single-column hairline template list. */
.emptySection {
display: flex;
flex-direction: column;
gap: var(--space-3);
padding-top: 4px;
}
.emptyHeader {
display: flex;
flex-direction: column;
gap: var(--space-1);
}
.emptyTitle {
margin: 0;
font-size: 14px;
font-weight: 600;
color: var(--fg-strong);
}
.emptyDesc {
margin: 0;
color: var(--fg-muted);
font-size: var(--fs-small);
line-height: 1.5;
max-width: 600px;
}
.templateRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
width: 100%;
padding: 10px 12px;
border: 0;
background: transparent;
color: var(--fg);
font: inherit;
text-align: left;
}
.templateRow + .templateRow {
box-shadow: inset 0 1px 0 var(--border);
}
.templateRow:hover {
background: var(--bg-hover);
}
.templateMain {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
min-width: 0;
}
.templateTitle {
font-weight: 500;
font-size: var(--fs-ui);
color: var(--fg-strong);
}
.templateSub {
font-size: var(--fs-tiny);
color: var(--fg-muted);
}
.templatePlus {
flex-shrink: 0;
color: var(--fg-muted);
}
.footerBar {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
padding-top: 12px;
border-top: 1px solid var(--border);
color: var(--fg-secondary);
font-size: var(--fs-small);
}
/* Dialog form (aligned to Dialog's 16px titlebar / footer insets). */
.dialogForm {
display: flex;
flex-direction: column;
gap: var(--space-3);
padding: var(--space-1) var(--space-4) var(--space-3);
font-size: var(--fs-ui);
}
.fieldGroup {
display: flex;
flex-direction: column;
gap: var(--space-1);
min-width: 0;
}
.fieldRow {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--space-3);
}
.workspaceRow {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: var(--space-2);
}
.fieldLabel {
font-size: var(--fs-small);
font-weight: 500;
color: var(--fg-secondary);
}
.fieldHint {
font-size: var(--fs-tiny);
color: var(--fg-muted);
line-height: 1.45;
}
/* Unified prompt surface matching the HomeEditor composer frame. */
.promptBox {
display: flex;
flex-direction: column;
border-radius: var(--radius-control);
background: var(--bg-field, var(--bg-button));
box-shadow: inset 0 0 0 1px var(--border-button);
transition: box-shadow var(--dur-fast) var(--ease);
}
.promptBox:focus-within {
box-shadow:
inset 0 0 0 1px var(--focus-ring),
0 0 0 1px var(--focus-ring);
}
.promptTextarea {
width: 100%;
min-height: 84px;
padding: 8px 10px 6px;
border: 0;
background: transparent;
color: var(--fg-strong);
font-family: var(--font-ui, inherit);
font-size: var(--fs-ui);
line-height: 1.5;
resize: vertical;
box-sizing: border-box;
}
.promptTextarea:focus {
outline: none;
}
.promptTextarea::placeholder {
color: var(--fg-faint);
}
/* Standalone monospace textarea used in Import / Export markdown dialogs. */
.codeTextarea {
width: 100%;
min-height: 168px;
padding: 8px 10px;
border: 0;
border-radius: var(--radius-control);
background: var(--bg-field, var(--bg-app));
box-shadow: inset 0 0 0 1px var(--border-button);
color: var(--fg-strong);
font-family: var(--font-mono);
font-size: var(--fs-small);
line-height: 1.5;
resize: vertical;
box-sizing: border-box;
}
.codeTextarea:focus {
outline: none;
box-shadow:
inset 0 0 0 1px var(--focus-ring),
0 0 0 1px var(--focus-ring);
}
.promptBar {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1);
padding: 4px 6px;
border-top: 1px solid var(--border);
}
.weekdayRow {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1);
}
.dayBtn {
height: 24px;
min-width: 34px;
padding: 0 8px;
border-radius: var(--radius-small);
box-shadow: inset 0 0 0 1px var(--border-button);
background: var(--bg-field, var(--bg-app));
color: var(--fg-secondary);
font-size: var(--fs-tiny);
}
.dayBtn:hover {
background: var(--bg-hover);
}
.dayBtnActive {
box-shadow: inset 0 0 0 1px var(--accent);
background: var(--bg-selected);
color: var(--fg-strong);
font-weight: 500;
}
.previewLine {
display: flex;
align-items: baseline;
flex-wrap: wrap;
gap: var(--space-1);
font-size: var(--fs-tiny);
color: var(--fg-muted);
line-height: 1.4;
}
.previewLabel {
color: var(--fg-secondary);
font-weight: 500;
}
.previewError {
color: var(--danger);
}
.overrideCard {
display: flex;
flex-direction: column;
gap: var(--space-1);
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow:
inset 0 0 0 1px var(--border),
inset 2px 0 0 var(--accent);
font-size: var(--fs-small);
}
.overrideCardClearing {
opacity: 0.78;
box-shadow: inset 0 0 0 1px var(--border);
}
.overrideHeader {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: var(--space-2);
}
.overrideTitle {
display: inline-flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
color: var(--fg-strong);
min-width: 0;
}
.overridePrompt {
color: var(--fg-secondary);
font-size: var(--fs-tiny);
line-height: 1.45;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
word-break: break-word;
}
.overrideInline {
font-size: var(--fs-tiny);
color: var(--fg-secondary);
line-height: 1.45;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
word-break: break-word;
}
.provenanceNext {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
color: var(--fg-muted);
font-size: var(--fs-tiny);
}
.advancedSection {
display: flex;
flex-direction: column;
border-top: 1px solid var(--border);
padding-top: 8px;
}
.advancedToggle {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
width: 100%;
padding: 4px 2px;
border-radius: var(--radius-small);
color: var(--fg-secondary);
font-size: var(--fs-small);
font-weight: 500;
text-align: left;
}
.advancedToggle:hover {
color: var(--fg-strong);
}
.advancedTitle {
display: inline-flex;
align-items: center;
gap: var(--space-1);
}
.advancedSummary {
color: var(--fg-muted);
font-size: var(--fs-tiny);
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.advancedBody {
display: flex;
flex-direction: column;
gap: var(--space-3);
padding-top: 10px;
}
.errorBox {
display: flex;
align-items: center;
gap: var(--space-1-5);
padding: 6px 10px;
border-radius: var(--radius-control);
background: var(--bg-feedback-error);
box-shadow: inset 0 0 0 1px var(--border-feedback-error);
color: var(--fg-strong);
font-size: var(--fs-small);
}
/* Session provenance banner & schedule strip */
.provenanceBanner {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: var(--space-2);
padding: 6px 12px;
border-bottom: 1px solid var(--border);
background: var(--bg-elev);
font-size: var(--fs-small);
}
.provenanceLeft {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
min-width: 0;
color: var(--fg-secondary);
}
.provenanceActions {
display: flex;
align-items: center;
gap: var(--space-1);
}
.sessionSchedules {
display: flex;
flex-direction: column;
gap: var(--space-1);
margin-bottom: 6px;
}
.sessionScheduleRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
padding: 4px 8px;
border-radius: var(--radius-control);
background: var(--bg-floating-toolbar);
box-shadow: inset 0 0 0 1px var(--border);
font-size: var(--fs-tiny);
}
.sessionScheduleInfo {
display: flex;
align-items: center;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
overflow: hidden;
}
.sessionSchedulePrompt {
color: var(--fg-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.statusPopover {
display: flex;
flex-direction: column;
gap: var(--space-2);
min-width: 260px;
max-width: 320px;
padding: 10px 12px;
font-size: var(--fs-small);
}
.statusPopoverHeader {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 600;
color: var(--fg-strong);
}
.statusPopoverMeta {
display: flex;
flex-direction: column;
gap: var(--space-1);
color: var(--fg-secondary);
font-size: var(--fs-tiny);
}
.statusPopoverActions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: var(--space-1-5);
padding-top: 4px;
border-top: 1px solid var(--border);
}