TypeScript
fix(mobile): restore composer glass and rounded shadows (#8597)
Julius Marminge8fc7f2294196
diff --git a/apps/mobile/src/components/ComposerToolbar.tsx b/apps/mobile/src/components/ComposerToolbar.tsxindex 324e944a007..b64e44b1937 100644--- a/apps/mobile/src/components/ComposerToolbar.tsx+++ b/apps/mobile/src/components/ComposerToolbar.tsx@@ -252,7 +252,8 @@ export function ComposerToolbarButton(props: {// so callers can lift it with max-w-full — flex-filling pills in the// thread composer stretch to the row's edge. The numeric maxWidth// prop still wins via the inline style below.- "h-11 max-w-[172px] flex-row items-center justify-center rounded-full border shadow-lg shadow-adaptive-black-a10-a25 active:opacity-70",+ "h-11 max-w-[172px] flex-row items-center justify-center rounded-full border active:opacity-70",+ variant === "primary" && "shadow-lg shadow-adaptive-black-a10-a25 disabled:shadow-none",isCircle ? "w-11" : "gap-2 px-3.5",variant === "primary"? props.disabled@@ -279,7 +280,6 @@ export function ComposerToolbarButton(props: {maxWidth: props.maxWidth,minWidth: props.minWidth,opacity: props.disabled ? 0.55 : pressed ? 0.72 : 1,- shadowOpacity: props.disabled ? 0 : 1,},props.style,]}diff --git a/apps/mobile/src/components/GlassSurface.tsx b/apps/mobile/src/components/GlassSurface.tsxindex 6d07c6a7504..c194d6b5534 100644--- a/apps/mobile/src/components/GlassSurface.tsx+++ b/apps/mobile/src/components/GlassSurface.tsx@@ -13,7 +13,11 @@ import { withUniwind } from "uniwind";import { cn } from "../lib/cn";-const ThemedGlassView = withUniwind(GlassView);+// Explicit mappings keep the native glassEffectStyle enum out of style-array conversion.+const ThemedGlassView = withUniwind(GlassView, {+ style: { fromClassName: "className" },+ tintColor: { fromClassName: "tintColorClassName", styleProperty: "accentColor" },+});interface GlassSurfaceProps extends ViewProps {readonly children: ReactNode;diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsxindex c1d7b8c34f4..2339994e9f5 100644--- a/apps/mobile/src/features/threads/ThreadComposer.tsx+++ b/apps/mobile/src/features/threads/ThreadComposer.tsx@@ -119,21 +119,17 @@ export function ComposerSurface(props: {/** Existing thread composers morph between pill and card layouts. */readonly animateLayout?: boolean;}) {- // Drop shadow lives on a wrapper: `overflow: "hidden"` on the surface itself- // (needed to clip content to the pill shape) would clip the shadow on iOS.- const shadowStyle: ViewStyle = {- borderRadius: props.style.borderRadius,- shadowOpacity: 1,- shadowRadius: 14,- shadowOffset: { width: 0, height: 6 },- elevation: 10,- };-+ // A box shadow follows the rounded surface even when the glass is transparent.+ // Keep it outside the clipped content so the shadow can extend past the edge.return (<Animated.View- className="shadow-adaptive-black-a15-a35"+ className="shadow-[0_6px_28px] shadow-adaptive-black-a15-a35"layout={props.animateLayout === false ? undefined : COMPOSER_LAYOUT_TRANSITION}- style={shadowStyle}+ style={{+ borderRadius: props.style.borderRadius,+ // Android versions before 9 do not support outset box shadows.+ elevation: Platform.OS === "android" && Platform.Version < 28 ? 10 : undefined,+ }}><GlassSurfacechrome="none"diff --git a/docs/user/mobile-appearance.md b/docs/user/mobile-appearance.mdindex 7631e98ee4a..a57b98e553c 100644--- a/docs/user/mobile-appearance.md+++ b/docs/user/mobile-appearance.md@@ -4,6 +4,9 @@ T3 Code Mobile includes the T3 Code, T3 Chat, Grove, Ocean, Ember, and Iris themlight and dark colors that apply throughout the app, including code reviews, file previews, theterminal, native headers, and sheets.+On supported iOS versions, the new-task and thread composers use the system glass material.+Other platforms use a themed background.+To change themes:1. Open **Settings**.