Skip to content

feat(core): CommentPin moves to Core - #13735

Open
ernestt wants to merge 3 commits into
feat/commentpin-api-passfrom
feat/commentpin-core
Open

ernestt wants to merge 3 commits into
feat/commentpin-api-passfrom
feat/commentpin-core

Conversation

@ernestt

@ernestt ernestt commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #13702 (CommentPin's API pass). Review that first; this PR's base is its branch.

User need

Product teams that anchor comment threads over content need CommentPin from @astryxdesign/core, the published package. Lab is private, so a product cannot install it from Lab. #13702 settled the pin's API (uncontrolled selection, Comments' person type, element sizes, no resolved or dimmed state) and cleared the two rubric blockers. Nothing is left to change before it graduates, so it moves now.

Problem and solution fit

  • CommentPin moves to Core unchanged: same props, defaults, behavior, and theming target. The source, tests, and docs move to packages/core/src/CommentPin/, and Core's strict lint and comment rules apply.
  • CommentUser moves with it. The person record CommentPin's participants share with the Comments family now lives in Core, exported from @astryxdesign/core/CommentPin and the package root. Lab's Comments family takes it from Core, so the two keep one shape.
  • Lab keeps a plain re-export. CommentPin and CommentPinProps from @astryxdesign/lab are the Core ones, so a Lab import keeps working and renders the Core component. They carry no @deprecated marker, and the record schedules no removal, because no owner decision deprecates these two symbols yet. A test checks that the component and its props type are the Core ones.
  • Supporting moves. The stories move to Core/CommentPin. The two blocks move to the CLI's component blocks. The ShadCN registry keeps the Lab route as an alias. The probe theme covers the new target. The sandbox route list names the two new block pages. As CLI component blocks, both meet the template rubric (version 1.4). The showcase shows two pins over a /template-assets image in a Card: AspectRatio sizes the image, and one small helper gives each pin the documented bottom-start placement. The margin block puts the pin in a Stack row beside the passage it annotates, with no custom styles. Graded against the rubric's counting rules, the showcase scores 90, its only deduction being the five style declarations the placement needs, and the margin block scores 100.

Current specification

  • component:CommentPin (draft record, amended here): new FR13 says the Lab exports re-export Core's, on the basis of spec:AST-017 FR2, and waits for an owner's approval. New FR14 names the states the comment-pin target reflects, grouped and unread included, and why themes need them. Verification and paths now point at Core. The record needs the spec owner's /approve-spec.
  • spec:AST-017 FR2: a private package such as Lab is outside the published compatibility promise, and a promotion from it is additive.
  • spec:AST-017 FR29 and FR29a: they govern a later deprecation of the Lab re-exports, if an owner decides one.
  • architecture:public-component-api DEC-2: a reflected data attribute is public surface that a record names, as FR14 does.
  • spec:AST-002: admission of a public Core surface.

Public delta and caller burden

  • New Core exports: CommentPin, CommentPinProps, and CommentUser from @astryxdesign/core/CommentPin and @astryxdesign/core.
  • @astryxdesign/lab's CommentPin and CommentPinProps still work: they are the Core ones, with no deprecation marker.
  • No prop, default, behavior, or theming change.
// Before
import {CommentPin} from '@astryxdesign/lab';
// After
import {CommentPin} from '@astryxdesign/core';

The only caller decision is the import path.

Design and alternatives

