style(web): fix prettier config, format entire web/ tree
.prettierrc.json was missing "semi": false, so prettier wanted to add semicolons to a codebase written without them (763 semicolon-free statements vs. 150 with, in hand-written .ts; zero hand-written .svelte files use them at all). That's why prettier --check failed on 249 files — not because the code was unformatted, but because the config didn't match the actual house style. Added "semi": false; left printWidth/etc as configured (printWidth barely moves the failure count: 218/213/212 files at 100/120/140). Ran `prettier --write .` with the corrected config. Verified semantics-preserving before and after: - eslint: 142 problems both before and after, byte-identical - build passes, 38/38 tests pass - token-stream diff (whitespace/semicolons/quotes normalized) on all 218 changed files: only 52 had any remaining token change, all either trailing-comma removal (matching trailingComma: "none") or import/ ternary reflow — no semantic changes - live smoke test: Knowledge, Tasks, Fleet map, and a chat window (AgentTrace, markdown, Scope graph, activity rail) all render correctly, no console errors Most of the diff is shadcn/ui vendor files (lib/components/ui/) moving from the CLI's own style (double quotes, tabs, semicolons) to house style; re-running `shadcn-svelte add` on a component will need a follow-up format pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -73,32 +73,116 @@
|
||||
const pendingApprovals = $derived(approvals.filter((a) => a.status === 'pending'))
|
||||
const decidedApprovals = $derived(approvals.filter((a) => a.status !== 'pending'))
|
||||
|
||||
const pendingColumns = $derived.by(() => [
|
||||
{ key: 'subject', header: 'Subject', class: 'font-mono text-xs', width: '180px', accessor: (a: Approval) => a.subject ?? '—', truncate: true },
|
||||
{ key: 'action', header: 'Action', truncate: true },
|
||||
{ key: 'risk_class', header: 'Risk', render: 'status-badge', renderProps: { kind: 'risk' }, width: '120px' },
|
||||
{ key: 'status', header: 'Status', render: 'status-badge', renderProps: { kind: 'execution' }, width: '100px' },
|
||||
{ key: 'expires_at', header: 'Expires', render: 'date', width: '170px' },
|
||||
{ key: '_actions', header: '', render: ApprovalActions,
|
||||
renderProps: { deciding, onApprove: (id: string) => decide(id, 'approve'), onDeny: (id: string) => decide(id, 'deny') },
|
||||
align: 'right', headerClass: 'text-right', width: '220px' },
|
||||
] as DataTableColumn<Approval>[])
|
||||
const pendingColumns = $derived.by(
|
||||
() =>
|
||||
[
|
||||
{
|
||||
key: 'subject',
|
||||
header: 'Subject',
|
||||
class: 'font-mono text-xs',
|
||||
width: '180px',
|
||||
accessor: (a: Approval) => a.subject ?? '—',
|
||||
truncate: true
|
||||
},
|
||||
{ key: 'action', header: 'Action', truncate: true },
|
||||
{
|
||||
key: 'risk_class',
|
||||
header: 'Risk',
|
||||
render: 'status-badge',
|
||||
renderProps: { kind: 'risk' },
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
key: 'status',
|
||||
header: 'Status',
|
||||
render: 'status-badge',
|
||||
renderProps: { kind: 'execution' },
|
||||
width: '100px'
|
||||
},
|
||||
{ key: 'expires_at', header: 'Expires', render: 'date', width: '170px' },
|
||||
{
|
||||
key: '_actions',
|
||||
header: '',
|
||||
render: ApprovalActions,
|
||||
renderProps: {
|
||||
deciding,
|
||||
onApprove: (id: string) => decide(id, 'approve'),
|
||||
onDeny: (id: string) => decide(id, 'deny')
|
||||
},
|
||||
align: 'right',
|
||||
headerClass: 'text-right',
|
||||
width: '220px'
|
||||
}
|
||||
] as DataTableColumn<Approval>[]
|
||||
)
|
||||
|
||||
const decidedColumns: DataTableColumn<Approval>[] = [
|
||||
{ key: 'subject', header: 'Subject', class: 'font-mono text-xs', width: '180px', accessor: (a) => a.subject ?? '—', truncate: true },
|
||||
{
|
||||
key: 'subject',
|
||||
header: 'Subject',
|
||||
class: 'font-mono text-xs',
|
||||
width: '180px',
|
||||
accessor: (a) => a.subject ?? '—',
|
||||
truncate: true
|
||||
},
|
||||
{ key: 'action', header: 'Action', truncate: true },
|
||||
{ key: 'status', header: 'Status', render: 'status-badge', renderProps: { kind: 'execution' }, width: '100px' },
|
||||
{ key: 'decided_at', header: 'Decided', render: 'date', width: '170px', accessor: (a) => a.decided_at ?? '—' },
|
||||
{
|
||||
key: 'status',
|
||||
header: 'Status',
|
||||
render: 'status-badge',
|
||||
renderProps: { kind: 'execution' },
|
||||
width: '100px'
|
||||
},
|
||||
{
|
||||
key: 'decided_at',
|
||||
header: 'Decided',
|
||||
render: 'date',
|
||||
width: '170px',
|
||||
accessor: (a) => a.decided_at ?? '—'
|
||||
}
|
||||
]
|
||||
|
||||
const activityColumns: DataTableColumn<ActivityItem>[] = [
|
||||
{ key: 'target', header: 'Target', class: 'font-mono text-xs', width: '180px', accessor: (a) => a.target ?? '—', truncate: true },
|
||||
{
|
||||
key: 'target',
|
||||
header: 'Target',
|
||||
class: 'font-mono text-xs',
|
||||
width: '180px',
|
||||
accessor: (a) => a.target ?? '—',
|
||||
truncate: true
|
||||
},
|
||||
{ key: '_action', header: 'Action', render: ActivityAction, truncate: true },
|
||||
{ key: 'risk_class', header: 'Risk', render: 'status-badge', renderProps: { kind: 'risk' }, width: '120px' },
|
||||
{ key: 'status', header: 'Status', render: 'status-badge', renderProps: { kind: 'execution' }, width: '110px' },
|
||||
{ key: 'duration_ms', header: 'Duration', render: DurationRenderer, width: '90px', align: 'right' },
|
||||
{
|
||||
key: 'risk_class',
|
||||
header: 'Risk',
|
||||
render: 'status-badge',
|
||||
renderProps: { kind: 'risk' },
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
key: 'status',
|
||||
header: 'Status',
|
||||
render: 'status-badge',
|
||||
renderProps: { kind: 'execution' },
|
||||
width: '110px'
|
||||
},
|
||||
{
|
||||
key: 'duration_ms',
|
||||
header: 'Duration',
|
||||
render: DurationRenderer,
|
||||
width: '90px',
|
||||
align: 'right'
|
||||
},
|
||||
{ key: 'created_at', header: 'When', render: 'relative-time', width: '100px' },
|
||||
{ key: '_cancel', header: '', render: ActivityCancel, renderProps: { onCancel: cancel }, align: 'right', headerClass: 'text-right', width: '100px' },
|
||||
{
|
||||
key: '_cancel',
|
||||
header: '',
|
||||
render: ActivityCancel,
|
||||
renderProps: { onCancel: cancel },
|
||||
align: 'right',
|
||||
headerClass: 'text-right',
|
||||
width: '100px'
|
||||
}
|
||||
]
|
||||
</script>
|
||||
|
||||
@@ -108,13 +192,19 @@
|
||||
<Tabs.Root value="approvals" class="flex flex-1 flex-col overflow-hidden">
|
||||
<Tabs.List>
|
||||
<Tabs.Trigger value="approvals">
|
||||
Approvals {#if pendingApprovals.length}<Badge variant="destructive" class="ml-1">{pendingApprovals.length}</Badge>{/if}
|
||||
Approvals {#if pendingApprovals.length}<Badge variant="destructive" class="ml-1"
|
||||
>{pendingApprovals.length}</Badge
|
||||
>{/if}
|
||||
</Tabs.Trigger>
|
||||
<Tabs.Trigger value="executions">Activity</Tabs.Trigger>
|
||||
</Tabs.List>
|
||||
|
||||
<Tabs.Content value="approvals" class="flex-1 overflow-auto">
|
||||
<DataTable columns={pendingColumns} data={pendingApprovals} emptyMessage="No pending approvals." />
|
||||
<DataTable
|
||||
columns={pendingColumns}
|
||||
data={pendingApprovals}
|
||||
emptyMessage="No pending approvals."
|
||||
/>
|
||||
|
||||
{#if decidedApprovals.length}
|
||||
<p class="mt-4 text-xs text-muted-foreground">Recently decided</p>
|
||||
|
||||
Reference in New Issue
Block a user