Skip to content

Commit 8a7f0bb

Browse files
committed
fix(mobile): restore the reserved compose space on Android
Revert commit 5882ccd (#26939), restoring the empty compose slot when the FAB is hidden.
1 parent 3fd2b85 commit 8a7f0bb

2 files changed

Lines changed: 9 additions & 20 deletions

File tree

‎apps/mobile/src/features/workspace/AndroidWorkspaceNavigation.android.tsx‎

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export function AndroidWorkspaceNavigation(props: {
8686
const rail = Boolean(props.rail);
8787
const floating = !rail && Boolean(props.floating);
8888
const tabs = [...visibleNavigationTabs(order, hidden, rail ? 5 : 4), "settings"];
89+
const metrics = floatingTabsMetrics(
90+
tabs.length,
91+
scale,
92+
fabSize,
93+
props.paneWidth ?? window.width,
94+
props.fillWidth,
95+
);
8996
const { containerColor, indicatorColor, selectedColor, unselectedColor } =
9097
androidWorkspaceNavigationColors(colors, rail, floating);
9198
const selectedTab = selectedNavigationTab(
@@ -95,24 +102,6 @@ export function AndroidWorkspaceNavigation(props: {
95102
hidden,
96103
rail ? 5 : 4,
97104
);
98-
// FloatingWorkspaceTabs starts the bar at the left inset, so a cutout narrows the room.
99-
const barWidth =
100-
props.paneWidth ??
101-
window.width - (Math.max(insets.left, FLOATING_TABS.edge) - FLOATING_TABS.edge);
102-
// A phone draws compose on the Chats list only; the split sidebar draws it on every tab
103-
// except the Settings and Usage pages.
104-
const composeBesideBar =
105-
props.paneWidth === undefined
106-
? selectedTab === "threads"
107-
: selectedTab !== "settings" && selectedTab !== "usage";
108-
const metrics = floatingTabsMetrics(
109-
tabs.length,
110-
scale,
111-
fabSize,
112-
barWidth,
113-
props.fillWidth,
114-
composeBesideBar && connectionState.hasConnections,
115-
);
116105
if (!rail && keyboardVisible) return null;
117106

118107
return (

‎apps/mobile/src/features/workspace/floating-workspace-tabs.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export function floatingTabsMetrics(
77
fabSize: number,
88
paneWidth?: number,
99
fillWidth = false,
10-
composeVisible = true,
1110
) {
1211
const unit = Math.max(1, scale);
1312
const height = fabSize;
@@ -17,10 +16,11 @@ export function floatingTabsMetrics(
1716
const room =
1817
paneWidth === undefined
1918
? count * 60 * unit
20-
: sharesRow && composeVisible
19+
: sharesRow
2120
? paneWidth - beside
2221
: paneWidth - 2 * FLOATING_TABS.edge;
2322
return {
23+
// Reserve the compose slot even while its button is hidden.
2424
pill: Math.max(0, fillWidth ? room : Math.min(count * 72 * unit, room)),
2525
height,
2626
row,

0 commit comments

Comments
 (0)