Skip to content

fix(Citation): without a source, Citation names the prop and the fix in development - #12394

Merged
josephfarina merged 3 commits into
mainfrom
josephfarina/rl28-citation-missing-source-error
Nov 18, 2026
Merged

josephfarina merged 3 commits into
mainfrom
josephfarina/rl28-citation-missing-source-error

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #12386 (merged), which adds the shared devPropError helper. Review the commits above it.

User impact

A builder who writes <Citation number={1}>Annual report</Citation> gets Cannot read properties of undefined (reading 'title') from inside Citation. The message names neither the component nor the prop.

Problem and solution fit

source is a required object; Citation reads its title to build the label. In development, Citation now checks the prop first and throws:

Citation: source is required, for example source={{title: 'Annual report', url: 'https://example.com/report'}}. Citation does not read children.

Expected behavior and authority

The prop's type in CitationProps defines the expected value. The error uses Core's Component: message form from utils/devWarning.ts.

Smallest restoration

One inline process.env.NODE_ENV !== 'production' check that throws devPropError when source == null. A production bundle drops it.

Evidence

  • Reproduction before the change: <Citation number={1}>Annual report</Citation> throws Cannot read properties of undefined (reading 'title').
  • Result after the change: the same render throws the message above in development.
  • Representative unchanged path: in production the same render throws the same TypeError as before; minified esbuild production output: the Citation bundle has the same size and code as the base; only minified local names differ.
  • Regression test or other mutation-sensitive proof: Citation.missingSource.test.tsx (development message, production behavior, and the message is in a development bundle only).

Scope

Components: Citation

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

CI=1 vitest run --project ui on the component's directory, tsc -p packages/core, eslint and prettier on the changed files.

@vercel

vercel Bot commented Nov 17, 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 Nov 18, 2026 2:04am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 2:13 AM UTC

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

@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.

Changes requested: only the pull request description needs a fix; the code change itself conforms.

  • The description says the minified esbuild production bundle of Citation is byte-identical to the base, but built with the repository's devBundle.ts settings both bundles are 32,558 bytes and 149 minifier-chosen identifier names differ, so please reword that line (for example: same size and code, only local names differ).

The development error, the unchanged production path and the bundle check are proven by Citation.missingSource.test.tsx, which fails on the base and passes on this branch. This pull request depends on devPropError from #12386, so it lands after that one.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset: in development, Citation throws an error that names source and the fix instead of a TypeError: verified (Citation.tsx:202-208; the new test fails on the base with the TypeError).
  • Changeset: production output is unchanged: verified (the production test passes on base and head; the production bundle has no guard or message and keeps its size).
  • Description: a Citation with children and no source throws a TypeError about reading title: verified on the base.
  • Description: source is a required object that Citation reads for its label: verified (Citation.tsx:75, :210).
  • Description: the check runs first and throws the stated message in development through the shared Component: message helper: verified (Citation.tsx:202-208; devPropError in utils/devWarning.ts on the base branch).
  • Description: in production the same render throws the same TypeError as before: verified (production test).
  • Description: the minified esbuild production bundle is byte-identical to the base: false (149 identifier names differ at 32,558 bytes).
  • Description: the regression test covers the development message, production behavior and the development-only bundle: verified (three tests; two fail on the base).
  • Description: no new public API, visual representation, default or interaction model: verified (the generated API delta has no rows).
  • Description: public text carries no internal context: verified.
  • Description: tests, typecheck, eslint and prettier pass: verified.
  • .changeset/citation-missing-source-error.md: clear
  • packages/core/src/Citation/Citation.missingSource.test.tsx: clear
  • packages/core/src/Citation/Citation.tsx: clear

Automated review (maintainer link)

