BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ns-ui/approval-inline-diff

Approval Inline Diff

ns-ui/approval-inline-diff
FreeComponent

Human-in-the-loop tool-call approval row: every argument is editable inline with an old→new diff, and deciding collapses the row irreversibly into a one-line receipt.

Live preview

live · rendered by the registry
Rendered by ns-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://design.helpmarq.com/r/approval-inline-diff.json

Source

registry/core/approval-inline-diff/component.tsxdesign.helpmarq.com/r/approval-inline-diff.json · first 6 KB
1"use client";
2
3import { useEffect, useId, useRef, useState } from "react";
4
5// ---------------------------------------------------------------------------
6// AssayGate — a human-in-the-loop approval row for an agent's proposed tool
7// call. Every argument renders as a real, labelled, inline-editable field;
8// touching one keeps the original value on the record and shows a Geist Mono
9// old→new diff (strikethrough) beneath it rather than silently swapping the
10// value. Approve and Deny are told apart by fill and weight, not colour —
11// Approve is the solid accent action, Deny a plain outlined one, both with
12// distinct glyphs. Deciding collapses the row into a one-line receipt
13// (outcome · actor · time) that cannot be reopened for editing — the
14// collapse is driven by grid-template-rows so it plays as a real motion, and
15// once `decision` is set nothing in this component ever clears it. The full
16// payload survives as-decided behind a native <details> disclosure on the
17// receipt line.
18// ---------------------------------------------------------------------------
19
20export type AssayField = {
21 key: string;
22 /** short label shown above the field, e.g. "command" */
23 label: string;
24 value: string;
25};
26
27export type AssayDecision = {
28 outcome: "approved" | "denied";
29 /** who decided — the human at the console, not the requesting agent */
30 actor: string;
31 timestamp: number;
32};
33
34export interface AssayGateProps {
35 /** the tool being called, e.g. "execute_shell" */
36 toolName: string;
37 /** the agent/identity that proposed the call */
38 requestedBy?: string;
39 fields: AssayField[];
40 /** seed one or more fields as already edited, keyed by field.key — the
41 * diff renders immediately instead of waiting for the human to type */
42 initialValues?: Record<string, string>;
43 /** recorded on the receipt as the decider — default "you" */
44 approverName?: string;
45 onDecision?: (decision: AssayDecision, fields: AssayField[]) => void;
46 /** pre-seed as already decided (e.g. rendering decision history) */
47 initialDecision?: AssayDecision;
48 className?: string;
49}
50
51function timeLabel(ts: number) {
52 return new Date(ts).toLocaleTimeString(undefined, {
53 hour: "numeric",
54 minute: "2-digit",
55 second: "2-digit",
56 });
57}
58
59// A wall-clock stamp is the one thing in this component that can legitimately
60// differ between the server render and the client one: `toLocaleTimeString`
61// … truncated

Files it writes

  • registry/core/approval-inline-diff/component.tsx

Facts

Registry
ns-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on ns-ui design.helpmarq.com nikolas-sapa/ns-ui on GitHub Raw registry item This item as JSON

More from ns-ui

All 228 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordion Latchaccordion-latchns-uiComponentsFreeno deps
ASCII Engraving Contourascii-engraving-contourns-uiComponentsFreeno deps
ASCII Globe Spinascii-globe-spinns-uiComponentsFreeno deps
ASCII Torus Donutascii-torus-donutns-uiComponentsFreeno deps
Autosave Ratchetautosave-ratchetns-uiComponentsFreeno deps
Avatar Stack Flockavatar-stack-flockns-uiComponentsFreeno deps
Background ASCII Ditherbackground-ascii-ditherns-uiComponentsFreeno deps
Background ASCII Plasmabackground-ascii-plasmans-uiComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex