From 6f0e87a4124b0ec7ab545efcb88bb0a8ba8cbf59 Mon Sep 17 00:00:00 2001
From: agorischek <6295280+agorischek@users.noreply.github.com>
Date: Sat, 5 Dec 2026 03:13:21 +0000
Subject: [PATCH 1/3] quiet-endpoints: read status from status parts, not an
item's own name
The check failed any entity whose text held a status word, so a route
/Library/Movies/Added or a member named Removed failed at Before and After.
The probe now records the text of status parts (data-change-status, the
kit's badges, status lines and tabs) apart; a status word there fails, and
one elsewhere fails only when the item's own ID, label and data don't hold it.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
---
changelog.d/quiet-endpoints-names.md | 5 ++
.../harness/browser/status-parts.spec.ts | 30 ++++++++++++
.../renderers/testing/src/checks/catalog.ts | 3 +-
.../src/checks/comparison/endpoints.ts | 32 ++++++++++++-
.../renderers/testing/src/measure/entities.ts | 15 ++++++
packages/renderers/testing/src/types.ts | 6 +++
.../renderers/testing/test/helpers.test.mjs | 47 +++++++++++++++++++
7 files changed, 136 insertions(+), 2 deletions(-)
create mode 100644 changelog.d/quiet-endpoints-names.md
create mode 100644 packages/renderers/harness/browser/status-parts.spec.ts
diff --git a/changelog.d/quiet-endpoints-names.md b/changelog.d/quiet-endpoints-names.md
new file mode 100644
index 000000000..492a18963
--- /dev/null
+++ b/changelog.d/quiet-endpoints-names.md
@@ -0,0 +1,5 @@
+---
+section: fixes
+---
+
+- **The renderer check “No status text at the endpoints” no longer fails an item for its own name** (#PR). An endpoint `POST /Library/Movies/Added`, or a member named `Removed`, failed `quiet-endpoints` at Before and After because its label held a status word. The check now reads status from the parts that state it (`data-change-status`, and the kit's badges, status lines and tabs), where any status word still fails, and elsewhere in an item's text fails only a status word that the item's own ID, label or data doesn't hold.
diff --git a/packages/renderers/harness/browser/status-parts.spec.ts b/packages/renderers/harness/browser/status-parts.spec.ts
new file mode 100644
index 000000000..46af5fa7e
--- /dev/null
+++ b/packages/renderers/harness/browser/status-parts.spec.ts
@@ -0,0 +1,30 @@
+import {expect, test} from '@playwright/test'
+import {openStage, type EntitySample} from '@githubnext/projections-renderer-testing/playwright'
+import {harnessInspector} from '@githubnext/projections-renderer-harness/playwright'
+
+/**
+ * The probe records the text of an entity's status parts (`data-change-status`, the kit's badges, status lines and
+ * tabs) apart from its name, so `quiet-endpoints` reads a status word in a badge as status and one in a name as a name.
+ */
+test('the probe reads status parts apart from an entity’s name', async ({page}, testInfo) => {
+ test.skip(testInfo.project.name !== 'chromium-desktop', 'The probe reads the DOM, the same in every engine.')
+ const stage = await openStage(page, harnessInspector(), {scenario: 'graph/npm-react-update', progress: 1, comparisonMode: 'diff'})
+ await stage.frame.locator('.pk').evaluate(root => {
+ const probe = document.createElement('div')
+ probe.innerHTML = `
+
POST /Library/Movies/Added
+ RemovedAdded
+ Modified
+ Renamed
`
+ root.append(probe)
+ })
+ const samples = new Map((await stage.measure('samples')).map(sample => [sample.id, sample]))
+ const status = (id: string) => samples.get(id)?.status
+ // The entity element itself is never a status part, whatever its class.
+ expect(status('probe:named')).toEqual([])
+ expect(samples.get('probe:badged')?.text).toBe('Removed Added')
+ expect(status('probe:badged')).toEqual(['Added'])
+ expect(status('probe:worded')).toEqual(['Modified'])
+ // A faded status part shows nothing.
+ expect(status('probe:faded')).toEqual([])
+})
diff --git a/packages/renderers/testing/src/checks/catalog.ts b/packages/renderers/testing/src/checks/catalog.ts
index 652c5196e..85006d368 100644
--- a/packages/renderers/testing/src/checks/catalog.ts
+++ b/packages/renderers/testing/src/checks/catalog.ts
@@ -129,7 +129,8 @@ export const checkDescriptions: Record = {
'Change status appears in reserved space: at every sampled progress, and in the diff, each entity has the same box with highlighting on and off.',
'status-text':
'While a change is emphasized, its entity states its status as text (Added, Removed, Modified, Renamed or Moved), visibly or for assistive technology, never by color alone.',
- 'quiet-endpoints': "At both endpoints, with the host's default highlighting, no entity shows status text.",
+ 'quiet-endpoints':
+ "At both endpoints, with the host's default highlighting, no entity shows status text: no status word (Added, Removed, Modified, Renamed or Moved) in a part that states status (data-change-status, or the kit's badges, status lines and tabs), nor elsewhere in its text unless its own ID, label or data holds the word, as a route /Movies/Added does.",
'content-top':
"The renderer draws no header of its own (the host shows the title, schema and counts): its first entity, canvas or marked content region (data-projections-content) starts within the stage padding of the frame top (the host's stage-inset, else 12 px, or its stage-inset-top where that is more), at full and phone width. A zoomable canvas (a scroll container marked data-zoom) counts as a whole, since it opens fitted (or at the text floor) and centres what it draws.",
'stage-insets':
diff --git a/packages/renderers/testing/src/checks/comparison/endpoints.ts b/packages/renderers/testing/src/checks/comparison/endpoints.ts
index 58d4b51e7..fcc83cf20 100644
--- a/packages/renderers/testing/src/checks/comparison/endpoints.ts
+++ b/packages/renderers/testing/src/checks/comparison/endpoints.ts
@@ -1,4 +1,5 @@
// The checks of a comparison's endpoints: neutral at progress 0 and 1, with no status text.
+import type {EntitySample, StageSubject} from '../../types.js'
import {Skip, progressModes, limit, samples, label, type Checks} from '../support.js'
import {acrossRevisions, difference, looks} from './support.js'
import {statusWords} from './status.js'
@@ -65,10 +66,39 @@ export const endpointChecks: Pick): string | undefined {
+ for (const text of sample.status ?? []) {
+ const word = statusWords.exec(text)?.[0]
+ if (word) return word
+ }
+ const named = ownText(sample.id, subject)
+ for (const [word] of sample.text.matchAll(new RegExp(statusWords.source, 'gu'))) {
+ if (!named.some(text => new RegExp(`\\b${word}\\b`, 'u').test(text))) return word
+ }
+ return undefined
+}
+
+/** Every string an item (entity or relationship) with this ID holds in either revision, with the ID itself. */
+function ownText(id: string, subject: Extract): string[] {
+ const texts = [id]
+ const collect = (value: unknown, depth: number): void => {
+ if (typeof value === 'string') texts.push(value)
+ else if (depth < 6 && typeof value === 'object' && value !== null) for (const item of Object.values(value)) collect(item, depth + 1)
+ }
+ for (const extraction of [subject.before, subject.after]) {
+ for (const item of [...extraction.entities, ...extraction.relationships]) if (item.id === id) collect(item, 0)
+ }
+ return texts
+}
diff --git a/packages/renderers/testing/src/measure/entities.ts b/packages/renderers/testing/src/measure/entities.ts
index 4d1b9bad7..e46e8cffb 100644
--- a/packages/renderers/testing/src/measure/entities.ts
+++ b/packages/renderers/testing/src/measure/entities.ts
@@ -19,12 +19,27 @@ export function entitySamples(root: Element = document.body): EntitySample[] {
box: [round(box.left), round(box.top), round(box.width), round(box.height)],
opacity: Math.round(effectiveOpacity(element) * 100) / 100,
...paintOf(element),
+ status: statusTexts(element),
parts: [...new Set([...element.querySelectorAll('[data-entity-id]')].map(part => part.getAttribute('data-entity-id')!))],
})
}
return samples
}
+/** Parts that state a change's status: the kit's status words (`data-change-status`), badges, status lines and tabs. */
+const statusMarks = '[data-change-status], .badge, .pk-status-text, .pk-status-tab, .pk-svg-status, .pk-change-status'
+
+/**
+ * The visible text of each status part of an entity element, outermost parts only and not its nested entities'. The
+ * element itself is never one, whatever its class: its text is its name.
+ */
+function statusTexts(element: Element): string[] {
+ return [...element.querySelectorAll(statusMarks)]
+ .filter(part => part.parentElement?.closest(`${statusMarks}, [data-entity-id]`) === element)
+ .map(part => paintOf(part).text)
+ .filter(text => text !== '')
+}
+
/** IDs of visible entities: nested ones (parts) first, then units. */
export function visibleEntities(root: Element = document.body): string[] {
const all = [...root.querySelectorAll('[data-entity-id]')].filter(visible)
diff --git a/packages/renderers/testing/src/types.ts b/packages/renderers/testing/src/types.ts
index e9ce4b23d..738d38582 100644
--- a/packages/renderers/testing/src/types.ts
+++ b/packages/renderers/testing/src/types.ts
@@ -169,6 +169,12 @@ export interface EntitySample {
opacity: number
paint: string
text: string
+ /**
+ * The visible text of each part that states a change's status (`data-change-status`, or the kit's badges, status
+ * lines and tabs); also in `text`. `quiet-endpoints` reads a status word here as status, and one elsewhere in
+ * `text` as status only when the item's own ID, label and data don't hold it.
+ */
+ status?: string[]
/** IDs of entity elements nested inside it (a unit's parts), whose emphasis it may show. */
parts: string[]
/**
diff --git a/packages/renderers/testing/test/helpers.test.mjs b/packages/renderers/testing/test/helpers.test.mjs
index 7695f9574..6e26454b5 100644
--- a/packages/renderers/testing/test/helpers.test.mjs
+++ b/packages/renderers/testing/test/helpers.test.mjs
@@ -163,6 +163,53 @@ test('stable-layout compares two diffs once each frame has the height its render
assert.equal(result.status, 'pass', result.details.join('\n'))
})
+test('quiet-endpoints reads status from status parts, not from an item’s own name', async () => {
+ const route = 'endpoint:POST /Library/Movies/Added'
+ const named = {
+ mode: 'comparison',
+ before: {...extraction([]), entities: [{id: route, kind: 'endpoint', label: 'POST /Library/Movies/Added'}]},
+ after: {
+ ...extraction([]),
+ entities: [
+ {id: route, kind: 'endpoint', label: 'POST /Library/Movies/Added'},
+ {id: 'member:ChangeKind.Removed', kind: 'member', label: 'Removed'},
+ ],
+ },
+ comparison: {
+ protocolVersion: 0,
+ changes: [
+ {id: 'member:ChangeKind.Removed', collection: 'entities', before: [], after: ['member:ChangeKind.Removed'], status: 'added'},
+ ],
+ steps: [{changes: ['member:ChangeKind.Removed']}],
+ },
+ }
+ const run = async drawn => {
+ const driver = fakeDriver(['side-by-side']).driver
+ driver.measure = async call =>
+ call === 'samples'
+ ? drawn.map(sample => ({box: [0, 0, 10, 10], opacity: 1, paint: 'plain', parts: [], categories: {}, ...sample}))
+ : []
+ return (await runChecks(driver, named, {checks: ['quiet-endpoints']}))[0]
+ }
+ // Labels that hold status words are names, at both endpoints.
+ const names = await run([
+ {key: route, id: route, text: 'POST /Library/Movies/Added', status: []},
+ {key: 'member:ChangeKind.Removed', id: 'member:ChangeKind.Removed', text: 'Removed', status: []},
+ ])
+ assert.equal(names.status, 'pass', names.details.join('\n'))
+ // A status badge fails, even beside a name holding the same word.
+ const badged = await run([{key: route, id: route, text: 'POST /Library/Movies/Added Added', status: ['Added']}])
+ assert.equal(badged.status, 'fail')
+ assert.match(
+ badged.details[0],
+ /At Before \(progress 0\), "endpoint:POST \/Library\/Movies\/Added" shows "Added"; endpoints carry no status\./u,
+ )
+ // Status text the item's name doesn't hold still fails, marked or not.
+ const loose = await run([{key: 'member:ChangeKind.Removed', id: 'member:ChangeKind.Removed', text: 'Removed Added', status: []}])
+ assert.equal(loose.status, 'fail')
+ assert.match(loose.details[0], /shows "Added"/u)
+})
+
test('checks run per declared comparison mode', async () => {
const status = results => Object.fromEntries(results.map(result => [result.id, result.status]))
const diffOnly = fakeDriver(['diff'])
From 370575066c6daaa97468cccaf244d1069f86d7bf Mon Sep 17 00:00:00 2001
From: agorischek <6295280+agorischek@users.noreply.github.com>
Date: Sat, 5 Dec 2026 03:13:47 +0000
Subject: [PATCH 2/3] Changelog fragment for #415
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
---
changelog.d/415.md | 5 +++++
changelog.d/quiet-endpoints-names.md | 5 -----
2 files changed, 5 insertions(+), 5 deletions(-)
create mode 100644 changelog.d/415.md
delete mode 100644 changelog.d/quiet-endpoints-names.md
diff --git a/changelog.d/415.md b/changelog.d/415.md
new file mode 100644
index 000000000..cb2455677
--- /dev/null
+++ b/changelog.d/415.md
@@ -0,0 +1,5 @@
+---
+section: fixes
+---
+
+- **The renderer check “No status text at the endpoints” no longer fails an item for its own name** (#415). An endpoint `POST /Library/Movies/Added`, or a member named `Removed`, failed `quiet-endpoints` at Before and After because its label held a status word. The check now reads status from the parts that state it (`data-change-status`, and the kit's badges, status lines and tabs), where any status word still fails, and elsewhere in an item's text fails only a status word that the item's own ID, label or data doesn't hold.
diff --git a/changelog.d/quiet-endpoints-names.md b/changelog.d/quiet-endpoints-names.md
deleted file mode 100644
index 492a18963..000000000
--- a/changelog.d/quiet-endpoints-names.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-section: fixes
----
-
-- **The renderer check “No status text at the endpoints” no longer fails an item for its own name** (#PR). An endpoint `POST /Library/Movies/Added`, or a member named `Removed`, failed `quiet-endpoints` at Before and After because its label held a status word. The check now reads status from the parts that state it (`data-change-status`, and the kit's badges, status lines and tabs), where any status word still fails, and elsewhere in an item's text fails only a status word that the item's own ID, label or data doesn't hold.
From 4b52b2988d6c9cf9b64b2477ddb3169ce3db162d Mon Sep 17 00:00:00 2001
From: agorischek <6295280+agorischek@users.noreply.github.com>
Date: Sat, 5 Dec 2026 03:40:03 +0000
Subject: [PATCH 3/3] quiet-endpoints: index names once, walk data to any
depth, skip hidden and nested status parts
Addresses review: names are indexed once per check and collected only when a
status word asks; data is walked iteratively without a depth limit; a nested
entity or a part only assistive technology hears is never a status part.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
---
.../harness/browser/status-parts.spec.ts | 9 ++++-
.../src/checks/comparison/endpoints.ts | 40 +++++++++++++------
.../renderers/testing/src/measure/entities.ts | 17 +++++++-
.../renderers/testing/test/helpers.test.mjs | 3 ++
4 files changed, 52 insertions(+), 17 deletions(-)
diff --git a/packages/renderers/harness/browser/status-parts.spec.ts b/packages/renderers/harness/browser/status-parts.spec.ts
index 46af5fa7e..c33322d6c 100644
--- a/packages/renderers/harness/browser/status-parts.spec.ts
+++ b/packages/renderers/harness/browser/status-parts.spec.ts
@@ -15,7 +15,9 @@ test('the probe reads status parts apart from an entity’s name', async ({page}
POST /Library/Movies/Added
RemovedAdded
Modified
- Renamed
`
+ Renamed
+ Removed
+ Added
`
root.append(probe)
})
const samples = new Map((await stage.measure('samples')).map(sample => [sample.id, sample]))
@@ -25,6 +27,9 @@ test('the probe reads status parts apart from an entity’s name', async ({page}
expect(samples.get('probe:badged')?.text).toBe('Removed Added')
expect(status('probe:badged')).toEqual(['Added'])
expect(status('probe:worded')).toEqual(['Modified'])
- // A faded status part shows nothing.
+ // A faded status part, or one only assistive technology hears, shows nothing.
expect(status('probe:faded')).toEqual([])
+ expect(status('probe:spoken')).toEqual([])
+ // A nested entity is never its parent's status part, whatever its class.
+ expect(status('probe:parent')).toEqual([])
})
diff --git a/packages/renderers/testing/src/checks/comparison/endpoints.ts b/packages/renderers/testing/src/checks/comparison/endpoints.ts
index fcc83cf20..1f73b2250 100644
--- a/packages/renderers/testing/src/checks/comparison/endpoints.ts
+++ b/packages/renderers/testing/src/checks/comparison/endpoints.ts
@@ -63,10 +63,11 @@ export const endpointChecks: Pick): string | undefined {
+function shownStatus(sample: EntitySample, named: (id: string) => readonly string[]): string | undefined {
for (const text of sample.status ?? []) {
const word = statusWords.exec(text)?.[0]
if (word) return word
}
- const named = ownText(sample.id, subject)
for (const [word] of sample.text.matchAll(new RegExp(statusWords.source, 'gu'))) {
- if (!named.some(text => new RegExp(`\\b${word}\\b`, 'u').test(text))) return word
+ const whole = new RegExp(`\\b${word}\\b`, 'u')
+ if (!named(sample.id).some(text => whole.test(text))) return word
}
return undefined
}
-/** Every string an item (entity or relationship) with this ID holds in either revision, with the ID itself. */
-function ownText(id: string, subject: Extract): string[] {
- const texts = [id]
- const collect = (value: unknown, depth: number): void => {
- if (typeof value === 'string') texts.push(value)
- else if (depth < 6 && typeof value === 'object' && value !== null) for (const item of Object.values(value)) collect(item, depth + 1)
- }
+/**
+ * Every string the items (entities and relationships) with an ID hold in either revision, with the ID itself: items
+ * indexed once, and each one's strings collected the first time a status word asks for them.
+ */
+function ownText(subject: Extract): (id: string) => readonly string[] {
+ const items = new Map()
for (const extraction of [subject.before, subject.after]) {
- for (const item of [...extraction.entities, ...extraction.relationships]) if (item.id === id) collect(item, 0)
+ for (const item of [...extraction.entities, ...extraction.relationships]) items.set(item.id, [...(items.get(item.id) ?? []), item])
+ }
+ const collected = new Map()
+ return id => {
+ let texts = collected.get(id)
+ if (texts) return texts
+ texts = [id]
+ // Data may nest JSON to any depth, so it is walked without recursion.
+ const pending = [...(items.get(id) ?? [])]
+ while (pending.length) {
+ const value = pending.pop()
+ if (typeof value === 'string') texts.push(value)
+ else if (typeof value === 'object' && value !== null) pending.push(...(Object.values(value) as unknown[]))
+ }
+ collected.set(id, texts)
+ return texts
}
- return texts
}
diff --git a/packages/renderers/testing/src/measure/entities.ts b/packages/renderers/testing/src/measure/entities.ts
index e46e8cffb..3d795f844 100644
--- a/packages/renderers/testing/src/measure/entities.ts
+++ b/packages/renderers/testing/src/measure/entities.ts
@@ -31,15 +31,28 @@ const statusMarks = '[data-change-status], .badge, .pk-status-text, .pk-status-t
/**
* The visible text of each status part of an entity element, outermost parts only and not its nested entities'. The
- * element itself is never one, whatever its class: its text is its name.
+ * element itself is never one, whatever its class: its text is its name; nor is a nested entity.
*/
function statusTexts(element: Element): string[] {
return [...element.querySelectorAll(statusMarks)]
- .filter(part => part.parentElement?.closest(`${statusMarks}, [data-entity-id]`) === element)
+ .filter(
+ part =>
+ !part.hasAttribute('data-entity-id') &&
+ part.parentElement?.closest(`${statusMarks}, [data-entity-id]`) === element &&
+ !hiddenWithin(part, element),
+ )
.map(part => paintOf(part).text)
.filter(text => text !== '')
}
+/** Whether a part, or anything around it up to `element`, is shown only to assistive technology (`sr-only`). */
+function hiddenWithin(part: Element, element: Element): boolean {
+ for (let node: Element | null = part; node && node !== element; node = node.parentElement) {
+ if (visuallyHidden(node, getComputedStyle(node))) return true
+ }
+ return visuallyHidden(element, getComputedStyle(element))
+}
+
/** IDs of visible entities: nested ones (parts) first, then units. */
export function visibleEntities(root: Element = document.body): string[] {
const all = [...root.querySelectorAll('[data-entity-id]')].filter(visible)
diff --git a/packages/renderers/testing/test/helpers.test.mjs b/packages/renderers/testing/test/helpers.test.mjs
index 6e26454b5..143851209 100644
--- a/packages/renderers/testing/test/helpers.test.mjs
+++ b/packages/renderers/testing/test/helpers.test.mjs
@@ -173,6 +173,7 @@ test('quiet-endpoints reads status from status parts, not from an item’s own n
entities: [
{id: route, kind: 'endpoint', label: 'POST /Library/Movies/Added'},
{id: 'member:ChangeKind.Removed', kind: 'member', label: 'Removed'},
+ {id: 'job:nightly', kind: 'job', label: 'nightly', data: {steps: [{run: {when: {on: {kind: {name: 'Modified'}}}}}]}},
],
},
comparison: {
@@ -195,6 +196,8 @@ test('quiet-endpoints reads status from status parts, not from an item’s own n
const names = await run([
{key: route, id: route, text: 'POST /Library/Movies/Added', status: []},
{key: 'member:ChangeKind.Removed', id: 'member:ChangeKind.Removed', text: 'Removed', status: []},
+ // However deep its data holds the word.
+ {key: 'job:nightly', id: 'job:nightly', text: 'nightly Modified', status: []},
])
assert.equal(names.status, 'pass', names.details.join('\n'))
// A status badge fails, even beside a name holding the same word.