Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(mobile): Duo 竖屏任务列表抽屉头部与状态栏同行

Dash176934018285
diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsx
index feb327fbc2..28c4a74a3a 100644
--- a/apps/mobile/app/sessions/[sessionId].tsx
+++ b/apps/mobile/app/sessions/[sessionId].tsx
@@ -3059,6 +3059,12 @@ function SessionScreenContent({ beforeSessionSwitchRef, newSessionActionRef }: S
// already includes that area; safeArea.top + 44 would count the toolbar twice.
const topChromeHeight = Math.max(topOverlayHeight,
horizontalSystemHeader ? nativeHeaderHeight : insets.top + navigationChrome.target);
+ // The drawer hides that toolbar; put the drawer's own header in the same row instead of
+ // below the whole status area. Duo (iOS 27.1) centers toolbar items spacing.md above the
+ // area's bottom; the drawer header adds spacing.lg itself. Ordinary bars keep safeArea.top.
+ const sessionListDrawerTopInset = horizontalSystemHeader && nativeHeaderHeight > 0
+ && nativeHeaderHeight < insets.top + navigationChrome.target
+ ? Math.max(0, nativeHeaderHeight - navigationChrome.target - spacing.md - spacing.lg) : undefined;
// 退出宽屏后 layout.drawerWidth 会变 0;退场期间继续用最后一个有效宽度,避免面板几何跳变。
const sessionListDrawerWidthRef = useRef(wideSessionNav.drawerWidth);
if (wideSessionNav.enabled) sessionListDrawerWidthRef.current = wideSessionNav.drawerWidth;
@@ -11110,6 +11116,7 @@ function SessionScreenContent({ beforeSessionSwitchRef, newSessionActionRef }: S
runNavigation={queueDrawerNavigation}
onSelectSession={handleDrawerSelectSession}
open={sessionListDrawerOpen}
+ topInset={sessionListDrawerTopInset}
width={sessionListDrawerWidthRef.current}
/>
) : null}
diff --git a/apps/mobile/docs/navigation-and-composer.md b/apps/mobile/docs/navigation-and-composer.md
index 0ee6997c3f..5bbce9a8f8 100644
--- a/apps/mobile/docs/navigation-and-composer.md
+++ b/apps/mobile/docs/navigation-and-composer.md
@@ -20,6 +20,7 @@
- 伙伴对话:左上角为返回(回到伙伴列表);Duo 系统栏已有返回时保留侧栏按钮,不出现两个返回。
- Duo 等宽屏任务页可拖动中间把手调整两栏:列表宽度限制在 240–420pt,并为正文保留至少 400pt;真实折痕划分的两栏不允许移动。宽度在当前窗口内跨任务和旋转保留,不写入持久设置。
- iOS 首页列表留在自己的原生路由内,进入任务后仍可供返回动画显示;常驻侧栏独立保留列表内容,拖动分栏时不叠加尺寸动画。抽屉页面卸载时只撤销自己发布的内容,旧页面的清理不影响新页面,下一任务测量前不显示失效内容。系统顶栏已计入安全区时,磨砂高度直接采用原生测量值。
+- Duo 竖屏的系统顶栏与状态栏同在一行;临时任务列表抽屉收起系统顶栏后,抽屉头部放在同一行(与时钟对齐),不排到整块状态区下方。
- 侧栏切换任务沿用当前原生 Screen;`SessionTaskLayout` 将常驻侧栏放在任务内容边界之外,保留侧栏标题和测量槽。任务内容及侧聊删除保护按电脑及任务身份重建,搜索、停止、模型操作等局部状态和迟到完成不能影响新任务。
- 设置等整页滚动的二级页:顶栏透明、系统柔和边缘,内容滚到顶栏和底部指示条下面,无硬分界(设置、语音词典、账号注销、伙伴私聊、共享任务管理、资源列表);设备详情只去掉底部色带。
diff --git a/apps/mobile/src/session/SessionListDrawer.tsx b/apps/mobile/src/session/SessionListDrawer.tsx
index 25efdeaec5..87152cb8c8 100644
--- a/apps/mobile/src/session/SessionListDrawer.tsx
+++ b/apps/mobile/src/session/SessionListDrawer.tsx
@@ -15,9 +15,11 @@ const DRAWER_CLOSE_VELOCITY = -800;
/** Container only: Home owns every list row, search, group, menu and subscription. */
export function SessionListDrawer({ currentSessionId, persistent = false, newSessionInSystemBar = false,
- onClose, onClosed, onSelectSession, runNavigation, newSessionActionRef, open, width,
+ onClose, onClosed, onSelectSession, runNavigation, newSessionActionRef, open, width, topInset,
}: {
currentSessionId: string;
+ /** Overrides the safe-area top where the task bar sits inside the status area (Duo). */
+ topInset?: number;
persistent?: boolean;
newSessionInSystemBar?: boolean;
onClose(): void;
@@ -199,7 +201,7 @@ export function SessionListDrawer({ currentSessionId, persistent = false, newSes
onPress={onClose} style={styles.scrimPressable} testID="sessionDrawer.scrim" />
</Animated.View> : null}
<GestureDetector gesture={panGesture}>
- <Animated.View style={[styles.panel, { paddingLeft: insets.left, paddingTop: insets.top, width: panelWidth },
+ <Animated.View style={[styles.panel, { paddingLeft: insets.left, paddingTop: topInset ?? insets.top, width: panelWidth },
!persistent && panelStyle]} testID="sessionDrawer.panel">
<View ref={homeContentRef} style={styles.content}>
<MobileHome newSessionActionRef={newSessionActionRef} width={width} currentSessionId={currentSessionId}