This follows the InfoTip graduation (#9238): a Core folder, Core changesets, a Lab re-export, and a registry alias. CommentUser goes to Core here rather than when Comments moves, because CommentPin's public props name it and a Core type cannot import from Lab.

Evidence

The Core component renders pixel-identically to the Lab one. The before images come from a Storybook build of #13702 (Lab/CommentPin), the after images from this branch (Core/CommentPin). Each pair was compared with pixelmatch at threshold 0:

Story Mode Different pixels
State matrix light, dark, forced colors 0, 0, 0
Sizes light, dark 0, 0
Over content and in a margin light, dark, RTL 0, 0, 0
Before (Lab) After (Core)
Lab state matrix Core state matrix
After, dark After, forced colors After, RTL placement
Core state matrix, dark Core state matrix, forced colors Core placement, RTL

Core sizes

The two blocks

Real Chromium, rendered from this head's block files with Core's build and the docs' /template-assets. Each pin's bottom-start corner lands on its anchor (34%/38% and 68%/70% of the image). Selecting one pin clears the other, and pressing the selected pin clears the selection. The margin pin keeps its focus ring and tooltip inside the card.

The showcase, then the margin block The margin pin with keyboard focus
CommentPin showcase and margin blocks Margin pin with focus ring and tooltip

Writing rubric results

component:CommentPin, against docs/contributing/spec-writing.md:

  • R1 (present tense, no change history): pass. FR13 states the re-export rule, and FR14 the reflected states, as system facts.
  • R2 (no research): pass.
  • R3 (evidence cites facts, not changes): pass. Verification rows name tests and states.
  • R4 (rejected alternatives): pass. None recorded.
  • R5 (no PR or issue as standing content): pass.
  • R6 (open questions with recorded answers): pass. OQ1–OQ3 are unanswered.
  • R7 (no project status): pass. "Additive Core export" is a lifecycle fact the template asks for.

Scope

Components: CommentPin, CommentUser (the person type CommentPinProps.participants names, which moves with the pin), Comments (type import only)

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Open owner calls, left out of the code and listed in the record:

  • OQ2: does size join the component size cascade? The size-cascade record makes joining the component's own opt-in, so the pin keeps a standalone ElementSize.
  • OQ3: does an agent participant draw a square avatar, as it does in Comments?

Also open, for an owner: whether to deprecate the Lab re-exports of CommentPin and CommentPinProps, and when to remove them. Until an owner decides, they stay plain re-exports, with no @deprecated marker and no removal in the record, as in the DiffViewer and SelectableCardGroup moves.

Testing

  • vitest run on CommentPin's tests, the Lab index test, and hostDataAttributes: pass. The node project: 30,276 tests pass; its first run's two failures, the probe theme check and the sandbox route list, pass with this branch's updates to both.

  • tsc for Core, Core docs, Lab, and Lab docs: pass.

  • ASTRYX_STRICT_LINT=1 eslint on the moved files: 0 errors.

  • pnpm review:pre --base <#13702 branch>: 0 findings. pnpm check:knowledge: clean. pnpm check:changesets: valid.

  • Real Chromium (Playwright) on static Storybook builds of both branches, scoped to #storybook-root.

  • Rebased onto main at 2608fe4, with no change to either commit's own diff (the same patch IDs as before the rebase). Repeated on this head: vitest run packages/core/src/CommentPin packages/lab/src/CommentPin packages/lab/src/Comments and hostDataAttributes: 332 passed. tsc for Core and Lab: pass. ASTRYX_STRICT_LINT=1 eslint on both CommentPin folders: clean. pnpm review:pre: 0 findings. pnpm check:knowledge: clean. pnpm check:changesets: valid. The node project: 30,737 passed, none failed.

  • This head adds one commit with the two blocks and the shorter file header. On it: 332 tests pass (Core and Lab CommentPin, Lab Comments, hostDataAttributes), and 470 CLI template and component tests pass. tsc for Core and Lab: pass. Strict ESLint and Prettier on the changed files: clean. pnpm review:pre: 0 findings. pnpm check:knowledge: clean. The node project: 30,737 passed, none failed.

  • Earlier runs, before the rebase, were on main at aee3fa9 and d63c249.

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Dec 2, 2026 7:11pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 24, 2026
@astracat-bot

astracat-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Dec 2, 2026, 7:32 PM UTC

@ernestt

ernestt commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Lab's CommentPin and CommentPinProps are now plain re-exports of Core's, with no @deprecated marker and no removal in the record, as in the DiffViewer and SelectableCardGroup moves. The Lab test checks that the component and its props type are the Core ones. Whether to deprecate them, and when to remove them, is listed in the description as an owner question.

No review has run on this pull request yet; this is its first new head since it opened.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision on the draft component:CommentPin record, and four fixes can land now.

  • FR13 still lists spec:AST-017 FR29 and FR29a as its source with status "settled" (docs/specs/components/CommentPin/CommentPin.spec.md:158), but those clauses only govern how a deprecation is marked and state no re-export, so give FR13 a source that states it (such as FR2, Lab is outside the compatibility promise) and a pending status until an owner approves it.
  • FR13's verification row still says a Lab export "without the deprecation metadata" fails (CommentPin.spec.md:317), but the Lab exports carry no @deprecated tag and index.test.ts checks only identity and the props type, so drop that clause.
  • CommentUser (packages/core/src/CommentPin/index.ts:17 and the package root) is outside this pull request's scope (CommentPin, Comments): since CommentPinProps names it and it cannot split, add CommentUser to the Scope Components: line so the owner decision covers it.
  • data-unread (packages/core/src/CommentPin/CommentPin.tsx:525) is new Core public surface under architecture:public-component-api DEC-2: name the reflected unread state, and why themes need it, in a current record, or stop reflecting it.

The record's requirements, FR13 and the Stable rows included, need an engineering owner's approval before they govern a stable Core API while OQ1–OQ3 stay open. An engineering owner records that decision by commenting /approve-spec with the full head SHA; the author may do so if they are an engineering owner. Separately and non-blocking: both blocks put aria-label on a div with no role, and the showcase loads third-party avatar and photo URLs that product teams would copy.

Claims and files checked

Review mode: full; reason: author-not-engowner

Claims

  • CommentPin moves to Core with the same props, defaults, behavior and theming target: verified (the component diff changes only imports, the person type's location and comment wording).
  • The source, tests and docs move to Core's CommentPin folder under Core's lint and comment rules: verified for the move (comment record references removed, the Lab provenance-baseline entry dropped); lint not re-run.
  • CommentUser moves with it, exported from the CommentPin entry point and the package root, and Lab's Comments family takes it from Core: verified (Core CommentPin index, Core index, Comments types).
  • Lab's CommentPin and CommentPinProps are plain re-exports with no deprecation marker, and the record schedules no removal: verified for the code and FR13; the FR13 verification row still names deprecation metadata (finding).
  • A test checks that the Lab component and props type are the Core ones: verified (Lab index test; the type case runs under Lab's type check).
  • The stories move to Core, the blocks to the CLI's component blocks, the registry keeps the Lab route as an alias, the probe theme covers the new target, and the sandbox routes name the two block pages: verified.
  • FR13 says the Lab exports re-export Core's, and verification and paths now point at Core: partly false (FR13's source column and its verification row still describe the deprecation version).
  • FR29 and FR29a govern a later deprecation only if an owner decides one: verified.
  • The new Core exports add no prop, default, behavior or theming change: verified.
  • CommentUser moves now because CommentPin's props name it and Core cannot import Lab: verified.
  • The move follows the InfoTip graduation's shape (Core folder, changesets, Lab re-export, registry alias): verified, except that InfoTip's Lab export is deprecated.
  • The plain re-export matches the DiffViewer and SelectableCardGroup moves: verified against those two open pull requests.
  • Joining the size cascade is the component's own opt-in (OQ2): verified (size-cascade INV2).
  • Writing rubric R1 to R7 for the record edit: verified.
  • The moved tooltip test carries main's pointer-move change: verified.
  • Renders are pixel-identical, and tests, type checks, lint and pre-review checks pass: unverified (no toolchain could be installed for this review).
  • The CLI changeset: astryx template lists both CommentPin blocks among Core's component blocks: verified (block docs in the CLI's component blocks, in its doc format).
  • The Core changeset's description of the pin (lead participant, up to three circles and the total, unread dot, three sizes, controlled or uncontrolled selection): verified (component source).

Files

  • .changeset/commentpin-core-blocks.md: clear
  • .changeset/promote-commentpin-to-core.md: clear
  • apps/sandbox/scripts/next-export-routes.json: clear
  • apps/storybook/rtl-audit/verified-not-applicable.json: clear
  • apps/storybook/stories/CommentPin.stories.tsx: clear
  • docs/specs/components/CommentPin/CommentPin.spec.md: FR13 source and verification row; draft record needs owner approval
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear
  • internal/shadcn-registry/routes.lock.json: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.doc.mjs: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.tsx: labelled role-less div (non-blocking)
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.doc.mjs: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.tsx: third-party images, raw layout, custom CSS and a labelled role-less div (non-blocking)
  • packages/cli/test/swizzle-proof/samples.mjs: clear
  • packages/core/package.json: clear
  • packages/core/src/CommentPin/CommentPin.doc.mjs: clear
  • packages/core/src/CommentPin/CommentPin.test.tsx: clear
  • packages/core/src/CommentPin/CommentPin.tsx: data-unread
  • packages/core/src/CommentPin/index.ts: CommentUser scope
  • packages/core/src/__tests__/hostDataAttributes.test.tsx: clear
  • packages/core/src/index.ts: clear
  • packages/lab/src/CommentPin/index.test.ts: clear
  • packages/lab/src/CommentPin/index.ts: clear
  • packages/lab/src/Comments/types.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear

Automated review (maintainer link)

Comment thread packages/core/src/CommentPin/index.ts Resolved
@ernestt

ernestt commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

All four fixes are in a new commit on this branch:

  • FR13's basis is now spec:AST-017 FR2, which puts a private package such as Lab outside the published compatibility promise. Its status is "pending owner approval", like the other draft rows.
  • FR13's verification row drops the deprecation-metadata clause; the Lab test checks identity and the props type.
  • CommentUser is on the Scope Components: line, as the person type CommentPinProps.participants names.
  • New FR14 names the states the comment-pin target reflects: size, selected and disabled, which every target reflects, plus grouped and unread. Themes need those two because such pins take the wider layout that holds the count or the dot; the dot itself stays StatusDot's target. FR14 waits for the owner decision with the rest of the record.

The fixes are a second commit, not an amend, so the pull requests stacked on this branch keep their heads. Their diffs are unchanged, since none of them touches the record.

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision on the draft component:CommentPin record, and three fixes are needed.

The decision covers the record's requirements (FR13, FR14 and the Stable column included), whether CommentPin graduates while OQ1–OQ3 stay open, and whether isSelected/onSelectedChange fits beside ToggleButton's isPressed/onPressedChange for this aria-pressed toggle. An engineering owner records it by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner.

  • Miss: CommentPinShowcase becomes a new astryx template block that grades 57/100 on the template rubric, under the 75 a new template needs (five raw HTML tags, 42 custom style properties, absolute i.pravatar.cc and images.unsplash.com image URLs, 182 lines and a @stylexjs/stylex import).
  • Miss: CommentPinInMargin becomes a new astryx template block that grades 74/100, one point under that floor (two raw <div>s, 13 custom style properties, a @stylexjs/stylex import and no synonyms in its description), so using Grid for the document row and adding synonyms would clear it.
  • Miss: the Testing section's "main's one change to a file it touches" is inaccurate, because main also changed the sandbox route list, the registry route lock and the comment-provenance baseline that this pull request edits, so please name them too.

Non-blocking: both blocks put aria-label on a div with no role, and the CommentPin.tsx header still runs 21 lines.

Claims and files checked

Review mode: full; reason: recipe-changed (many rules)

Claims (title: "feat(core): CommentPin moves to Core")

  • The title says CommentPin moves to Core: verified (new Core folder, entry point and root export).
  • CommentPin moves unchanged, with the same props, defaults, behavior and theming target: verified (the whole component diff changes only imports, where the person type is declared, comments and one equivalent type spelling; the same test file passes; six frames are identical).
  • Source, tests and docs move into Core's CommentPin folder, under Core's strict lint and comment rules: verified (strict eslint on the moved files reports nothing; the Lab provenance-baseline entry is removed).
  • CommentUser moves with it, is exported from the CommentPin entry point and the package root, and Lab's Comments family takes it from Core: verified (Core entry and barrel; Comments/types.ts imports and re-exports it).
  • Lab's CommentPin and CommentPinProps are plain re-exports with no deprecation marker and no scheduled removal, and a test checks the component and its props type: verified (the Lab index test's identity case passes here, and its type case compiles under Lab's typecheck).
  • The story moves to Core: verified (the title is now Core/CommentPin).
  • The blocks move to the CLI's component blocks: verified (astryx template --list shows both at the head and neither at the base).
  • The registry keeps the Lab route as an alias: verified (route lock and doc alias).
  • The probe theme covers the new target: verified (the probe check reports current).
  • The sandbox route list names both block pages: verified (the route-manifest test passes).
  • FR13 rests on the compatibility record's private-package clause and waits for approval; FR14 names the reflected states and why; verification and paths point at Core: verified in the record.
  • The compatibility record makes the promotion additive, and its deprecation clauses govern only a later deprecation: verified.
  • A reflected data attribute is public surface that a record names, as FR14 does: verified, though FR14 is still draft.
  • New Core exports CommentPin, CommentPinProps and CommentUser: verified (the API generator lists only added Core rows).
  • No prop, default, behavior or theming change, and Lab imports keep working: verified (same props and defaults; target class and states unchanged; no published theme styles the target).
  • CommentUser moves now because CommentPin's props name it and Core cannot import Lab: verified.
  • The move follows the InfoTip graduation's shape (Core folder, changesets, Lab re-export, registry alias): verified; InfoTip's Lab export is also deprecated.
  • The plain re-export matches the DiffViewer and SelectableCardGroup moves: verified against those two pull requests' Lab entries.
  • Joining the size cascade is the component's own opt-in: verified (the size-cascade record's explicit-participation invariant).
  • Writing rubric R1–R7 for the record: reported.
  • The renders are pixel-identical: reported, and reproduced locally for six frames.
  • Tests, type checks, lint and pre-review checks pass: reported. Reproduced locally: the focused tests (238), the probe, route and swizzle-sample tests, strict lint on the moved files, Lab's typecheck, the knowledge check and the changeset check. Core's typecheck, the full node project and the pre-review checklist were not run.
  • This head changes only the record: verified.
  • Main's one change to a file this pull request touches is the tooltip test's pointer-move line: false (main also changed three generated files this pull request edits).
  • Public text carries no internal context: verified.
  • CLI changeset: astryx template lists both CommentPin blocks among Core's component blocks: verified (run here).
  • Core changeset's description of the pin (lead participant, up to three circles and the total, accent unread dot, three sizes, kept or host-controlled selection): verified against the focused tests for each case.

