fix(ui): trim view prose, en dash placeholders, collapse fixed grids on phones

Drop empty-state essays that repeated their titles, the harness native select
becomes the Select component, and the binding and source forms collapse to one
column below sm. Issue-ID and history narration removed from comments.
This commit is contained in:
sam committed 2026-10-18 15:02:00 +11:00
1 parent f1b33eb6f9
commit 686da8be4d
16 files changed
+58 -63

No files matched your search

+2 -2
View File
@@ -235,7 +235,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
>({{ spec.type }}{{ spec.required ? ", required" : "" }})</span
>
</FieldLabel>
<div class="grid grid-cols-2 items-start gap-3">
<div class="grid grid-cols-1 items-start gap-3 sm:grid-cols-2">
<Select
:model-value="inputSource(name)"
@update:model-value="setInputSource(name, $event)"
@@ -292,7 +292,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
</Field>
<Field v-if="takesRepository(workflow) && !draft.repoParam">
<div class="grid grid-cols-2 items-start gap-3">
<div class="grid grid-cols-1 items-start gap-3 sm:grid-cols-2">
<Field>
<FieldLabel for="binding-owner">Pinned owner</FieldLabel>
<Input id="binding-owner" v-model="draft.owner" />
+2 -2
View File
@@ -53,11 +53,11 @@ const emit = defineEmits<{
class="max-w-56 truncate font-mono text-xs text-fg-muted"
:title="props.binding.filter"
>
{{ props.binding.filter || "—" }}
{{ props.binding.filter || "–" }}
</TableCell>
<TableCell>
<div class="flex items-center gap-2">
{{ props.binding.workflow || "—" }}
{{ props.binding.workflow || "–" }}
<Badge v-if="props.binding.workflow_disabled" variant="warn">Disabled</Badge>
<Badge
v-if="failing"
+1 -2
View File
@@ -16,8 +16,7 @@ import { useBindings } from "./use-bindings";
* workflow together, with a draft -> pending_approval -> armed state machine so nothing
* self-arms. See docs/architecture/bindings.md and
* docs/prds/payload-field-mapping.md. Owner/Repo optionally pin a multi-repo
* deployment's dispatch target (archie-core-t2db.8's backend fix, commit
* ac42f64).
* deployment's dispatch target.
*/
const {
-1
View File
@@ -62,7 +62,6 @@ const failureTitle = computed(() =>
<Empty v-else-if="!loading && !rows.length">
<EmptyHeader>
<EmptyTitle>No bindings yet</EmptyTitle>
<EmptyDescription>None yet. A mapping + a workflow make a binding.</EmptyDescription>
</EmptyHeader>
</Empty>
+1 -1
View File
@@ -246,7 +246,7 @@ export function repoPin(binding: Binding): string {
if (binding.repo_param) return `from ${binding.repo_param}`;
return binding.owner && binding.repo
? `${binding.owner}/${binding.repo}`
: "—";
: "–";
}
/** The event type a row shows: its mapping's. */
+1 -1
View File
@@ -65,7 +65,7 @@ function open(): void {
</div>
</TableCell>
<TableCell class="font-mono">{{
props.capture.content_type || "—"
props.capture.content_type || "–"
}}</TableCell>
<TableCell class="text-right">
<ChevronRight class="size-4 text-fg-subtle" />
+1 -1
View File
@@ -52,7 +52,7 @@ import { captures, enabled, error, loading } from "./state";
<EmptyHeader>
<EmptyMedia variant="icon"><Inbox /></EmptyMedia>
<EmptyTitle>No captures yet</EmptyTitle>
<EmptyDescription>No captures. Add a source.</EmptyDescription>
<EmptyDescription>Add a source to start receiving events.</EmptyDescription>
</EmptyHeader>
</Empty>
-2
View File
@@ -21,7 +21,6 @@ import {
import { Button } from "@/components/ui/button";
import {
Empty,
EmptyDescription,
EmptyHeader,
EmptyTitle,
} from "@/components/ui/empty";
@@ -163,7 +162,6 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
<Empty v-if="!proposals.length && !eventTypes.length">
<EmptyHeader>
<EmptyTitle>No event types yet</EmptyTitle>
<EmptyDescription>Nothing is dispatched until a type matches.</EmptyDescription>
</EmptyHeader>
</Empty>
</CardContent>
+6 -12
View File
@@ -32,19 +32,13 @@ import { loadEventCounts, type EventsCounts } from "./counts";
* because they are one chain read in order -- an event, the mapping that names
* its fields, the binding that decides what runs.
*
* The numbered strip is the page's ONLY navigation. It used to be joined by a
* tab list naming the same three panels a second time ("Inspector | Mappings |
* Bindings" under "Capture | Map | Bind"), which read as one wizard drawn
* twice. The strip keeps the verbs; the URL keeps the ids.
* The numbered strip is the page's only navigation. The open step is the query
* string's (`?tab=`), so a step is a link and survives a reload, and switching
* is a `replace`: walking the chain adds no history to back out through. A
* capture's own selection rides alongside it (`?capture=`), so returning to
* Capture lands on the record that was open.
*
* The open step is the query string's (`?tab=`), so a step is a link and
* survives a reload, and switching is a `replace`: walking the chain adds no
* history to back out through. A capture's own selection rides alongside it
* (`?capture=`), so returning to Capture lands on the record that was open.
*
* Which steps exist, and which one is showing, is decided in tab-selection.ts --
* this file owns the components and the address bar, that file owns the rule,
* and the rule is unit-tested without a browser.
* Which steps exist, and which one is showing, is decided in tab-selection.ts.
*/
const PANELS: Record<string, Component> = {
inspector: CapturesPage,
+32 -24
View File
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select";
/**
* Harness: the OAuth credential bindings a Kit profile resolves, and the
* setup terminal that captures a binding's tokens
@@ -18,10 +17,18 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import {
Empty,
EmptyDescription,
EmptyHeader,
EmptyTitle,
} from "@/components/ui/empty";
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Skeleton } from "@/components/ui/skeleton";
import {
Table,
@@ -93,13 +100,13 @@ function openTerminal(): void {
}
function formatTimestamp(value?: string): string {
if (!value) return "—";
if (!value) return "–";
const at = new Date(value);
return Number.isNaN(at.getTime()) ? value : at.toLocaleString();
}
function scopes(binding: HarnessBinding): string {
return binding.scopes?.length ? binding.scopes.join(", ") : "—";
return binding.scopes?.length ? binding.scopes.join(", ") : "–";
}
</script>
@@ -107,11 +114,12 @@ function scopes(binding: HarnessBinding): string {
<div>
<PageHeader title="Harness" />
<p v-if="failure" class="mb-4 text-sm text-danger" role="alert">
{{ failure }}
</p>
<Alert v-if="failure" variant="destructive" class="mb-4">
<AlertTitle>Could not load the harness</AlertTitle>
<AlertDescription>{{ failure }}</AlertDescription>
</Alert>
<div v-if="loading" class="space-y-2">
<div v-if="loading" class="flex flex-col gap-2">
<Skeleton class="h-24 w-full" />
<Skeleton class="h-40 w-full" />
</div>
@@ -119,32 +127,32 @@ function scopes(binding: HarnessBinding): string {
<Empty v-else-if="unconfigured">
<EmptyHeader>
<EmptyTitle>Harness bindings are not configured</EmptyTitle>
<EmptyDescription>Credential bindings and OAuth tokens unavailable.</EmptyDescription>
</EmptyHeader>
</Empty>
<template v-else-if="state">
<Alert v-if="!state.terminal" class="mb-4">
<AlertTitle>Setup terminal unavailable</AlertTitle>
<AlertDescription>Start the daemon with a container runtime and a harness token to log in to a
CLI from here. Bindings are still listed below.</AlertDescription>
<AlertDescription>Start the daemon with a container runtime and a harness token to log in to a CLI from here.</AlertDescription>
</Alert>
<Card v-else class="mb-4">
<CardContent class="flex flex-wrap items-end gap-3">
<label class="flex flex-col gap-1 text-sm">
<span class="text-muted-foreground">Profile</span>
<NativeSelect
size="sm"
v-model="profile" class="min-w-48"
:disabled="!state.profiles.length"
>
<NativeSelectOption v-if="!state.profiles.length" value="">No profiles configured</NativeSelectOption>
<NativeSelectOption v-for="name in state.profiles" :key="name" :value="name">
{{ name }}
</NativeSelectOption>
</NativeSelect>
</label>
<div class="flex flex-col gap-1 text-sm">
<Label for="harness-profile" class="text-muted-foreground">Profile</Label>
<Select v-model="profile" :disabled="!state.profiles.length">
<SelectTrigger id="harness-profile" size="sm" class="min-w-48">
<SelectValue placeholder="No profiles configured" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem v-for="name in state.profiles" :key="name" :value="name">
{{ name }}
</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
<Button :disabled="!profile" @click="openTerminal">Open setup terminal</Button>
</CardContent>
</Card>
+2 -2
View File
@@ -16,8 +16,8 @@ import { cancelDelete, confirmDelete, pendingDelete } from "./state";
/**
* The destructive confirmation for one mapping. Deleting unprompted is not
* offered: a playbook binding (t2db.4) points at a mapping by id, so removing
* one without being asked would break a binding the operator still has.
* offered: a binding points at a mapping by id, so removing one without being
* asked would break a binding the operator still has.
*/
function onOpenChange(open: boolean) {
if (!open) cancelDelete();
+4 -5
View File
@@ -25,12 +25,11 @@ import {
/**
* The mapping's own fields: the name it is saved under, the organisational
* source hint, and the captured event the payload and the preview resolve
* against. The hint is a note to a human, never a matcher -- t2db.4 decides
* which events a mapping applies to.
* against. The hint is a note to a human, never a matcher; bindings decide which
* events a mapping applies to.
*
* Laid out as labelled controls rather than the FieldGroup/Field pair, which
* this project has not installed; each label is bound to its control by id so
* the association survives a click on either.
* Each label is bound to its control by id so the association survives a click
* on either.
*/
/** The picker's value for "no capture chosen". Capture ids are numeric, so no
+1 -1
View File
@@ -26,7 +26,7 @@ const emit = defineEmits<{
}}</TableCell>
<TableCell class="tabular-nums">{{ matchCountLabel(mapping) }}</TableCell>
<TableCell class="text-fg-muted">{{
mapping.match_count ? ago(mapping.last_matched_at) : "—"
mapping.match_count ? ago(mapping.last_matched_at) : "–"
}}</TableCell>
<TableCell>
<div class="flex justify-end gap-2">
+4 -5
View File
@@ -10,11 +10,10 @@ import MappingsTable from "./MappingsTable.vue";
import { actionError, loadMappings, startCreate } from "./state";
/**
* Payload field mapping (t2db.3): bind named fields to JSON paths inside a real
* captured event, preview the resolution before saving, and manage saved
* mappings. See docs/prds/payload-field-mapping.md. Binding a mapping and a
* matcher to a workflow (t2db.4) is a separate, not-yet-built page -- this one
* only produces the mapping entity and its preview.
* Payload field mapping: bind named fields to JSON paths inside a real captured
* event, preview the resolution before saving, and manage saved mappings. See
* docs/prds/payload-field-mapping.md. Binding a mapping to a workflow happens
* on the Bindings tab.
*
* Composes the list and the two overlays; it holds no state of its own.
*/
-1
View File
@@ -47,7 +47,6 @@ import {
<Empty v-else-if="!mappings.length">
<EmptyHeader>
<EmptyTitle>No mappings yet</EmptyTitle>
<EmptyDescription>None yet.</EmptyDescription>
</EmptyHeader>
</Empty>
+1 -1
View File
@@ -82,7 +82,7 @@ function url(source: Source): string {
>
<Input
v-model="customPath"
class="w-64 font-mono"
class="w-full font-mono sm:w-64"
placeholder="Custom path (optional)"
aria-label="Custom path"
/>