Repository navigation
Side-by-side panes mark their side's changes with the diff's vocabulary - #417
Open
agorischek wants to merge 5 commits into
Open
agorischek wants to merge 5 commits into
agorischek wants to merge 5 commits into
Conversation
…abulary A held pane marks only the changes on its side (Before: removed and modified; After: added and modified), with the same status border, band and tint as the diff. Values show their own side's value in the change's hue, with no signs and nothing struck through. The kit's marks read the pane (HeldPane), so renderers drop their own pane special cases. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
… side neutral-endpoints and quiet-endpoints run only for a renderer with animated mode: a side-by-side or swipe pane is a static comparison. status-text expects Before to name its removals and changes and After its additions and changes. The new pane-marks check fails a pane that marks the other side's arrivals or departures, or a changed card whose band and edge disagree (a tinted band on a neutral edge). Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
… docs Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Pane filtering leaves incorrect footer and chip statuses visible or announced, while pane checks use the wrong comparison mode and can miss violations or report false failures.
6 open issues
Pane-filter displayed and accessible status · New Pane-filter footer emphasis as well as card emphasis · New Select an explicit held-pane comparison mode · New Limit status-word detection to status content · New Check side-rule paint on chips without visible status · New Ignore invisible descendants when measuring paint · New
What changed in this PR
This PR unifies change highlighting across Projections’ comparison modes, giving held panes the same visual vocabulary as diffs.
Changes:
- Adds pane-aware highlighting and value rendering to shared kit components.
- Removes renderer-specific pane treatments.
- Adds pane checks, regression coverage, documentation, and changelog entries.
| File | Description |
|---|---|
| packages/renderers/testing/test/helpers.test.mjs | Updates the check count. |
| packages/renderers/testing/src/types.ts | Defines pane measurements and check identifiers. |
| packages/renderers/testing/src/probe.ts | Registers the pane probe. |
| packages/renderers/testing/src/measure/pane-marks.ts | Measures pane status, borders, and bands. |
| packages/renderers/testing/src/measure.ts | Exports pane measurements. |
| packages/renderers/testing/src/checks/comparison/status.ts | Expects modified status in both panes. |
| packages/renderers/testing/src/checks/comparison/panes.ts | Adds pane consistency checks. |
| packages/renderers/testing/src/checks/comparison/endpoints.ts | Restricts endpoint checks to animation. |
| packages/renderers/testing/src/checks/comparison.ts | Registers pane checks. |
| packages/renderers/testing/src/checks/catalog.ts | Documents updated check contracts. |
| packages/renderers/testing/README.md | Explains mode-specific checks. |
| packages/renderers/kit/test/status.test.mjs | Tests pane filtering and emphasis. |
| packages/renderers/kit/test/layout.test.mjs | Updates card region expectations. |
| packages/renderers/kit/test/group.test.mjs | Checks pane strikethrough exclusions. |
| packages/renderers/kit/test/facts.test.mjs | Tests pane-aware values and cards. |
| packages/renderers/kit/styles/nesting.css | Includes pane SVG values in nesting rules. |
| packages/renderers/kit/styles/matrix.css | Excludes panes from matrix strikethrough. |
| packages/renderers/kit/styles/layout.css | Unifies card borders and tints. |
| packages/renderers/kit/styles/diff.css | Adds pane-aware text styling. |
| packages/renderers/kit/styles/chips.css | Removes strikethrough in held panes. |
| packages/renderers/kit/src/react/shell/props.ts | Documents pane emphasis behavior. |
| packages/renderers/kit/src/react/shell/kit-renderer.tsx | Provides pane context and root attributes. |
| packages/renderers/kit/src/react/shell/frame.ts | Defines held-pane context and hook. |
| packages/renderers/kit/src/react/shell/document.ts | Limits pane emphasis to held comparisons. |
| packages/renderers/kit/src/react/matrix-grid.tsx | Filters matrix change marks by pane. |
| packages/renderers/kit/src/react/layout-components.tsx | Makes emphasized cards change regions. |
| packages/renderers/kit/src/react/facts.tsx | Adds pane-aware facts and value lists. |
| packages/renderers/kit/src/react/diff-components.tsx | Displays each pane’s own values. |
| packages/renderers/kit/src/react/chip.tsx | Filters chip marks and signs by pane. |
| packages/renderers/kit/src/react.ts | Exports pane context APIs. |
| packages/renderers/kit/src/emphasis.ts | Adds pane classification and emphasis filtering. |
| packages/renderers/harness/browser/pane-marks.spec.ts | Tests pane border and band measurements. |
| packages/renderers/github-actions/src/values.tsx | Delegates pane value treatment to the kit. |
| packages/renderers/github-actions/src/matrix.tsx | Removes redundant emphasis plumbing. |
| packages/renderers/github-actions/src/job.tsx | Updates matrix rendering arguments. |
| packages/renderers/api/test/api.test.mjs | Tests signature hues and absent signs. |
| packages/renderers/api/src/signature-view.tsx | Uses change hues for pane signatures. |
| packages/renderers/api/browser/api.spec.ts | Updates pane signature browser expectations. |
| packages/renderers/agentic-workflows/test/agentic-workflows.test.mjs | Tests values under held-pane context. |
| packages/renderers/agentic-workflows/src/card.tsx | Removes renderer-specific pane marking. |
| packages/renderers/agentic-workflows/browser/agentic-workflows.spec.ts | Supplies explicit pane identity. |
| docs/reference/renderer-kit.md | Regenerates pane API documentation. |
| docs/guides/develop-a-renderer.md | Explains comparison modes and pane checks. |
| docs/guides/change-emphasis.md | Documents shared pane emphasis rules. |
| changelog.d/417.md | Announces renderer-author API changes. |
| changelog.d/417-behaviour-changes.md | Announces updated renderer checks. |
Review effort: Balanced
Comment on lines
+97
to
+99
| const pane = useHeldPane() | ||
| const change = paneChange(own, pane) | ||
| const sign = signed && !pane |
Comment on lines
+238
to
+239
| const region = | ||
| mark ?? (change && emphasis > 0 && isChanged(change) && (pane === undefined || paneShows(change, pane)) ? change : undefined) |
| if (!changedEntities(subject.comparison).length) throw new Skip('The comparison changes no entities.') | ||
| const failures: string[] = [] | ||
| for (const pane of ['before', 'after'] as const) { | ||
| await driver.load(subject, {progress: pane === 'before' ? 0 : 1, highlighting: 1, pane}) |
Comment on lines
+74
to
+76
| const found = node.textContent?.match(statusWords) | ||
| if (!found) continue | ||
| words.push(...found) |
| range.selectNodeContents(node) | ||
| wordBoxes.push(range.getBoundingClientRect()) | ||
| } | ||
| if (!words.length) continue |
Comment on lines
+86
to
+102
| if (!ownPart(unit, element)) continue | ||
| const own = element.getBoundingClientRect() | ||
| const framing = sameBox(own, box) | ||
| // A band spans the item, as its tint does; a badge or pill holding the words is not the item's band. | ||
| const behindWords = own.width >= box.width - 2 * edgeSlack && wordBoxes.some(word => contains(own, word)) | ||
| if (!framing && !behindWords) continue | ||
| // Text says a change in its hue; only what encloses the words is their band. | ||
| const text = element instanceof SVGTextContentElement | ||
| const sources: [CSSStyleDeclaration, boolean][] = [[getComputedStyle(element), false]] | ||
| if (element instanceof HTMLElement) { | ||
| for (const pseudo of ['::before', '::after']) { | ||
| const style = getComputedStyle(element, pseudo) | ||
| if (style.content !== 'none' && style.content !== 'normal') sources.push([style, true]) | ||
| } | ||
| } | ||
| for (const [style, pseudo] of sources) { | ||
| if (framing) for (const family of edgeHues(element, style, hues)) if (isChange(family)) edge.add(family) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
One vocabulary of change across every comparison mode, drawn by the kit so every renderer gets it. A green card means added everywhere.
stepEmphasisgives the other side's changes no emphasis (paneShows,paneChange), and the shell provides the pane to components (HeldPane/useHeldPane, anddata-paneon the.pkroot).EntityCardis now a change region (pk-region,data-change) while emphasized in the diff, a transition and a held pane alike: its border, tint and footer band in its change's hue. Before, a pane's card drew a 3 px leading stripe and a hued band on a grey border. At no emphasis (animated progress 0 and 1) it is drawn exactly as an unchanged card.ValueMark,ValueList,Fact,ValueChange,ValueText,SvgValueChange,ChipandMatrixGridshow only their side's value in the change's hue (modified in amber in both panes), with no sign and no strikethrough, whateversignsays. The diff keepsold → newwith signs and strikethrough.shownMark's emphasis gate andemphasisIn(values.tsx), thesign={frame.side === 'diff'}props, and thestrengththreaded throughmatrix.tsxonly to gate marks; agentic-workflows drops its "pane's hue" rewrite of modified entries into removed/added and itssign/markedgating (card.tsx); api tones a pane's signature by its change (modified in amber) with no+/−instead of Before red and After green (signature-view.tsx).@githubnext/projections-renderer-testing).neutral-endpointsandquiet-endpointsrun only for a renderer with animated mode.status-textnow expects Before to name its removals and changes and After its additions and changes. A newpane-markscheck (probe callpaneMarks) loads each held pane with highlighting and fails when Before marks something added or After something removed (in status words, edge or band), or when a changed card's edge (all the way round) and the band behind its status words disagree, such as a tinted band on a neutral border or a stripe beside it. Pills and tags (no taller than a chip) are only held to the side rule.Refs #373
Agreement with in-flight work
kit/status-badges-keep-colour(no PR yet): consistent. Only containers go neutral when they hold coloured descendants, and the kit's nesting rule still neutralizes a pane's card holding changed values.pane-marksreads a card's band only from surfaces spanning the card, so a status badge that keeps its colour inside a neutral card isn't mistaken for a band. Overlap: both editstyles/nesting.css(this PR adds.pk-svg-own, a pane's SVG value, to its selector lists) and the checks list indevelop-a-renderer.md, so whichever lands second rebases those hunks.kit/chip-sign-grows(no PR yet): consistent for the diff (signs whole) and animated mode (signs grow in place, neutral at the endpoints). One rule differs: that branch hasstepSigns(…, 'before' | 'after')return 1, a whole sign in a held pane, and itschange-emphasis.mdsays so. The approved strategy draws no signs in a pane, sostepSignsshould return 0 for a held pane. HereChipalready ignoressignin a held pane, so a pane shows none either way. Overlap: both editreact/chip.tsx(that branch movesChipsout and reworksChip; this PR adds the pane lines inChip),styles/chips.cssandchange-emphasis.md.Images
Side by side, before this change (left) and after (right), light and dark. The renderer bundles are built from this branch and drawn by the v0.3.3 CLI (
PROJECTIONS_INSPECTOR_ASSETS). Before =main.The sabbasi3-factory-lab/chrono-node-rs#529 repro:
compare 2749e6e7..d0c4770 -p github-actions-jobs-v2-router --mode side-by-side --png. An added workflow: the After pane's cards had a green band and stripe on a grey border, and now have the diff's green border, tint and band.The same range's
ciworkflow (-p github-actions-jobs-ci), a modified job holding a changed value. Its card stays neutral (no nested accents) in both panes, now without the stripe, and the value is amber with no sign.API (
packages/renderers/api/fixtures/dotnet-{before,after}.json). Modified signatures were red with−in Before and green with+in After; now each is amber in both panes with no sign. Removed stays red in Before only and added green in After only.Dependencies (
packages/renderers/graph/fixtures/npm-workspace-v{2,3}.json). The graph cards already drew the diff's vocabulary in panes, so the images are unchanged pixel for pixel. They are the reference the other renderers now match.Evidence
npm run tools -- check --fast: passed (lint, typecheck, format, styles, considered, machines and the other fast gates).npm run tools -- test packages/renderers/kit: passed (203 tests), with new tests forpaneShows/paneChange/stepEmphasisin a pane, the pane-aware value components andEntityCardas a region in every mode.npm run tools -- testforpackages/renderers/github-actions,api,agentic-workflows,runtime-policy,galleryandtesting: passed.Every built-in scenario's renderer checks (
harness/browser/checks.spec.ts, all 95 run in desktop Chromium, by temporarily pointing its three-project split atchromium-desktop; not committed): 95 passed oncepane-markswas limited to cards (the database renderer's tags hang their status in a tab).The new probe spec
harness/browser/pane-marks.spec.ts: passed. It shows the probe reads a stripe card as band added/edge neutral, a region card as both added, and a badge as no band.The renderer browser suites of github-actions, api, agentic-workflows, runtime-policy, kit, gallery, code-statistics, database and the harness's other specs: passed on
chromium-desktop(847 passed; the 2 specs this PR updates then passed) andchromium-mobile(436 passed).npm run docs:generate: regenerateddocs/reference/renderer-kit.md.Not run: WebKit projects (the cloud runner runs only Chromium here), the macOS and Windows suites, and the full
tools check.Documentation that this change affects is updated, and generated reference
pages are regenerated (
npm run docs:generate).Fixes include a regression test.
A changelog fragment at
changelog.d/<this PR's number>.mddescribes whatusers will notice, or the PR has the
no changeloglabel (seechangelog.d/README.md).
No credentials, private source or machine-specific paths are included.