Files

  • .changeset/commentpin-core-blocks.md: clear
  • .changeset/promote-commentpin-to-core.md: clear
  • apps/sandbox/scripts/next-export-routes.json: clear
  • apps/storybook/rtl-audit/verified-not-applicable.json: clear
  • apps/storybook/stories/CommentPin.stories.tsx: clear
  • docs/specs/components/CommentPin/CommentPin.spec.md: draft record needs an engineering owner's decision
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear
  • internal/shadcn-registry/routes.lock.json: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.doc.mjs: description lacks synonyms (part of the 74 grade)
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.tsx: new template graded 74, under 75
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.doc.mjs: description lacks synonyms (part of the 57 grade)
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.tsx: new template graded 57, under 75
  • packages/cli/test/swizzle-proof/samples.mjs: clear
  • packages/core/package.json: clear
  • packages/core/src/CommentPin/CommentPin.doc.mjs: clear
  • packages/core/src/CommentPin/CommentPin.test.tsx: clear
  • packages/core/src/CommentPin/CommentPin.tsx: 21-line file header (non-blocking)
  • packages/core/src/CommentPin/index.ts: clear
  • packages/core/src/__tests__/hostDataAttributes.test.tsx: clear
  • packages/core/src/index.ts: clear
  • packages/lab/src/CommentPin/index.test.ts: clear
  • packages/lab/src/CommentPin/index.ts: clear
  • packages/lab/src/Comments/types.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear

Automated review (maintainer link)

CommentPin and `CommentUser`, the person record its participants share with
the Comments family, move from Lab to Core, imported from
`@astryxdesign/core/CommentPin` or the package root. The component keeps its
props, defaults, and behavior.

The Lab exports re-export the Core ones, with no deprecation marker: no
owner decision deprecates them yet. Lab's Comments family takes
`CommentUser` from Core. The Storybook stories move to Core/CommentPin, the
blocks move to the CLI's component blocks, and the ShadCN registry keeps
the Lab route as an alias. The probe theme covers the new target, and the
sandbox route list names the two new block pages. The
`component:CommentPin` record stays a draft for an engineering owner's
approval.
FR13 rests on spec:AST-017 FR2, which puts a private package such as Lab
outside the published compatibility promise. Like the other draft rows,
it waits for an owner's approval, and its verification row no longer
mentions deprecation metadata. FR14 names the states the comment-pin
target reflects: size, selected, and disabled, which every target
reflects, plus grouped and unread. Themes need those two because such pins
take the wider layout that holds the count or the dot.
@ernestt
ernestt force-pushed the feat/commentpin-core branch from 43dc229 to d0165a7 Compare December 2, 2026 04:56
@ernestt

ernestt commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 2608fe4 with the rest of the stack. This pull request's own diff is unchanged: its patch ID is the same as before the rebase, and it applied without conflicts. In the stack, only #13737 changed in content; #13702, #13735, #13736, #13738, #13739, #13740 and #13741 are unchanged apart from the rebase. Both commits keep their patch IDs.