@josephfarina
josephfarina changed the base branch from josephfarina/rl28-selector-options-error to main November 18, 2026 01:33
@josephfarina
josephfarina marked this pull request as ready for review November 18, 2026 01:35
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · f3f627d

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Selector 114.8 kB (+1 B) · 18.7 kB CSS (0) — ✗ · ✓ · ✓
SelectorOption 24.2 kB (−1 B) · 6.7 kB CSS (0) — ✗ · ✓ · ✓
Banner 68.2 kB (+24 B) · 11.3 kB CSS (0) — — · — · —
138 more components
Component Size LoC Visual · A11y · RTL
ChatDictationButton 66.8 kB (+11 B) · 10.9 kB CSS (0) — — · — · —
richtext/RichTextView 283.8 kB (+10 B) · 2.3 kB CSS (0) — — · — · —
PowerSearch 310.3 kB (+7 B) · 25.6 kB CSS (0) — — · — · —
MoreMenu 109.1 kB (+6 B) · 18.9 kB CSS (0) — — · — · —
charts/Chart 242.0 kB (+5 B) · 516 B CSS (0) — — · — · —
lab/ChatEmojiPicker 122.7 kB (+5 B) · 773 B CSS (0) — — · — · —
CheckboxList 73.5 kB (+4 B) · 7.8 kB CSS (0) — — · — · —
Carousel 76.3 kB (+3 B) · 11.7 kB CSS (0) — — · — · —
CommandPalette 78.6 kB (+3 B) · 12.8 kB CSS (0) — — · — · —
ContextMenuItem 35.9 kB (+3 B) · 7.1 kB CSS (0) — — · — · —
MultiSelector · Storybook 103.2 kB (+3 B) · 17.8 kB CSS (0) 2,726 (+7) ✓ · ✓ · ✓
Pagination 147.6 kB (+3 B) · 19.1 kB CSS (0) — — · — · —
BreadcrumbItem 98.0 kB (+2 B) · 13.3 kB CSS (0) — — · — · —
CommandPaletteInput 33.3 kB (+2 B) · 7.6 kB CSS (0) — — · — · —
Popover 100.2 kB (+2 B) · 15.2 kB CSS (0) — — · — · —
lab/ChatReactionBar 123.9 kB (+2 B) · 1.1 kB CSS (0) — — · — · —
lab/TransferListSelector 145.3 kB (+2 B) · 1.4 kB CSS (0) — — · — · —
ChatLayoutScrollButton 66.8 kB (+1 B) · 11.0 kB CSS (0) — — · — · —
DateInput 203.0 kB (+1 B) · 18.0 kB CSS (0) — — · — · —
DropdownMenuSubMenu 78.9 kB (+1 B) · 10.5 kB CSS (0) — — · — · —
Step 31.8 kB (+1 B) · 5.6 kB CSS (0) — — · — · —
TableHeaderCell 104.5 kB (+1 B) · 19.1 kB CSS (0) — — · — · —
lab/TransferList 136.4 kB (+1 B) · 1.2 kB CSS (0) — — · — · —
AlertDialog 130.0 kB (0) · 15.5 kB CSS (0) — — · — · —
AppShell 98.8 kB (0) · 14.4 kB CSS (0) — — · — · —
Avatar 46.2 kB (0) · 5.7 kB CSS (0) — — · — · —
AvatarGroup 49.0 kB (0) · 5.8 kB CSS (0) — — · — · —
AvatarGroupOverflow 52.3 kB (0) · 5.7 kB CSS (0) — — · — · —
BaseTypeahead 79.6 kB (0) · 11.7 kB CSS (0) — — · — · —
BottomSheet 75.2 kB (0) · 7.8 kB CSS (0) — — · — · —
Breadcrumbs 16.5 kB (0) · 3.4 kB CSS (0) — — · — · —
Button 66.2 kB (0) · 10.8 kB CSS (0) — — · — · —
Calendar 77.3 kB (0) · 11.4 kB CSS (0) — — · — · —
ChatComposer 85.8 kB (0) · 12.9 kB CSS (0) — — · — · —
ChatComposerDrawer 18.2 kB (0) · 4.7 kB CSS (0) — — · — · —
ChatComposerInput 83.5 kB (0) · 12.1 kB CSS (0) — — · — · —
ChatComposerTokenElement 83.5 kB (0) · 12.1 kB CSS (0) — — · — · —
ChatMessage 17.2 kB (0) · 3.7 kB CSS (0) — — · — · —
ChatMessageList 29.5 kB (0) · 7.1 kB CSS (0) — — · — · —
ChatMessageMetadata 20.5 kB (0) · 4.1 kB CSS (0) — — · — · —
ChatSendButton 66.6 kB (0) · 10.8 kB CSS (0) — — · — · —
ChatToolCalls 33.8 kB (0) · 8.5 kB CSS (0) — — · — · —
CheckboxInput 69.4 kB (0) · 10.2 kB CSS (0) — — · — · —
Citation · Storybook 20.8 kB (0) · 4.4 kB CSS (0) 242 (+9) ✓ · ✓ · —
CodeBlock 81.7 kB (0) · 12.2 kB CSS (0) — — · — · —
CommandPaletteFooter 17.5 kB (0) · 3.7 kB CSS (0) — — · — · —
CommandPaletteList 16.4 kB (0) · 3.4 kB CSS (0) — — · — · —
ComplexSelector 78.7 kB (0) · 12.7 kB CSS (0) — — · — · —
ContextMenu 103.4 kB (0) · 18.8 kB CSS (0) — — · — · —
DateTimeInput 226.5 kB (0) · 19.8 kB CSS (0) — — · — · —
Dialog 25.7 kB (0) · 7.0 kB CSS (0) — — · — · —
DialogHeader 69.2 kB (0) · 12.4 kB CSS (0) — — · — · —
DrawerHeader 69.3 kB (0) · 13.8 kB CSS (0) — — · — · —
DropdownMenuCheckboxItem 28.8 kB (0) · 7.3 kB CSS (0) — — · — · —
DropdownMenuRadioItem 28.8 kB (0) · 7.3 kB CSS (0) — — · — · —
Field 59.9 kB (0) · 7.3 kB CSS (0) — — · — · —
FieldLabel 55.7 kB (0) · 5.8 kB CSS (0) — — · — · —
FileInput 75.3 kB (0) · 11.7 kB CSS (0) — — · — · —
IconButton 66.3 kB (0) · 10.8 kB CSS (0) — — · — · —
InfoTip 50.8 kB (0) · 5.4 kB CSS (0) — — · — · —
InputGroup 61.4 kB (0) · 7.9 kB CSS (0) — — · — · —
Kbd 17.2 kB (0) · 3.6 kB CSS (0) — — · — · —
LayoutContent 17.9 kB (0) · 1.8 kB CSS (0) — — · — · —
LayoutPanel 22.1 kB (0) · 5.0 kB CSS (0) — — · — · —
Lightbox 147.8 kB (0) · 12.0 kB CSS (0) — — · — · —
Link 56.8 kB (0) · 7.1 kB CSS (0) — — · — · —
List 19.0 kB (0) · 790 B CSS (0) — — · — · —
MetadataList 17.3 kB (0) · 3.7 kB CSS (0) — — · — · —
MobileNav 77.5 kB (0) · 11.4 kB CSS (0) — — · — · —
MobileNavToggle 66.6 kB (0) · 10.8 kB CSS (0) — — · — · —
NumberInput 104.1 kB (0) · 12.2 kB CSS (0) — — · — · —
Outline 25.4 kB (0) · 4.1 kB CSS (0) — — · — · —
OverflowList 11.0 kB (0) · 3.6 kB CSS (0) — — · — · —
RadioList 61.2 kB (0) · 7.4 kB CSS (0) — — · — · —
ResizeHandle 22.3 kB (0) · 4.3 kB CSS (0) — — · — · —
SegmentedControl 102.5 kB (0) · 6.9 kB CSS (0) — — · — · —
SideNav 122.5 kB (0) · 12.2 kB CSS (0) — — · — · —
SideNavCollapseButton 67.1 kB (0) · 10.8 kB CSS (0) — — · — · —
SideNavHeading 83.8 kB (0) · 12.1 kB CSS (0) — — · — · —
SideNavItem 78.2 kB (0) · 11.9 kB CSS (0) — — · — · —
Slider 115.0 kB (0) · 8.9 kB CSS (0) — — · — · —
Spinner 26.1 kB (0) · 6.3 kB CSS (0) — — · — · —
StackItem 16.4 kB (0) · 219 B CSS (0) — — · — · —
Stepper 67.9 kB (0) · 10.9 kB CSS (0) — — · — · —
Switch 109.4 kB (0) · 10.0 kB CSS (0) — — · — · —
Tab 15.0 kB (0) · 4.2 kB CSS (0) — — · — · —
Table 121.8 kB (0) · 19.8 kB CSS (0) — — · — · —
TableSelectionToolbar 76.6 kB (0) · 14.1 kB CSS (0) — — · — · —
TabList 47.6 kB (0) · 6.5 kB CSS (0) — — · — · —
TabMenu 80.1 kB (0) · 11.9 kB CSS (0) — — · — · —
TextArea 92.6 kB (0) · 9.4 kB CSS (0) — — · — · —
TextInput 99.0 kB (0) · 12.0 kB CSS (0) — — · — · —
Thumbnail 70.7 kB (0) · 12.4 kB CSS (0) — — · — · —
TimeInput 177.9 kB (0) · 17.0 kB CSS (0) — — · — · —
Timestamp 30.8 kB (0) · 11.1 kB CSS (0) — — · — · —
Toast 105.5 kB (0) · 11.1 kB CSS (0) — — · — · —
ToggleButton 93.4 kB (0) · 10.9 kB CSS (0) — — · — · —
Token 29.7 kB (0) · 4.9 kB CSS (0) — — · — · —
Tokenizer 105.9 kB (0) · 20.4 kB CSS (0) — — · — · —
Toolbar 47.5 kB (0) · 8.2 kB CSS (0) — — · — · —
TopNav 79.3 kB (0) · 11.8 kB CSS (0) — — · — · —
TopNavMegaMenu 77.5 kB (0) · 12.7 kB CSS (0) — — · — · —
TopNavMenu 82.8 kB (0) · 12.0 kB CSS (0) — — · — · —
TreeList 46.4 kB (0) · 5.9 kB CSS (0) — — · — · —
Typeahead 89.2 kB (0) · 13.5 kB CSS (0) — — · — · —
lab/ChatTypingIndicator 26.3 kB (0) · 612 B CSS (0) — — · — · —
lab/ChatVirtualizer 57.4 kB (0) · 223 B CSS (0) — — · — · —
lab/CommentPin 60.7 kB (0) · 1.2 kB CSS (0) — — · — · —
lab/DialogHeroHeader 90.4 kB (0) · 372 B CSS (0) — — · — · —
lab/DiffViewer 94.4 kB (0) · 2.1 kB CSS (0) — — · — · —
lab/EmojiPicker 118.8 kB (0) · 751 B CSS (0) — — · — · —
lab/ListInput 95.3 kB (0) · 922 B CSS (0) — — · — · —
lab/NavigationScreen 85.2 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/NavigationStack 85.2 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/PageControl 78.3 kB (0) · 709 B CSS (0) — — · — · —
lab/Schedule 116.1 kB (0) · 3.9 kB CSS (0) — — · — · —
lab/SelectableCardGroup 69.3 kB (0) · 162 B CSS (0) — — · — · —
lab/TabBar 83.7 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/TabBarItem 3.9 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/TourStep 95.0 kB (0) · 691 B CSS (0) — — · — · —
richtext/RichTextEditor 307.1 kB (0) · 2.6 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 309.2 kB (0) · 454 B CSS (0) — — · — · —
DateRangeInput 100.8 kB (−1 B) · 13.3 kB CSS (0) — — · — · —
DropdownMenuItem 28.0 kB (−1 B) · 6.9 kB CSS (0) — — · — · —
Item 20.6 kB (−1 B) · 6.2 kB CSS (0) — — · — · —
TopNavHeading 83.3 kB (−1 B) · 12.0 kB CSS (0) — — · — · —
charts/ChartLegend 48.1 kB (−2 B) · 224 B CSS (0) — — · — · —
Markdown 205.3 kB (−2 B) · 22.1 kB CSS (0) — — · — · —
TableCell 104.6 kB (−2 B) · 19.3 kB CSS (0) — — · — · —
ChatLayout 89.8 kB (−3 B) · 11.4 kB CSS (0) — — · — · —
lab/CommentComposer 180.5 kB (−3 B) · 1.9 kB CSS (0) — — · — · —
lab/TabBarMoreList 102.4 kB (−3 B) · 1.8 kB CSS (0) — — · — · —
CheckboxListItem 80.4 kB (−4 B) · 12.1 kB CSS (0) — — · — · —
DropdownMenu 108.8 kB (−4 B) · 18.9 kB CSS (0) — — · — · —
ListItem 79.5 kB (−4 B) · 12.1 kB CSS (0) — — · — · —
RadioListItem 76.5 kB (−4 B) · 10.7 kB CSS (0) — — · — · —
lab/Comments 376.9 kB (−4 B) · 2.5 kB CSS (0) — — · — · —
lab/CommentThread 370.1 kB (−10 B) · 2.4 kB CSS (0) — — · — · —
Visual changes: 4 snapshots in 1 component

