Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f82e2dc
Review Home to-do rows report by report with auto-advance
adamgrzybowski Nov 17, 2026
579e5c7
Merge remote-tracking branch 'eorigin/main' into @adamgrzybowski/home…
adamgrzybowski Nov 17, 2026
52d6de7
Stop exporting unused TodoReportIDs type
adamgrzybowski Nov 17, 2026
8e3664d
Add translations for Home to-do review toasts
adamgrzybowski Nov 17, 2026
ba77e41
Address Home to-do review feedback
adamgrzybowski Nov 17, 2026
b9d3b6e
Advance the Home to-do review when the action lands before the report…
adamgrzybowski Nov 20, 2026
d912eda
Sync Mobile-Expensify submodule pointer to main
adamgrzybowski Nov 20, 2026
1c7800d
Merge eorigin/main into @adamgrzybowski/home-todos-rhp-auto-advance
adamgrzybowski Nov 23, 2026
0126a55
Animate Home to-do review between reports and celebrate the last one
adamgrzybowski Nov 24, 2026
9b1b09b
Mock makeMutable as a shared value in Jest
adamgrzybowski Nov 24, 2026
4e972bd
Merge remote-tracking branch 'eorigin/main' into tmp/pr-107110-jest-fix
adamgrzybowski Nov 24, 2026
3f4fbaa
Pass the route key to useHomeTodoReportTransition
adamgrzybowski Nov 24, 2026
a785617
Apply design feedback to the Home to-do review celebration
adamgrzybowski Nov 24, 2026
6d2a475
Merge remote-tracking branch 'origin/@adamgrzybowski/home-todos-rhp-a…
adamgrzybowski Nov 24, 2026
90f1a3d
Merge remote-tracking branch 'eorigin/main' into @adamgrzybowski/home…
adamgrzybowski Nov 25, 2026
d069931
Update Home to-do celebration copy in all locales
adamgrzybowski Nov 25, 2026
64d1e8e
Address Home to-do review feedback on transitions, timings and fireworks
adamgrzybowski Nov 26, 2026
2462f41
Park the celebration growl fully offscreen so no stripe stays visible
adamgrzybowski Nov 26, 2026
58e74f0
Move the Home to-do review past a report removed from another screen
adamgrzybowski Nov 26, 2026
d8ec21c
Show the Home to-do result as a green button and fix the celebration …
adamgrzybowski Nov 27, 2026
05bbf90
Keep the celebration growl padding even on native
adamgrzybowski Nov 30, 2026
485d910
Apply the Home to-do panel style and header measurement only during a…
adamgrzybowski Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions jest/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {ReadDirItem} from 'react-native-fs';
import type * as RNKeyboardController from 'react-native-keyboard-controller';

import 'react-native-gesture-handler/jestSetup';
import type Animated from 'react-native-reanimated';
import type * as Reanimated from 'react-native-reanimated';

import {useMemo} from 'react';
import 'setimmediate';
Expand Down Expand Up @@ -146,19 +146,24 @@ jest.mock('react-native-share', () => ({
default: jest.fn(),
}));

jest.mock('react-native-reanimated', () => ({
...jest.requireActual<typeof Animated>('react-native-reanimated/mock'),
createAnimatedPropAdapter: jest.fn,
// react-native-reanimated/mock leaves dispatchCommand out (see its own "ADD ME IF NEEDED" comment). forceClearInput
// (src/libs/ComponentUtils) dispatches it from a UI-thread worklet, so any test exercising that path needs it mocked.
dispatchCommand: jest.fn(),
useReducedMotion: jest.fn,
useScrollViewOffset: jest.fn(() => 0),
// A real animated ref is callable and has observe, which useKeyboardDrivenScroll uses to listen to the scroll view's events
useAnimatedRef: jest.fn(() => Object.assign(jest.fn(), {observe: jest.fn()})),
LayoutAnimationConfig: ({children}: {children: React.ReactNode}) => children,
makeShareableCloneRecursive: jest.fn,
}));
jest.mock('react-native-reanimated', () => {
const reanimatedMock = jest.requireActual<typeof Reanimated>('react-native-reanimated/mock');
return {
...reanimatedMock,
// The mock's makeMutable returns the raw value, so module-level shared values would have no get or set.
makeMutable: reanimatedMock.useSharedValue,
createAnimatedPropAdapter: jest.fn,
// react-native-reanimated/mock leaves dispatchCommand out (see its own "ADD ME IF NEEDED" comment). forceClearInput
// (src/libs/ComponentUtils) dispatches it from a UI-thread worklet, so any test exercising that path needs it mocked.
dispatchCommand: jest.fn(),
useReducedMotion: jest.fn,
useScrollViewOffset: jest.fn(() => 0),
// A real animated ref is callable and has observe, which useKeyboardDrivenScroll uses to listen to the scroll view's events
useAnimatedRef: jest.fn(() => Object.assign(jest.fn(), {observe: jest.fn()})),
LayoutAnimationConfig: ({children}: {children: React.ReactNode}) => children,
makeShareableCloneRecursive: jest.fn,
};
});

