From ed88937cf03e65fe5d620f170fd14b1fae6bb2e7 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 16 Sep 2026 17:51:20 -0700 Subject: [PATCH] fix(mobile): prevent Android compose FAB animation jitter (#12169) --- apps/mobile/assets/icons/compose.xml | 8 ++ .../MaterialNewThreadButton.android.tsx | 4 + .../MaterialScrollComposeButton.android.tsx | 75 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 apps/mobile/assets/icons/compose.xml create mode 100644 apps/mobile/src/components/MaterialScrollComposeButton.android.tsx diff --git a/apps/mobile/assets/icons/compose.xml b/apps/mobile/assets/icons/compose.xml new file mode 100644 index 0000000000000000000000000000000000000000..1a958a9abc60abba8603ee7f41da7f5ba47f0d1d --- /dev/null +++ b/apps/mobile/assets/icons/compose.xml @@ -0,0 +1,8 @@ + + + + diff --git a/apps/mobile/src/components/MaterialNewThreadButton.android.tsx b/apps/mobile/src/components/MaterialNewThreadButton.android.tsx index 8d2caf704f42681a70757fb82a033a7e954def40..cd76633d893570f5a13bc9ad0d02b92110d52bce 100644 --- a/apps/mobile/src/components/MaterialNewThreadButton.android.tsx +++ b/apps/mobile/src/components/MaterialNewThreadButton.android.tsx @@ -1,10 +1,14 @@ import type { ComponentProps } from "react"; import { MaterialFloatingActionButton } from "./MaterialFloatingActionButton.android"; +import { MaterialScrollComposeButton } from "./MaterialScrollComposeButton.android"; import type { MaterialNewThreadButton as SharedMaterialNewThreadButton } from "./MaterialNewThreadButton.shared"; export function MaterialNewThreadButton( props: ComponentProps, ) { + if (props.extended && props.expanded !== undefined) { + return ; + } return ( void; + readonly className?: string; + readonly style?: StyleProp; +}) { + const { themeAppearance, themeVariables: colors } = useAppearancePreferences(); + const typography = useScaledTextRole("footnote"); + const [expandedWidth, setExpandedWidth] = useState(56); + const rememberWidth = useCallback(({ width }: { width: number }) => { + setExpandedWidth((previous) => Math.max(previous, width)); + }, []); + return ( + + + + + + + + + + + + + New thread + + + + + + + {/* The visual host is wider than the button; only this target intercepts list touches. */} + + + ); +} -- 2.54.0