diff --git a/packages/react/src/Timeline/Timeline.issues.features.stories.tsx b/packages/react/src/Timeline/Timeline.issues.features.stories.tsx index 20324b0b6ff..b31889bfb77 100644 --- a/packages/react/src/Timeline/Timeline.issues.features.stories.tsx +++ b/packages/react/src/Timeline/Timeline.issues.features.stories.tsx @@ -40,6 +40,8 @@ import Octicon from '../Octicon' import Token from '../Token' import classes from './Timeline.issues.features.stories.module.css' import {BoldLink, Examples, MutedTime, UserActor, VariantSection} from './internal/timelineStoryHelpers' +import {actorTypeForLogin, ISSUE_TAXONOMY, toEventDataAttributes} from './taxonomy' +import type {IssueEventType} from './taxonomy' /** * Issue Timeline event examples (Phase 2 of github/primer#6663). @@ -104,6 +106,23 @@ export default { ], } as Meta> +/** + * Serialize the taxonomy `data-*` contract (github/primer#6664) for one Issues + * event row. `type` is an ISSUE_TAXONOMY leaf; `category` + `visibility` are read + * from the catalog, so metadata leaves (labels, assignees, milestones, project + * fields, issue types, rename) pick up `visibility: 'auditOnly'` automatically. + * Pass the row's rendered actor login so `data-actor-type` resolves (every Issues + * event carries an actor). + */ +const issueAttrs = (type: IssueEventType, login?: string) => + toEventDataAttributes({ + scope: 'issue', + type, + category: ISSUE_TAXONOMY[type].category, + visibility: ISSUE_TAXONOMY[type].visibility, + actorType: login ? actorTypeForLogin(login) : undefined, + }) + /** * The Closed event group — `IssueTimeline.eventClosed` (audit § 2). * @@ -118,7 +137,7 @@ export const EventClosed = () => ( {/* Closed as completed */} - + @@ -139,7 +158,7 @@ export const EventClosed = () => ( (portable for docs copy-paste; matches production `TimelineRow`). */} - + ( {/* Closed via pull request */} - + @@ -185,7 +204,7 @@ export const EventClosed = () => ( {/* Closed via commit */} - + @@ -210,7 +229,7 @@ export const EventClosed = () => ( equivalent for github-ui's `ProjectV2` closer link. */} - + @@ -233,7 +252,7 @@ export const EventClosed = () => ( composed here from Primer primitives. */} - + ( {/* Closed with no state reason */} - + @@ -293,7 +312,7 @@ export const EventState = () => ( {/* Reopened — open (green) badge via useIssueState (ReopenedEvent.tsx) */} - + @@ -310,7 +329,7 @@ export const EventState = () => ( plain inline Link (the audit shows it bold; live code is canonical). */} - + @@ -329,7 +348,7 @@ export const EventState = () => ( {/* Pinned */} - + @@ -345,7 +364,7 @@ export const EventState = () => ( {/* Unpinned */} - + @@ -362,7 +381,7 @@ export const EventState = () => ( the resulting discussion by number. */} - + @@ -378,6 +397,7 @@ export const EventState = () => ( {/* Converted from draft */} + {/* 'Converted from draft' has no ISSUE_TAXONOMY leaf (a draft-conversion verb the Issues catalog excludes); left untagged. */} @@ -407,7 +427,7 @@ export const EventReferences = () => ( open PR state icon inline before the PR title). */} - + @@ -431,7 +451,7 @@ export const EventReferences = () => ( icon is behind the live code here. */} - + @@ -451,7 +471,7 @@ export const EventReferences = () => ( inline (showAgoTimestamp={false}) and the commit card is sub-content. */} - + @@ -482,7 +502,7 @@ export const EventReferences = () => ( {/* Multiple commit references — same event, pluralized copy + N cards. */} - + @@ -538,7 +558,7 @@ export const EventDuplicates = () => ( IssueLink uses the open (green) state icon. */} - + @@ -562,6 +582,7 @@ export const EventDuplicates = () => ( {/* Marked as a duplicate of this issue — no right controls. */} + {/* 'Marked as canonical' has no ISSUE_TAXONOMY leaf (only 'marked_as_duplicate' exists); left untagged. */} @@ -584,6 +605,7 @@ export const EventDuplicates = () => ( {/* Unmarked this as a duplicate of . */} + {/* 'Unmarked as duplicate' has no ISSUE_TAXONOMY leaf (only 'marked_as_duplicate' exists); left untagged. */} @@ -605,6 +627,7 @@ export const EventDuplicates = () => ( {/* Unmarked as a duplicate of this issue. */} + {/* 'Unmarked as canonical' has no ISSUE_TAXONOMY leaf (only 'marked_as_duplicate' exists); left untagged. */} @@ -638,7 +661,7 @@ export const EventModeration = () => ( {/* User blocked (permanent) */} - + @@ -654,7 +677,7 @@ export const EventModeration = () => ( {/* User temporarily blocked */} - + @@ -670,7 +693,7 @@ export const EventModeration = () => ( {/* Comment pinned — IssueCommentPinnedEvent.tsx links the pinned comment. */} - + @@ -689,7 +712,7 @@ export const EventModeration = () => ( {/* Comment unpinned */} - + @@ -720,7 +743,7 @@ export const EventIssueTypes = () => ( {/* Type added */} - + @@ -750,7 +773,7 @@ export const EventIssueTypes = () => ( {/* Type removed */} - + @@ -780,7 +803,7 @@ export const EventIssueTypes = () => ( {/* Type changed */} - + @@ -840,7 +863,7 @@ export const EventIssueHierarchy = () => ( {/* Sub-issue added (single) */} - + @@ -865,7 +888,7 @@ export const EventIssueHierarchy = () => ( {/* Sub-issue added (multiple) — plural copy + N reference rows */} - + @@ -897,7 +920,7 @@ export const EventIssueHierarchy = () => ( {/* Sub-issue removed (single) */} - + @@ -922,7 +945,7 @@ export const EventIssueHierarchy = () => ( {/* Sub-issues removed (multiple) */} - + @@ -954,7 +977,7 @@ export const EventIssueHierarchy = () => ( {/* Parent issue added (single) */} - + @@ -979,7 +1002,7 @@ export const EventIssueHierarchy = () => ( {/* Parent issues added (multiple) */} - + @@ -1011,7 +1034,7 @@ export const EventIssueHierarchy = () => ( {/* Parent issue removed (single) */} - + @@ -1036,7 +1059,7 @@ export const EventIssueHierarchy = () => ( {/* Parent issues removed (multiple) */} - + @@ -1084,7 +1107,7 @@ export const EventDependencies = () => ( {/* Blocked by (single) */} - + @@ -1109,7 +1132,7 @@ export const EventDependencies = () => ( {/* Blocked by (multiple) — count in copy + N rows */} - + @@ -1141,7 +1164,7 @@ export const EventDependencies = () => ( {/* Blocked by removed (single) */} - + @@ -1166,7 +1189,7 @@ export const EventDependencies = () => ( {/* Blocked by removed (multiple) */} - + @@ -1198,7 +1221,7 @@ export const EventDependencies = () => ( {/* Blocking (single) */} - + @@ -1223,7 +1246,7 @@ export const EventDependencies = () => ( {/* Blocking (multiple) */} - + @@ -1255,7 +1278,7 @@ export const EventDependencies = () => ( {/* Blocking removed (single) */} - + @@ -1280,7 +1303,7 @@ export const EventDependencies = () => ( {/* Blocking removed (multiple) */} - + @@ -1332,7 +1355,7 @@ export const EventIssueFields = () => ( {/* Set text field */} - + @@ -1353,7 +1376,7 @@ export const EventIssueFields = () => ( {/* Set number field */} - + @@ -1374,7 +1397,7 @@ export const EventIssueFields = () => ( {/* Set date field */} - + @@ -1395,7 +1418,7 @@ export const EventIssueFields = () => ( {/* Set single-select field — value is a colored token */} - + @@ -1429,7 +1452,7 @@ export const EventIssueFields = () => ( {/* Changed text field */} - + @@ -1450,7 +1473,7 @@ export const EventIssueFields = () => ( {/* Changed number field */} - + @@ -1471,7 +1494,7 @@ export const EventIssueFields = () => ( {/* Changed date field */} - + @@ -1492,7 +1515,7 @@ export const EventIssueFields = () => ( {/* Changed single-select field */} - + @@ -1523,7 +1546,7 @@ export const EventIssueFields = () => ( {/* Cleared text field — no value */} - + @@ -1540,7 +1563,7 @@ export const EventIssueFields = () => ( {/* Cleared number field */} - + @@ -1557,7 +1580,7 @@ export const EventIssueFields = () => ( {/* Cleared date field */} - + @@ -1574,7 +1597,7 @@ export const EventIssueFields = () => ( {/* Cleared single-select field */} - + @@ -1591,7 +1614,7 @@ export const EventIssueFields = () => ( {/* Rollup: updated only — multiple field updates collapsed into one row */} - + @@ -1616,7 +1639,7 @@ export const EventIssueFields = () => ( {/* Rollup: removed only */} - + @@ -1635,7 +1658,7 @@ export const EventIssueFields = () => ( {/* Rollup: updated and also removed — combined row joined by "and also" */} - + @@ -1687,7 +1710,7 @@ export const EventProject = () => ( {/* Added to project */} - + @@ -1708,7 +1731,7 @@ export const EventProject = () => ( {/* Removed from project */} - + @@ -1732,7 +1755,7 @@ export const EventProject = () => ( strings are PLAIN TEXT (not bold). Both forms shown under one caption. */} - + @@ -1746,7 +1769,7 @@ export const EventProject = () => ( - + @@ -1786,7 +1809,7 @@ export const EventLabels = () => ( {/* Label added */} - + @@ -1815,7 +1838,7 @@ export const EventLabels = () => ( {/* Label removed */} - + @@ -1845,6 +1868,7 @@ export const EventLabels = () => ( with "and" between them. */} + {/* 'Labels added and removed' is one row representing two events (labeled + unlabeled); a single row cannot carry two event types, so left untagged. */} @@ -1905,7 +1929,7 @@ export const EventTitle = () => ( {/* Title changed */} - + @@ -1940,7 +1964,7 @@ export const EventMilestones = () => ( {/* Added to milestone */} - + @@ -1960,7 +1984,7 @@ export const EventMilestones = () => ( {/* Removed from milestone */} - + @@ -1999,7 +2023,7 @@ export const EventAssignments = () => ( {/* Self-assigned */} - + @@ -2015,7 +2039,7 @@ export const EventAssignments = () => ( {/* Assigned someone else — assignee is a bold link, no avatar. */} - + @@ -2031,7 +2055,7 @@ export const EventAssignments = () => ( {/* Assigned multiple — joined with "and". */} - + @@ -2049,7 +2073,7 @@ export const EventAssignments = () => ( {/* Self-unassigned */} - + @@ -2065,7 +2089,7 @@ export const EventAssignments = () => ( {/* Unassigned someone else */} - + @@ -2081,7 +2105,7 @@ export const EventAssignments = () => ( {/* Unassigned multiple — joined with "and". */} - + @@ -2118,7 +2142,7 @@ export const EventLockUnlock = () => ( too heated). */} - + @@ -2128,7 +2152,7 @@ export const EventLockUnlock = () => ( - + @@ -2138,7 +2162,7 @@ export const EventLockUnlock = () => ( - + @@ -2148,7 +2172,7 @@ export const EventLockUnlock = () => ( - + @@ -2164,7 +2188,7 @@ export const EventLockUnlock = () => ( {/* Locked (no reason) */} - + @@ -2180,7 +2204,7 @@ export const EventLockUnlock = () => ( {/* Unlocked — UnlockIcon badge (not LockIcon). */} - + @@ -2211,7 +2235,7 @@ export const EventCommentDeleted = () => ( {/* Comment deleted */} - + @@ -2249,7 +2273,7 @@ export const EventCrossReferences = () => ( {/* Mentioned from an issue */} - + @@ -2274,7 +2298,7 @@ export const EventCrossReferences = () => ( {/* Mentioned from a pull request */} - + @@ -2299,7 +2323,7 @@ export const EventCrossReferences = () => ( {/* Linked a closing pull request */} - +