// eslint-disable-next-line @typescript-eslint/no-unsafe-return
jest.mock('react-native-worklets', () => require('react-native-worklets/src/mock'));
Expand Down
20 changes: 20 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5279,6 +5279,7 @@ const CONST = {
SUCCESS: 'success',
ERROR: 'error',
WARNING: 'warning',
CELEBRATION: 'celebration',
POSITION: {
TOP: 'top',
BOTTOM_RIGHT: 'bottomRight',
Expand All @@ -5290,6 +5291,25 @@ const CONST = {
// Pixel distance used to park the growl fully offscreen before it slides in. It only needs to
// exceed the growl's height + margins; the exact value isn't tied to a measured dimension.
OFFSCREEN_OFFSET: 255,
// The celebration growl is much taller, so it needs room for its height, the bottom inset, the native safe area and its shadow.
CELEBRATION_OFFSCREEN_OFFSET: 360,
},

/**
* Timings of a Home to-do review moving from one report to the next, in ms. RESULT_FALLBACK_DURATION must exceed
* RESULT_HOLD_DURATION + EXIT_DURATION so the fallback only restores the action button when the review did not move on.
*/
HOME_TODO_REVIEW_ANIMATION: {
RESULT_HOLD_DURATION: 550,
RESULT_FALLBACK_DURATION: 3000,
EXIT_DURATION: 150,
ENTER_DURATION: 250,

/** Shows the panel again even if the screen never renders a new report ID, so it cannot stay out of view */
ENTER_FALLBACK_DELAY: 1000,

/** How far the panel moves while it fades, a short slide so it reads as the same panel leaving and coming back */
PANEL_OFFSET: 24,
},

LOCALES,
Expand Down
4 changes: 4 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ const ONYXKEYS = {
/** The ID of the bank account whose business details the Wise intro page has started reading. RAM-only, since a reload ends the read. */
RAM_ONLY_WISE_INTRO_READ_BANK_ACCOUNT_ID: 'wiseIntroReadBankAccountID',

/** The reports a Home to-do row's `Begin` button pages through. RAM-only, since a reload ends the review. */
RAM_ONLY_HOME_TODO_REVIEW: 'homeTodoReview',

/** Ordered reportIDs from the latest SearchForReports response, used to display server search results in the tier order Auth returned. */
RAM_ONLY_SEARCH_RESULT_REPORT_IDS: 'searchResultReportIDs',

Expand Down Expand Up @@ -2030,6 +2033,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.RAM_ONLY_WISE_ONBOARDING_PENDING_SAVES]: Record<string, boolean>;
[ONYXKEYS.RAM_ONLY_WISE_INTRO_READ_BANK_ACCOUNT_ID]: number;
[ONYXKEYS.RAM_ONLY_SEARCH_RESULT_REPORT_IDS]: string[] | null;
[ONYXKEYS.RAM_ONLY_HOME_TODO_REVIEW]: OnyxTypes.HomeTodoReview | null;
[ONYXKEYS.RAM_ONLY_SEARCH_TRANSACTION_WRITES]: {writeID: number; oldestWriteID: number; transactionIDs: Record<string, number>; reportIDs: Record<string, number>};
[ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_USERS]: boolean;
[ONYXKEYS.RAM_ONLY_IS_AUTHENTICATING_WITH_SHORT_LIVED_TOKEN]: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,24 @@ import isIllustrationLottieAnimation from '@libs/isIllustrationLottieAnimation';

import type IconAsset from '@src/types/utils/IconAsset';

import type LottieView from 'lottie-react-native';
import type {ComponentRef} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';

import {useRef} from 'react';
import {StyleSheet, View} from 'react-native';

type ConfirmationPageIllustrationProps = {
illustration?: DotLottieAnimation | IconAsset;
illustrationStyle?: StyleProp<ViewStyle>;

/** The frame a Lottie illustration jumps to once it loads, to skip a slow opening. Native players start from the first frame. */
initialFrame?: number;
};

function ConfirmationPageIllustration({illustration = LottieAnimations.Fireworks, illustrationStyle}: ConfirmationPageIllustrationProps) {
function ConfirmationPageIllustration({illustration = LottieAnimations.Fireworks, illustrationStyle, initialFrame}: ConfirmationPageIllustrationProps) {
const styles = useThemeStyles();
const animationRef = useRef<ComponentRef<typeof LottieView> | null>(null);
const isReduceMotionEnabled = Accessibility.useReducedMotion();
const illustrations = useMemoizedLazyIllustrations(['Fireworks']);
const isLottie = isIllustrationLottieAnimation(illustration);
Expand All @@ -48,8 +55,11 @@ function ConfirmationPageIllustration({illustration = LottieAnimations.Fireworks
if (isLottie) {
return (
<Lottie
ref={animationRef}
source={illustration}
autoPlay
// iOS never reports a loaded .lottie file and native players ignore a start frame, so this only skips ahead on web
onAnimationLoaded={initialFrame === undefined || isReduceMotionEnabled ? undefined : () => animationRef.current?.play(initialFrame)}
loop
style={[styles.confirmationAnimation, illustrationStyle]}
webStyle={{
Expand Down
92 changes: 59 additions & 33 deletions src/components/GrowlNotification/GrowlNotificationContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Button from '@components/Button';
import ConfirmationPageIllustration from '@components/ConfirmationPage/primitives/ConfirmationPageIllustration';
import Icon from '@components/Icon';
import * as Pressables from '@components/Pressable';
import Text from '@components/Text';
Expand All @@ -25,8 +26,8 @@ import GrowlNotificationContainer from './GrowlNotificationContainer';
import GrowlNotificationPortal from './GrowlNotificationPortal';
import shouldUseExplicitBottomPosition from './shouldUseExplicitBottomPosition';

const INACTIVE_OFFSET = CONST.GROWL.OFFSCREEN_OFFSET;
const INACTIVE_POSITION_Y = -INACTIVE_OFFSET;
/** Skips most of the first rocket's climb in the fireworks, so the first burst (frame 17 at 24 fps) comes right after the growl appears */
const CELEBRATION_FIREWORKS_START_FRAME = 12;

const PressableWithoutFeedback = Pressables.PressableWithoutFeedback;

Expand All @@ -39,21 +40,24 @@ type GrowlNotificationContentProps = {
/** Position where the growl is anchored */
position?: GrowlPosition;

/** Heading shown above the body text, used by the celebration growl */
title?: string;

/** Identifies this growl instance; passed back through onDismissed so the parent can ignore stale dismissals. */
nonce: number;
onDismissed: (dismissedNonce: number) => void;
};

// Every growl variant must have an icon mapping; keeping this map exhaustive over GrowlType.
type GrowlIconTypes = Record<
GrowlType,
Exclude<GrowlType, typeof CONST.GROWL.CELEBRATION>,
{
icon: React.FC<SvgProps> | IconAsset;
iconColor: string;
}
>;

function GrowlNotificationContent({bodyText, type, duration, action, position, nonce, onDismissed}: GrowlNotificationContentProps) {
function GrowlNotificationContent({bodyText, type, duration, action, position, title, nonce, onDismissed}: GrowlNotificationContentProps) {
// Normalized: 0 = fully offscreen for the current anchor, 1 = fully visible. The container
// multiplies this against the live `inactiveY`, so the offscreen position stays correct
// even when the responsive layout flips after the growl is dismissed.
Expand All @@ -69,7 +73,8 @@ function GrowlNotificationContent({bodyText, type, duration, action, position, n

// Derived live so that resizing the window flips position + slide direction during display.
const useBottomPosition = shouldUseExplicitBottomPosition(position) || (!!action && !shouldUseNarrowLayout);
const inactiveY = useBottomPosition ? INACTIVE_OFFSET : INACTIVE_POSITION_Y;
const inactiveOffset = type === CONST.GROWL.CELEBRATION ? CONST.GROWL.CELEBRATION_OFFSCREEN_OFFSET : CONST.GROWL.OFFSCREEN_OFFSET;
const inactiveY = useBottomPosition ? inactiveOffset : -inactiveOffset;

const types: GrowlIconTypes = {
[CONST.GROWL.SUCCESS]: {
Expand Down Expand Up @@ -147,41 +152,62 @@ function GrowlNotificationContent({bodyText, type, duration, action, position, n
useBottomPosition={useBottomPosition}
>
<GestureDetector gesture={flingGesture}>
<View style={[styles.growlNotificationBox, action ? styles.growlNotificationBoxWithAction : styles.growlNotificationBoxWithoutAction]}>
{/* The dismiss target covers only the icon + text; the action Button is a sibling
(not nested inside a pressable) so it stays independently focusable for screen
readers and its press can't bubble into a dismiss. */}
{type === CONST.GROWL.CELEBRATION ? (
<PressableWithoutFeedback
accessibilityLabel={bodyText}
accessibilityLabel={title ? `${title} ${bodyText}` : bodyText}
Comment thread
adamgrzybowski marked this conversation as resolved.
Resolved
sentryLabel={CONST.SENTRY_LABEL.GROWL_NOTIFICATION.DISMISS}
onPress={triggerDismiss}
style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.gap3]}
style={[
styles.growlNotificationBox,
styles.growlNotificationCelebrationBox,
useBottomPosition && !shouldUseNarrowLayout ? styles.alignSelfEnd : styles.alignSelfCenter,
]}
>
<Icon
src={types[type].icon}
fill={types[type].iconColor}
{/* Falls back to a still image with reduce motion on */}
<ConfirmationPageIllustration
illustrationStyle={styles.growlNotificationCelebrationAnimation}
initialFrame={CELEBRATION_FIREWORKS_START_FRAME}
/>
<Text style={styles.growlNotificationText}>{bodyText}</Text>
{!!title && <Text style={[styles.growlNotificationText, styles.textStrong, styles.textAlignCenter, styles.flex0]}>{title}</Text>}
<Text style={[styles.growlNotificationText, styles.growlNotificationSupportingText, styles.textAlignCenter, styles.flex0]}>{bodyText}</Text>
</PressableWithoutFeedback>
{!!action && (
<Button
accessibilityLabel={action.label}
sentryLabel={CONST.SENTRY_LABEL.GROWL_NOTIFICATION.ACTION}
onPress={() => {
if (isActionPressedRef.current) {
return;
}
isActionPressedRef.current = true;
triggerDismiss();
action.onPress();
}}
innerStyles={styles.bgTransparent}
hoverStyles={styles.growlNotificationActionHovered}
) : (
<View style={[styles.growlNotificationBox, action ? styles.growlNotificationBoxWithAction : styles.growlNotificationBoxWithoutAction]}>
{/* The dismiss target covers only the icon + text; the action Button is a sibling
(not nested inside a pressable) so it stays independently focusable for screen
readers and its press can't bubble into a dismiss. */}
<PressableWithoutFeedback
accessibilityLabel={bodyText}
sentryLabel={CONST.SENTRY_LABEL.GROWL_NOTIFICATION.DISMISS}
onPress={triggerDismiss}
style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.gap3]}
>
<Button.Text style={styles.growlNotificationActionText}>{action.label}</Button.Text>
</Button>
)}
</View>
<Icon
src={types[type].icon}
fill={types[type].iconColor}
/>
<Text style={styles.growlNotificationText}>{bodyText}</Text>
</PressableWithoutFeedback>
{!!action && (
<Button
accessibilityLabel={action.label}
sentryLabel={CONST.SENTRY_LABEL.GROWL_NOTIFICATION.ACTION}
onPress={() => {
if (isActionPressedRef.current) {
return;
}
isActionPressedRef.current = true;
triggerDismiss();
action.onPress();
}}
innerStyles={styles.bgTransparent}
hoverStyles={styles.growlNotificationActionHovered}
>
<Button.Text style={styles.growlNotificationActionText}>{action.label}</Button.Text>
</Button>
)}
</View>
)}
</GestureDetector>
</GrowlNotificationContainer>
</View>
Expand Down
8 changes: 6 additions & 2 deletions src/components/GrowlNotification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type GrowlContent = {
/** Position where the growl is anchored */
position?: GrowlPosition;

/** Heading shown above the body text, used by the celebration growl */
title?: string;

/** Bumped on every show() call so identical-args re-shows still remount and re-trigger the growl. */
nonce: number;
};
Expand All @@ -32,8 +35,8 @@ type GrowlNotificationProps = {
function GrowlNotification({ref}: GrowlNotificationProps) {
const [content, setContent] = useState<GrowlContent | null>(null);

const show: NonNullable<GrowlRef['show']> = ({bodyText, type, duration, action, position}) => {
setContent((prev) => ({bodyText, type, duration, action, position, nonce: (prev?.nonce ?? 0) + 1}));
const show: NonNullable<GrowlRef['show']> = ({bodyText, type, duration, action, position, title}) => {
setContent((prev) => ({bodyText, type, duration, action, position, title, nonce: (prev?.nonce ?? 0) + 1}));
};

useImperativeHandle(ref, () => ({show}), [show]);
Expand All @@ -60,6 +63,7 @@ function GrowlNotification({ref}: GrowlNotificationProps) {
duration={content.duration}
action={content.action}
position={content.position}
title={content.title}
nonce={content.nonce}
onDismissed={handleDismissed}
/>
Expand Down
Loading
Loading