Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/client/src/engine-link/screen-surface-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(`<span class="ttl">${OCR_TEXT}</span>`, 'g')) ?? []).length,
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/surfaces/blocks/ask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))),
)
2 changes: 1 addition & 1 deletion apps/client/src/surfaces/blocks/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
),
)
8 changes: 4 additions & 4 deletions apps/client/src/surfaces/blocks/distillates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand All @@ -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).
Expand Down Expand Up @@ -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</)
})
6 changes: 4 additions & 2 deletions apps/client/src/surfaces/blocks/distillates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { actionButtons } from './actions.js'

type Actions = NonNullable<Block['actions']>

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
Expand Down Expand Up @@ -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)),
)
Expand Down
3 changes: 2 additions & 1 deletion apps/client/src/surfaces/blocks/drafts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <endpoint>` 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/)
})
Expand Down
6 changes: 4 additions & 2 deletions apps/client/src/surfaces/blocks/drafts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ const ACT_LABEL: Record<Draft['actKind'], string> = {
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}`
}

Expand Down
6 changes: 3 additions & 3 deletions apps/client/src/surfaces/blocks/fields-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions apps/client/src/surfaces/blocks/fields.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/)
Expand All @@ -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</)
})
3 changes: 2 additions & 1 deletion apps/client/src/surfaces/blocks/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { rowAffordances } from './actions.js'

type Actions = NonNullable<Block['actions']>

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
Expand Down
17 changes: 17 additions & 0 deletions apps/client/src/surfaces/blocks/pinned-doc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
4 changes: 3 additions & 1 deletion apps/client/src/surfaces/blocks/pinned-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion apps/client/src/surfaces/blocks/relevant-now.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading
Loading