Skip to content

Add macOS Paper Storybook mode and PR coverage - #4355

Open
Jason Morse (JasonVMo) wants to merge 12 commits into
mainfrom
user/jasonvmo/macos-paper-storybook
Open

Jason Morse (JasonVMo) wants to merge 12 commits into
mainfrom
user/jasonvmo/macos-paper-storybook

Conversation

@JasonVMo

@JasonVMo Jason Morse (JasonVMo) commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Platforms Impacted

  • iOS
  • macOS
  • win32 (Office)
  • windows
  • android

Description of changes

Originally stacked on #4354; the parent has merged and this PR now targets main.

  • Add --macos --paper to the shared Storybook CLI and a matching paper API option. Fabric remains the default; Windows/Win32 reject the flag.
  • Pass the selected architecture through native preparation and child commands, honor it in the macOS Podfile, expose the renderer in driver manifests/capabilities, and rotate bridge nonces when switching renderers.
  • Add macOS Paper Storybook PR, using the existing native driver setup, complete story traversal, authored tests, and separately named artifacts.
  • Document the development/CI commands and the requirement to rerun prep when switching the shared generated native project between renderers.
  • Use centered alignment only in macOS Paper CompoundItemLayout demos to avoid a native Yoga NaN-baseline abort. Fabric/other-platform demos and the primitive implementation are unchanged.
  • Measure LayoutStableText's hidden reserve Text directly in the macOS native geometry fixture. Paper rounds Text frames differently from wrapper View frames; comparing Text with Text retains the same width, leading-alignment, intrinsic-height, and centering assertions. Production LayoutStableText styles, its contract, and Button/Tab snapshots are unchanged in the final diff.
  • Deduplicate compatible locked Storybook React/theming/UI-common packages after the concurrent UI-lite and addon-controls upgrades on main. No new resolution overrides or duplicate-checker exclusions are added; the existing server API and dependency ranges are preserved.
  • Add renderer/CLI/story regression coverage and changesets.

Related upstream bug: microsoft/react-native-macos#3121. This is a story-only workaround, not a fix for the upstream native baseline callback.

Verification

Hosted run 37089117508 at 21f75691f passes macOS Paper Storybook PR, macOS Storybook PR, Windows Storybook PR, Win32 Storybook PR, and JS PR. Each macOS renderer job renders all 168 stories and reports 30 authored cases: 7 passed and 23 explicit capability skips. The formerly failing LayoutStableText native alignment case passes in both renderer jobs.

Root/workspace commands were run from the repository root:

Command Result
yarn lint-repo Passed, including the native-core reference constraint fixed in #4354.
yarn build Passed.
yarn change:check Passed.
yarn dedupe '@storybook/*' storybook --check Passed: no remaining deduplication candidates after aligning the existing compatible locked versions.
yarn workspace @fluentui-react-native/storybook-desktop lint Passed.
yarn workspace @fluentui-react-native/storybook-desktop build Passed.
yarn workspace @fluentui-react-native/storybook-desktop test --runInBand Passed: 175 tests across 17 suites.
yarn workspace @fluentui-react-native/components lint Passed.
yarn workspace @fluentui-react-native/components build Passed.
yarn workspace @fluentui-react-native/components test --runInBand --testNamePattern CompoundItemLayout Passed: 7 selected tests, including four platform/renderer story cases.
yarn workspace @fluentui-react-native/components test --runInBand --testNamePattern 'LayoutStableText|Button|Tab' Passed: 111 selected tests and 7 snapshots, including native layout-callback forwarding for hidden reserve and visible Text.
yarn workspace @fluentui-react-native/agentic-components-storybook format Passed.
yarn workspace @fluentui-react-native/agentic-components-storybook lint Passed.
yarn workspace @fluentui-react-native/storybook-desktop-runtime lint Passed with the refreshed dependency graph.
yarn workspace @fluentui-react-native/storybook-desktop-runtime test --runInBand Passed: 14 tests across 2 suites.

Native commands were run from apps/storybook:

Command Result
yarn storybook prep --macos --paper Passed.
yarn storybook bundle --macos --paper Passed.
yarn storybook bundle --windows Passed with strict duplicate checks enabled after dependency alignment.
yarn storybook bundle --win32 Passed with strict duplicate checks enabled after dependency alignment.
yarn storybook build --macos --paper Passed.
FURN_DESKTOP_DRIVER_DISABLED_INPUT_FEATURES=physicalClick yarn storybook smoke --macos --paper --mode stories-and-tests Passed: all 168 stories rendered; 30 authored cases, 7 passed and 23 explicit capability skips.
yarn storybook prep --macos Passed when switching back to Fabric.
FURN_DESKTOP_DRIVER_DISABLED_INPUT_FEATURES=physicalClick yarn storybook smoke --macos --mode stories-and-tests Passed: all 168 stories rendered; 30 authored cases, 7 passed and 23 explicit capability skips.

The initial Paper sweep exposed the upstream native baseline abort. Hosted Paper CI subsequently rendered all 168 stories but failed the LayoutStableText width assertion by comparing a 104-point Text frame with a 102-point wrapper View. A trial maximum-width style did not change that result and has been removed. The final fixture compares the actual hidden reserve Text and visible Text, without weakening assertions or changing production layout. Concurrent dependency upgrades on main then blocked both macOS renderer jobs at bundling; deduplicating existing compatible locked packages restores all three desktop bundles without disabling validation. The final local Paper sweep used freshly regenerated Pods and a clean app-specific native build. Both local renderer sweeps passed, and all four hosted desktop Storybook jobs now pass. Capability skips are not claimed as executed native-state/input qualification. Windows/Win32 native lifecycles were not run locally; VoiceOver was not qualified.

Before After
macOS Storybook supported the Fabric lifecycle and had no dedicated Paper PR job. Fabric remains the default; --macos --paper enables the Paper lifecycle and dedicated PR coverage.
macOS Paper's composite baseline demo terminated Yoga with a NaN-baseline assertion. Only macOS Paper demos use centered alignment; Fabric baseline demos and the primitive stay unchanged.
Native alignment compared Text measurements with a differently rounded wrapper View. Both measurements come from the actual Text line boxes; geometry assertions and production styles remain unchanged.

Pull request checklist

This PR has considered (when applicable):

  • Automated Tests
  • Documentation and examples
  • Keyboard Accessibility
  • Voiceover
  • Internationalization and Right-to-left Layouts

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken, minified production esbuild bundles with React and React Native runtimes externalized.

Scenario Modules-Mac (Δ) Modules-Win (Δ) Size-Mac (Δ) Size-Win (Δ)
components-button 62 (+0) 63 (+0) 49.94k (+0b) 49.87k (+0b)
components-catalog 159 (+0) 160 (+0) 155.26k (+0b) 155.19k (+0b)
design-theme-state 33 (+0) 34 (+0) 30.11k (+0b) 30.03k (+0b)
design-themed-root 37 (+0) 38 (+0) 32.07k (+0b) 32.00k (+0b)
design-color-lib 6 (+0) 6 (+0) 6.33k (+0b) 6.33k (+0b)
design-theme-state-legacy-source 34 (+0) 35 (+0) 31.77k (+0b) 31.69k (+0b)
design-legacy-theme-from-flex 57 (+0) 58 (+0) 97.72k (+0b) 97.59k (+0b)

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

Base automatically changed from user/jasonvmo/native-lib1 to main October 3, 2026 00:46
Jason Morse (JasonVMo) and others added 5 commits October 2, 2026 18:19
Fix the macOS Paper CI geometry failure without relaxing its native alignment assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Compare Text line boxes with the same Paper pixel-rounding policy, preserve the native assertions, and remove the ineffective max-width production change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Align locked React, theming, and UI-common packages after the main-branch UI upgrades while preserving strict Metro duplicate checks and existing dependency ranges.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant