diff --git a/.github/workflows/activation-e2e.yml b/.github/workflows/activation-e2e.yml index 096ead0..72dd99a 100644 --- a/.github/workflows/activation-e2e.yml +++ b/.github/workflows/activation-e2e.yml @@ -196,3 +196,11 @@ jobs: path: | artifacts/diag/** if-no-files-found: warn + # Maestro's --debug-output nests the UI-hierarchy dump under a + # hidden `.maestro/tests//` directory. upload-artifact + # excludes dotfiles/dot-directories by default, so every prior run + # silently uploaded only logcat.txt/probe.txt and dropped the + # actual hierarchy dumps we need to diagnose flow failures (issue + # #104) — this was invisible because if-no-files-found: warn + # doesn't fail the step when SOME files still match. + include-hidden-files: true diff --git a/.maestro/flows/variant-picker.yaml b/.maestro/flows/variant-picker.yaml index 18c4c34..42c4892 100644 --- a/.maestro/flows/variant-picker.yaml +++ b/.maestro/flows/variant-picker.yaml @@ -21,6 +21,11 @@ name: Variant picker - reasoning-effort chip renders, selects, and still sends # NOT render on session open. This flow explicitly opens the model picker and # selects the mock provider's model first, which is what actually makes # variants available — matching how a real user reaches this chip. +# +# This flow does NOT assert on the SSE-streamed assistant reply after +# sending — see the "Sending a message" comment near chat-send-button below, +# and activation-positive.yaml's file-level comment, for why (issue #90 mode +# B: a CI-harness-specific SSE limitation, not an app bug). - launchApp: clearState: true @@ -98,7 +103,14 @@ name: Variant picker - reasoning-effort chip renders, selects, and still sends - takeScreenshot: variant-S4_chip_shows_high # Sending a message must still work with a variant selected (regression: the -# variant chip must not break the send path). +# variant chip must not break the send path). Like activation-positive.yaml, +# this stops at the optimistic local echo (src/stores/sessions.ts) instead of +# waiting on the SSE-streamed assistant reply — issue #90 mode B (see +# activation-positive.yaml's file-level comment) proved that in THIS harness +# (Android emulator + this Node mock + adb-reverse) the long-lived SSE +# connection reliably delivers only its first chunk, so the reply never +# renders here regardless of app correctness. Asserting on it would be +# asserting on a CI-harness limitation, not real app behavior. - tapOn: id: "chat-message-input" - inputText: "Message with reasoning effort set to high" @@ -109,14 +121,14 @@ name: Variant picker - reasoning-effort chip renders, selects, and still sends - extendedWaitUntil: visible: - text: "Hello from the mock opencode server" - timeout: 20000 + id: "chat-bubble-user" + timeout: 5000 - assertVisible: - id: "chat-bubble-assistant" + id: "chat-bubble-user" - assertVisible: text: "Message with reasoning effort set to high" -# The chip must still read "High" after the round trip (selection persists -# across a send, it isn't reset by the reply landing). +# The chip must still read "High" after sending (selection persists across a +# send, it isn't reset once the message is submitted). - assertVisible: text: "High" -- takeScreenshot: variant-S6_reply_received_variant_still_high +- takeScreenshot: variant-S6_message_sent_variant_still_high diff --git a/src/components/chat/DirectoryBrowserSheet.tsx b/src/components/chat/DirectoryBrowserSheet.tsx index 48ef946..bde091e 100644 --- a/src/components/chat/DirectoryBrowserSheet.tsx +++ b/src/components/chat/DirectoryBrowserSheet.tsx @@ -97,6 +97,22 @@ export function DirectoryBrowserSheet({ [clientForDirectory], ) + // The caller (app/(tabs)/index.tsx openBrowser) sets the start directory + // via setState and calls sheetRef.current?.expand() in the very same + // synchronous handler. expand() kicks off a reanimated-driven animation + // whose onChange callback can fire before React has committed the + // re-render that would give this component the new `startDirectory` prop + // (issue #104: this raced consistently, leaving the sheet permanently + // showing "Enter a path above to start browsing" because the FIRST + // onChange(index=0) captured `startDirectory=null` from the initial + // mount's closure and set wasOpen=true, which then blocked every later + // onChange from ever calling enter() again for that open). Mirror the + // prop into a ref, updated inline on every render (synchronous, no extra + // render cycle) so the onChange handler below always reads the latest + // value regardless of which render's closure the native side invokes. + const startDirectoryRef = useRef(startDirectory) + startDirectoryRef.current = startDirectory + // Reset to the starting directory when the sheet transitions from closed // to open (not on drags between snap points), and notify on full close. const wasOpen = useRef(false) @@ -110,9 +126,10 @@ export function DirectoryBrowserSheet({ if (wasOpen.current) return // snap-point change while already open wasOpen.current = true setJumpPath("") - if (startDirectory) { - enter(startDirectory) - loadRoots(startDirectory) + const dir = startDirectoryRef.current + if (dir) { + enter(dir) + loadRoots(dir) } else { // No starting directory known (e.g. server home not loaded yet): // show an explicit empty state instead of a previous open's entries. @@ -124,7 +141,7 @@ export function DirectoryBrowserSheet({ setRoots([]) } }, - [startDirectory, enter, loadRoots, onDismiss], + [enter, loadRoots, onDismiss], ) const goUp = useCallback(() => { diff --git a/src/components/markdown/Markdown.tsx b/src/components/markdown/Markdown.tsx index 69f20c2..5360a5c 100644 --- a/src/components/markdown/Markdown.tsx +++ b/src/components/markdown/Markdown.tsx @@ -1,9 +1,28 @@ import type { ReactNode } from "react" -import { View, Text, useColorScheme, Platform, type ViewStyle, type TextStyle } from "react-native" +import { View, Text, useColorScheme, Platform, type StyleProp, type ViewStyle, type TextStyle } from "react-native" import { useMarkdown, Renderer } from "react-native-marked" import { CodeBlock } from "./CodeBlock" +// react-native-marked's base Renderer hardcodes `selectable` on every plain +// text node it produces (text/strong/em/del/heading/codespan). On Android, +// selectable nested inside a FlatList row has a long-standing, +// still-unresolved RN bug (facebook/react-native#46999, a reopened +// regression of #28952's fix) where the underlying view's selectable state +// — and, per our own diff-scroll flow (issue #104), its exposure to the +// accessibility tree Maestro/UiAutomator reads from — never gets applied +// correctly. Chat messages here are rendered as rows of the session screen's +// own FlatList (app/session/[id].tsx), so every markdown text node hits +// this. Code content is still copyable via CodeBlock's explicit Copy +// button, so dropping `selectable` on plain text costs little. class CustomRenderer extends Renderer { + private plainText(children: string | ReactNode[], styles?: StyleProp): ReactNode { + return ( + + {children} + + ) + } + code(text: string, language?: string, containerStyle?: ViewStyle, _textStyle?: TextStyle) { return ( @@ -12,12 +31,28 @@ class CustomRenderer extends Renderer { ) } + text(text: string | ReactNode[], styles?: TextStyle): ReactNode { + return this.plainText(text, styles) + } + + strong(children: string | ReactNode[], styles?: TextStyle): ReactNode { + return this.plainText(children, styles) + } + + em(children: string | ReactNode[], styles?: TextStyle): ReactNode { + return this.plainText(children, styles) + } + + del(children: string | ReactNode[], styles?: TextStyle): ReactNode { + return this.plainText(children, styles) + } + + heading(text: string | ReactNode[], styles?: TextStyle): ReactNode { + return this.plainText(text, styles) + } + codespan(text: string, styles?: TextStyle): ReactNode { - return ( - - {text} - - ) + return this.plainText(text, [styles, { fontStyle: "normal", fontWeight: "normal" }]) } }