Skip to content

Commit ad58959

Browse files
voida6claude
andcommitted
fix(mobile): Android floating tab bar fills the row when compose is hidden
The floating bar always left room for the compose button, so on Settings, Pulls and Usage it stayed narrow with an empty gap on the right. It now reserves that room only on Chats with an environment connected. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 58e60bf commit ad58959

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ 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-
);
9689
const { containerColor, indicatorColor, selectedColor, unselectedColor } =
9790
androidWorkspaceNavigationColors(colors, rail, floating);
9891
const selectedTab = selectedNavigationTab(
@@ -102,6 +95,15 @@ export function AndroidWorkspaceNavigation(props: {
10295
hidden,
10396
rail ? 5 : 4,
10497
);
98+
// Only the Chats list draws the compose button beside the bar.
99+
const metrics = floatingTabsMetrics(
100+
tabs.length,
101+
scale,
102+
fabSize,
103+
props.paneWidth ?? window.width,
104+
props.fillWidth,
105+
selectedTab === "threads" && connectionState.hasConnections,
106+
);
105107
if (!rail && keyboardVisible) return null;
106108

107109
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,6 +7,7 @@ export function floatingTabsMetrics(
77
fabSize: number,
88
paneWidth?: number,
99
fillWidth = false,
10+
composeVisible = true,
1011
) {
1112
const unit = Math.max(1, scale);
1213
const height = fabSize;
@@ -16,11 +17,10 @@ export function floatingTabsMetrics(
1617
const room =
1718
paneWidth === undefined
1819
? count * 60 * unit
19-
: sharesRow
20+
: sharesRow && composeVisible
2021
? paneWidth - beside
2122
: paneWidth - 2 * FLOATING_TABS.edge;
2223
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)