Skip to content

Kit: add Chip and Chips, and rebuild ChangePills on them - #223

Open
agorischek wants to merge 3 commits into
agorischek/kit-tonefrom
agorischek/kit-chip
Open

agorischek wants to merge 3 commits into
agorischek/kit-tonefrom
agorischek/kit-chip

Conversation

@agorischek

@agorischek agorischek commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: f7c3bcebf374cfd99603797b25026234da175fd0

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Kit unit tests cover markup, change, selection, status-tab reserve and emphasis inheritance.
↑ agentic-workflows (the only ChangePills user) browser spec and renderer checks pass on chromium-desktop, webkit-desktop and chromium-mobile.
↓ Small visual change in agentic-workflows: a removed chip's label is muted as well as struck, and a wrapped chip's sign sits by its first line (before/after below).

Superego feedback item 15. Stacked on #222 (tones), which it uses.

Chip: one small item as a pill.

  • An optional category dot, a label (monospace identifier by default, or font="text"), trailing content as children, and a tone.
  • change (added, removed, modified, renamed) paints the chip in its hue, and strikes and mutes a removed label. Everything fades with emphasis, or with the --emphasis of the item around it when that's left out, so endpoints read plain.
  • sign adds + / − / ~. A sign, dot or count sits by the label's first line when it wraps, like a list marker. paint={false} keeps a chip neutral inside an item already marked, so colours don't nest.
  • status hangs a StatusTab under the chip. The chip reserves the tab's width in a zero-height row at every frame, so it's never narrower than its tab and never changes width. The tab squares the chip's own radius (--pk-chip-radius), not the card radius.
  • id and onSelect make it a button, either a pk-part or, with unit, a ring unit of its own.

Chips: a wrapping list. tabs keeps a tab's room under every line.

ChangePills is now a Chips list of signed chips and gains modified (~). Its list-specific CSS moved from diff.css to the new chips.css. The agentic-workflows styles and spec now use the pk-chip classes.

Documented in the components guide (new Chips section), the renderer-kit guide and the agent authoring guide. Migrating runtime-policy's hand-made chips follows separately. Database tags are canvas-placed slots that crossfade renamed names, so they keep their own pill for now (details in the follow-up).

Emphasis 1, then 0 (endpoint: plain, widths unchanged):

Chips with status tabs and ChangePills at full emphasis, light and dark
The same chips at zero emphasis: plain, same widths

agentic-workflows diff, before (main) and after, light and dark. The removed chips' labels are now muted, and wrapped chips' signs sit by their first line (each such chip is a pixel shorter, with no mixed-baseline growth):

agentic-workflows before and after, light
agentic-workflows before and after, dark

A chip is one small item as a pill: a category dot, a monospace label,
trailing content and a tone. A changed chip is painted in its hue (or only
signed, inside an item already marked), struck through when removed, all
fading with emphasis, and can hang a status tab whose width it always
reserves. Chips is a wrapping list that can keep the tabs' room.

ChangePills is now a Chips list of signed chips and gains a modified state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ChangePills aligned a sign to the label's baseline and runtime-policy chips
centred it, mid-way down a label that wraps. Each piece is a label one line
tall, so they now line up at the top: by the first line, like a list marker,
with no extra height from mixed baselines.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The chip’s status tab ignores inherited emphasis when none is explicitly supplied, and its accessible text omits supplied status details.

2 open issues
What changed in this PR

Adds reusable Chip and Chips components to the renderer kit, building on tones from #222, and rebuilds ChangePills on these shared primitives.

Changes:

  • Adds chips with change styling, tones, selection, and width-reserved status tabs.
  • Adds modified (~) support to ChangePills and migrates agentic-workflows selectors.
  • Updates tests, component guides, and API documentation.
File Description
packages/​renderers/​kit/​test/​diff.test.mjs Updates ChangePills assertions and covers modified items.
packages/​renderers/​kit/​test/​chip.test.mjs Adds Chip and Chips markup tests.
packages/​renderers/​kit/​styles/​regions.css Uses chip-specific radius for tab corners.
packages/​renderers/​kit/​styles/​diff.css Moves list-pill styling to chip styles.
packages/​renderers/​kit/​styles/​chips.css Adds chip layout, change, and selection styles.
packages/​renderers/​kit/​src/​react/​diff-components.tsx Rebuilds ChangePills using chips.
packages/​renderers/​kit/​src/​react/​chip.tsx Implements Chip and Chips.
packages/​renderers/​kit/​src/​react.ts Exports the new components.
packages/​renderers/​kit/​react.css Includes chip styles.
packages/​renderers/​agentic-workflows/​src/​styles.css Migrates styling selectors to chip classes.
packages/​renderers/​agentic-workflows/​browser/​agentic-workflows.spec.ts Updates browser assertions for chip markup.
eslint-suppressions.json Removes an obsolete non-null assertion suppression.
docs/​reference/​renderer-kit.md Documents chip APIs and modified pills.
docs/​guides/​renderer-kit.md Updates ChangePills guidance.
docs/​guides/​renderer-kit-components.md Adds chip usage and integration guidance.

Review effort: Balanced

A chip's accessible words come from its status (Renamed and modified) when
it has one, since the tab is hidden from assistive technology. A chip with no
emphasis of its own now fades its status tab with the item around it, as its
paint does, instead of drawing it at full strength.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants