Components · Content

Composed text

Machine-composed prose. A sentence is bound to a record source or it is withheld; the disclosure is a constant; there is no author, no score on the whole, and no half a document.

Stable · v1.0 shadcn/ui WCAG 2.2 AA

Overview

Two pattern pages carry the rules for text a machine wrote. Composed output says every clinically material assertion binds to a source, an unbindable sentence is withheld rather than hedged, omissions are counted, and nothing carries an overall score. Authorship & the record says the disclosure is text that survives copy and print, is authored by the application rather than the composer, and that a person accepts composed text and never authors it. Until this component existed, every one of those rules was held by the implementer — fourteen rows of “The implementer” across the two guarantees tables, nine of them now here — and the pattern pages had the largest implementer-held share in this system.

The rule

A sentence the composer cannot bind to the record is not written down. Not greyed, not hedged, not footnoted — counted. The type has two kinds of sentence, bound and withheld, and no third, so prose without a source is not something a caller can express.

Bound or withheld

sources is a non-empty tuple, and a source is a record reference with its own label and address. A sentence citing the composer’s earlier sentence is unwritable, because a sentence is not a source.

Disclosed by the application

The disclosure string is a constant in the component. The composer cannot write its own disclosure, and the caller cannot soften it, because neither is given the sentence.

Whole, or nothing

The props are a finished artefact. There is no streaming, no partial, no chunk, and no score on the whole — none of those is a prop, so none can be rendered.

Anatomy

Composed text · a handover brief, not yet accepted
Composed by NightBrief v4.2 17 Aug 06:41. Composed text, not committed. Review before accepting — you will be recorded as having accepted it, not as its author.

Covered: observations, medication changes, results, clinical notes, 15 Aug 08:00 – 17 Aug 06:30.
Not carried: 3 nursing notes · 1 imaging report (reported 22:40, after the composing window) · 1 assertion withheld — no supporting entry found.
Not available: theatre record — system unreachable at 06:41.

Admitted 15 Aug with community-acquired pneumonia. Oxygen requirement fell from 4 L/min to 2 L/min over the shift obs 21:00. Antibiotics switched from intravenous to oral at 18:20 from 2 sources: med 18:20, obs 21:00.

Overnight: pain score rose to 7 at 02:15 and remains unaddressed in the record obs 02:15.

ElementRule
Disclosure First in the document, as a sentence: composer, version, time, and either who accepted it or that nobody yet has. A border does not survive copy and a colour does not survive print; a sentence survives both.
Omission notice Before the prose in DOM order: what was covered, what was not carried by category and count, how many assertions were withheld and why, and what could not be read. Unreachable is not the same as empty.
Prose Bound sentences only. Each carries its sources as links with the source’s own label; a sentence with more than one says “from n sources”. A paragraph whose every sentence was withheld does not exist.
Binding An underlined link in the running colour. Bound and unbound are not distinguished by colour, because there is no unbound text to distinguish.

Withheld, not hedged

The tempting rendering of a sentence the composer could not support is the sentence with a caveat — greyed, marked unverified, followed by a question mark. Every one of those loses to the momentum of the paragraph around it: a reader moving through fluent prose does not stop at a grey word. So the sentence is not rendered. What the reader gets instead is a count in the omission notice and the reason, which is a fact they can act on: two assertions withheld for want of a supporting entry is a prompt to go and look, where two hedged sentences are a prompt to keep reading.

This is why Sentence has two kinds and not three. A hedged kind would be the most natural addition and the most harmful; its absence is the rule.

A disclosure the composer cannot write

If the model writes its own disclosure, the disclosure is another output of the thing being disclosed. The sentence here — Composed text, not committed. Review before accepting — you will be recorded as having accepted it, not as its author — is a constant in the component’s source. It is not a prop, so a caller cannot pass a softer one, and it is not generated, so the composer cannot pass any. Once someone has accepted the text, the sentence changes to name them: accepted by, never author. There is no author prop, because nobody authors composed text; someone stands behind it.

Do's and don'ts

Do

Not carried: 3 nursing notes · 2 assertions withheld — no supporting entry found.

Antibiotics switched from intravenous to oral at 18:20 med 18:20.

The unsupported sentences are a count above the prose. The reader knows two things were not said, and why, before reading what was.

Don't

Antibiotics switched from intravenous to oral at 18:20 med 18:20. Renal function is improving (unverified).

A greyed sentence with a caveat, read at the speed of the paragraph around it. The caveat loses. This rendering is not expressible with the component: there is no hedged kind of sentence.

Do

Composed by NightBrief v4.2, 17 Aug 06:41. Accepted by A. Reyes, 17 Aug 06:58.

A sentence, first in the document. Select-all and copy carries it; print carries it; a screen reader reaches it before the prose.

Don't

Admitted 15 Aug with community-acquired pneumonia…

Author: A. Reyes

A left rule is the only mark of composition, and it does not survive copy. The clinician is credited as the author of observations they did not make.

Do

Pain score rose to 7 at 02:15 obs 02:15.