Repeated on this head: 332 tests passed (Core and Lab CommentPin, Lab Comments, hostDataAttributes). tsc for Core and Lab: pass. Strict lint on both CommentPin folders: clean. pnpm review:pre: 0 findings. pnpm check:knowledge: clean. pnpm check:changesets: valid. The node project: 30,737 passed, none failed.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision on the draft component:CommentPin record, and two template fixes are needed.

The decision covers the record's requirements (FR13, FR14 with the new data-unread reflection, and the Stable column included), whether CommentPin graduates while OQ1–OQ3 stay open, and whether isSelected/onSelectedChange fits beside ToggleButton's isPressed/onPressedChange for this aria-pressed toggle. An engineering owner records it by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner.

  • CommentPinShowcase becomes a new astryx template block that grades 57/100 on the template rubric, under the 75 a new template needs (five raw HTML tags, 42 custom style properties, absolute i.pravatar.cc and images.unsplash.com image URLs, 182 lines and a @stylexjs/stylex import).
  • CommentPinInMargin becomes a new astryx template block that grades 74/100, one point under that floor (two raw <div>s, 13 custom style properties, a @stylexjs/stylex import and no synonyms in its description), so using Grid for the document row and adding synonyms would clear it.

Non-blocking: both blocks put aria-label on a div with no role, and the CommentPin.tsx header still runs 21 lines. The rendering is unchanged: seven state, size and placement frames are pixel-identical between Lab and Core, reproduced locally.

Claims and files checked

Review mode: full; reason: author-not-engowner

