GeezerVison is showing github.com — fix(mobile): align floating controls and preserve sidebar clipping · pingdotgg/t3code@f6ec3a0
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/home/AndroidHomeFab.android.tsx +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -37,7 +37,8 @@ export function AndroidHomeFabLayout(props: ComponentProps<typeof SharedAndroidH | 37 | 37 | const workspace = useWorkspaceTabs(); | 38 | 38 | const bottomClearance = | 39 | 39 | insets.bottom + | 40 | | - 2 * FLOATING_TABS.edge + | | 40 | + FLOATING_TABS.bottom + | | 41 | + FLOATING_TABS.edge + | 41 | 42 | Math.max(floating.height, floating.fabOffset + fabSize); | 42 | 43 | const context = useMemo( | 43 | 44 | () => (floatingTabsEnabled && workspace ? { ...workspace, bottomClearance } : workspace), | @@ -74,7 +75,10 @@ export function AndroidHomeFabLayout(props: ComponentProps<typeof SharedAndroidH | 74 | 75 | className="absolute" | 75 | 76 | style={ | 76 | 77 | floatingTabsEnabled | 77 | | - ? { right: 16, bottom: insets.bottom + 16 + floating.fabOffset } | | 78 | + ? { | | 79 | + right: FLOATING_TABS.edge, | | 80 | + bottom: insets.bottom + FLOATING_TABS.bottom + floating.fabOffset, | | 81 | + } | 78 | 82 | : androidHomeFabPosition(insets.bottom, props.sidebar) | 79 | 83 | } | 80 | 84 | /> | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx +8-3Lines changed: 8 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -747,7 +747,10 @@ function AdaptiveWorkspaceLayoutContent( | 747 | 747 | })); | 748 | 748 | const sidebarAnimatedStyle = useAnimatedStyle(() => ({ | 749 | 749 | // Fading a UIKit glass ancestor can leave remounted header effects missing. | 750 | | - opacity: Platform.OS === "ios" ? 1 : Math.min(1, renderedSidebarWidth.value / 80), | | 750 | + opacity: | | 751 | + Platform.OS === "ios" || floatingTabsEnabled | | 752 | + ? 1 | | 753 | + : Math.min(1, renderedSidebarWidth.value / 80), | 751 | 754 | width: renderedSidebarWidth.value, | 752 | 755 | })); | 753 | 756 |
| @@ -894,7 +897,8 @@ function AdaptiveWorkspaceLayoutContent( | 894 | 897 | </AndroidHomeFabLayout> | 895 | 898 | </AndroidWorkspaceSidebar> | 896 | 899 | </RenderErrorBoundary> | 897 | | - {floatingTabsEnabled && !workspacePage && panes.primarySidebarVisible ? ( | | 900 | + {/* Keep the pill under the content throughout the sidebar's clipping animation. */} | | 901 | + {floatingTabsEnabled && !workspacePage ? ( | 898 | 902 | <FloatingWorkspaceTabs | 899 | 903 | paneWidth={layout.listPaneWidth} | 900 | 904 | onNewThread={handleStartNewTask} | @@ -944,7 +948,8 @@ function AdaptiveWorkspaceLayoutContent( | 944 | 948 | ...safeAreaInsets, | 945 | 949 | bottom: | 946 | 950 | safeAreaInsets.bottom + | 947 | | - 2 * FLOATING_TABS.edge + | | 951 | + FLOATING_TABS.bottom + | | 952 | + FLOATING_TABS.edge + | 948 | 953 | floatingTabs.height, | 949 | 954 | } | 950 | 955 | : compactAndroidSettings | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadComposer.tsx +7-3Lines changed: 7 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,10 @@ import { Button } from "../../components/ui/Button"; | 3 | 3 | import * as Dialog from "../../components/ui/Dialog"; | 4 | 4 | import type { ComposerTextPaste } from "../../native/T3ComposerEditor.types"; | 5 | 5 | import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout"; | 6 | | -import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider"; | | 6 | +import { | | 7 | + useAppearancePreferences, | | 8 | + useAndroidFloatingTabs, | | 9 | +} from "../settings/appearance/AppearancePreferencesProvider"; | 7 | 10 | import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell"; | 8 | 11 | import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime"; | 9 | 12 | import { AsyncResult } from "effect/reactivity"; | @@ -561,7 +564,8 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps | 561 | 564 | ); | 562 | 565 | const isVoiceInputPresented = voicePresentation.statusLabel !== null; | 563 | 566 | const isExpanded = isFocused || settingsSheetPresentation.keepsComposerExpanded; | 564 | | - const { setComposerEditing } = useAdaptiveWorkspaceLayout(); | | 567 | + const { layout, setComposerEditing } = useAdaptiveWorkspaceLayout(); | | 568 | + const floatingSidebarComposer = useAndroidFloatingTabs() && layout.usesSplitView; | 565 | 569 | const hasSidebarTabBar = useSidebarWorkspaceTabs() === "picker"; | 566 | 570 | const [compactRowWidth, setCompactRowWidth] = useState(0); | 567 | 571 | const compactAttachmentLimit = compactRowWidth >= 500 ? 3 : 1; | @@ -855,7 +859,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps | 855 | 859 | borderRadius: hasSidebarTabBar ? 31 : 27, | 856 | 860 | borderCurve: "circular", | 857 | 861 | overflow: "hidden", | 858 | | - paddingVertical: hasSidebarTabBar ? 9 : 2, | | 862 | + paddingVertical: hasSidebarTabBar ? 9 : floatingSidebarComposer ? 6 : 2, | 859 | 863 | }} | 860 | 864 | > | 861 | 865 | {isExpanded ? editingAttachments : null} | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -839,7 +839,8 @@ function ThreadNavigationSidebarPane( | 839 | 839 | paddingBottom: | 840 | 840 | Platform.OS === "android" | 841 | 841 | ? floatingTabsEnabled | 842 | | - ? 2 * FLOATING_TABS.edge + | | 842 | + ? FLOATING_TABS.bottom + | | 843 | + FLOATING_TABS.edge + | 843 | 844 | Math.max(floatingTabs.height, floatingTabs.fabOffset + fabSize) | 844 | 845 | : Math.max(insets.bottom, 16) + fabClearance - insets.bottom | 845 | 846 | : 16 + insets.bottom, | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/AndroidWorkspaceNavigation.android.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -179,7 +179,7 @@ export function FloatingWorkspaceTabs(props: { | 179 | 179 | position: "absolute", | 180 | 180 | left: Math.max(insets.left, FLOATING_TABS.edge) - FLOATING_TABS.shadow, | 181 | 181 | right: 0, | 182 | | - bottom: insets.bottom + FLOATING_TABS.edge - FLOATING_TABS.shadow, | | 182 | + bottom: insets.bottom + FLOATING_TABS.bottom - FLOATING_TABS.shadow, | 183 | 183 | alignItems: "flex-start", | 184 | 184 | }} | 185 | 185 | > | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/AndroidWorkspaceSidebar.android.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,7 @@ export function AndroidWorkspaceSidebar(props: { | 25 | 25 | const { scale, fabSize } = useAndroidControlSizing(); | 26 | 26 | const floating = floatingTabsMetrics(enabled.length + 1, scale, fabSize); | 27 | 27 | const bottomClearance = floatingTabsEnabled | 28 | | - ? insets.bottom + 2 * FLOATING_TABS.edge + floating.height | | 28 | + ? insets.bottom + FLOATING_TABS.bottom + FLOATING_TABS.edge + floating.height | 29 | 29 | : 16; | 30 | 30 | const context = useMemo(() => ({ ...workspace, bottomClearance }), [workspace, bottomClearance]); | 31 | 31 | if (enabled.length === 0) return <WorkspaceNoTabs />; | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/WorkspaceRootScreen.android.tsx +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -37,7 +37,8 @@ export function WorkspaceRootScreen() { | 37 | 37 | ...workspace, | 38 | 38 | bottomClearance: floatingTabsEnabled | 39 | 39 | ? insets.bottom + | 40 | | - 2 * FLOATING_TABS.edge + | | 40 | + FLOATING_TABS.bottom + | | 41 | + FLOATING_TABS.edge + | 41 | 42 | Math.max( | 42 | 43 | floating.height, | 43 | 44 | workspace.state.selectedTab === "threads" ? floating.fabOffset + fabSize : 0, | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/workspace/floating-workspace-tabs.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | // Keep the native drawing inset out of the visible size and edge margins. | 2 | | -export const FLOATING_TABS = { edge: 16, gap: 12, shadow: 8 }; | | 2 | +export const FLOATING_TABS = { edge: 16, bottom: 6, gap: 12, shadow: 8 }; | 3 | 3 |
| 4 | 4 | export function floatingTabsMetrics( | 5 | 5 | count: number, | |
|