Skip to content

Commit 20fb61c

Browse files
committed
feat(core): CommentPin moves to Core
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 become deprecated re-exports of the Core ones for one release, and 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.
1 parent c4542db commit 20fb61c

24 files changed

Lines changed: 255 additions & 122 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/cli': patch
3+
---
4+
5+
[docs] `astryx template` lists CommentPin's blocks among Core's component blocks: the "Avatar-first annotations" showcase and the "Comment pin in a document margin" example.
6+
7+
@ernestt
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[component] Promote `CommentPin` to Core, imported from `@astryxdesign/core/CommentPin` or the package root together with `CommentUser`, the person record its participants take. CommentPin is the avatar-first button that anchors a comment thread, or a group of threads, over content or in a content margin. A single pin shows its lead participant; a group shows up to three participant circles and the thread total. An accent dot marks unread threads. Three sizes follow the element-size scale. Activation flips the selection, which the pin keeps, or the host controls through `isSelected` and `onSelectedChange`. The host owns anchors, grouping, and which pins render.
6+
7+
@ernestt

‎apps/sandbox/scripts/next-export-routes.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@
278278
"/templates/CommandPalettePickerMode/",
279279
"/templates/CommandPaletteRichItems/",
280280
"/templates/CommandPaletteShowcase/",
281+
"/templates/CommentPinInMargin/",
282+
"/templates/CommentPinShowcase/",
281283
"/templates/ComplexSelectorDeadlinePicker/",
282284
"/templates/ComplexSelectorShowcase/",
283285
"/templates/ComplexSelectorTreeSearch/",

‎apps/storybook/rtl-audit/verified-not-applicable.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@
391391
"reason": "EmojiPicker is a search field above CSS grids of emoji whose columns follow CSS direction, with sticky group headings and a footer preview in logical-property flex rows; its search glyph is radially symmetric. Its one direction-sensitive behavior, horizontal arrow keys, comes from core useGridFocus, which resolves direction per keydown with isRtlElement; that hook's RTL tests and EmojiPicker's own right-to-left keyboard test cover it, and no audit dimension measures keyboard direction."
392392
},
393393
{
394-
"component": "lab/CommentPin",
395-
"reason": "CommentPin sets its fixed 4px speech-bubble corner with the logical border-end-start-radius longhand (the other corners use logical longhands too), so it mirrors under RTL by construction, and switches transform origin from left-bottom to right-bottom. Absolute examples place the inline-start edge at the anchor and translate only on the block axis, so bottom-start placement mirrors without a physical inline offset. Its flex row, avatar overlap, and padding use logical properties; avatars and the numeric count have no directional glyph or keyboard semantics to reverse."
394+
"component": "core/CommentPin",
395+
"reason": "CommentPin sets its fixed 2px speech-bubble corner with the logical border-end-start-radius longhand (the other corners use logical longhands too), so it mirrors under RTL by construction, and switches transform origin from left-bottom to right-bottom. Absolute examples place the inline-start edge at the anchor and translate only on the block axis, so bottom-start placement mirrors without a physical inline offset. Its flex row, avatar overlap, and padding use logical properties; avatars and the numeric count have no directional glyph or keyboard semantics to reverse."
396396
},
397397
{
398398
"component": "lab/CommentComposer",

‎apps/storybook/stories/CommentPin.stories.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import type {Meta, StoryObj} from '@storybook/react';
44
import {useEffect, useRef, useState} from 'react';
55
import * as stylex from '@stylexjs/stylex';
6-
import {CommentPin} from '@astryxdesign/lab';
6+
import {CommentPin} from '@astryxdesign/core/CommentPin';
77
import {Text} from '@astryxdesign/core/Text';
88
import {HStack, VStack} from '@astryxdesign/core/Stack';
99
import {
@@ -169,7 +169,7 @@ function FocusedSelectedPin() {
169169
}
170170

171171
const meta: Meta<typeof CommentPin> = {
172-
title: 'Lab/CommentPin',
172+
title: 'Core/CommentPin',
173173
component: CommentPin,
174174
tags: ['autodocs'],
175175
parameters: {layout: 'centered'},

‎docs/specs/components/CommentPin/CommentPin.spec.md‎

Lines changed: 37 additions & 23 deletions
Large diffs are not rendered by default.

‎internal/eslint-plugin-astryx/no-comment-provenance.baseline.json‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,16 +2277,6 @@
22772277
"DR2",
22782278
"design:bidirectionality"
22792279
],
2280-
"packages/lab/src/CommentPin/CommentPin.tsx": [
2281-
"FR1",
2282-
"FR2",
2283-
"FR2",
2284-
"FR2",
2285-
"FR4",
2286-
"FR6",
2287-
"ORD4",
2288-
"spec:AST-085"
2289-
],
22902280
"packages/lab/src/Comments/CommentActions.tsx": [
22912281
"architecture:react-component-runtime/INV2"
22922282
],

‎internal/shadcn-registry/routes.lock.json‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@
301301
"path": "components/command-palette-list",
302302
"aliases": []
303303
},
304+
{
305+
"name": "component-comment-pin",
306+
"path": "components/comment-pin",
307+
"aliases": [
308+
"components/lab/comment-pin"
309+
]
310+
},
304311
{
305312
"name": "component-complex-selector",
306313
"path": "components/complex-selector",
@@ -597,11 +604,6 @@
597604
"path": "components/lab/comment-composer",
598605
"aliases": []
599606
},
600-
{
601-
"name": "component-lab-comment-pin",
602-
"path": "components/lab/comment-pin",
603-
"aliases": []
604-
},
605607
{
606608
"name": "component-lab-comment-thread",
607609
"path": "components/lab/comment-thread",

packages/lab/blocks/CommentPinInMargin.doc.mjs renamed to packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.doc.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Meta Platforms, Inc. and affiliates.
22

33
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4-
export default {
4+
export const doc = {
55
type: 'block',
66
name: 'Host-owned placement',
77
displayName: 'Comment pin in a document margin',

packages/lab/blocks/CommentPinInMargin.tsx renamed to packages/cli/assets/templates/blocks/components/CommentPin/CommentPinInMargin.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
* @input A host-positioned CommentPin and its lead commenter
77
* @output A document passage with one comment pin in its margin; activating
88
* the pin toggles its own selection and aria-pressed state
9-
* @position Copyable Lab CommentPin placement example
9+
* @position Copyable CommentPin placement example
1010
*/
1111

1212
import * as stylex from '@stylexjs/stylex';
1313
import {Card} from '@astryxdesign/core/Card';
1414
import {Text} from '@astryxdesign/core/Text';
1515
import {VStack} from '@astryxdesign/core/Stack';
1616
import {colorVars, spacingVars} from '@astryxdesign/core/theme/tokens.stylex';
17-
import {CommentPin} from '@astryxdesign/lab';
17+
import {CommentPin} from '@astryxdesign/core/CommentPin';
1818

1919
const styles = stylex.create({
2020
document: {

0 commit comments

Comments
 (0)