Claims (title: "feat(core): CommentPin moves to Core")

  • The title says CommentPin moves to Core: verified (new Core folder, entry point and root export).
  • The pull request is stacked on the API-pass pull request, whose branch is its base: verified.
  • Lab is private, so products cannot install the pin from it: verified (Lab's package manifest is private).
  • The API-pass pull request settled the pin's API and nothing is left to change before graduating: reported (a statement about another pull request; the record that would settle the API is still draft).
  • CommentPin moves unchanged, with the same props, defaults, behavior and theming target: verified (the component diff changes only imports, where the person type is declared, comments and one equivalent type spelling; the target name is unchanged; the same tests pass; seven frames are identical).
  • Source, tests and docs move into Core's CommentPin folder under Core's strict lint and comment rules: verified (strict lint on the moved files reports nothing; the Lab comment-provenance baseline entry is removed).
  • CommentUser moves with it, is exported from the CommentPin entry point and the package root, and Lab's Comments family takes it from Core so the two keep one shape: verified (Core entry and barrel; Comments types import and re-export it; no other declaration remains).
  • Lab's CommentPin and CommentPinProps are plain re-exports with no deprecation marker and no scheduled removal, and a test checks the component and its props type: verified (the identity case passes here, and the type case compiles under Lab's typecheck).
  • The stories move to Core: verified (the story title and Storybook ids are now Core's).
  • The two blocks move to the CLI's component blocks: verified (the template list shows both at the head and neither at the base).
  • The ShadCN registry keeps the Lab route as an alias: verified (route lock and doc alias).
  • The probe theme covers the new target: verified (the probe check passes here).
  • The sandbox route list names both new block pages: verified (the route-manifest test passes here).
  • FR13 rests on the compatibility record's private-package clause and waits for approval; FR14 names the reflected states, grouped and unread included, and why; verification and paths point at Core: verified in the record.
  • The compatibility record makes the promotion additive, and its deprecation clauses govern only a later deprecation: verified.
  • A reflected data attribute is public surface that a record names, as FR14 does: verified, though FR14 is still draft.
  • New Core exports are CommentPin, CommentPinProps and CommentUser from the CommentPin entry point and the root: verified (the API generator lists only added Core rows).
  • Lab imports keep working with no deprecation marker, and there is no prop, default, behavior or theming change: verified.
  • The only caller decision is the import path: verified.
  • The move follows the InfoTip graduation's shape (Core folder, changesets, Lab re-export, registry alias): verified; InfoTip's Lab export is deprecated, unlike this one.
  • CommentUser moves now because CommentPin's props name it and a Core type cannot import Lab: verified.
  • The renders are pixel-identical between Lab and Core: reported, and reproduced locally for seven frames.
  • Writing rubric R1–R7 for the record: reported.
  • Joining the size cascade is the component's own opt-in: verified (the size-cascade record's explicit-participation invariant).
  • The plain re-export matches the DiffViewer and SelectableCardGroup moves: verified against those two open pull requests' Lab entries.
  • The scope checklist items, including no internal context in public text: verified (no internal context found in the added lines, commits, title or description).
  • The branch was rebased onto main with no change to either commit's own diff: verified (identical patch IDs overall and per commit).
  • Tests, type checks, lint and pre-review checks pass on this head: reported. Reproduced locally: the focused tests (332), the probe, route and swizzle-sample tests, strict lint on both CommentPin folders, Core's typecheck, Lab's source typecheck, the knowledge check and the changeset check. Lab's docs typecheck, the full node project and the pre-review checklist were not run.
  • CLI changeset: astryx template lists both CommentPin blocks among Core's component blocks: verified (run here).
  • Core changeset's description of the pin (lead participant, up to three circles and the total, accent unread dot, three element sizes, kept or host-controlled selection, host-owned anchors): verified against the focused tests and the size styles for each case.

Files

  • .changeset/commentpin-core-blocks.md: clear
  • .changeset/promote-commentpin-to-core.md: clear
  • apps/sandbox/scripts/next-export-routes.json: clear
  • apps/storybook/rtl-audit/verified-not-applicable.json: clear
  • apps/storybook/stories/CommentPin.stories.tsx: clear
  • docs/specs/components/CommentPin/CommentPin.spec.md: draft record needs an engineering owner's decision
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear
  • internal/shadcn-registry/routes.lock.json: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.doc.mjs: description lacks synonyms (part of the 74 grade)
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.tsx: new template graded 74, under 75
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.doc.mjs: description lacks synonyms (part of the 57 grade)
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.tsx: new template graded 57, under 75
  • packages/cli/test/swizzle-proof/samples.mjs: clear
  • packages/core/package.json: clear
  • packages/core/src/CommentPin/CommentPin.doc.mjs: clear
  • packages/core/src/CommentPin/CommentPin.test.tsx: clear
  • packages/core/src/CommentPin/CommentPin.tsx: 21-line file header (non-blocking)
  • packages/core/src/CommentPin/index.ts: clear
  • packages/core/src/__tests__/hostDataAttributes.test.tsx: clear
  • packages/core/src/index.ts: clear
  • packages/lab/src/CommentPin/index.test.ts: clear
  • packages/lab/src/CommentPin/index.ts: clear
  • packages/lab/src/Comments/types.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear

