shadcn/ui for dshfiles DSH plugins, plus TanStack Query, Table, Form, Machine, Chart, Diff, and Virtual bindings. This package guide is the current source of truth for components and integration; state ownership covers the async-data, form, flow, and persistence boundaries.
- Tailwind v4,
dshx:prefix, no global Preflight — the dshx client-CSS contract. A scoped Preflight applies under.dshx-rootand inside shadcn portal content ([data-slot$="-content"]); never bare[data-slot], which DSH also uses for its own outlets. - shadcn semantic colors are the DSH theme.
src/styles.cssmapsbackground,foreground,card,popover,primary,secondary,muted,accent,destructive,border,input,ring,info,success,warning,chart-1..5inline onto--dsw-*, so light/dark follow the Host.tealandvioletare categorical hues the Host theme lacks (workspace and divergence chips), andgraph-1..6are the revision graph's branch hues; each has its own light and dark value.dark:matchesbody[data-ds-dark-theme]. - BB density.
text-smis 13px, controls are 32px (sm28px,xs24px), radius 6px.
// dshx.config.ts
import { pluginUiVite } from '@dshfiles/plugin-ui/vite'
export default defineConfig({ client: { entry: 'src/client.tsx', vite: { plugins: [pluginUiVite()] } } })A consumer needs no stylesheet of its own: @dshfiles/ui-styles is the one bundle that imports this package's
styles.css, compiles the union of every owned plugin's classes and injects the sheet once. A plugin that needs extra
rules of its own keeps a src/client.css holding only those rules — imported once from the client entry, never
importing the shared sheet again — as jujutsu and memory do. Depend on "@dshfiles/plugin-ui": "link:../plugin-ui".
Do not add Tailwind, Radix, or TanStack packages to a plugin directly — this package pins them.
import { Button } from '@dshfiles/plugin-ui/components/ui/button'
import { Badge } from '@dshfiles/plugin-ui/components/ui/badge'
import { cn } from '@dshfiles/plugin-ui/lib/utils'
;<section className="dshx-root dshx:flex dshx:flex-col dshx:gap-4 dshx:p-6">
<Button variant="outline" size="sm">
<RefreshCwIcon /> Refresh
</Button>
<Badge variant="secondary">6 secrets</Badge>
</section>- Put
dshx-rooton each surface root you render. Prefix every utility (dshx:hover:bg-accent), write complete static class strings, merge withcn. - Animated components:
src/components/motion/on the shared motion layer (see Motion). - Components:
src/components/ui/(button, input, textarea, label, select, checkbox, switch, tabs, badge, card, table, dialog, alert-dialog, dropdown-menu, context-menu, popover, tooltip, command, combobox, separator, skeleton, toggle, toggle-group, collapsible, alert, kbd, spinner, empty, field, input-group, item, progress, scroll-area, page-header, search-input, status-dot). Wrap tooltips inTooltipProvider. PageHeader(components/ui/page-header) is a plugin page's top row:heading(theh1) over a one-linedescription, with badges and actions as children on the right.SearchInput(components/ui/search-input) is the search field: the input group with a leading search glyph.classNamesizes the group;aria-label,value,refand every other prop reach the input.StatusDot(components/ui/status-dot) is the round status marker:tone(current,success,destructive,warning,info,muted) or a computed color class,sizesm(6px) or default (8px). It isaria-hiddenunless given anaria-label, which makes itrole="img"; it forwards its ref so aTooltipTrigger asChildcan wrap it.components/image-lightbox(ImageLightbox) is the one full-window image viewer: arrow keys and side controls move, the thumbnail strip jumps, Escape closes and focus returns to the opener, and an image withoutsrcshows as loading. The thread composer and the backlog composer both render it, so a gallery change lands in one place. Labels default to English and accept a translatedImageLightboxLabels.- Agent cards:
components/tool-card(ToolCardon the HostDisclosureRow,StatusIcon),components/code-blockandcomponents/stack-trace(see Code and stack traces). The HostTerminalBlockstays the view for command output. Markdown(components/markdown) renders text through the HostMarkdownTextwith English chrome and thecompactvariant by default;[label](scheme:target)links open through the dshxLinkHandlerregistry.Code(components/code) is the HostCodeBlockwith English copy labels. Pass translatedlabels/copyLabelwhen the plugin has a locale.- Icons:
import { RefreshCwIcon } from '@dshfiles/plugin-ui/icons'(lucide-react re-exported, so plugins need no extra dependency); HostIcon*from@deepseek-ai/dsh-client-ui-primitiveswhere a DSH-native glyph matters. - Readable names:
EntityLabels(@dshfiles/plugin-ui/hooks/entity-labels) turns Session ids into thread titles (useSessionLabel) and workspace ids or folders into project names (useWorkspaceLabel);isThreadWorkspaceandgroupByRepositoryfold jj thread workspaces under their repository. Pass the optionalthreadDirectories(from@dshfiles/thread-sidebar/thread-directoriesor a Host answer) so a custom threads directory folds too; without it the<repository>-threadslayout applies. Pass it the injectedctx.sessions/ctx.workspaces. - Per-thread polls:
useSessionOnScreen(@dshfiles/plugin-ui/hooks/session-on-screen) says whether the main view shows a thread. Main tabs keep every visited thread mounted, so gate a per-threadrefetchIntervalon it and keep the first read on mount. - Copy feedback:
useCopyFeedback(@dshfiles/plugin-ui/hooks/copy-feedback) copies through the HostwriteClipboardand returnscopiedfor 1.5 s after a successful write, for a copy button that swaps its glyph or label.copyresolves to whether the write succeeded, so a caller can still report a failure. - Hand-rolled dialogs: prefer the kit Dialog, Sheet or Popover. When the surface cannot use them (it stays mounted while hidden, or anchors to a Host slot),
useDialogFocus(@dshfiles/plugin-ui/hooks/dialog-focus) moves focus in on open (initialFocusor the first focusable), keeps Tab inside withtrap, and returns focus to the opener on close. Escape andaria-modalstay with the surface. - Phone bottom sheets drag:
installSheetDrag(@dshfiles/plugin-ui/hooks/sheet-drag, installed once by@dshfiles/ui-styles) moves every phone sheet that draws the grabber (kit menus, selects, popovers, the Host menu, composer pickers) and any element markeddata-dshx-sheet. The grab strip or adata-dshx-sheet-handledrags either way; the content drags down only from its scroll top. It snaps to rest, expanded (up to 90% of the viewport when the content overflows) or dismissed (SheetSnapinlib/sheet-snap), honours flicks andprefers-reduced-motion, and dismisses through Escape, so an owner only needs its usual Escape close. Touch on a phone-width viewport only. - List selection:
ListSelectionModel(@dshfiles/plugin-ui/hooks/list-selection) is the shared anchored selection for batch lists —toggle,extend(inclusive Shift range from the anchor),toggleAllVisible(visible-only select-all), andprune(drop ids a filter, group or scope hid). Keep selection inuseState<ListSelection<Id>>; the batch bar and any confirmation belong to the list, not the model. - Infinite lists:
useLoadMore(@dshfiles/plugin-ui/hooks/use-load-more) observes a sentinel near a scroll boundary and re-arms when itsresetKeychanges, so short lists keep filling until the sentinel leaves the root. Change the key after content grows, disable the hook while a page is pending, and keep its callback fresh through a ref. Keep older-page sentinels before all rows;usePrependScrollAnchor(@dshfiles/plugin-ui/hooks/use-prepend-scroll-anchor) preserves the visible position when older rows prepend. - Small views:
dshx:@containeron a surface root, thendshx:@max-pane-narrow:(< 28rem) anddshx:@max-pane-compact:(< 42rem) on its children. Panels follow their own width, not the viewport; the collapse-order rules are in theplugin-uiskill.
cd plugins/@dshfiles/plugin-ui
pnpm dlx shadcn@4.21.4 add <name-or-registry-url>components.json sets the dshx prefix and self-referencing aliases. After adding, rewrite @dshfiles/plugin-ui/... and cn imports in the new file to relative .js paths (../../lib/utils.js, ./button.js, so NodeNext consumers typecheck) — the CLI resolves them inconsistently — check it did not add stray dependencies, and use React.forwardRef on any part a Radix asChild trigger wraps (React 18 drops ref on function components).
Every plugin page (main panel, stage detail) is built from one template, so the product reads as one app (ADE plan §5; tokens and anatomy in DESIGN.md). Pilots: activity-timeline, background-jobs, mcp-servers.
import { EmptyState, Page, PageSection } from '@dshfiles/plugin-ui/components/page'
import { EntityList, EntityRow } from '@dshfiles/plugin-ui/components/entity-row'
import { StatusGlyph, type WorkStatus } from '@dshfiles/plugin-ui/components/work-status'
;<Page
heading="Hosts"
description="Machines threads can run on."
count={hosts.length}
primaryAction={{ id: 'add', label: 'Add host', icon: <PlusIcon />, onSelect: openAdd }}
actions={[{ id: 'refresh', label: 'Refresh', icon: <RefreshCwIcon />, onSelect: refetch, pending: isFetching }]}
>
<PageSection heading="Registered" meta={`${online} online`}>
{hosts.length === 0 ? (
<EmptyState action={{ label: 'Add host', onSelect: openAdd }}>No hosts yet.</EmptyState>
) : (
<EntityList>
{hosts.map(host => (
<EntityRow
key={host.id}
role="listitem"
status={toWorkStatus(host)}
heading={host.name}
meta={<span>{host.os}</span>}
trailing={
<Button size="sm" variant="outline">
Connect
</Button>
}
/>
))}
</EntityList>
)}
</PageSection>
</Page>| Part | Contract |
|---|---|
Page |
One h1 heading, optional description (≤ 72ch), optional count and meta chips (two or three), at most one primaryAction (give it items to make it a New ▾ menu of kinds), any number of actions, optional tabs, then the body. It is its own @container with p-5 (p-3 below 28rem). Below 42rem (measured with a ResizeObserver) inline actions fold into the ⋯ overflow menu; placement: 'overflow' keeps one there always. scroll makes the page own its scroll (h-full overflow-y-auto) where the host pane does not; fill instead fills the pane height and hands the rest to the body (or active tab), for master–detail pages whose panes scroll on their own. |
| Page tabs | One style only: the segmented TabsList (variant="default", grey track, white active pill), scrolling sideways when it does not fit. Use them for page views; a filter over one list stays a ToggleGroup. No underline tabs on pages. |
PageSection |
A section named by its h2 heading (text-sm font-semibold), optional muted meta ("3 enabled"), actions and description. |
EmptyState |
One sentence, centred and muted, plus at most one outline action. It draws no frame: the list or card around it does. Not for loading (use Spinner). |
WorkStatus |
Exactly six states (working, needs-you, failed, ready, idle, done, ADE plan §4.7). Map plugin states onto them; add detail text, never a new colour. WorkStatusModel has the labels and the attention/emphasis predicates. |
StatusGlyph |
Fixed 16px box. Dark cockpit: working is a colourless ring spinner (all spinners phase-synced, paused off screen), needs-you the info diamond, failed the destructive cross, ready a solid foreground dot, idle a faint ring, done a muted check; glyph-only stale (dashed ring) and stopped (muted square). Labelled by default; decorative when the row already states it in text. |
EntityRow / EntityList |
leading (checkbox, chevron) · glyph · heading · muted meta chips · description line · trailing inline verb; children render full width below (an output pane). onSelect makes the middle one button; leading/trailing stay separate controls. Ready titles are bold, done titles muted, nothing else is coloured. In narrow panes meta wraps under the title and trailing verbs drop to their own line. EntityList is the one bordered list with hairline dividers; give its rows role="listitem". |
Primary button: black. The primary action is Button variant="default", which is bg-primary = the Host
--dsw-alias-brand-primary (#0f1115 light, #f9fafb dark), the convention most plugins already use (MCP Add
server, Memory, Backlog New, Hosts). Blue (info, --dsw-alias-state-business-primary) is never a button fill: it is
reserved for focus rings, selection and the Needs-you glyph. One primary per page; everything else is outline
(header) or ghost/outline sm (rows). The legacy components/ui/page-header stays for unmigrated pages only.
Audit of UI rebuilt across owned plugins (native forks excluded), October 2026. Add a component here only when three or more plugins repeat the same behavior; otherwise compose the existing kit.
| Pattern | Duplicates found | Decision |
|---|---|---|
Status dot (rounded size-1.5/size-2 span) |
37 in 12 plugins: ai-accounts (8), backlog (8), thread-sidebar (7), jj-integration, main-tabs, mcp-servers, usage, worktree-memory (2 each), agent-communication, editor, settings-shell, workbench | StatusDot, all migrated. multi-host keeps its own host-state dot; the Host StateDot has fixed session states only. Quota chart markers in ai-accounts are plot glyphs, not status dots. |
Search field (input group + leading SearchIcon) |
11 input groups in 9 plugins, 9 hand-rolled SearchIcon over Input, 4 native inputs |
SearchInput; migrated 8 input groups (activity-timeline, agent-toolkit, background-jobs, mcp-servers, secret-catalog, traces ×3) and 3 hand-rolled (agent-communication, usage, workbench). Left as is: fields with a clear button (plugin-marketplace, settings-shell), a trailing or 14px glyph (jujutsu, mcp quick panel, secret overlay), a shortcut hint or custom height (ai-accounts), path entry (project-folder-picker), keyboard handoff in a picker (model-effort-picker), and borderless native inputs inside custom chrome (backlog, memory, jj-integration). |
| Copy button with a timed "copied" check | 4: ai-accounts, jj-integration, memory, thread-sidebar | useCopyFeedback hook rather than a component: the four buttons differ in glyph, label and tooltip, only the write and the 1.5 s flag are shared. Plain one-shot copy actions keep calling the Host writeClipboard. |
Page header (h1 + one-line description + badge/action row) |
3 identical: activity-timeline, agent-communication, background-jobs; ~10 more with their own type scale, icon tile or back link | PageHeader for the identical three. The others differ on purpose (text-lg vs text-xl, text-sm descriptions, icon tiles, back buttons), so migrating them would change how they look. |
Pending icon swap (busy ? <Spinner /> : <Icon />) |
~25 in 12 plugins | Rejected: the icon, size, label and tooltip vary per button, and Spinner already names the busy state. |
Inline error text (<p role="alert" class="text-destructive">) |
~30 in 6 plugins | Rejected: sizes differ (11px, xs, sm) with the surrounding text; FieldError covers form fields. |
Key/value list (dl grid) |
18 in 11 plugins | Rejected: every grid uses its own column template and density. |
| Empty and loading states | muted <p> texts in ~30 files |
Rejected: one-line copy in context; the kit Empty covers full empty panels. |
window.confirm |
1 (backlog reply delete) | Kept: a single case; AlertDialog is the kit answer when it next changes. |
The component gallery demos every composite below. Each one replaced local markup on the screen named; when a screen needs a prop the component lacks, add it here rather than forking the component.
| Component | Used by |
|---|---|
TraceWaterfall, AgentTimeline, CallStackTree |
traces: span tree, session traces, span exception frames |
StackTrace, CodeBlock |
test-runs: failing test frames and code frames, Stack trace card under bash |
MergeChecks |
diffs-review Land card |
MergeConflictGraph |
jj-integration workspace menu conflict notice |
FallbackChain |
model-effort-picker fallbacks, with a "Serving now" rung |
CreditsUsage |
ai-accounts quota windows |
SpendMap |
usage › Cost |
ActivityFeed |
activity-timeline rows |
RoutineList |
project-automations rows |
BulkSelectList |
jujutsu workspace cleanup selection |
AgentRoster |
agent-communication live agent list |
StepTrail, AgentRunSteps |
agent-plan activity strip and plan steps |
PipelineRun |
project-checks receipts |
CheckpointGraph, CostWaterfall, PresenceList |
session-undo rewind preview, usage thread Cost facet, agent-plan activity strip |
Page, PageSection, EmptyState, EntityList |
most owned pages |
ComposerRow |
background-jobs, jujutsu, queue-reorder, rich-composer: the state rows above the composer |
Deleted rather than adopted: MergeChecklist (overlapped MergeChecks), TestRunResults (a streaming view, while
test-runs shows finished runs and its counts would be wrong for Vitest's default reporter), QuotaMeter, Typewriter
and SessionRecap (no caller).
Kept with no caller yet, each for a named future feature: PipelineDag (project actions with dependencies),
WorkflowRun (an owned workflow tool card), DelegationBoard, ApprovalRun and AgentRunStatus (fan-out approval
and child status pills, ADE UX Phase 7), DelegatorBoard (Inbox grouped by source),
AgentQueue (host-pool work queue), ClarifyPrompt (an owned ask_user_question card), ToolbarWalkthrough
(plugin-guide onboarding), ShapeshiftCard (palette actions that morph into a form), RevisionScrubber (rewind any
turn), RevisionAvatarGraph, AgentCursors and AgentPresenceBar (thread-share v2 presence), AccessMap (a
policies scope view). Not done: ContextGraph as an optional graph view of agent-toolkit's Context facet. ActivityDock was
deleted once turn-summary's walkthrough became a row toggle; its DockChanges list stays in motion/activity-dock
for that walkthrough.
Recount a component's callers outside the kit and the gallery:
cd plugins/@dshfiles
grep -rlE --include='*.tsx' '<TraceWaterfall([ >/]|$)' */src | grep -v '^component-gallery/\|^plugin-ui/\|\.test\.'Every animated component uses one engine and one feel, and every one is visible in the component gallery.
import { animate, springs, presets, motionSafe, enter, flip, drawStroke, everyFrame } from '@dshfiles/plugin-ui/motion'
import { useAnimate, useEnter, useFlip, useCountUp, useElapsed, useInView } from '@dshfiles/plugin-ui/motion/react'
import { PresenceList } from '@dshfiles/plugin-ui/components/motion/presence-list'
import { RollingNumber, ShimmerText } from '@dshfiles/plugin-ui/components/motion/text'- Engine: Motion's framework-free core (
motion, MIT): springs, keyframes, stagger, sequences, layout/FLIP, view transitions,inView/scroll,hover/press, on plain DOM through Web Animations where possible.motion/reactis not used: the React hooks above are thin refs-and-effects over the vanilla API, so a non-React surface shares the same presets.@dshfiles/shared-runtimeprovidesmotion, so plugins share one copy. - Use the presets, not ad-hoc numbers:
springs.snappy(chrome),springs.smooth(content, layout),springs.bouncy(confirmation),springs.gentle(large surfaces);durations,easings,staggers, and the enter/exit keyframes inpresets. The helpers are grouped on theMotionclass; the short names are aliases. - Reduced motion: pass every option object through
motionSafe(the helpers and hooks already do). Underprefers-reduced-motionthe animation ends on its final frame at once andPresenceListremoves items immediately; CSS loops usedshx:motion-reduce:animate-none. - Live clocks and running bars use
everyFrame/useElapsed, neversetIntervalinside a component. Simulated data belongs to gallery demos; components stay controlled by props. - Do not put Tailwind
scale-*/rotate-*/translate-*classes on an element Motion animates: they set the separate CSSscale/rotate/translateproperties, which compound with Motion'stransform. - Inline styles cannot use the
--dshx-color-*theme variables (they are declared on:root, where the Host's--dsw-*tokens are not defined, so they resolve to nothing). Use the--dsw-alias-*token directly, asShimmerTextdoes, or a utility class. - Animated components live in
src/components/motion/: agents (queues, run steps, routines, delegation, rosters, checkpoints, plans), traces (timeline, waterfall, replay, cost waterfall, fallback chain), usage (credits, spend map, activity feed/dock, session recap, access map, landing pipeline), revisions (scrubber, merge conflicts, merge checks, pipeline DAG, call stack, avatar graph) and interaction (bulk select, run status, approvals, clarify prompt, toolbar walkthrough), plus shared parts (lane-graph,node-links,trace-kit,sliding-segments,step-glyph,auto-height,height-reveal,elapsed-clock,agent-avatar).
import { PluginQueryProvider, errorMessage, useMutation, useQuery, useQueryClient } from '@dshfiles/plugin-ui/query'Wrap each slot root once (inside dshx decorate(...)). Prefix every key with the plugin id, forward signal to the dshx client, invalidate by key after mutations. One client per plugin bundle.
import { DataTable, createColumnHelper, tableFeatures, useTable } from '@dshfiles/plugin-ui/table'
;<DataTable table={table} empty="No rows" /> // shadcn Table in a bordered card, uppercase headers, aria-sort
;<DataTable table={table} append={<TableRow>…</TableRow>} /> // extra rows (e.g. drafts) after the row model; empty is skippedimport { useAppForm } from '@dshfiles/plugin-ui/form'
;<form.AppField name="alias">{field => <field.TextField label="Alias" required />}</form.AppField>Field components: TextField, TextAreaField, SelectField (shadcn Select), CheckboxField, SwitchField; form.SubmitButton. Validators are Standard Schema (zod 4).
import { assign, fromPromise, setup, useMachine } from '@dshfiles/plugin-ui/machine'The subpath names each xstate export a plugin uses; add a name there when a plugin needs another.
Only for tangled flows with three or more states (select → prepare → confirm → receipt). Machines own flow state; server data stays in Query. Call the Host through fromPromise actors and forward their signal — leaving a state stops the actor and aborts the call.
@dshfiles/plugin-ui/chart re-exports TanStack Charts 1.0.0 and ChartFrame, which maps --ts-chart-* onto DSH tokens.
import { CodeBlock, FilePath } from '@dshfiles/plugin-ui/components/code-block'
import { CodeFrame, StackTrace, locationFrame } from '@dshfiles/plugin-ui/components/stack-trace'
import { StackFrames } from '@dshfiles/plugin-ui/lib/stack-frames'
;<CodeBlock code={source} path="src/cart/pricing.ts" startLine={27} highlightLines={[29]} />
const report = StackFrames.extract(output) // first error + frames in command output, or undefined
;<StackTrace frames={report.frames} openFile={openFile} />CodeBlockhighlights with the Host's lazy Shiki grammars (useCodeHighlighter, grammar frompathorlang) and draws a header with the path or language, a wrap toggle, copy and download (downloadable={false}hides it). The gutter counts fromstartLine(falsehides it), so a fragment cut from line 27 reads 27; the HostCodeBlockalways counts from 1 and has no wrap or download.Code(components/code) stays the Host block for Markdown-style fences.StackFrames.parse(stacktrace)reads V8, JVM, Gecko and Python stacks intoCallFrames, innermost first, withfile, fullpath,lineandcolumn; application frames arechanged, library and runtime frames (node_modules,node:,site-packages,java.)existing.StackFrames.extract(output)finds the first error in command output with its header (TypeError: …, a JVMException in thread, a Python traceback's last line) and its frames. With no header above, only two or moreat …lines count as a trace; afile:0line (grep -c) or a Gecko location that is not a URL or absolute file path is never a frame, and aCaused bychain ends it.StackTraceshows the location, theCodeFrame(aCodeBlocknumbered from the frame's first line, failing line marked) and the frames as flat mono rows (name, then a dimfile:line) with no card or heading of its own, so it sits inside aToolCard. Each run of library frames folds into one "N library frames" row that expands in place. Selecting a frame callsopenFile(path, { line }).locationFrameturns a Vitestfile:line:columnlocation into a frame with no function name (bare).
Adopters: test-runs (failing tests, and the Stack trace card under any bash call that crashed) and traces (span exception frames). The gallery's Code tab demos all three.
The Code Block, Stack Trace and Diff Review rows of HextaUI were design references.
HextaUI's repository (preetsuthar17/hextaui, LICENSE: MIT, © 2026 Preet
Suthar) covers its free components, hooks and utilities: those may be ported here with that notice kept in the ported
file. Its blocks are HextaUI Pro under the Pro License, which allows Pro and free
blocks (Prompt Input included) inside an open-source end product but forbids redistributing them as part of a UI kit or
component library, which this package is. So blocks are only ever rebuilt here from their visible behaviour, and no
HextaUI code is vendored in this package. HextaUI builds on Base UI and Tabler icons; ports land on the Radix parts and
lucide icons this package already has rather than adding Base UI.
Its other blocks were compared against what this repository already ships, and no port is left to do:
| Block | Where the behaviour lives here |
|---|---|
| Subagents | thread-sidebar subagent lineage header (mode, activity, duration, tokens) plus the state on the subagent tool row. |
| Tool Calls | tool-meta: the native call tree wrapped with section rows and timings, and the approval card with its risk level. |
| Prompt Input | rich-composer uploads row, model chip and the Stop/retry controls in its input bar. |
| Chat Sidebar | thread-sidebar: status groups with headers, per-filter empty copy, unread and archived handling. |
| Settings, Appearance | settings-shell: one Settings page grouped by task, with settings-search over sections, plugin pages, controls and key bindings. |
| API keys | secret-catalog rows show alias, scope and last use; a value can never be masked and shown, because DSH stores references only (secret references). |
| Models | model-effort-picker: model groups per provider, provider labels on the chips and the per-model fallback list. |
| Notifications | thread-sidebar notification settings: per-category toggles, placement and duration, plus desktop notification support. |
| Billing | usage: cost and quota bars, tool share bars and the per-account usage history; there is no billing data to summarise. |
@dshfiles/plugin-ui/diff wraps @pierre/diffs 1.5.2 (Shiki-based, Apache-2.0). PatchView takes a git patch
string (patch) or pre-parsed files (parsePatchFiles(patch).flatMap(p => p.files)), a layout of unified
(default) or split, an optional focusPath to scroll to, and empty content. It virtualizes files and lines, so
megabyte patches stay responsive; give it a bounded height through className. Light/dark follows
body[data-ds-dark-theme] with the pierre-light/pierre-dark themes. Every file renders in its own shadow root
with adopted stylesheets, so no library CSS leaks into the page; style it only through inherited --diffs-*
custom properties. pluginUiVite() aliases the library's shiki import to src/shiki-slim.ts (a curated grammar
set on the JavaScript regex engine) and drops unused themes and the WASM engine, because dshx inlines every dynamic
import into one client file; other languages render as plain text. Add a grammar there when a plugin needs one, and
check the bundle. Patch-parsed diffs carry only the patch lines, so collapsed context shows as a count and cannot
expand without full file contents (loadDiffFiles).
@dshfiles/plugin-ui/virtual re-exports TanStack Virtual 3.14 (useVirtualizer, defaultRangeExtractor) for long
row lists (jujutsu revision graph). Measure variable rows with measureElement; pin sticky headers or a drag source
with a custom rangeExtractor so they stay mounted. PatchView virtualizes on its own.
Radix parts run in jsdom. A Radix Select renders a hidden native <select name=…>; drive it with fireEvent.change. Host primitives still cannot be imported under Node — alias them to ./testing/host-primitives.tsx in vitest.config.ts when a plugin keeps any.
The Host ships one unlayered button, input, select, textarea { font-family: inherit }. Unlayered rules beat Tailwind's layered utilities, so a monospace control needs the important form: dshx:font-mono!.
@dshfiles/ui-stylesis the only bundle that compiles the shared Tailwind sheet: itssrc/client.cssimportsplugin-ui/styles.css, whose@source '../..'scans every owned plugin, and it injects the result once. Same-specificity rules resolve by sheet order, so the sheet must stay one ordered rule set — that is why the union is compiled once instead of per plugin; a later plugin's base rule (max-w-[…]) would otherwise override an earlier plugin's variant (sm:max-w-2xl). Consumers ship nothing; after a class change rebuild the owner and the changed plugin.- Host modals sit at
z-index: 1000. Kit dialogs/sheets use 1050 and floating layers (select, popover, menus, tooltip, hover card) 1100, so they open above Host Settings and above our own dialogs.
Client UI uses @dshfiles/plugin-ui (shadcn/ui on Tailwind v4); skills
plugin-ui and plugin-state hold the details. The rules that break silently:
- Every utility is
dshx:-prefixed, a complete static string, merged withcn;dshx-rooton each surface root; semantic colors only. - Avoid native JSX
titleattributes for hover help; use the shared@dshfiles/plugin-uiTooltip components instead, because native title tooltips appear after a long delay. Keeptitleprops only for components whose prop is actual semantic content (such as a dialog or panel heading). Oxlint enforces this withui-guidance/no-native-titleand its explicit semantic-component allowlist. @dshfiles/ui-stylesis the only bundle that compiles the shared sheet; after any class change, rebuild it and the plugin you changed.- The touch baseline in
@dshfiles/ui-styles/src/client.cssis the one deliberate page-global element rule set: it setstouch-actionon every native button, link, tab and menu item, and a 16px floor on every native field under a coarse pointer. Keep it inside@layer base; an unlayered rule there beatsdshx:touch-noneand every otherdshx:utility. Add a new page-global rule to that file only with the same reason, and list it here. - On a coarse pointer every kit button, toggle, toggle-group item and raw
<button>under.dshx-rootgets a 44px hit area through::after(tabs triggers use::before). A raw button that draws with anafter:utility is skipped; one that draws with a hand-written::afterrule loses its drawing, so use anafter:utility or::beforeinstead. - Avoid native JSX
<select>controls; useComboboxfrom@dshfiles/plugin-ui/components/ui/comboboxinstead, matching the New Thread picker for consistent, searchable selection. Theno-native-selectlint rule enforces this. - A fixed overlay (sheet, scrim, popover, toast) portals to
document.body. Inside an ancestor withtransform,filterorcontain,position: fixedresolves against that ancestor: the phone thread⋯sheet rendered inside the translated top bar came out 157px wide, above the screen. - A menu row that opens another overlay runs it from the menu's
onCloseAutoFocus, after the menu unmounts, not fromonSelector asetTimeout(0). The closing menu's focus trap otherwise pulls focus back and the new popover dismisses itself as "focus outside" (Saved prompts, Prompt history and Send later closed within a second). - Project pickers should list registered projects, not JJ thread workspaces;
use
EntityLabels.projectsOfwhen deriving choices from the workspace list. - Host/async data →
/query, multi-field forms →/form, tangled flows →/machine, localStorage →createStoredValue. - Prefer Host utilities (
relativeTime,writeClipboard,rankByNamefrom@deepseek-ai/dsh-client-ui-primitives) over local copies. - Multi-select only when a repeated row verb is worth batching. Add it to a list whose rows share a routine verb (move, mark, enable, stop) and whose batch saves real work; skip it for detail panes and for lists whose rows have unrelated actions. Use one model: plain click selects one row — or runs the row's existing verb when it already has one — Cmd/Ctrl-click toggles the selection, Shift-click extends the inclusive range from the anchor, and the header checkbox selects exactly the rows visible under the current filter, group or scope; changing any of those drops ids that are no longer visible. A batch action keeps each single-row verb's rules, refusals and confirmations, and a bulk destructive verb (forget, stop, remove) opens an explicit confirmation that names the count — it never runs from a bare click.