A change is a question for the reviewer, not a failure.

Component · story Before After Diff
Selector · Indicator Space Bottom Sheet Wide Start (neutral, dark) · same image also changed on another pull request, not proven from main before frame after frame diff frame
Selector · Indicator Space Bottom Sheet Wide Start (neutral, light) · same image also changed on another pull request, not proven from main before frame after frame diff frame
Selector · Indicator Space Bottom Sheet Narrow End RTL (neutral, dark) · same image also changed on another pull request, not proven from main before frame after frame diff frame
Selector · Indicator Space Bottom Sheet Narrow End RTL (neutral, light) · same image also changed on another pull request, not proven from main before frame after frame diff frame

Inheritance checked against the 6 newest reports of other pull requests.

Package size: @astryxdesign/core 7.66 MB packed (+1.4 kB); no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@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.

Approved pending CI: CI has not finished on this head yet, and the merge guard waits for its required checks.

The earlier point is fixed: the description now says the Citation production bundle keeps its size and code with only minified local names differing, which reproduces at 32,558 bytes on both sides. The development check holds up: the new tests fail on main with the old TypeError and pass here, the production path is unchanged, and first-load JavaScript is +0 bytes minified on every reference page. The branch still carries #12386's commit, which is identical on main, so a merge adds only the three Citation files.