Automated review (maintainer link)

… and template assets

As CLI component blocks, CommentPinShowcase and CommentPinInMargin are
graded by the template rubric. The showcase used raw HTML, about forty
custom style properties, and third-party image URLs; the margin block used
raw divs and a StyleX stylesheet.

The showcase now shows two pins over an image in a Card: AspectRatio sizes
the image from /template-assets, and each pin takes the documented
bottom-start placement from one small helper. The margin block puts the pin
in a Stack row beside the passage it annotates, with no custom styles. Both
descriptions name the pattern's other names. CommentPin's file header is
shorter.
@ernestt

ernestt commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Both template fixes are in one new commit on this branch:

  • CommentPinShowcase. It now shows two pins over a /template-assets image in a Card. AspectRatio sizes the image, and one small helper gives each pin the documented bottom-start placement. That removes the raw HTML other than the image, which the rubric exempts because Core has no image component. It also removes the third-party image URLs, the StyleX import, and all but five style declarations. It is 91 lines.
  • CommentPinInMargin. The pin sits in a Stack row beside the passage it annotates, with no custom styles and no raw elements. The description now gives the pattern's other names.

Graded against the template rubric 1.4's counting rules, the showcase scores 90 (its one deduction is the five declarations the placement needs) and the margin block scores 100. The description has real-Chromium captures: each pin's bottom-start corner lands on its anchor, the selection behaves as described, and the margin pin keeps its focus ring inside the card. The two optional notes are handled too: the aria-labeled divs are gone, and CommentPin's file header is shorter.

On this head: 332 tests pass (Core and Lab CommentPin, Lab Comments, hostDataAttributes), along with 470 CLI template and component tests. tsc for Core and Lab passes. Strict ESLint and Prettier on the changed files are clean, pnpm review:pre shows 0 findings, pnpm check:knowledge is clean, and the node project passes all 30,737 tests.

The commit sits on top of the old head, so #13736–#13739 keep their heads and approvals. CommentUser was already on the Scope line. The owner decision on the record stays with the spec owner.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision on the draft component:CommentPin record, and one description fix is needed.

The decision covers the record's requirements (FR13, FR14 with the new data-unread reflection, and the Stable column), whether CommentPin graduates while OQ1–OQ3 stay open, and whether isSelected/onSelectedChange fits beside ToggleButton's isPressed/onPressedChange for this aria-pressed toggle. An engineering owner records it by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner.

  • The description's Evidence section says "The margin pin keeps its focus ring and tooltip inside the card.", but the margin block's tooltip runs about 80 px past the card edge (reproduced locally, and visible in your own focus capture), so say that only the focus ring stays inside.

Both blocks now clear the template bar, and their placement (in both text directions), selection and keyboard behavior, like the pin's unchanged rendering, match the description, reproduced locally.

Claims and files checked

Review mode: full; reason: author-not-engowner

