From c7b0ebb89751e57f128b739ff89af9ad26d33cc6 Mon Sep 17 00:00:00 2001
From: Ambisphaeric <270742616+Ambisphaeric@users.noreply.github.com>
Date: Fri, 17 Jul 2026 19:28:37 -0400
Subject: [PATCH 1/2] fix(hud): make row decorations unselectable; de-slop
residual machine-voice strings
Copying values out of the HUD is a core workflow, but a native selection
(double-click / drag / select-all) captured row decorations along with the
value (why lines, mark glyphs, kind tags, affordance labels). Every decoration
span is now user-select:none so a selection yields the bare value only; value
text (entity/moment/summary/todo/draft/transcript/field text) stays selectable.
A vnode-level regression test derives the non-selectable classes from the actual
stylesheet and asserts a selection across representative rows extracts the bare
value, with a by-construction negative probe.
Also removes residual machine-voice from user-visible strings: banned end-user
vocabulary and an internal lane name in two block labels; roadmap-phase and
tracker references in placeholder/diagnostics copy; a raw chunk ordinal in the
citations line; a raw exception painted under the chat box (now a calm line with
the machine reason behind the hover title); and a live copy control on degraded
summary rows whose payload was an empty string.
Refs #242
---
.../engine-link/screen-surface-e2e.test.ts | 2 +-
apps/client/src/surfaces/blocks/ask.ts | 2 +-
apps/client/src/surfaces/blocks/custom.ts | 2 +-
.../src/surfaces/blocks/distillates.test.ts | 8 +-
.../client/src/surfaces/blocks/distillates.ts | 6 +-
.../src/surfaces/blocks/fields-app.test.ts | 6 +-
.../client/src/surfaces/blocks/fields.test.ts | 6 +-
apps/client/src/surfaces/blocks/fields.ts | 3 +-
.../src/surfaces/blocks/pinned-doc.test.ts | 17 +++
apps/client/src/surfaces/blocks/pinned-doc.ts | 4 +-
.../src/surfaces/blocks/relevant-now.ts | 5 +-
.../surfaces/blocks/selection-hygiene.test.ts | 131 ++++++++++++++++++
.../src/surfaces/blocks/summaries.test.ts | 4 +
apps/client/src/surfaces/blocks/summaries.ts | 4 +-
.../surfaces/blocks/transcript-inspector.ts | 2 +-
.../src/surfaces/hud/input-submit.test.ts | 26 +++-
apps/client/src/surfaces/hud/input-submit.ts | 22 ++-
.../src/surfaces/hud/notetaker-layout.test.ts | 2 +-
apps/client/src/surfaces/hud/panel-styles.ts | 9 ++
apps/client/src/surfaces/hud/styles.ts | 32 +++++
20 files changed, 266 insertions(+), 27 deletions(-)
create mode 100644 apps/client/src/surfaces/blocks/selection-hygiene.test.ts
diff --git a/apps/client/src/engine-link/screen-surface-e2e.test.ts b/apps/client/src/engine-link/screen-surface-e2e.test.ts
index 0b4c5955..fcbd90b5 100644
--- a/apps/client/src/engine-link/screen-surface-e2e.test.ts
+++ b/apps/client/src/engine-link/screen-surface-e2e.test.ts
@@ -245,7 +245,7 @@ test('#175 headless: a real screen mirror crosses EngineLink + seeded Surface +
assert.equal(loadedSurface?.id, 'surf-openinfo-fields', 'the engine served the actual seeded Surface')
assert.ok(loadedSurface?.stack.some((block) => block.block === 'distillates' && block.query?.source === 'distillates'))
assert.equal(mounted, true)
- assert.match(headlessTarget.innerHTML, /Transcript · distillate stream/)
+ assert.match(headlessTarget.innerHTML, /class="glbl">Transcript)
assert.ok(headlessTarget.innerHTML.includes(OCR_TEXT), 'model-only text reached serialized block HTML through the persisted mirror')
assert.equal(
(headlessTarget.innerHTML.match(new RegExp(`${OCR_TEXT}`, 'g')) ?? []).length,
diff --git a/apps/client/src/surfaces/blocks/ask.ts b/apps/client/src/surfaces/blocks/ask.ts
index b14e9fc3..184364e0 100644
--- a/apps/client/src/surfaces/blocks/ask.ts
+++ b/apps/client/src/surfaces/blocks/ask.ts
@@ -11,5 +11,5 @@ export const renderAsk: BlockRenderer = () =>
'div',
{ class: 'hgroup' },
h('div', { class: 'glbl' }, 'Ask'),
- h('div', { class: 'rel' }, h('span', { class: 'mk p' }, '·'), h('span', { class: 'body' }, h('span', { class: 'why' }, 'ask this context — recall path P3'))),
+ h('div', { class: 'rel' }, h('span', { class: 'mk p' }, '·'), h('span', { class: 'body' }, h('span', { class: 'why' }, 'ask about what is here'))),
)
diff --git a/apps/client/src/surfaces/blocks/custom.ts b/apps/client/src/surfaces/blocks/custom.ts
index 1b39b991..040af065 100644
--- a/apps/client/src/surfaces/blocks/custom.ts
+++ b/apps/client/src/surfaces/blocks/custom.ts
@@ -17,6 +17,6 @@ export const renderCustom: BlockRenderer = ({ block }) =>
'div',
{ class: 'rel' },
h('span', { class: 'mk p' }, '·'),
- h('span', { class: 'body' }, h('span', { class: 'why' }, block.block === 'custom' ? 'sandboxed custom block — P6' : 'no renderer for this block type in this client build')),
+ h('span', { class: 'body' }, h('span', { class: 'why' }, block.block === 'custom' ? 'a self-contained custom block' : 'no renderer for this block type in this client build')),
),
)
diff --git a/apps/client/src/surfaces/blocks/distillates.test.ts b/apps/client/src/surfaces/blocks/distillates.test.ts
index 93d7fb22..f006e8b2 100644
--- a/apps/client/src/surfaces/blocks/distillates.test.ts
+++ b/apps/client/src/surfaces/blocks/distillates.test.ts
@@ -38,10 +38,10 @@ test('the distillates block renders STORE-DERIVED windows: distilled text, a tim
renderSurface({ surface, now, results: [undefined, result(items)] }, defaultBlockRegistry),
)
- assert.match(html, /Transcript · distillate stream/) // the block's group label
+ assert.match(html, /class="glbl">Transcript) // the block's group label
assert.match(html, /agreed to ship Thursday/) // store-derived window text (only via result.items)
assert.match(html, /class="mk t">2:30p/) // each line carries its timestamp (clockLabel of windowEnd)
- assert.match(html, /class="why">distilled from capture) // HUMAN why (#117/#118), clock already leads the row
+ assert.match(html, /class="why">from what was captured) // HUMAN why (#117/#118), clock already leads the row
// #118 REGRESSION: no endpoint id, no `via …` machine phrasing at this tier — the recorded trail
// stays on the distillate's provenance, reachable on diagnostics surfaces + the ledger, not here.
assert.doesNotMatch(html, /llm\.fast/)
@@ -54,7 +54,7 @@ test('empty is EXPLAINABLE, not silent: an always-visible distillates block rend
const html = renderToHtml(
renderSurface({ surface, now, results: [undefined, result([])] }, defaultBlockRegistry),
)
- assert.match(html, /Transcript · distillate stream/) // the block still renders its label
+ assert.match(html, /class="glbl">Transcript) // the block still renders its label
assert.match(html, /No transcript yet/)
// #227: the live-empty why NAMES the Settings → Features toggle in human words (a pure renderer can't read
// the runtime flag, so it names the enablement path unconditionally — the fields.ts pattern).
@@ -84,5 +84,5 @@ test('top caps the rendered rows, and an on-match empty distillates block stays
stack: [{ block: 'now' }, { block: 'distillates', show: 'on-match', query: { source: 'distillates', params: {} } }],
}
const hidden = renderToHtml(renderSurface({ surface: onMatch, now, results: [undefined, result([])] }, defaultBlockRegistry))
- assert.doesNotMatch(hidden, /Transcript · distillate stream/)
+ assert.doesNotMatch(hidden, /class="glbl">Transcript)
})
diff --git a/apps/client/src/surfaces/blocks/distillates.ts b/apps/client/src/surfaces/blocks/distillates.ts
index f32be07d..b8db55ca 100644
--- a/apps/client/src/surfaces/blocks/distillates.ts
+++ b/apps/client/src/surfaces/blocks/distillates.ts
@@ -6,7 +6,9 @@ import { actionButtons } from './actions.js'
type Actions = NonNullable
-const LABEL = 'Transcript · distillate stream'
+// hud-voice §2: "distillate" is banned end-user vocabulary; the block is framed to the user as the
+// transcript (its empty state and Settings toggle already say so), so the label is the human word (#242).
+const LABEL = 'Transcript'
/**
* The `distillates` block — the transcript/distillate STREAM on a panel (#12). It reads the hydrated
@@ -34,7 +36,7 @@ const streamRow = (distillate: Distillate, actions: Actions): VNode =>
'span',
{ class: 'body' },
h('span', { class: 'ttl' }, distillate.text),
- h('span', { class: 'why' }, 'distilled from capture'),
+ h('span', { class: 'why' }, 'from what was captured'),
),
h('span', { class: 'go' }, ...actionButtons(actions, distillate.text)),
)
diff --git a/apps/client/src/surfaces/blocks/fields-app.test.ts b/apps/client/src/surfaces/blocks/fields-app.test.ts
index 947d3c3a..5cce8648 100644
--- a/apps/client/src/surfaces/blocks/fields-app.test.ts
+++ b/apps/client/src/surfaces/blocks/fields-app.test.ts
@@ -103,9 +103,9 @@ test('the SHIPPED fields-app document renders the fast-fields canon through the
assert.match(html, /data-copy="Q3 renewal pricing"/)
// the distillate/transcript stream block renders beneath the fields with its own human why-line
- assert.match(html, /Transcript · distillate stream/)
+ assert.match(html, /class="glbl">Transcript)
assert.match(html, /Dana to review the security doc/)
- assert.match(html, /distilled from capture/)
+ assert.match(html, /from what was captured/)
})
test('the shipped fields-app document is honest when the fields feature is OFF: points at the fix, never blank', async () => {
@@ -114,7 +114,7 @@ test('the shipped fields-app document is honest when the fields feature is OFF:
assert.equal(fieldsBlock?.show, 'always', 'the app must not vanish when empty (unlike the HUD ride-along)')
const html = renderToHtml(renderSurface({ surface, now, results: results([]) }, defaultBlockRegistry))
- assert.match(html, /Fields · fast/) // the card is present…
+ assert.match(html, /class="glbl">Fields) // the card is present…
assert.match(html, /No fields yet/) // …and explains itself…
assert.match(html, /turn on Fields in Settings → Features/) // …pointing at the toggle in human terms
assert.doesNotMatch(html, /distill\.fields/) // …never the raw flag key (#118)
diff --git a/apps/client/src/surfaces/blocks/fields.test.ts b/apps/client/src/surfaces/blocks/fields.test.ts
index 3a9d08d4..df331cbd 100644
--- a/apps/client/src/surfaces/blocks/fields.test.ts
+++ b/apps/client/src/surfaces/blocks/fields.test.ts
@@ -49,7 +49,7 @@ test('the fields block renders each field value with its label, value, and a HUM
const items = [fieldValue('field-topic', 'topic', 'Q3 planning')]
const html = renderToHtml(renderSurface({ surface, now, results: [undefined, result(items)] }, defaultBlockRegistry))
- assert.match(html, /Fields · fast/) // the block's group label
+ assert.match(html, /class="glbl">Fields) // the block's group label
assert.match(html, /Q3 planning/) // store-derived field value (only via result.items)
assert.match(html, /class="mk t">topic/) // the field label
// the why-line is HUMAN (#117/#118): recency from the value's updatedAt, never the machine trail
@@ -86,7 +86,7 @@ test('a provisional field renders the #66 micro-state dot (a real signal, not de
test('empty is EXPLAINABLE, not silent: an always-visible fields block renders a no-fields line', () => {
const html = renderToHtml(renderSurface({ surface, now, results: [undefined, result([])] }, defaultBlockRegistry))
- assert.match(html, /Fields · fast/)
+ assert.match(html, /class="glbl">Fields)
assert.match(html, /No fields yet/)
// #100/#118: the empty state points at the Settings toggle in HUMAN terms — never the raw flag key
assert.match(html, /turn on Fields in Settings → Features/)
@@ -104,5 +104,5 @@ test('an all-dismissed empty discloses the suppressed count (#66), and an on-mat
stack: [{ block: 'now' }, { block: 'fields', show: 'on-match', query: { source: 'fields', params: {} } }],
}
const hidden = renderToHtml(renderSurface({ surface: onMatch, now, results: [undefined, result([])] }, defaultBlockRegistry))
- assert.doesNotMatch(hidden, /Fields · fast/)
+ assert.doesNotMatch(hidden, /class="glbl">Fields)
})
diff --git a/apps/client/src/surfaces/blocks/fields.ts b/apps/client/src/surfaces/blocks/fields.ts
index c2872d57..d6e3dd31 100644
--- a/apps/client/src/surfaces/blocks/fields.ts
+++ b/apps/client/src/surfaces/blocks/fields.ts
@@ -7,7 +7,8 @@ import { rowAffordances } from './actions.js'
type Actions = NonNullable
-const LABEL = 'Fields · fast'
+// hud-voice §2: "fast" is the internal lane/tier name (fast vs judged) — not the user's world; drop it (#242).
+const LABEL = 'Fields'
/**
* The `fields` block — the fan-out substrate's surface (#61). It reads the hydrated `fields` query
diff --git a/apps/client/src/surfaces/blocks/pinned-doc.test.ts b/apps/client/src/surfaces/blocks/pinned-doc.test.ts
index 9a3f5bc8..99b9c1f6 100644
--- a/apps/client/src/surfaces/blocks/pinned-doc.test.ts
+++ b/apps/client/src/surfaces/blocks/pinned-doc.test.ts
@@ -48,3 +48,20 @@ test('pinned-doc copy payload is the pasteable reference ONLY — the title neve
assert.doesNotMatch(payload ?? '', /—/)
assert.doesNotMatch(payload ?? '', /Signed MSA/)
})
+
+test('a URL pin copies the FULLY REALIZED link — the full canonical URI, not the display title (#242)', () => {
+ // The owner canon: copy must yield the whole value (a full URL), never a short/display form. A url-kind
+ // pin displays a human title in the .ttl but its `uri` is the full canonical link — the copy payload is
+ // the uri, so a copied link is complete (scheme + host + path + query), never the bare domain shown as title.
+ const link: Pin = {
+ id: 'pin-url', workspaceId: 'ws', uri: 'https://docs.example.com/rfc/soc2?section=controls#c-4',
+ title: 'SOC 2 controls', kind: 'url', ingest: { status: 'ingested' }, createdAt: '2026-07-16T20:10:00Z',
+ }
+ const html = render([link])
+ const payload = copyPayload(html)
+ assert.equal(payload, 'https://docs.example.com/rfc/soc2?section=controls#c-4') // the WHOLE URL
+ assert.match(html, /SOC 2 controls/) // the display title still renders on the row…
+ // …but never rides into the clipboard, and neither does the ext/kind decoration or a bare-domain shortening.
+ assert.doesNotMatch(payload ?? '', /SOC 2 controls|—/)
+ assert.notEqual(payload, 'docs.example.com')
+})
diff --git a/apps/client/src/surfaces/blocks/pinned-doc.ts b/apps/client/src/surfaces/blocks/pinned-doc.ts
index 4ade02b0..796a50ad 100644
--- a/apps/client/src/surfaces/blocks/pinned-doc.ts
+++ b/apps/client/src/surfaces/blocks/pinned-doc.ts
@@ -29,7 +29,9 @@ const pinRow = (pin: Pin, actions: Actions): VNode =>
h(
'span',
{ class: 'body' },
- h('span', { class: 'ttl' }, pin.title, ' ', h('span', { class: 'ext' }, pin.kind)),
+ // The kind tag carries its leading space inside the (non-selectable) .ext span so a native selection
+ // of the title yields the bare title with no trailing separator (#242).
+ h('span', { class: 'ttl' }, pin.title, h('span', { class: 'ext' }, ` ${pin.kind}`)),
h('span', { class: 'why' }, ingestWhy(pin)),
),
// copy payload = the document VALUE ONLY (`pin.uri`) — the pasteable reference, matching the fallback
diff --git a/apps/client/src/surfaces/blocks/relevant-now.ts b/apps/client/src/surfaces/blocks/relevant-now.ts
index 30ad6fc1..1f1dbfb0 100644
--- a/apps/client/src/surfaces/blocks/relevant-now.ts
+++ b/apps/client/src/surfaces/blocks/relevant-now.ts
@@ -114,7 +114,10 @@ const renderRow = (
const glyph = clarifyGlyph(row.entity, clarify)
const ask = clarifyAsk(row.entity, dismissBase.workspaceId, clarify)
const body: VNode[] = [
- h('span', { class: 'ttl' }, stateDot(row.entity.state, vocab), row.entity.name, ' ', h('span', { class: 'ext' }, ext)),
+ // The value (entity name) is the ONLY selectable text in the row title; the ext/kind tag carries its
+ // own leading space INSIDE the (non-selectable) .ext span so a native selection yields the bare value
+ // with no trailing separator (#242).
+ h('span', { class: 'ttl' }, stateDot(row.entity.state, vocab), row.entity.name, h('span', { class: 'ext' }, ` ${ext}`)),
h('span', { class: 'why' }, why),
]
if (ask) body.push(ask)
diff --git a/apps/client/src/surfaces/blocks/selection-hygiene.test.ts b/apps/client/src/surfaces/blocks/selection-hygiene.test.ts
new file mode 100644
index 00000000..816ce372
--- /dev/null
+++ b/apps/client/src/surfaces/blocks/selection-hygiene.test.ts
@@ -0,0 +1,131 @@
+import { test } from 'node:test'
+import assert from 'node:assert/strict'
+import type { Block, Distillate, Entity, RelevantEntity, TodoItem } from '@openinfo/contracts'
+import type { NowContext } from '../block-renderer/index.js'
+import type { VNode } from '../block-renderer/vnode.js'
+import { hudStyles } from '../hud/styles.js'
+import { panelStyles } from '../hud/panel-styles.js'
+import { defaultBlockRegistry } from './index.js'
+
+/**
+ * SELECTION-HYGIENE regression (#242) — the headline QA defect: the HUD is used to select/copy VALUES out
+ * of rows, and a native double-click / drag / select-all must capture the bare value and NOTHING else (no
+ * why/context line, no mark glyph, no kind tag, no affordance label). The bug the owner saw was selecting a
+ * summary line yielding ".".
+ *
+ * The client has no bundler and the renderer is a PURE vnode tree, so this test proves the mechanism WITHOUT
+ * a DOM: it derives the set of non-selectable classes FROM THE ACTUAL STYLESHEET (never a hardcoded list),
+ * then walks a rendered row collecting the text a browser selection would keep — every text node with no
+ * `user-select:none` ancestor — and asserts it equals the bare value. Deriving the set from the live
+ * stylesheet is the by-construction guard: delete a rule in styles.ts and the matching decoration text leaks
+ * into `selectableText`, failing the equality below; the explicit `has(...)` assertions and the negative
+ * probe make that dependency load-bearing rather than vacuously green.
+ */
+
+const now: NowContext = { live: true }
+
+/**
+ * Parse a CSS string into the set of classes made non-selectable. For each rule whose body declares
+ * `user-select:none`, the SUPPRESSED element is the last simple selector in each comma-separated selector
+ * (e.g. `.rel .body .ttl .ext` suppresses `.ext`; `.rel .go` suppresses `.go` and its children by
+ * inheritance), so we take the trailing class token. No hardcoded class list — the stylesheet is the source.
+ */
+const parseSuppressedClasses = (rawCss: string): Set => {
+ const out = new Set()
+ // Strip CSS comments first — they are not selectors, and ours name value classes (.ttl, .in-msg) that
+ // must NOT be treated as suppressed.
+ const css = rawCss.replace(/\/\*[\s\S]*?\*\//g, '')
+ for (const rule of css.split('}')) {
+ const brace = rule.indexOf('{')
+ if (brace === -1) continue
+ const selectorList = rule.slice(0, brace)
+ const body = rule.slice(brace + 1)
+ if (!/user-select\s*:\s*none/.test(body)) continue
+ for (const selector of selectorList.split(',')) {
+ const classes = selector.trim().match(/\.[A-Za-z0-9_-]+/g)
+ if (classes && classes.length > 0) out.add(classes[classes.length - 1]!.slice(1))
+ }
+ }
+ return out
+}
+
+const hasSuppressedClass = (attrs: Record, suppressed: ReadonlySet): boolean => {
+ const cls = attrs['class']
+ return typeof cls === 'string' && cls.split(/\s+/).some((c) => suppressed.has(c))
+}
+
+/** The text a native selection across `node` would keep: every text node NOT under a user-select:none ancestor. */
+const selectableText = (node: VNode, suppressed: ReadonlySet, under = false): string => {
+ if (typeof node === 'string') return under ? '' : node
+ const nowUnder = under || hasSuppressedClass(node.attrs, suppressed)
+ return node.children.map((child) => selectableText(child, suppressed, nowUnder)).join('')
+}
+
+const render = (block: Block, items: unknown[]): VNode => {
+ const node = defaultBlockRegistry[block.block]!({ block, now, result: { source: block.query!.source, items, truncated: false } })
+ assert.ok(node && !Array.isArray(node), 'block renders a single root node')
+ return node
+}
+
+const copyAction = [{ id: 'a-copy', label: 'Copy', verb: 'copy' as const, params: {} }]
+
+const suppressed = parseSuppressedClasses(`${hudStyles}\n${panelStyles}`)
+
+// A link surfaces as an `artifact` entity whose `name` is the extracted surface form — a FULL URL here, to
+// double as the "fully realized value" proof: the whole URL selects, and none of the row decoration does.
+const linkEntity: Entity = {
+ id: 'e-link', workspaceId: 'ws', kind: 'artifact', name: 'https://docs.example.com/soc2?section=controls#c-4',
+ aliases: [], momentRefs: [], outboundCount: 0, mentions: 3,
+ firstSeen: '2026-07-16T19:57:00Z', lastSeen: '2026-07-16T19:57:00Z',
+ provenance: [{ slot: 'llm', endpoint: 'dev-mac-omlx', windowEnd: '2026-07-16T19:57:00Z' }],
+ sightings: [{ via: 'heard', at: '2026-07-16T19:57:00Z' }],
+}
+const relBlock: Block = { block: 'relevant-now', show: 'always', query: { source: 'relevant-now', params: {} }, actions: copyAction }
+const rel: RelevantEntity = { entity: linkEntity, score: 1, moments: [] }
+const relNode = render(relBlock, [rel])
+
+const todoBlock: Block = { block: 'todos', show: 'always', query: { source: 'todos', params: { session: 'current' } }, actions: copyAction }
+const todo: TodoItem = { id: 't1', text: 'Send Dana the signed MSA', createdAt: '2026-07-16T14:40:00Z', provenance: { sessionId: 'ses', distillateId: 'dst-9' } }
+const todoNode = render(todoBlock, [todo])
+
+const distBlock: Block = { block: 'distillates', show: 'always', query: { source: 'distillates', params: {} }, actions: copyAction }
+const distillate: Distillate = {
+ id: 'dst-1', sessionId: 'ses', workspaceId: 'ws',
+ windowStart: '2026-07-16T14:20:00Z', windowEnd: '2026-07-16T14:30:00Z',
+ sourceChunks: ['c-1'], text: 'Provide feedback to QA within 18 minutes',
+ voice: { scope: 'session', dials: { tone: 3, warmth: 4, wit: 2, charm: 2, specificity: 9, brevity: 8 } },
+ provenance: { slot: 'llm', endpoint: 'llm.fast' }, schemaVersion: 1, createdAt: '2026-07-16T14:30:00Z',
+}
+const distNode = render(distBlock, [distillate])
+
+test('a native selection of a relevant-now row keeps the bare value only — no why, mark, kind tag, or affordance', () => {
+ // The row DISPLAYS its why ("heard · …"), a mark glyph, the kind/mention tag, and a Copy button — none may
+ // ride into a selection. The only selectable text is the entity value (here, the full canonical URL).
+ assert.equal(selectableText(relNode, suppressed), linkEntity.name)
+})
+
+test('a native selection of a todos row keeps the bare to-do text only', () => {
+ assert.equal(selectableText(todoNode, suppressed), todo.text)
+})
+
+test('a native selection of a distillates (transcript) row keeps the bare value only — the ".from the meeting" defect cannot recur', () => {
+ // The exact shape the owner reported: value + adjacent why-line. The why ("from what was captured") and the
+ // clock (.mk) are decoration; a selection must yield only the distilled value.
+ assert.equal(selectableText(distNode, suppressed), distillate.text)
+})
+
+test('the classes this test relies on are non-selectable in the ACTUAL stylesheet (by-construction guard)', () => {
+ // Derived from styles.ts / panel-styles.ts, not hardcoded — removing any of these rules fails BOTH this
+ // assertion and the equality tests above (the decoration text would leak into selectableText).
+ for (const cls of ['why', 'ext', 'mk', 'glbl', 'go', 'dot', 't', 'unans', 'in-cites', 'in-who']) {
+ assert.ok(suppressed.has(cls), `.${cls} must be non-selectable`)
+ }
+})
+
+test('negative probe: were .why NOT suppressed, the why line WOULD leak — proving the guard is load-bearing', () => {
+ const weakened = new Set(suppressed)
+ weakened.delete('why')
+ const leaked = selectableText(relNode, weakened)
+ assert.notEqual(leaked, linkEntity.name)
+ assert.match(leaked, /heard/) // the why line rejoins the selection exactly when the rule is gone
+})
diff --git a/apps/client/src/surfaces/blocks/summaries.test.ts b/apps/client/src/surfaces/blocks/summaries.test.ts
index efeb7ed5..7e811adb 100644
--- a/apps/client/src/surfaces/blocks/summaries.test.ts
+++ b/apps/client/src/surfaces/blocks/summaries.test.ts
@@ -50,6 +50,10 @@ test('HONEST degraded: a summary with no model prose renders a calm unavailable
assert.match(html, /Summary unavailable — no summary model connected/) // calm human degraded copy (hud-voice §3)
assert.match(html, /nothing invented/) // the why reassures: no fabrication
assert.match(html, /title="no summarizer endpoint"/) // the machine reason stays reachable on inspection, not in glance
+ // #242: a degraded row has no value to copy — the copy affordance is SUPPRESSED, never a live button that
+ // would put an empty string on the clipboard.
+ assert.doesNotMatch(html, /data-copy=""/)
+ assert.doesNotMatch(html, /data-verb="copy"/)
})
test('empty is EXPLAINABLE, and an on-match empty summaries block stays hidden', () => {
diff --git a/apps/client/src/surfaces/blocks/summaries.ts b/apps/client/src/surfaces/blocks/summaries.ts
index b052bc6b..7a55f53c 100644
--- a/apps/client/src/surfaces/blocks/summaries.ts
+++ b/apps/client/src/surfaces/blocks/summaries.ts
@@ -50,7 +50,9 @@ const summaryRow = (summary: Summary, actions: Actions): VNode => {
// The recorded machine reason stays reachable on inspection (hud-voice §4), never in glance position.
h('span', degraded && summary.degraded ? { class: 'why', title: summary.degraded.reason } : { class: 'why' }, why),
),
- h('span', { class: 'go' }, ...actionButtons(actions, degraded ? '' : summary.text!)),
+ // A degraded row has NO value to copy — suppress the copy affordance entirely rather than shipping a
+ // live Copy button that puts an empty string on the clipboard (#242). Live rows copy the prose.
+ h('span', { class: 'go' }, ...(degraded ? [] : actionButtons(actions, summary.text!))),
)
}
diff --git a/apps/client/src/surfaces/blocks/transcript-inspector.ts b/apps/client/src/surfaces/blocks/transcript-inspector.ts
index fbfce6c5..6c6d4b6f 100644
--- a/apps/client/src/surfaces/blocks/transcript-inspector.ts
+++ b/apps/client/src/surfaces/blocks/transcript-inspector.ts
@@ -80,7 +80,7 @@ const retentionRow = (ringLimit: number): VNode =>
'span',
{ class: 'body' },
h('span', { class: 'ttl' }, `live feed · last ${ringLimit}, this session, not persisted`),
- h('span', { class: 'why' }, 'transcript chunks are the ephemeral fast-path (#58); the durable stream is the distillate block'),
+ h('span', { class: 'why' }, 'transcript chunks are the ephemeral fast-path; the durable stream lives in the Transcript block'),
),
)
diff --git a/apps/client/src/surfaces/hud/input-submit.test.ts b/apps/client/src/surfaces/hud/input-submit.test.ts
index d85a2b9c..27170db3 100644
--- a/apps/client/src/surfaces/hud/input-submit.test.ts
+++ b/apps/client/src/surfaces/hud/input-submit.test.ts
@@ -176,7 +176,10 @@ test('a FAILED submit paints the reason as visible text (never a silent no-op)',
await flush()
const status = container.querySelector('.in-status')!.innerHTML
- assert.match(status, /in-note error">no llm endpoint answered/)
+ // hud-voice §2 (#242): the strip shows ONE calm human line, never the raw exception verbatim…
+ assert.match(status, /class="in-note error"[^>]*>Couldn’t answer — the engine returned an error\./)
+ // …and the raw machine reason stays REACHABLE behind inspection (the hover title), never painted as slop.
+ assert.match(status, /title="[^"]*no llm endpoint answered \(fabric llm slot is empty\)[^"]*"/)
// the user turn is still shown; the assistant turn is NOT fabricated
const log = container.querySelector('.in-log')!.innerHTML
assert.match(log, /You<\/span>hello/)
@@ -226,6 +229,27 @@ test('a dropped file ingests via the injected upload, shows the attachment, and
assert.match(container.querySelector('.in-log')!.innerHTML, /cited p\.2/)
})
+test('a PAGELESS citation is named by its human title, never a raw chunk ordinal (#242)', async () => {
+ const session = new InputSession({
+ // Two chunks from the same pageless source: the machine ordinal (#0/#1) must NOT render; the human
+ // title stands in, deduped so it appears once.
+ submit: async () =>
+ reply('answered', 'cited', [
+ { pinId: 'pin-9', pinTitle: 'onboarding notes', ordinal: 0, excerpt: 'a' },
+ { pinId: 'pin-9', pinTitle: 'onboarding notes', ordinal: 1, excerpt: 'b' },
+ ]),
+ })
+ const { container, textarea, submit } = buildContainer()
+ session.install(container)
+ textarea.value = 'what did we agree?'
+ container.dispatch('click', submit)
+ await flush()
+ const log = container.querySelector('.in-log')!.innerHTML
+ assert.match(log, /cited onboarding notes/) // the human source name
+ assert.doesNotMatch(log, /#0|#1/) // never the raw chunk ordinal
+ assert.doesNotMatch(log, /onboarding notes · onboarding notes/) // deduped, not stuttered
+})
+
test('the local path is resolved via the preload webUtils bridge (Electron 32+ removed File.path)', async () => {
// The desktop shell's real DOM File no longer carries `.path` (removed in Electron 32; this repo ships
// 38) — the path now comes from webUtils.getPathForFile, exposed on window.openinfoFiles by preload.cts.
diff --git a/apps/client/src/surfaces/hud/input-submit.ts b/apps/client/src/surfaces/hud/input-submit.ts
index 7437bf7c..8b7a9227 100644
--- a/apps/client/src/surfaces/hud/input-submit.ts
+++ b/apps/client/src/surfaces/hud/input-submit.ts
@@ -137,7 +137,11 @@ const turnHtml = (turn: ChatTurn): string =>
const citationsHtml = (reply: ChatReply): string => {
if (reply.citations.length === 0) return ''
- const tags = reply.citations.map((c) => escapeHtml(c.page !== undefined ? `p.${c.page}` : `#${c.ordinal}`)).join(' · ')
+ // A page anchor is human ("p.3"); the chunk ORDINAL is a machine index (hud-voice §2), so a pageless
+ // source is named by its human title instead, never "#2" (#242). Deduped so repeated anchors don't stutter.
+ const tags = [...new Set(reply.citations.map((c) => (c.page !== undefined ? `p.${c.page}` : (c.pinTitle ?? 'a passage'))))]
+ .map(escapeHtml)
+ .join(' · ')
return `cited ${tags}
`
}
@@ -335,8 +339,10 @@ export class InputSession {
const outcome = await this.deps.captureScreen()
if (outcome.ok) screenshot = outcome.frame
else captureNote = outcome.reason
- } catch (error) {
- captureNote = error instanceof Error ? error.message : String(error)
+ } catch {
+ // A capture bridge that throws is a screen-side failure, not the answer — say so in calm words,
+ // never paint the raw exception into the status line (hud-voice §2, #242).
+ captureNote = 'screen capture did not respond'
}
} else {
captureNote = 'screen capture needs the desktop app'
@@ -388,8 +394,14 @@ export class InputSession {
const calm = calmChatStatus(reply, captureNote)
this.status = calm.text === '' ? undefined : { kind: 'ok', text: calm.text, detail: calm.detail }
} catch (error) {
- // VISIBLE FAILURE — the reason is painted as text, never swallowed.
- this.status = { kind: 'error', text: error instanceof Error ? error.message : String(error) }
+ // VISIBLE FAILURE — the reason is never swallowed, but the raw exception is machine-speak
+ // (hud-voice §2): the strip shows one calm human line and the raw message rides the hover title
+ // (the same detail-on-inspection pattern as calmChatStatus), reachable but never painted as slop (#242).
+ this.status = {
+ kind: 'error',
+ text: 'Couldn’t answer — the engine returned an error.',
+ detail: error instanceof Error ? error.message : String(error),
+ }
} finally {
this.streaming = undefined
this.pending = false
diff --git a/apps/client/src/surfaces/hud/notetaker-layout.test.ts b/apps/client/src/surfaces/hud/notetaker-layout.test.ts
index 588b7c04..4fc5cc0a 100644
--- a/apps/client/src/surfaces/hud/notetaker-layout.test.ts
+++ b/apps/client/src/surfaces/hud/notetaker-layout.test.ts
@@ -227,5 +227,5 @@ test('the note-taker zones are honest when empty (always-on blocks explain thems
assert.match(right, /No transcript yet/)
assert.match(right, /turn on “Distill what is captured” in Settings → Features/)
// the on-match fields block simply stays hidden when it has produced nothing (no fabricated card)
- assert.doesNotMatch(right, /Fields · fast/)
+ assert.doesNotMatch(right, /class="glbl">Fields)
})
diff --git a/apps/client/src/surfaces/hud/panel-styles.ts b/apps/client/src/surfaces/hud/panel-styles.ts
index 42990a9a..fc06f1f9 100644
--- a/apps/client/src/surfaces/hud/panel-styles.ts
+++ b/apps/client/src/surfaces/hud/panel-styles.ts
@@ -34,4 +34,13 @@ export const panelStyles = `
font-size:11px;color:var(--s-muted);padding:6px 12px;border-bottom:1px solid var(--s-line-soft)}
.panel-suggestion button{font:inherit;font-size:11px;color:var(--s-ink);background:none;
border:1px solid var(--s-line);border-radius:7px;padding:2px 8px;cursor:pointer}
+/* Selection hygiene (#242): the chat VALUE (.in-msg — the message text) stays selectable; the
+ role label, citation line, status note, attachment chip, file-drop affordance, and suggestion
+ banner are decorations and must never ride into a native selection of the conversation. */
+.in-turn .in-who,
+.in-cites,
+.in-note,
+.in-attached,
+.in-drop,
+.panel-suggestion{-webkit-user-select:none;user-select:none}
`
diff --git a/apps/client/src/surfaces/hud/styles.ts b/apps/client/src/surfaces/hud/styles.ts
index 0278bddc..774998f9 100644
--- a/apps/client/src/surfaces/hud/styles.ts
+++ b/apps/client/src/surfaces/hud/styles.ts
@@ -108,6 +108,38 @@ body{margin:0;background:var(--page-bg);
.mk.a{color:var(--m-artifact)} .mk.c{color:var(--m-commit)} .mk.q{color:var(--m-quest)}
.mk.d{color:var(--m-decide)} .mk.p{color:var(--s-muted)}
+/* ── Selection hygiene (#242): the HUD is used to select/copy VALUES out of rows, so a native
+ double-click / drag / select-all must capture the bare value and NOTHING else. The value text
+ (entity/moment/summary/todo/draft/transcript/field text — .ttl text, .mo .x text, .lt-tx, .in-msg)
+ stays selectable by inheriting the default; every DECORATION span is user-select:none so it can
+ never ride into a selection. The .hudtop drag handle was already non-selectable (its .ctx/.el ride
+ with it). Setting none on a container (.rel .go, .glyphs, .clarify-ask, .session-control) covers its
+ buttons by inheritance; setting it on a descendant (.ttl .ext, .mo .x .unans) overrides the selectable
+ value ancestor for that one span. */
+.nowline,
+.hgroup .glbl,
+.rel .mk,
+.rel .body .ttl .ext,
+.rel .body .why,
+.rel .go,
+.dot,
+.glyphs,
+.clarify-ask,
+.mo .t,
+.mo .g,
+.mo .x .unans,
+.hintrow .hk,
+.hintrow .copybar,
+.lt-head,
+.lt-muted-note,
+.lt-empty,
+.lt-line .lt-who,
+.session-control,
+.nt-brand,
+.nt-nav,
+.nt-canvas-head,
+.nt-side-head{-webkit-user-select:none;user-select:none}
+
.streamwrap{max-height:224px;overflow:hidden;position:relative;padding-bottom:8px;margin:0 18px}
.streamwrap::after{content:"";position:absolute;left:0;right:0;bottom:0;height:30px;
background:linear-gradient(transparent, rgba(21,24,32,.95));pointer-events:none}
From aab887b211b7bf1d25092ddb2ab234c6d60b6213 Mon Sep 17 00:00:00 2001
From: Ambisphaeric <270742616+Ambisphaeric@users.noreply.github.com>
Date: Fri, 17 Jul 2026 19:40:39 -0400
Subject: [PATCH 2/2] fix(hud): reword drafts provenance why-line off banned
"distillate" vocabulary
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The prepared-drafts why-line rendered "from N distillates + M moments" —
"distillate" is banned end-user vocabulary (hud-voice §2). Reworded to the human
word "summary/summaries" ("from N summaries + M moments"), with an explicit
plural form since the source noun does not take a naive +s.
Refs #242
---
apps/client/src/surfaces/blocks/drafts.test.ts | 3 ++-
apps/client/src/surfaces/blocks/drafts.ts | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/apps/client/src/surfaces/blocks/drafts.test.ts b/apps/client/src/surfaces/blocks/drafts.test.ts
index b0769600..0505f053 100644
--- a/apps/client/src/surfaces/blocks/drafts.test.ts
+++ b/apps/client/src/surfaces/blocks/drafts.test.ts
@@ -40,8 +40,9 @@ test('the drafts block renders STORE-DERIVED drafts: the prepared body + a prove
// WHY-line built from the draft's own provenance: act kind + human source counts. #118: NO machine trail
// (endpoint/model/template id) at this human tier, nor the old `via ` phrasing — it stays
// recorded on provenance and reachable on diagnostics + the ledger, just not rendered here.
- assert.match(html, /class="why">follow-up draft · from 2 distillates \+ 1 moment)
+ assert.match(html, /class="why">follow-up draft · from 2 summaries \+ 1 moment)
assert.doesNotMatch(html, /via llm\.fast|class="why">[^<]*via /)
+ assert.doesNotMatch(html, /distillate/) // hud-voice §2: the banned word never reaches the render (#242)
// the copy affordance carries the body (the app prepares; the human executes — verbs never send)
assert.match(html, /data-copy="Hi Dana, thanks for the time today/)
})
diff --git a/apps/client/src/surfaces/blocks/drafts.ts b/apps/client/src/surfaces/blocks/drafts.ts
index fab5c263..21dd999a 100644
--- a/apps/client/src/surfaces/blocks/drafts.ts
+++ b/apps/client/src/surfaces/blocks/drafts.ts
@@ -26,11 +26,13 @@ const ACT_LABEL: Record = {
nudge: 'nudge',
}
-const plural = (n: number, one: string): string => `${n} ${one}${n === 1 ? '' : 's'}`
+const plural = (n: number, one: string, many: string): string => `${n} ${n === 1 ? one : many}`
const whyLine = (draft: Draft): string => {
const kind = ACT_LABEL[draft.actKind] ?? draft.actKind
- const sources = `${plural(draft.provenance.sourceDistillates.length, 'distillate')} + ${plural(draft.provenance.sourceMoments.length, 'moment')}`
+ // hud-voice §2: "distillate" is banned end-user vocabulary → the human word for a distilled capture
+ // window is "summary" (#242). Explicit plural form ("summaries") since the naive +s is wrong here.
+ const sources = `${plural(draft.provenance.sourceDistillates.length, 'summary', 'summaries')} + ${plural(draft.provenance.sourceMoments.length, 'moment', 'moments')}`
return `${kind} · from ${sources}`
}