feat(orchestrator-ui): mark file-edit events with an EDIT badge

FileAction and EditAction both write kind="file" — the discriminator
is action="file:create" vs "file:edit". The dashboard timeline used
to render both identically; now an EDIT sub-chip surfaces edits without
widening the kind enum (which doubles as the bus topic family).

No schema or API change. Polish only.
This commit is contained in:
2026-04-27 17:42:21 -04:00
parent 147f52467f
commit 2eeec15f9c
2 changed files with 25 additions and 0 deletions

View File

@@ -259,6 +259,12 @@ const Orchestrator: React.FC = () => {
r.kind === 'traffic' || r.kind === 'file' || r.kind === 'email'
? r.kind : '';
const isEmail = r.kind === 'email';
// FileAction and EditAction both write kind="file"; the
// discriminator lives in `action` ("file:create" vs
// "file:edit"). Surface the difference visually without
// widening the kind enum (which doubles as the bus
// topic family).
const isEdit = r.kind === 'file' && r.action?.startsWith('file:edit');
return (
<tr
key={r.uuid}
@@ -268,6 +274,15 @@ const Orchestrator: React.FC = () => {
<td className="dim">{timeAgo(r.ts)}</td>
<td>
<span className={`kind-chip ${kindCls}`}>{r.kind}</span>
{isEdit && (
<span
className="chip dim-chip"
style={{ marginLeft: 4 }}
title="In-place edit of a previously planted file"
>
EDIT
</span>
)}
</td>
<td className="mono matrix-text">
{isEmail && r.language && (

View File

@@ -65,6 +65,7 @@ const OrchestratorInspector: React.FC<Props> = ({ event, onClose }) => {
event.kind === 'traffic' || event.kind === 'file' || event.kind === 'email'
? event.kind : '';
const isEmail = event.kind === 'email';
const isEdit = event.kind === 'file' && event.action?.startsWith('file:edit');
const srcSrc = sourceTag(event.src_decky_uuid);
const dstSrc = sourceTag(event.dst_decky_uuid);
const isLive = event.uuid.startsWith('live-');
@@ -84,6 +85,15 @@ const OrchestratorInspector: React.FC<Props> = ({ event, onClose }) => {
<span className={`kind-chip ${kindCls}`} style={{ marginLeft: 8 }}>
{event.kind.toUpperCase()}
</span>
{isEdit && (
<span
className="chip dim-chip"
style={{ marginLeft: 4 }}
title="In-place edit of a previously planted file"
>
EDIT
</span>
)}
</h3>
<button className="close-btn" onClick={onClose} aria-label="Close">
<X size={16} />