Skip to content

kit: type roles, quiet text pieces and card header slots - #282

Merged
agorischek merged 4 commits into
mainfrom
kit-type-roles-card-header
Dec 3, 2026
Merged

agorischek merged 4 commits into
mainfrom
kit-type-roles-card-header

Conversation

@agorischek

@agorischek agorischek commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 75da837b6675762bebe87a605d4d0d4a3f26b8d5

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Kit unit tests pass (191), with markup tests for Text variant, Code, Slot, Tag and the card header slots; kit typecheck and lint pass.
↑ Copilot's six review points are fixed: a flag tone stays semibold on a role, code is 1px smaller in every form without shrinking twice when nested, and TypeRole/typeRoleClass are in the main entry. Computed sizes and weights were checked in Chromium.
↑ Additive: plain Text keeps its size and weight, and a card without the new props draws as before (its name now always takes the title size).
↓ EntityCard's name no longer inherits a renderer's root size, so a renderer that set its root to sm gets a 14px name. The migration PR (#284) checks the built-in renderers in the browser.

Steps 3 and 4 of the kit typography rollout, as one PR. Stacked on #278 (base kit-facts-value-list); retarget to main once that merges.

Type roles. Text variant takes a role that says what a piece of text is and carries its size, weight, font and tone from the theme: title, heading, kind, label, value, code, meta or figure. pk-type-<role> (typeRoleClass) sets one without React. Kit components use them: an EntityCard name is a title, a Group band a heading, a Facts label a label. Plain Text (no variant) keeps its old size and weight.

Quiet text pieces. Code is code inside running text, in the text's own color with no fill or edge. Slot is a named blank in a template, muted code with no brackets or accent (#268's first version drew these as accent-colored code in guillemets). Tag is a categorical label with a recessed fill and no edge.

Card header slots. EntityCard takes kind (a muted word above the name), subtitle (one muted line under it), aside (a muted fact at the end of the first line) and titleFont="code". So a card leads with one title rather than a label followed by hand-built lines.

New guide page: Renderer kit: type and values.

The same card built both ways, with this PR's kit (light and dark):

Before: a label then hand-built lines; after: kind, title, subtitle and aside

The same in dark mode

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

Code sizing remains inconsistent, role defaults override flag weights, and the role helper is unavailable from the framework-free entry point.

4 open issues
What changed in this PR

Continues the renderer-kit typography rollout with reusable text roles, quiet inline components, and structured card headers.

Changes:

  • Adds eight text roles plus Code, Slot, and Tag.
  • Adds card header slots and applies roles to existing kit components.
  • Updates markup tests, authoring guidance, and API documentation.
File Description
packages/​renderers/​text-diff/​test/​view.test.mjs Updates heading markup expectations.
packages/​renderers/​runtime-policy/​test/​runtime-policy.test.mjs Updates panel heading expectations.
packages/​renderers/​kit/​test/​layout.test.mjs Tests text components and card slots.
packages/​renderers/​kit/​test/​group.test.mjs Checks heading role classes.
packages/​renderers/​kit/​test/​facts.test.mjs Checks fact label roles.
packages/​renderers/​kit/​styles/​type.css Defines typography and inline component styles.
packages/​renderers/​kit/​styles/​layout.css Styles card slots and fact spacing.
packages/​renderers/​kit/​src/​react/​type.tsx Implements roles and text components.
packages/​renderers/​kit/​src/​react/​layout-components.tsx Adds card slots and component roles.
packages/​renderers/​kit/​src/​react/​facts.tsx Applies the label role.
packages/​renderers/​kit/​src/​react.ts Exports the new typography API.
packages/​renderers/​kit/​base.css Includes typography styles.
packages/​cli/​templates/​SKILL.md Recommends role-based typography.
docs/​reference/​renderer-kit.md Documents new APIs.
docs/​README.md Links the typography guide.
docs/​guides/​renderer-kit-type.md Introduces roles and quiet text pieces.
docs/​guides/​renderer-kit-components.md Explains header slots and typography.
docs/​agents/​create-projection.md Updates generated authoring guidance.
changelog.d/​type-roles.md Records user-facing additions.

Review effort: Balanced

Comment thread packages/renderers/kit/base.css Resolved
Comment thread packages/renderers/kit/styles/type.css Resolved
Comment thread packages/renderers/kit/styles/type.css Resolved
Base automatically changed from kit-facts-value-list to main December 2, 2026 23:01
agorischek and others added 2 commits December 2, 2026 15:01
Text variant takes a type role (title, heading, kind, label, value, code,
meta, figure) carrying size, weight, font and tone; pk-type-<role> sets one
without React. EntityCard names are titles, Group bands headings and Facts
labels labels. Code, Slot and Tag are quiet text pieces. EntityCard gains
kind, subtitle, aside and titleFont, so a card leads with one title.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…nts guide stays within its size

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@agorischek
agorischek force-pushed the kit-type-roles-card-header branch from 3cc5256 to 5879fc9 Compare December 2, 2026 23:02
…in every form, and the roles are in the main entry

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

Code-role sizing still leaves native code/pre elements at a fixed size and shrinks identifiers twice inside class-only code roles.

2 open issues
4 resolved since last review

Review effort: Balanced

Comment thread packages/renderers/kit/styles/type.css Resolved
Comment thread packages/renderers/kit/styles/type.css Resolved
…n identifier inside it doesn't shrink again

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.

🟢 Approval recommended

No active review issues remain for the typography and card-header changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@agorischek
agorischek merged commit af72ff2 into main Dec 3, 2026
54 checks passed
@agorischek
agorischek deleted the kit-type-roles-card-header branch December 3, 2026 00:13
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