fix(mobile): Keep the last line of iOS assistant replies visible #8220
t3code/codex-turn-mapping fromrefs/pull/8220/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
mwolson(GitHub profile, opens in a new tab) changed the title
- apps/mobile/src/native/SelectableMarkdownText.ios.tsx line 36OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -17,4 +18,19 @@1718 }181919-export function SelectableMarkdownText(props: MobileSelectableMarkdownTextProps) {20- return <T3SelectableMarkdownText {...props} highlightCode={highlightCodeSnippet} />;20+export function SelectableMarkdownText({21+ fillWidth = false,22+ ...props23+}: MobileSelectableMarkdownTextProps) {24+ const content = (25+ <T3SelectableMarkdownText26+ {...props}27+ fillWidth={fillWidth}28+ highlightCode={highlightCodeSnippet}29+ />30+ );31+32+ if (!fillWidth) {33+ return content;34+ }35+36+ return <View style={{ alignSelf: "stretch", flexShrink: 1, minWidth: 0 }}>{content}</View>;
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/mobile/src/features/threads/ThreadFeed.tsx line 1998OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -2039,20 +1998 @@2039- // must add the same UIKit-added extra, or its keyboard-open end2040- // targets land one safe-area short of the true resting offset.2041- adjustedInsetCompensation={usesNativeAutomaticInsets ? insets.bottom : 0}2042- freeze={props.freeze}2043- // Animated: on send, the optimistic message's dataChange fires2044- // maintainScrollAtEnd before any render-cycle suppression could2045- // engage — an instant snap there teleports the feed to the anchor2046- // instead of scrolling to it. Keeping it enabled (animated) during2047- // anchor scrolls also lets it correct a scroll that landed on a2048- // stale end target once the anchor row finishes measuring.2049- maintainScrollAtEnd={2050- disclosureToggleSettling || !endFollowEnabled2051- ? false2052- : {2053- animated: true,2054- on: {2055- dataChange: true,2056- itemLayout: true,2057- layout: true,2058- },1998+ {viewportHeight > 0 ? (
- apps/mobile/src/features/threads/ThreadFeed.tsx line 2120OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -2117,0 +2100,21 @@2100+ onScroll={handleScroll}2101+ onScrollBeginDrag={handleScrollBeginDrag}2102+ onScrollEndDrag={handleScrollEndDrag}2103+ onMomentumScrollBegin={handleMomentumScrollBegin}2104+ onMomentumScrollEnd={handleMomentumScrollEnd}2105+ scrollEventThrottle={16}2106+ ListHeaderComponent={2107+ <>2108+ {usesNativeAutomaticInsets ? null : <View style={{ height: topContentInset }} />}2109+ {props.historyControls ? (2110+ <ThreadFeedLoadEarlierControl {...props.historyControls} />2111+ ) : null}2112+ {props.topAccessory}2113+ </>2114+ }2115+ contentContainerStyle={{2116+ paddingTop: 12,2117+ paddingHorizontal: contentHorizontalPadding,2118+ }}2119+ />2120+ ) : null}
- apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.ios.tsx line 198OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -184,3 +190,9 @@184190 key={appearanceKey}185191 uiTextView186192 selectable193+ onTextLayout={(event) => {194+ const lines = event.nativeEvent.lines;195+ if (!Array.isArray(lines) || lines.length === 0) {196+ return;197+ }198+ const next = Math.ceil(lines.length * props.textStyle.lineHeight);
- apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.ios.tsx line 199OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -184,3 +190,10 @@184190 key={appearanceKey}185191 uiTextView186192 selectable193+ onTextLayout={(event) => {194+ const lines = event.nativeEvent.lines;195+ if (!Array.isArray(lines) || lines.length === 0) {196+ return;197+ }198+ const next = Math.ceil(lines.length * props.textStyle.lineHeight);199+ setMinHeight((current) => (next > current ? next : current));
mwolson(GitHub profile, opens in a new tab) changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.ios.tsx line 166OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -158,3 +159,8 @@158159159160 return { key: `${signature}:${occurrence}`, run, text };160161 });162+ const [minHeight, setMinHeight] = useState(0);163+ const runSignature = keyedRuns.map((keyedRun) => keyedRun.key).join("|");164+ useEffect(() => {165+ setMinHeight(0);166+ }, [runSignature]);apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.ios.tsx line 199OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -184,3 +190,10 @@184190 key={appearanceKey}185191 uiTextView186192 selectable193+ onTextLayout={(event) => {194+ const lines = event.nativeEvent.lines;195+ if (!Array.isArray(lines) || lines.length === 0) {196+ return;197+ }198+ const next = Math.ceil(lines.length * props.textStyle.lineHeight);199+ setMinHeight((current) => (next > current ? next : current));
- apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.ios.tsx lines 246 to 248OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -184,3 +186,8 @@184186 key={appearanceKey}185187 uiTextView186188 selectable189+ onTextLayout={(event) => {190+ const lines = event.nativeEvent.lines;191+ if (!Array.isArray(lines) || lines.length === 0) {192+ return;193+ }
- apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.ios.tsx line 194OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -184,3 +186,9 @@184186 key={appearanceKey}185187 uiTextView186188 selectable189+ onTextLayout={(event) => {190+ const lines = event.nativeEvent.lines;191+ if (!Array.isArray(lines) || lines.length === 0) {192+ return;193+ }194+ setMinHeight(Math.ceil(lines.length * props.textStyle.lineHeight));
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge closed this
Sign in to join this conversation.






Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
b4879da9-c4d0-49e8-b779-ed7b703918bdYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share