Skip to content

Commit bd08182

Browse files
fix(mobile): Settings sidebar keeps the brand and drops the maximize button
Beside a detail column the tab bar names the tab and the detail header the page, so the sidebar shows the T3 Code mark instead of a "Settings" title. Settings pages lose the sidebar toggle, like the system Settings app. The workspace toolbar no longer mounts an empty trailing toolbar for Settings, which replaced the scope filter in the header. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 4e72e7a commit bd08182

3 files changed

Lines changed: 33 additions & 39 deletions

File tree

‎apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import { workspaceUsesColumns } from "../workspace/workspace-tabs-state";
3939
import { isSettingsRoute, settingsOpenIn } from "../settings/settings-navigation";
4040
import { workspaceRoutesOf } from "./workspace-overlay-routes";
4141
import { setNativelyPoppingWorkspaceRoute } from "../workspace/workspace-detail-selection";
42-
import { useWorkspaceSidebarHeaderItem } from "./useWorkspaceSidebarHeaderItem";
4342
import { useDeviceType, useNativeLayoutMetrics } from "../../native/native-layout-metrics";
4443

4544
import { useAdaptiveWorkspaceLayout } from "./AdaptiveWorkspaceLayout";
@@ -94,26 +93,15 @@ function ColumnScreen(props: {
9493
readonly onDismiss: (routeKey: string, native: boolean) => void;
9594
readonly onAppearance: (type: "willAppear" | "didAppear" | "willDisappear", key: string) => void;
9695
readonly onCompose?: () => void;
97-
/** Settings pages don't draw their own sidebar toggle, unlike threads and pull requests. */
98-
readonly sidebarToggle?: boolean;
9996
readonly navigation: ViewProps["navigation"];
10097
}) {
10198
const { descriptor } = props;
10299
// Options a screen set inside this workspace tab slot, over its route's.
103-
const slotOptions = slotScreenOptions(
100+
const options = slotScreenOptions(
104101
use(WorkspaceSlotOptionsContext),
105102
descriptor.route.key,
106103
descriptor.options,
107104
);
108-
const sidebarItem = useWorkspaceSidebarHeaderItem();
109-
// Swapping header components would unmount the native header config, which hides the bar.
110-
const options =
111-
props.sidebarToggle && !slotOptions.unstable_headerLeftItems
112-
? ({
113-
...slotOptions,
114-
unstable_headerLeftItems: () => [sidebarItem],
115-
} as AppNativeStackNavigationOptions as typeof slotOptions)
116-
: slotOptions;
117105
const [presented, setPresented] = useState(false);
118106
const primaryColumn = useMemo(
119107
() =>
@@ -420,7 +408,6 @@ function WorkspaceColumns(
420408
key={screenKey}
421409
screenKey={screenKey}
422410
descriptor={descriptor}
423-
sidebarToggle={inSettingsSlot}
424411
attached={props.detail.some((current) => current.key === route.key)}
425412
onDismiss={handleNativeDismiss}
426413
onAppearance={followCollapsedSplit}

‎apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ function WorkspaceRootContent() {
164164
? { headerSearchBarOptions: undefined, unstable_headerRightItems: () => [] }
165165
: {}),
166166
unstable_headerLeftItems: () => [],
167+
// Beside a detail column the tab bar names the tab and the detail header the page,
168+
// so the sidebar keeps the brand.
167169
headerTitle:
168-
settingsOpen || state.selectedTab === "usage" ? undefined : renderHeaderTitle,
170+
sidebarNavigation || (!settingsOpen && state.selectedTab !== "usage")
171+
? renderHeaderTitle
172+
: undefined,
169173
}}
170174
/>
171175
) : (

‎apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx‎

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -183,30 +183,33 @@ export function WorkspaceToolbar(props: {
183183
: undefined,
184184
}}
185185
/>
186-
{/* UIKit lays trailing items out from the edge inward. */}
187-
<Toolbar placement="right">
188-
{searchButton}
189-
{nativeToolbarCompose && foldedSearch ? <Toolbar.Spacer width={8} /> : null}
190-
{composeButton}
191-
{selectedTab !== "threads" ||
192-
isDuoDevice(deviceType) ||
193-
deviceType === "pad" ||
194-
sidebarTabs === "picker" ||
195-
compactTabs ? null : (
196-
<Toolbar.Button
197-
accessibilityLabel="New chat"
198-
icon="square.and.pencil"
199-
onPress={props.onNewTask}
200-
/>
201-
)}
202-
{NATIVE_LIQUID_GLASS_SUPPORTED ? null : (
203-
<Toolbar.Button
204-
accessibilityLabel={searchLabel}
205-
icon="magnifyingglass"
206-
onPress={focusSearch}
207-
/>
208-
)}
209-
</Toolbar>
186+
{/* UIKit lays trailing items out from the edge inward. A trailing toolbar replaces the
187+
header's own items, so an empty one would hide the Settings scope filter. */}
188+
{workspace.settingsOpen && !foldedSearch && NATIVE_LIQUID_GLASS_SUPPORTED ? null : (
189+
<Toolbar placement="right">
190+
{searchButton}
191+
{nativeToolbarCompose && foldedSearch ? <Toolbar.Spacer width={8} /> : null}
192+
{composeButton}
193+
{selectedTab !== "threads" ||
194+
isDuoDevice(deviceType) ||
195+
deviceType === "pad" ||
196+
sidebarTabs === "picker" ||
197+
compactTabs ? null : (
198+
<Toolbar.Button
199+
accessibilityLabel="New chat"
200+
icon="square.and.pencil"
201+
onPress={props.onNewTask}
202+
/>
203+
)}
204+
{NATIVE_LIQUID_GLASS_SUPPORTED ? null : (
205+
<Toolbar.Button
206+
accessibilityLabel={searchLabel}
207+
icon="magnifyingglass"
208+
onPress={focusSearch}
209+
/>
210+
)}
211+
</Toolbar>
212+
)}
210213
<Toolbar placement="bottom">
211214
{sidebarTabs === "toolbar" ? <WorkspaceTabToolbarButtons /> : null}
212215
{bottomSearch && searchVisible ? <Toolbar.SearchBarSlot /> : null}

0 commit comments

Comments
 (0)