Claims

  • Title: CommentPin moves to Core: verified (new Core folder, entry point and root export).
  • The pull request is stacked on the API-pass pull request, whose branch is its base: verified.
  • Lab is private, so products cannot install the pin from it: verified (Lab's package manifest is private).
  • The API-pass pull request settled the pin's API and nothing is left to change before graduating: reported (a statement about another pull request; the record that would settle the API is still draft).
  • CommentPin moves unchanged, with the same props, defaults, behavior and theming target, under Core's strict lint and comment rules: verified (the component diff changes only imports, where the person type is declared, comments and one equivalent type spelling; the target name is unchanged; the focused tests pass; two story frames are identical; strict lint is clean).
  • CommentUser moves with it, is exported from the CommentPin entry point and the package root, and Lab's Comments family takes it from Core: verified (Core entry and barrel; Comments types import and re-export it; no other declaration remains).
  • Lab's CommentPin and CommentPinProps are plain re-exports with no deprecation marker and no scheduled removal, and a test checks the component and its props type: verified (the identity case passes here and the type case compiles under Lab's typecheck).
  • The stories move to Core: verified (the story title and Storybook ids are now Core's).
  • The two blocks move to the CLI's component blocks: verified (the template list shows both at the head and neither at the base).
  • The ShadCN registry keeps the Lab route as an alias: verified (route lock and doc alias).
  • The probe theme covers the new target: verified (the probe check passes here).
  • The sandbox route list names both new block pages: verified (the route-manifest test passes here).
  • As CLI blocks, both meet the template rubric: verified (both clear the 75 floor).
  • The showcase shows two pins over a template-asset image in a Card, AspectRatio sizes the image, and one helper gives each pin the documented bottom-start placement: verified (code, the doc's placement rule, and the pins measured here).
  • The margin block puts the pin in a Stack row beside its passage with no custom styles: verified.
  • The showcase scores 90, its only deduction the five placement declarations, and the margin block scores 100: verified against the repository's own rubric doc (version 1.4); this review's rubric version counts the image and the missing client directive, giving 85 and 98.
  • Each pin's bottom-start corner lands on its anchor at 34%/38% and 68%/70% of the image: verified (measured here, and mirrored in right-to-left).
  • Selecting one pin clears the other, and pressing the selected pin clears the selection: verified (probed here).
  • The margin pin keeps its focus ring and tooltip inside the card: false for the tooltip, which runs about 80 px past the card edge (finding).
  • The record's re-export requirement rests on the compatibility record's private-package clause and waits for approval; the reflected-states requirement names grouped and unread and why; verification and paths point at Core; the record needs approval: verified in the record.
  • The compatibility record makes the promotion additive, and its deprecation clauses govern only a later deprecation: verified.
  • A reflected data attribute is public surface that a record names, as the new requirement does: verified, though that requirement is still draft.
  • Admission of a public Core surface belongs to the component-admission record: verified (the record cites it).
  • New Core exports are CommentPin, CommentPinProps and CommentUser from the CommentPin entry point and the root: verified (the API generator lists only added Core rows).
  • Lab imports keep working with no deprecation marker, and there is no prop, default, behavior or theming change: verified.
  • The only caller decision is the import path: verified.
  • The move follows the InfoTip graduation's shape (Core folder, changesets, Lab re-export, registry alias): verified; InfoTip's Lab exports are deprecated, unlike these.
  • CommentUser moves now because CommentPin's props name it and a Core type cannot import Lab: verified.
  • The plain re-export matches the DiffViewer and SelectableCardGroup moves: reported (those moves are in other pull requests).
  • Joining the size cascade is the component's own opt-in: verified (the size-cascade record's explicit-participation invariant).
  • The renders are pixel-identical between Lab and Core: reported, and reproduced locally for the state matrix and placement stories.
  • Writing rubric R1–R7 for the record: reported.
  • The scope checklist items, including no internal context in public text: verified (no internal context found in the added lines, commits, title or description).
  • The branch was rebased onto main with no change to either earlier commit's own diff: verified (identical patch IDs per commit).
  • This head adds one commit with the two blocks and the shorter file header: verified.
  • Tests, type checks, lint and pre-review checks pass: reported. Reproduced locally: the focused tests (332), the CLI template tests (332), the probe, route and swizzle-sample tests, a type check of both blocks, Lab's typecheck, strict lint, and the knowledge and changeset checks. The full node project and the pre-review checklist were not run.
  • CLI changeset: astryx template lists both CommentPin blocks among Core's component blocks: verified (run here).
  • Core changeset's description of the pin (lead participant, up to three circles and the total, accent unread dot, three element sizes, kept or host-controlled selection, host-owned anchors): verified against the focused tests for each case.

Files

  • .changeset/commentpin-core-blocks.md: clear
  • .changeset/promote-commentpin-to-core.md: clear
  • apps/sandbox/scripts/next-export-routes.json: clear
  • apps/storybook/rtl-audit/verified-not-applicable.json: clear
  • apps/storybook/stories/CommentPin.stories.tsx: clear
  • docs/specs/components/CommentPin/CommentPin.spec.md: draft record needs an engineering owner's decision
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear
  • internal/shadcn-registry/routes.lock.json: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.doc.mjs: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.tsx: clear (the description misstates where its tooltip sits)
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.doc.mjs: clear
  • packages/cli/assets/templates/blocks/components/CommentPin/CommentPinShowcase.tsx: clear
  • packages/cli/test/swizzle-proof/samples.mjs: clear
  • packages/core/package.json: clear
  • packages/core/src/CommentPin/CommentPin.doc.mjs: clear
  • packages/core/src/CommentPin/CommentPin.test.tsx: clear
  • packages/core/src/CommentPin/CommentPin.tsx: clear
  • packages/core/src/CommentPin/index.ts: clear
  • packages/core/src/__tests__/hostDataAttributes.test.tsx: clear
  • packages/core/src/index.ts: clear
  • packages/lab/blocks/CommentPinInMargin.doc.mjs: clear (deleted)
  • packages/lab/blocks/CommentPinInMargin.tsx: clear (deleted)
  • packages/lab/blocks/CommentPinShowcase.doc.mjs: clear (deleted)
  • packages/lab/blocks/CommentPinShowcase.tsx: clear (deleted)
  • packages/lab/src/CommentPin/index.test.ts: clear
  • packages/lab/src/CommentPin/index.ts: clear
  • packages/lab/src/Comments/types.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 40d6d75a Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant