feat: [DSRN] Added HeaderStandardAnimated#1151
Merged
Merged
Conversation
…o dsrn/headerstandardanimated
Contributor
📖 Storybook Preview |
Contributor
📖 Storybook Preview |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 4 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3daf77d. Configure here.
Contributor
📖 Storybook Preview |
Contributor
📖 Storybook Preview |
kirillzyusko
reviewed
May 5, 2026
…o dsrn/headerstandardanimated
Contributor
📖 Storybook Preview |
Contributor
📖 Storybook Preview |
Contributor
📖 Storybook Preview |
georgewrmarshall
approved these changes
May 8, 2026
Contributor
georgewrmarshall
left a comment
There was a problem hiding this comment.
The current revision looks ready to merge. The earlier cleanup items around Storybook wiring, shared center-title rendering, animation constants, and Jest coverage policy all look addressed in the latest head, and the focused RN tests for the animated header, hook, and shared center-column pass locally.
Contributor
📖 Storybook Preview |
Contributor
📖 Storybook Preview |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This PR adds
HeaderStandardAnimatedto@metamask/design-system-react-native: a scroll-linked variant ofHeaderStandardthat fades and shifts the center title block as the user scrolls past the first content section, so the compact header title stays readable.Motivation: Screens that use a large title area inside the scroll body often need the header center copy to transition smoothly once that section scrolls away—without ad‑hoc animation in every screen.
Solution:
HeaderStandardAnimated— Same API shape asHeaderStandardfor the bar (back/close, etc.), butchildrenis omitted; the center is built fromtitle/subtitlelikeHeaderStandard. It accepts ReanimatedscrollYandtitleSectionHeightshared values and animates opacity and vertical offset whenscrollYreaches the measured title section height.useHeaderStandardAnimated— Initializes shared values, exposessetTitleSectionHeight(foronLayouton the first scroll section), andonScrollforAnimated.ScrollViewso scroll updates stay on the UI thread.Also included: TypeScript types, unit tests for the component and hook, React Native Storybook stories (
Default,Subtitle), component README, and public exports from the package.Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-287
Manual testing steps
yarn storybook:iosoryarn storybook:androidper project docs).Screenshots/Recordings
Before
After
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-04-28.at.21.36.34.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk: adds new components/hooks and refactors
HeaderStandardcenter rendering without changing external behavior; main risk is regressions in header title/subtitle rendering and Reanimated-driven animation edge cases.Overview
Adds
HeaderStandardAnimated, a scroll-driven variant ofHeaderStandardthat fades/translates the centered title block based onscrollYand measuredtitleSectionHeight, plus auseHeaderStandardAnimatedhook to provide shared values and anonScrollhandler.Refactors
HeaderStandardto delegate its title/subtitle rendering to a new sharedHeaderStandardCenterColumntemp component and updatesHeaderStandardPropsto reuse the shared title/subtitle field types.Includes Storybook stories, README docs, unit tests for the new component/hook, public exports from
components/index.ts, and relaxes Jest coverage thresholds foruseHeaderStandardAnimated.tsdue to Reanimated worklet mocking limitations.Reviewed by Cursor Bugbot for commit 7b81f7b. Bugbot is set up for automated code reviews on this repo. Configure here.