Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ export function AndroidWorkspaceNavigation(props: {
const rail = Boolean(props.rail);
const floating = !rail && Boolean(props.floating);
const tabs = [...visibleNavigationTabs(order, hidden, rail ? 5 : 4), "settings"];
const metrics = floatingTabsMetrics(
tabs.length,
scale,
fabSize,
props.paneWidth ?? window.width,
props.fillWidth,
);
const { containerColor, indicatorColor, selectedColor, unselectedColor } =
androidWorkspaceNavigationColors(colors, rail, floating);
const selectedTab = selectedNavigationTab(
Expand All @@ -102,6 +95,24 @@ export function AndroidWorkspaceNavigation(props: {
hidden,
rail ? 5 : 4,
);
// FloatingWorkspaceTabs starts the bar at the left inset, so a cutout narrows the room.
const barWidth =
props.paneWidth ??
window.width - (Math.max(insets.left, FLOATING_TABS.edge) - FLOATING_TABS.edge);
// A phone draws compose on the Chats list only; the split sidebar draws it on every tab
// except the Settings and Usage pages.
const composeBesideBar =
props.paneWidth === undefined
? selectedTab === "threads"
: selectedTab !== "settings" && selectedTab !== "usage";
const metrics = floatingTabsMetrics(
tabs.length,
scale,
fabSize,
barWidth,
props.fillWidth,
composeBesideBar && connectionState.hasConnections,
);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
if (!rail && keyboardVisible) return null;

return (
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/workspace/floating-workspace-tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function floatingTabsMetrics(
fabSize: number,
paneWidth?: number,
fillWidth = false,
composeVisible = true,
) {
const unit = Math.max(1, scale);
const height = fabSize;
Expand All @@ -16,11 +17,10 @@ export function floatingTabsMetrics(
const room =
paneWidth === undefined
? count * 60 * unit
: sharesRow
: sharesRow && composeVisible
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
? paneWidth - beside
: paneWidth - 2 * FLOATING_TABS.edge;
return {
// Reserve the compose slot even while its button is hidden.
pill: Math.max(0, fillWidth ? room : Math.min(count * 72 * unit, room)),
height,
row,
Expand Down
Loading