Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Redesign the Actions inbox

rcourtmand6387b824132
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 9fd90b1241..019e58f75c 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -630,8 +630,12 @@ AGENT_SURFACE_ID_PULSE_MCP)` and `getAgentSurfaceToolPosturePresentation`,
## Extension Points
-Global Actions review uses the canonical shared `Dialog`, `Button`, and mobile
-navigation primitives. The responsive route must preserve named tabs, keyboard
+Global Actions review uses the canonical shared `Dialog`, `Button`, `Subtabs`,
+`Card`, `MetadataBadge`, and mobile navigation primitives. The Open/History
+selector is an in-page sub-navigation surface and must compose `Subtabs`
+instead of recreating a segmented tablist in `Actions.tsx`; queue rows may own
+action state and resource semantics, but their frame and badge chrome stay on
+the shared primitives. The responsive route must preserve named tabs, keyboard
focus, dialog focus containment, and phone-width overflow checks; journey 83
is the desktop/browser accessibility proof and is not mobile-device proof.
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 4032f136d2..a24ce8a3e0 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -1739,6 +1739,16 @@ no fact card and directs the operator to refresh and review the canonical
record. Execution, verification plus adjacent evidence source, and compensation
remain three independent `ActionResultV2` cards.
+The Actions inbox presents that durable record as a compact operator queue,
+not a stack of equally weighted audit cards. Open work orders approval-required
+decisions before runnable and executing actions; each collapsed row exposes
+only state, action, bounded resource identity, recency, and reason before the
+operator opens the governed review. Opaque canonical resource IDs remain in
+the row's accessible name and title but are visually demoted to a type plus
+short suffix. Read-only demo posture is quiet supporting context rather than a
+page-level callout. The governed review dialog continues to own the full exact
+resource ID, plan, policy evidence, lifecycle, authority, and outcome truth.
+
APT review presents server-recorded policy provenance and distinguishes the
elevated update posture from low-risk-eligible cache cleanup. Both typed actions
declare that no command, path, package selection, removal choice, or reboot
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index afbbb2acec..c1d5a00a99 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -68,6 +68,7 @@ import metadataBadgeSource from '@/components/shared/MetadataBadge.tsx?raw';
import organizationBadgesSource from '@/components/shared/OrganizationBadges.tsx?raw';
import discoveryReadinessBadgeSource from '@/components/shared/DiscoveryReadinessBadge.tsx?raw';
import subtabsSource from '@/components/shared/Subtabs.tsx?raw';
+import actionsSource from '@/pages/Actions.tsx?raw';
import toggleSource from '@/components/shared/Toggle.tsx?raw';
import toggleModelSource from '@/components/shared/toggleModel.ts?raw';
import searchTipsPopoverSource from '@/components/shared/SearchTipsPopover.tsx?raw';
@@ -1162,6 +1163,11 @@ describe('shared primitive guardrails', () => {
expect(subtabsSource).toContain('subtabButtonClass');
});
+ it('keeps the Actions inbox on the canonical in-page subtab primitive', () => {
+ expect(actionsSource).toContain('<Subtabs');
+ expect(actionsSource).not.toContain('role="tablist"');
+ });
+
it('keeps contextual row focus on one shared helper across summary consumers', () => {
expect(contextualFocusSource).toContain(
'export const preserveScrollableAncestorVerticalOffset',
@@ -2495,7 +2501,7 @@ describe('shared primitive guardrails', () => {
'inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-blue-50',
);
expect(patrolIntelligenceWorkspaceSource).toContain('MetadataBadge');
- expect(patrolIntelligenceWorkspaceSource).toContain('findingsBadgePresentation().tone');
+ expect(patrolIntelligenceWorkspaceSource).toContain('tone={group.tone}');
expect(patrolIntelligenceWorkspaceSource).not.toContain(
'findingsBadgePresentation().toneClasses',
);
diff --git a/frontend-modern/src/features/actions/__tests__/actionPresentation.branchcov0713.test.ts b/frontend-modern/src/features/actions/__tests__/actionPresentation.branchcov0713.test.ts
index 7126dd6572..cb4ae08430 100644
--- a/frontend-modern/src/features/actions/__tests__/actionPresentation.branchcov0713.test.ts
+++ b/frontend-modern/src/features/actions/__tests__/actionPresentation.branchcov0713.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest';
import type {
+ ActionAuditRecord,
ActionEvidenceClass,
ActionPolicyAuthorityFactor,
ActionPolicyAuthorityKind,
@@ -8,6 +9,9 @@ import type {
import {
formatActionName,
formatPolicyAuthority,
+ getActionInboxStatePresentation,
+ getActionResourcePresentation,
+ sortOpenActionsForReview,
verificationTruthLabel,
} from '../actionPresentation';
@@ -38,10 +42,22 @@ describe('formatActionName', () => {
['dashed capability is humanized', 'restart-service', 'Restart Service'],
['mixed separators collapse to single spaces', 'restart._-service', 'Restart Service'],
['repeated separators collapse to a single space', 'restart___service', 'Restart Service'],
- ['multi-word capability title-cases each word', 'restart_long_running_service', 'Restart Long Running Service'],
+ [
+ 'multi-word capability title-cases each word',
+ 'restart_long_running_service',
+ 'Restart Long Running Service',
+ ],
['already-spaced phrase is still title-cased', 'restart service', 'Restart Service'],
- ['camelCase token has no separator and only first letter uppercased', 'restartService', 'RestartService'],
- ['leading and trailing separators are trimmed before title-casing', '_restart_service_', 'Restart Service'],
+ [
+ 'camelCase token has no separator and only first letter uppercased',
+ 'restartService',
+ 'RestartService',
+ ],
+ [
+ 'leading and trailing separators are trimmed before title-casing',
+ '_restart_service_',
+ 'Restart Service',
+ ],
['single word is title-cased', 'reboot', 'Reboot'],
['single character is uppercased', 'x', 'X'],
] as const)('regex path: %s', (_name, input, expected) => {
@@ -57,9 +73,12 @@ describe('formatActionName', () => {
expect(formatActionName('')).toBe('');
});
- it.each(['_', '.', '-', '_._', '-_.', '___'])('returns an empty string for an all-separator input %j', (input) => {
- expect(formatActionName(input)).toBe('');
- });
+ it.each(['_', '.', '-', '_._', '-_.', '___'])(
+ 'returns an empty string for an all-separator input %j',
+ (input) => {
+ expect(formatActionName(input)).toBe('');
+ },
+ );
it('throws a TypeError when called with null despite the declared string type', () => {
expect(() => formatActionName(null as unknown as string)).toThrow(TypeError);
@@ -70,6 +89,64 @@ describe('formatActionName', () => {
});
});
+describe('Actions inbox presentation', () => {
+ it.each([
+ ['pending_approval', 'Approval required', 'warning', 'border-l-amber-500'],
+ ['planned', 'Ready to review', 'muted', 'border-l-slate-400'],
+ ['approved', 'Ready to run', 'info', 'border-l-sky-500'],
+ ['executing', 'Running', 'info', 'border-l-blue-500'],
+ ['failed', 'Failed', 'danger', 'border-l-red-500'],
+ ['completed', 'Completed', 'success', 'border-l-emerald-500'],
+ ['rejected', 'Rejected', 'muted', 'border-l-slate-400'],
+ ['expired', 'Expired', 'muted', 'border-l-slate-400'],
+ ] as const)(
+ 'presents %s as an operator-facing queue state',
+ (state, label, tone, accentClass) => {
+ expect(getActionInboxStatePresentation(state)).toEqual({ label, tone, accentClass });
+ },
+ );
+
+ it.each([
+ ['app-container-b66c935311856ba4', 'App container', '…856ba4'],
+ ['vm-7f8b2b6cd98c2089', 'Virtual machine', '…8c2089'],
+ ['agent-acdfdee2953587fb', 'Host agent', '…3587fb'],
+ ['docker:container:edge', 'edge', 'Docker container'],
+ ['proxmox:node:pve-1', 'pve-1', 'Proxmox node'],
+ ['', 'Unknown resource', ''],
+ ] as const)('turns resource id %j into a compact label', (resourceId, label, detail) => {
+ expect(getActionResourcePresentation(resourceId)).toEqual({ label, detail });
+ });
+
+ it('keeps an unrecognized resource id intact', () => {
+ expect(getActionResourcePresentation('storage-pool')).toEqual({
+ label: 'storage-pool',
+ detail: '',
+ });
+ });
+
+ it('sorts decisions before runnable and executing work without mutating the API response', () => {
+ const actions = [
+ { id: 'running', state: 'executing', updatedAt: '2026-07-13T12:03:00Z' },
+ { id: 'approved', state: 'approved', updatedAt: '2026-07-13T12:02:00Z' },
+ { id: 'approval-old', state: 'pending_approval', updatedAt: '2026-07-13T12:00:00Z' },
+ { id: 'approval-new', state: 'pending_approval', updatedAt: '2026-07-13T12:01:00Z' },
+ ] as ActionAuditRecord[];
+
+ expect(sortOpenActionsForReview(actions).map((action) => action.id)).toEqual([
+ 'approval-new',
+ 'approval-old',
+ 'approved',
+ 'running',
+ ]);
+ expect(actions.map((action) => action.id)).toEqual([
+ 'running',
+ 'approved',
+ 'approval-old',
+ 'approval-new',
+ ]);
+ });
+});
+
describe('formatPolicyAuthority', () => {
it.each([
['capability_registry', 'Capability safety policy'],
@@ -80,7 +157,10 @@ describe('formatPolicyAuthority', () => {
});
it('ignores non-kind fields when selecting the label', () => {
- const consulted = makeAuthority('capability_registry', { status: 'consulted', reasonCodes: [] });
+ const consulted = makeAuthority('capability_registry', {
+ status: 'consulted',
+ reasonCodes: [],
+ });
const unavailable = makeAuthority('capability_registry', {
status: 'unavailable',
sourceId: 'other-source',
@@ -107,22 +187,29 @@ describe('verificationTruthLabel', () => {
it.each([
['confirmed', undefined, 'Confirmation lacks an evidence source'],
['confirmed', 'none' as ActionEvidenceClass, 'Confirmation lacks an evidence source'],
- ] as const)('reports a confirmed status without independent/agent evidence (%s, %s)', (status, evidenceClass, expected) => {
- expect(verificationTruthLabel(status, evidenceClass)).toBe(expected);
- });
+ ] as const)(
+ 'reports a confirmed status without independent/agent evidence (%s, %s)',
+ (status, evidenceClass, expected) => {
+ expect(verificationTruthLabel(status, evidenceClass)).toBe(expected);
+ },
+ );
it('credits an independent observer for a confirmed outcome', () => {
- expect(verificationTruthLabel('confirmed', 'independent')).toBe('Confirmed by independent observer');
+ expect(verificationTruthLabel('confirmed', 'independent')).toBe(
+ 'Confirmed by independent observer',
+ );
});
it('credits the executing agent for a confirmed outcome', () => {
- expect(verificationTruthLabel('confirmed', 'agent_attested')).toBe('Confirmed by executing agent');
+ expect(verificationTruthLabel('confirmed', 'agent_attested')).toBe(
+ 'Confirmed by executing agent',
+ );
});
it('routes an unrecognized evidence class to the "lacks an evidence source" arm without throwing', () => {
- expect(
- verificationTruthLabel('confirmed', 'bogus' as unknown as ActionEvidenceClass),
- ).toBe('Confirmation lacks an evidence source');
+ expect(verificationTruthLabel('confirmed', 'bogus' as unknown as ActionEvidenceClass)).toBe(
+ 'Confirmation lacks an evidence source',
+ );
});
it.each([
diff --git a/frontend-modern/src/features/actions/actionPresentation.ts b/frontend-modern/src/features/actions/actionPresentation.ts
index da2a8b7951..a74956da6b 100644
--- a/frontend-modern/src/features/actions/actionPresentation.ts
+++ b/frontend-modern/src/features/actions/actionPresentation.ts
@@ -1,9 +1,12 @@
import type {
+ ActionAuditRecord,
+ ActionAuditState,
ActionEvidenceClass,
ActionPolicyAuthorityFactor,
ActionPolicyReasonCode,
ActionVerificationTruthStatus,
} from '@/types/actionAudit';
+import type { MetadataBadgeTone } from '@/components/shared/MetadataBadge';
export const formatActionName = (value: string): string =>
value === 'install_os_updates'
@@ -11,9 +14,103 @@ export const formatActionName = (value: string): string =>
: value === 'clean_package_cache'
? 'Clear downloaded package data'
: value
- .replace(/[._-]+/g, ' ')
- .trim()
- .replace(/\b\w/g, (letter) => letter.toUpperCase());
+ .replace(/[._-]+/g, ' ')
+ .trim()
+ .replace(/\b\w/g, (letter) => letter.toUpperCase());
+
+export interface ActionInboxStatePresentation {
+ accentClass: string;
+ label: string;
+ tone: MetadataBadgeTone;
+}
+
+const ACTION_INBOX_STATE_PRESENTATION: Record<ActionAuditState, ActionInboxStatePresentation> = {
+ planned: { accentClass: 'border-l-slate-400', label: 'Ready to review', tone: 'muted' },
+ pending_approval: {
+ accentClass: 'border-l-amber-500',
+ label: 'Approval required',
+ tone: 'warning',
+ },
+ approved: { accentClass: 'border-l-sky-500', label: 'Ready to run', tone: 'info' },
+ executing: { accentClass: 'border-l-blue-500', label: 'Running', tone: 'info' },
+ completed: { accentClass: 'border-l-emerald-500', label: 'Completed', tone: 'success' },
+ failed: { accentClass: 'border-l-red-500', label: 'Failed', tone: 'danger' },
+ rejected: { accentClass: 'border-l-slate-400', label: 'Rejected', tone: 'muted' },
+ expired: { accentClass: 'border-l-slate-400', label: 'Expired', tone: 'muted' },
+};
+
+export const getActionInboxStatePresentation = (
+ state: ActionAuditState,
+): ActionInboxStatePresentation => ACTION_INBOX_STATE_PRESENTATION[state];
+
+const OPEN_ACTION_PRIORITY: Record<ActionAuditState, number> = {
+ pending_approval: 0,
+ planned: 1,
+ approved: 1,
+ executing: 2,
+ failed: 3,
+ completed: 4,
+ rejected: 4,
+ expired: 4,
+};
+
+export const sortOpenActionsForReview = (
+ actions: readonly ActionAuditRecord[],
+): ActionAuditRecord[] =>
+ [...actions].sort((left, right) => {
+ const priority = OPEN_ACTION_PRIORITY[left.state] - OPEN_ACTION_PRIORITY[right.state];
+ if (priority !== 0) return priority;
+ return Date.parse(right.updatedAt) - Date.parse(left.updatedAt);
+ });
+
+export interface ActionResourcePresentation {
+ detail: string;
+ label: string;
+}
+
+const OPAQUE_RESOURCE_SUFFIX = /^(?:[a-f\d]{12,}|[a-z\d]{16,})$/i;
+
+const compactOpaqueSuffix = (value: string): string => `…${value.slice(-6)}`;
+
+const DASHED_RESOURCE_PREFIXES: Array<{ prefix: string; label: string }> = [
+ { prefix: 'app-container', label: 'App container' },
+ { prefix: 'agent', label: 'Host agent' },
+ { prefix: 'vm', label: 'Virtual machine' },
+];
+
+const CANONICAL_RESOURCE_KINDS: Record<string, string> = {
+ 'docker:container': 'Docker container',
+ 'proxmox:node': 'Proxmox node',
+ 'proxmox:vm': 'Proxmox virtual machine',
+ 'proxmox:lxc': 'Proxmox container',
+};
+
+export const getActionResourcePresentation = (resourceId: string): ActionResourcePresentation => {
+ const normalized = resourceId.trim();
+ if (!normalized) return { label: 'Unknown resource', detail: '' };
+
+ const canonicalParts = normalized.split(':').filter(Boolean);
+ if (canonicalParts.length > 1) {
+ const name = canonicalParts.at(-1) || normalized;
+ const kindKey = canonicalParts.slice(0, -1).join(':').toLowerCase();
+ const kind = CANONICAL_RESOURCE_KINDS[kindKey] || formatActionName(kindKey);
+ return OPAQUE_RESOURCE_SUFFIX.test(name)
+ ? { label: kind, detail: compactOpaqueSuffix(name) }
+ : { label: name, detail: kind };
+ }
+
+ for (const candidate of DASHED_RESOURCE_PREFIXES) {
+ const prefix = `${candidate.prefix}-`;
+ if (!normalized.toLowerCase().startsWith(prefix)) continue;
+ const suffix = normalized.slice(prefix.length);
+ return {
+ label: candidate.label,
+ detail: OPAQUE_RESOURCE_SUFFIX.test(suffix) ? compactOpaqueSuffix(suffix) : suffix,
+ };
+ }
+
+ return { label: normalized, detail: '' };
+};
export const formatPolicyAuthority = (factor: ActionPolicyAuthorityFactor): string => {
switch (factor.kind) {
@@ -65,7 +162,10 @@ export const formatEvidenceClass = (value: ActionEvidenceClass): string => {
}
};
-export const verificationTruthLabel = (status: ActionVerificationTruthStatus, evidenceClass?: ActionEvidenceClass): string => {
+export const verificationTruthLabel = (
+ status: ActionVerificationTruthStatus,
+ evidenceClass?: ActionEvidenceClass,
+): string => {
switch (status) {
case 'confirmed':
return evidenceClass === 'independent'
diff --git a/frontend-modern/src/pages/Actions.tsx b/frontend-modern/src/pages/Actions.tsx
index 95da1d5054..61759c8388 100644
--- a/frontend-modern/src/pages/Actions.tsx
+++ b/frontend-modern/src/pages/Actions.tsx
@@ -1,10 +1,20 @@
-import { For, Show, createEffect, createSignal } from 'solid-js';
+import { For, Show, createEffect, createMemo, createSignal } from 'solid-js';
+import ChevronRightIcon from 'lucide-solid/icons/chevron-right';
+import EyeIcon from 'lucide-solid/icons/eye';
import RefreshCwIcon from 'lucide-solid/icons/refresh-cw';
import { ResourceActionsAPI } from '@/api/resourceActions';
import { Button } from '@/components/shared/Button';
+import { Card } from '@/components/shared/Card';
+import { MetadataBadge } from '@/components/shared/MetadataBadge';
import { PageHeader } from '@/components/shared/PageHeader';
+import { Subtabs } from '@/components/shared/Subtabs';
import { ActionReviewDialog } from '@/features/actions/ActionReviewDialog';
-import { formatActionName } from '@/features/actions/actionPresentation';
+import {
+ formatActionName,
+ getActionInboxStatePresentation,
+ getActionResourcePresentation,
+ sortOpenActionsForReview,
+} from '@/features/actions/actionPresentation';
import type { ActionAuditRecord, ActionDetailResponse, ActionInboxView } from '@/types/actionAudit';
import { formatRelativeTime } from '@/utils/format';
@@ -38,6 +48,22 @@ export function Actions() {
void loadActions();
});
+ const queueSummary = createMemo(() => {
+ const count = actions().length;
+ if (view() === 'settled') {
+ return `${count} recorded ${count === 1 ? 'outcome' : 'outcomes'}`;
+ }
+ const approvals = actions().filter((action) => action.state === 'pending_approval').length;
+ const base = `${count} open ${count === 1 ? 'action' : 'actions'}`;
+ return approvals > 0
+ ? `${base} · ${approvals} ${approvals === 1 ? 'awaits' : 'await'} approval`
+ : base;
+ });
+
+ const displayedActions = createMemo(() =>
+ view() === 'pending' ? sortOpenActionsForReview(actions()) : actions(),
+ );
+
const openAction = async (record: ActionAuditRecord) => {
setDetailError('');
try {
@@ -48,48 +74,45 @@ export function Actions() {
};
return (
- <div class="mx-auto w-full max-w-6xl space-y-5 px-3 py-4 sm:px-5">
+ <div class="mx-auto w-full max-w-6xl space-y-4 px-3 py-4 sm:px-5">
<PageHeader
title="Actions"
- description="Review every pending change and its recorded outcome in one place."
- />
- <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
- <div
- role="tablist"
- aria-label="Action views"
- class="inline-flex rounded-lg border border-border bg-surface p-1"
- >
- <button
- role="tab"
- aria-selected={view() === 'pending'}
- class={`rounded px-4 py-2 text-sm font-medium ${view() === 'pending' ? 'bg-blue-600 text-white' : 'text-muted hover:text-base-content'}`}
- onClick={() => setView('pending')}
- >
- Needs attention
- </button>
- <button
- role="tab"
- aria-selected={view() === 'settled'}
- class={`rounded px-4 py-2 text-sm font-medium ${view() === 'settled' ? 'bg-blue-600 text-white' : 'text-muted hover:text-base-content'}`}
- onClick={() => setView('settled')}
+ description="Review proposed infrastructure changes and track their outcomes."
+ actions={
+ <Button
+ variant="ghost"
+ size="sm"
+ aria-label="Refresh actions"
+ onClick={() => void loadActions()}
+ isLoading={loading()}
>
- History
- </button>
- </div>
- <Button
- aria-label="Refresh actions"
- onClick={() => void loadActions()}
- isLoading={loading()}
- >
- <RefreshCwIcon class="mr-2 h-4 w-4" />
- Refresh
- </Button>
- </div>
+ <RefreshCwIcon class="mr-2 h-4 w-4" />
+ Refresh
+ </Button>
+ }
+ />
+ <Subtabs
+ value={view()}
+ onChange={(nextView) => setView(nextView as ActionInboxView)}
+ tabs={[
+ { value: 'pending', label: 'Open' },
+ { value: 'settled', label: 'History' },
+ ]}
+ ariaLabel="Action views"
+ trailing={
+ <Show when={!loading() && actions().length > 0}>
+ <span class="pb-2 text-xs text-muted">{queueSummary()}</span>
+ </Show>
+ }
+ />
<Show when={readOnly()}>
- <div class="rounded-lg border border-blue-300 bg-blue-50 p-3 text-sm text-blue-900 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-100">
- Mock action history is read-only. Open any record to inspect its plan, policy evidence,
- lifecycle, and outcome.
+ <div class="flex items-center gap-2 rounded-md border border-border-subtle bg-surface-alt/50 px-3 py-2 text-xs text-muted">
+ <EyeIcon class="h-4 w-4 shrink-0" aria-hidden="true" />
+ <span>
+ <strong class="font-medium text-base-content">Read-only demo data.</strong> You can
+ inspect plans, policy evidence, and recorded outcomes.
+ </span>
</div>
</Show>
@@ -116,7 +139,7 @@ export function Actions() {
<Show when={!loading() && !loadError() && actions().length === 0}>
<div
data-testid="actions-calm-state"
- class="rounded-xl border border-dashed border-border bg-surface p-8 text-center"
+ class="rounded-md border border-dashed border-border bg-surface p-6 text-center"
>
<h2 class="text-lg font-semibold">
{view() === 'pending' ? 'No actions need attention' : 'No action history yet'}
@@ -129,42 +152,67 @@ export function Actions() {
</div>
</Show>
<Show when={actions().length > 0}>
- <ul
- class="space-y-3"
- aria-label={view() === 'pending' ? 'Actions needing attention' : 'Action history'}
- >
- <For each={actions()}>
- {(action) => (
- <li>
- <button
- type="button"
- class="w-full rounded-xl border border-border bg-surface p-4 text-left transition hover:border-blue-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-500"
- onClick={() => void openAction(action)}
- >
- <div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
- <div class="min-w-0">
- <div class="font-semibold">
- {formatActionName(action.request.capabilityName)}
- </div>
- <div class="mt-1 break-all text-sm text-muted">
- {action.request.resourceId}
- </div>
- <p class="mt-2 text-sm">{action.request.reason}</p>
- </div>
- <div class="shrink-0 text-left sm:text-right">
- <span class="inline-flex rounded-full border border-border-subtle bg-surface-hover px-2.5 py-1 text-xs font-medium">
- {formatActionName(action.state)}
- </span>
- <div class="mt-2 text-xs text-muted">
- {formatRelativeTime(action.updatedAt)}
+ <Card padding="none" class="overflow-hidden" data-testid="actions-queue">
+ <ul
+ class="divide-y divide-border-subtle"
+ aria-label={view() === 'pending' ? 'Open actions' : 'Action history'}
+ >
+ <For each={displayedActions()}>
+ {(action) => {
+ const state = () => getActionInboxStatePresentation(action.state);
+ const resource = () => getActionResourcePresentation(action.request.resourceId);
+ const title = () => formatActionName(action.request.capabilityName);
+ return (
+ <li>
+ <button
+ type="button"
+ aria-label={`Review ${title()} on ${action.request.resourceId}, ${state().label}`}
+ class={`group w-full border-l-2 px-3 py-3 text-left transition-colors hover:bg-surface-hover/70 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-500 sm:px-4 ${state().accentClass}`}
+ onClick={() => void openAction(action)}
+ >
+ <div class="flex items-center gap-3">
+ <div class="min-w-0 flex-1">
+ <div class="flex flex-wrap items-center gap-2">
+ <MetadataBadge
+ tone={state().tone}
+ size="xs"
+ shape="rounded"
+ appearance="outline"
+ >
+ {state().label}
+ </MetadataBadge>
+ <span class="truncate text-sm font-semibold text-base-content">
+ {title()}
+ </span>
+ </div>
+ <div
+ class="mt-1 flex min-w-0 items-center gap-1.5 text-xs text-muted"
+ title={action.request.resourceId}
+ >
+ <span class="truncate">{resource().label}</span>
+ <Show when={resource().detail}>
+ <span aria-hidden="true">·</span>
+ <span class="truncate font-mono text-[11px]">
+ {resource().detail}
+ </span>
+ </Show>
+ <span aria-hidden="true">·</span>
+ <span class="shrink-0">{formatRelativeTime(action.updatedAt)}</span>
+ </div>
+ <p class="mt-1.5 truncate text-sm text-muted">{action.request.reason}</p>
+ </div>
+ <span class="inline-flex shrink-0 items-center gap-1 rounded border border-border px-2 py-1 text-xs font-medium text-muted transition-colors group-hover:bg-surface group-hover:text-base-content">
+ Review
+ <ChevronRightIcon class="h-3.5 w-3.5" aria-hidden="true" />
+ </span>
</div>
- </div>
- </div>
- </button>
- </li>
- )}
- </For>
- </ul>
+ </button>
+ </li>
+ );
+ }}
+ </For>
+ </ul>
+ </Card>
</Show>
<ActionReviewDialog
detail={selected()}
diff --git a/tests/integration/tests/81-actions-inbox.spec.ts b/tests/integration/tests/81-actions-inbox.spec.ts
index b56fba93f7..a379250001 100644
--- a/tests/integration/tests/81-actions-inbox.spec.ts
+++ b/tests/integration/tests/81-actions-inbox.spec.ts
@@ -102,6 +102,12 @@ test("Actions inbox exposes the canonical decision packet and durable calm histo
await page.route("**/api/actions/action-1", (route) => route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ audit: action, events: [] }) }));
await page.goto("/actions", { waitUntil: "domcontentloaded" });
await expect(page.getByRole("heading", { name: "Actions" })).toBeVisible();
+ await expect(page.getByRole("tab", { name: "Open", exact: true })).toHaveAttribute("aria-selected", "true");
+ const openActions = page.getByRole("list", { name: "Open actions" });
+ await expect(openActions).toBeVisible();
+ await expect(openActions.getByText("Approval required")).toBeVisible();
+ await expect(openActions.getByText("edge", { exact: true })).toBeVisible();
+ await expect(openActions.getByText("Docker container", { exact: true })).toBeVisible();
await page.getByRole("button", { name: /Restart.*docker:container:edge/ }).click();
await expect(page.getByRole("dialog", { name: "Restart" })).toBeVisible();
await expect(page.getByText("Capability safety policy")).toBeVisible();