This component no longer exists. It was in ns-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-07 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
Confidence Logprob Hatch
ns-ui/confidence-logprob-hatchRemovedComponent
Hand-hatched underlines under low-confidence tokens, stroke density mapping straight to logprob doubt in three buckets, with a hover/focus popover naming what the model almost said instead.
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/confidence-logprob-hatch.jsonSource
1"use client";23import {4 useEffect,5 useId,6 useLayoutEffect,7 useMemo,8 useRef,9 useState,10 type FocusEvent as ReactFocusEvent,11 type KeyboardEvent as ReactKeyboardEvent,12} from "react";1314// ---------------------------------------------------------------------------15// PencilHedge — token-level model uncertainty rendered as pencil hesitation.16// A span the model was unsure about gets a 4px hand-hatched underline built17// from ONE shared SVG <pattern> per doubt bucket (sparse / medium /18// cross-hatch — a draftsman going over a line once, twice, or crossed), fed19// by a single generation's logprobs: no resampling, cheap enough for every20// message. The words themselves NEVER change weight, blur or opacity — that21// is the failure mode this design exists to avoid, unlike an ink-reveal22// treatment. Density is a shape channel (line count/angle), not a hue, so it23// reads under every theme and every color-vision deficiency.24//25// Hover or focus on a hatched span opens a small popover (12px / rounded-md)26// listing the runner-up tokens the model almost said as mono rows — "said27// 0.44", "almost 0.31" — each alternative a real button that rewrites the28// span in place with a short settle transition and clears its marks (a29// resolved token reads exactly like a confident one). The popover is a30// plain DOM child of the hatched span itself, not a portal: mouseenter/31// mouseleave don't fire crossing into a descendant, so moving the pointer32// from text down into the popover never flickers it shut, and Tab reaches33// its buttons in natural document order with no focus-stealing hacks.34//35// A11y: the hatched span is role="note" tabIndex=0 with an aria-label36// carrying the doubt — "low confidence: <text>" by default, expanded to37// name the alternatives with percentages when the caller opts a message38// into verbose mode, so default reading flow stays quiet. The popover is39// role="dialog" with an aria-label naming the token it's alternatives-for.40// Escape closes from anywhere (span or popover) and returns focus to the41// span, never trapping. Confident text is never wrapped at all — plain42// text, no role, no tabIndex, nothing to land on.43//44// Colors are the five registry tokens only (--background --foreground45// --muted --border --accent), read as CSS custom properties directly in46// SVG attributes — no canvas here, so no getComputedStyle dance is needed.47// prefers-reduced-motion drops the settle transition; the rewrite still48// … truncated