The binding names the source in the reader’s own words — which observation, when — so the link is worth opening before it is opened.

Don't

Pain score rose to 7 at 02:15 [1] · overall reliability 87%

A numbered footnote says nothing about what it points at, and the percentage is a number with no calibrated referent standing in for checking the parts. Neither is expressible here: a source has a label, and there is no score prop.

What the component enforces, and what it only asks for

The shape of the props holds the rules that are about the artefact. The rules about whether the bindings are true are the composer’s, and no renderer can hold those.

RuleHeld by How
Every sentence binds to a record source, or is withheldThe component Sentence is bound with a non-empty tuple of sources, or withheld with a reason. There is no third kind, and a source is a record reference — label and address — so a sentence cannot cite a sentence.
Asserted: ComposedText: an unbound sentence and a self-citation are unwritable
A withheld sentence is counted, never hedgedThe component Withheld sentences are dropped from the prose and counted in the omission notice with their reasons. A paragraph left empty does not render.
Asserted: ComposedText: a withheld sentence is counted, never rendered as prose
The disclosure is text, first, and not the composer’sThe component A sentence naming composer and version precedes everything in DOM order. The wording is a constant in the component, not a prop.
Asserted: ComposedText: the disclosure is text, first in the document, naming composer and version
The omission notice precedes the prose, by category and countThe component omissions is required, with covered, notCarried and notAvailable; it renders before the prose. An unreachable source is named as unread, not counted as empty.
Asserted: ComposedText: the omission notice precedes the prose and counts by category
Bindings are links named by their source, and synthesis says soThe component Each source renders as an underlined link whose text is the source’s own label. A sentence with more than one source says “from n sources” in words.
Asserted: ComposedText: every binding is a link with the source's own label, and two sources say so
Attribution is “accepted by”; no score; no partial documentThe component acceptedBy is the only attribution prop; there is no author, no score of any kind, and no streaming or partial prop. The props are the whole artefact.
Asserted: ComposedText: attribution is accepted-by, and there is no author prop
Select-all and copy carries the disclosure, then the counts, and no withheld sentenceThe component Read from a browser selection’s text — what copy carries — not from the DOM: the disclosure comes first, the omission notice before the prose, the withheld count is present and the withheld sentence is not.
Asserted: ComposedText: select-all carries the disclosure before the prose, and no withheld sentence
A binding shows the system’s focus ringThe component The governed --ring outline, at 3:1 against its surround. The bindings were the only links in the package without one, and showed whatever the browser drew. Measured with the stylesheet a consumer has.
Asserted: Focus: every focusable control shows a ring that meets 3:1 against its surround
The binding is trueYou A source is a label and an address you pass. Whether the entry at that address supports the sentence is the composer’s correctness, and nothing here can read the record to check.
The counts are rightYou notCarried is your count. An empty list is rendered as your claim that nothing was left out — “none, by the composer’s own count” — not as a fact.
The version resolves to a buildYou version is a string. See Labelling & versioning for what it must resolve to.
Nothing is committed without a named human actYou This renders the artefact and its acceptance state. The commit control, its pending state and what it writes to the Event log are yours — see Editing the draft.
The material source that could not be read blocks compositionYou The component will render a brief that names an unread source. Whether that source was material enough that no brief should exist is a judgement made before these props were built.
Why this is written down

A rule stated on a component page reads as a rule the component keeps. 7 of these 12 are; 5 are obligations this page is handing to the reader. The six the component holds are the ones about the shape of the artefact — what can be expressed at all. The five it cannot hold are about whether the artefact is true, and a renderer that claimed those would be the composer writing its own disclosure by another route.

Accessibility

Outcomes of use

Clinical safety notes

Risk controls this page specifies

Trace these in your risk file (ISO 14971) and usability engineering file (IEC 62366-1). Which of these the component keeps and which are yours is stated in the guarantees table; a control the component does not keep is one your risk file must show you keep.

Implementation

$ npx shadcn@latest add https://md.notjustany.tech/r/composed-text.json
<ComposedText
  composer={{ name: "NightBrief", version: "4.2" }}
  composedAt="17 Aug 06:41"
  omissions={{
    covered: "observations, medication changes, 15 Aug 08:00 – 17 Aug 06:30",
    notCarried: [{ category: "nursing notes", count: 3 }],
    notAvailable: [{ source: "theatre record", reason: "system unreachable at 06:41" }],
  }}
  paragraphs={[
    [
      { kind: "bound", text: "Oxygen requirement fell from 4 L/min to 2 L/min over the shift.",
        sources: [{ id: "o1", label: "obs 21:00", href: "/record/obs/o1" }] },
      { kind: "withheld", reason: "no supporting entry found" },
    ],
  ]}
  acceptedBy={undefined}   // not yet; there is no `author` prop and never will be
/>

// A sentence is bound or withheld. There is no hedged kind, no score prop, and no
// way to pass the disclosure in: the component owns that sentence.
NotJustAnyMed.Tech Design System · Composed text · v1.0 · draft for review
Reference applications named in this system are fictional; all patient data shown is fabricated.