Promote button logic, delete confirmation, tooltips, and AGENTS.md conventions

U2 — Promote button three-state model:
- showPromote: visible only when a next promotion target exists
- canPromote: enabled only when deployed + no blocking gates
- promoteDisabledReason: tooltip explaining why promotion is disabled
- Added .rdp__btn--disabled style (opacity + pointer-events)

W1 — Script delete confirmation:
- Replace window.confirm() with app-confirm-dialog variant="danger"
- Names the script being deleted in the confirmation message

W2 — Script description tooltip:
- Add [title] binding to truncated description text in scripts table

V1 — Remove duplicate "Profile" h2 in User Preferences tab panel

X1 — Breadcrumb root "Ops" → "Operations" to match sidebar group label

AGENTS.md — Three new mandatory conventions:
- Destructive Action Convention: all deletes/revokes must use app-confirm-dialog
- Truncated Text Convention: all text-overflow:ellipsis elements must have [title]
- Promote Button Convention: three-state (hidden/disabled/enabled) model

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-03-27 13:20:25 +02:00
parent 4912ce86c1
commit 27b2759b00
6 changed files with 98 additions and 10 deletions

View File

@@ -87,6 +87,49 @@ Design and build the StellaOps web user experience that surfaces backend capabil
- 4. Coordinate doc updates, tests, and cross-guild communication whenever contracts or workflows change.
- 5. Revert to `TODO` if you pause the task without shipping changes; leave notes in commit/PR descriptions for context.
## Destructive Action Convention (MANDATORY)
All destructive actions (delete, revoke, purge, reset) **must** use `<app-confirm-dialog>` — never `window.confirm()` or unguarded inline handlers.
**Rules:**
- Every destructive button must open a styled `<app-confirm-dialog>` with `variant="danger"` before executing
- The confirm dialog message must name the resource being destroyed (e.g., "Delete script 'Pre-deploy Health Check'?")
- Include "This cannot be undone." or equivalent irreversibility warning when applicable
- Never perform destructive API calls directly from a `(click)` handler without confirmation
**Pattern:**
```html
<app-confirm-dialog #deleteConfirm
title="Delete Script"
[message]="'Delete script \\'' + item.name + '\\'? This cannot be undone.'"
confirmLabel="Delete" cancelLabel="Cancel" variant="danger"
(confirmed)="executeDelete()" />
```
## Truncated Text Convention (MANDATORY)
All text that may be truncated by CSS (`text-overflow: ellipsis`, table cell overflow, or max-width constraints) **must** have a `[title]` attribute binding to the full untruncated text.
**Rules:**
- Table cells with descriptions, names, digests, or IDs that truncate must include `[title]="fullValue"`
- Metric card labels already have `[title]="label"` (built into `stella-metric-card`) — do not add a second one
- For dynamically computed truncation, prefer `[title]` over custom tooltip directives for simplicity and offline compatibility
- Ensure tooltips are also applied to `<span>` and `<code>` elements inside table cells when they use `text-overflow: ellipsis`
## Promote Button Convention (MANDATORY)
The Promote button on release detail pages must follow a three-state model:
1. **Hidden** — no further promotion path exists (single-environment release, or already at the final environment in the promotion graph)
2. **Disabled** — promotion path exists but preconditions are not met:
- Release is not yet deployed on the current environment (status = `draft`)
- Blocking gates are unresolved
- Tooltip must explain why promotion is disabled
3. **Enabled** — release is deployed, gates are clear, and a next environment exists
Use `showPromote` (computed, boolean) for visibility and `canPromote` (computed, boolean) for the enabled/disabled state.
Use `promoteDisabledReason` (computed, string | null) for the disabled tooltip.
## Metric / KPI Cards Convention (MANDATORY)
All metric badges, stat cards, KPI tiles, and summary indicators **must** use `<stella-metric-card>`.