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): show transient notices above resident messages

DavidShen518724469cad
diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsx
index 8b84e38fbc..da7ec4109a 100644
--- a/apps/mobile/app/sessions/[sessionId].tsx
+++ b/apps/mobile/app/sessions/[sessionId].tsx
@@ -10685,11 +10685,13 @@ function SessionScreenContent() {
width={conversationShareWidth}
/>
) : null}
- <SessionTransientNotice
- notice={transientNotice}
- onDismiss={dismissTransientNotice}
- top={Math.max(topOverlayHeight, insets.top + 44) + spacing.sm}
- />
+ <MessageHistoryOverlay>
+ <SessionTransientNotice
+ notice={transientNotice}
+ onDismiss={dismissTransientNotice}
+ top={Math.max(topOverlayHeight, insets.top + 44) + spacing.sm}
+ />
+ </MessageHistoryOverlay>
<MessageHistoryOverlay enabled={!paneLayout.persistent || sessionListDrawerOverlayMounted}>
{/* The persistent panel stays below the shared resident list. Only modal
drawers cover resident histories, including their closing animation. */}
diff --git a/apps/mobile/src/__tests__/mobileNativeBoundaryContracts.test.ts b/apps/mobile/src/__tests__/mobileNativeBoundaryContracts.test.ts
index d042090473..bd96e06700 100644
--- a/apps/mobile/src/__tests__/mobileNativeBoundaryContracts.test.ts
+++ b/apps/mobile/src/__tests__/mobileNativeBoundaryContracts.test.ts
@@ -281,6 +281,26 @@ expect(settings).toContain("t('settings.version.googlePlayContentUpdateUnavailab
// guard: native persistent history hosts must wrap routes and replace route prefetch ownership.
describe('persistent native history ownership', () => {
+ // guard: mobile-development.md native rendering boundary; a route-local notice cannot
+ // paint above Android's opaque resident message surface regardless of its zIndex.
+ it('hosts transient route notices above the resident message surface', () => {
+ const source = ts.createSourceFile('session.tsx', readFileSync(
+ resolve(process.cwd(), 'app/sessions/[sessionId].tsx'), 'utf8',
+ ), ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
+ const notices: ts.JsxSelfClosingElement[] = [];
+ const visit = (node: ts.Node) => {
+ if (ts.isJsxSelfClosingElement(node) && node.tagName.getText(source) === 'SessionTransientNotice') notices.push(node);
+ ts.forEachChild(node, visit);
+ };
+ visit(source);
+ expect(notices).toHaveLength(1);
+ const parent = notices[0]!.parent;
+ expect(ts.isJsxElement(parent)).toBe(true);
+ if (!ts.isJsxElement(parent)) return;
+ expect(parent.openingElement.tagName.getText(source)).toBe('MessageHistoryOverlay');
+ // Unlike the sidebar panel, a notice needs the overlay on persistent layouts too.
+ expect(parent.openingElement.attributes.properties).toHaveLength(0);
+ });
// guard: keep the real route wired to the shared list and native clipping layers.
// The provider behavior suite cannot exercise Android native stacking.
it('keeps the persistent sidebar on the shared list below its native host', () => {