Claims and files checked

Review mode: full; reason: other:base retargeted from the parent branch to main

Claims

  • The branch builds on #12386, which adds the shared development-error helper: verified; #12386 is merged into main and the helper is in the shared diagnostics module.
  • Without a source, the example render throws a TypeError reading 'title' from inside Citation: verified on main by the new test.
  • That message names neither the component nor the prop: verified.
  • source is a required object and Citation reads its title to build the label: verified in the props type and the render.
  • In development Citation checks the prop first and throws the quoted message: verified by the new test.
  • The props type defines the expected value: verified.
  • The error uses Core's Component: message form: verified in the shared diagnostics module.
  • One inline development check throws the helper's error when source is missing: verified.
  • A production bundle drops the check: verified by the bundle test and a bundle comparison.
  • After the change the example render throws the new message in development: verified.
  • In production the same render throws the same TypeError as before: verified on main and on this branch.
  • The minified production bundle keeps its size and code, and only minified local names differ: verified (32,558 bytes on both sides, 149 local names differ).
  • The new test file covers the development message, the production behavior and the development-only bundle: verified; two of its three tests fail on main.
  • The scope is Citation: verified for what a merge adds; the compare view's other files are #12386's and already on main.
  • No new public API, visual representation, default or interaction model: verified; the API comparison has no rows and nothing rendered changes.
  • Public text carries no internal context: verified.
  • The unit tests, the Core typecheck, lint and formatting pass: verified at this head.
  • Changeset (Citation): in development Citation names the source prop and the fix instead of a TypeError, and production output is unchanged: verified.
  • Changeset (Selector): in development Selector and MultiSelector without an options array name the prop and the fix instead of 'options is not iterable', and production output is unchanged: verified by its tests at this head; identical on main.

Files

  • packages/core/src/Citation/Citation.tsx: clear
  • packages/core/src/Citation/Citation.missingSource.test.tsx: clear
  • .changeset/citation-missing-source-error.md: clear
  • packages/core/src/Selector/Selector.tsx: clear (identical on main)
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear (identical on main)
  • packages/core/src/Selector/Selector.missingOptions.test.tsx: clear (identical on main)
  • packages/core/src/utils/devWarning.ts: clear (identical on main)
  • packages/core/src/utils/devWarning.test.ts: clear (identical on main)
  • packages/core/src/utils/tests/devBundle.ts: clear (identical on main)
  • .changeset/selector-missing-options-error.md: clear (identical on main)

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 36f851d into main Nov 18, 2026
89 checks passed
@github-actions
github-actions Bot deleted the josephfarina/rl28-citation-missing-source-error branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — f3f627d6 Deployed Nov 18, 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