@devries-cameron20 / t3code Mirror · read-only / commits / 7e9d5a7efa
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 12:45 UTC

fix(mobile): prevent message and composer overlap (#9195)

Julius Marminge committed Sep 2, 2026 at 01:56 UTC 7e9d5a7efa70f92f91d960a4f50243ba44d805da
4 files changed +31 -5
apps/mobile/src/features/threads/ThreadComposer.tsx
+8 -3
@@ -151,6 +151,11 @@ export const COMPOSER_LAYOUT_TRANSITION =
151 ? undefined
152 : LinearTransition.duration(COMPOSER_TRANSITION_DURATION_MS).reduceMotion(ReduceMotion.System);
153
154 +const COMPOSER_ATTACHMENT_ENTERING =
155 + Platform.OS === "android"
156 + ? FadeIn.duration(160)
157 + : FadeIn.delay(COMPOSER_TRANSITION_DURATION_MS).duration(160).reduceMotion(ReduceMotion.System);
158 +
159 const AnimatedGlassSurface = Animated.createAnimatedComponent(GlassSurface);
160
161 export function ComposerSurface(props: {
@@ -623,10 +628,10 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
628 onPickFiles={props.onPickDraftFiles}
629 />
630 ) : null}
626 - {isExpanded ? (
631 + {isExpanded && props.draftAttachments.length > 0 ? (
632 <Animated.View
628 - className={props.draftAttachments.length > 0 ? "px-[14px] pb-2.5" : undefined}
629 - entering={FadeIn.duration(160)}
633 + className="px-[14px] pb-2.5"
634 + entering={COMPOSER_ATTACHMENT_ENTERING}
635 exiting={FadeOut.duration(120)}
636 >
637 <ComposerAttachmentStrip
apps/mobile/src/features/threads/ThreadFeed.tsx
+4
@@ -178,6 +178,10 @@ import {
178 import { MARKDOWN_IMAGE_MAX_WIDTH, resolveMarkdownImageDisplaySize } from "./markdownImageSize";
179
180 const WIDE_MARKDOWN_BLOCK_OPTIONS = {
181 + // Native iOS blockquotes and adjacent selectable text are separate layout
182 + // chunks. Giving their shrink-to-fit bubble a definite width keeps both
183 + // chunks measured against the width at which UIKit draws them.
184 + includeBlockquotes: Platform.OS === "ios",
185 includeOrderedLists: Platform.OS === "android",
186 } as const;
187
apps/mobile/src/lib/wideMarkdownBlocks.test.ts
+8
@@ -41,6 +41,14 @@ describe("hasWideMarkdownBlock", () => {
41 );
42 });
43
44 + it("detects blockquotes only when the native renderer needs width pinning", () => {
45 + expect(hasWideMarkdownBlock("> quoted", { includeBlockquotes: true })).toBe(true);
46 + expect(hasWideMarkdownBlock(" > quoted", { includeBlockquotes: true })).toBe(true);
47 + expect(hasWideMarkdownBlock("> quoted")).toBe(false);
48 + expect(hasWideMarkdownBlock("prose > quoted", { includeBlockquotes: true })).toBe(false);
49 + expect(hasWideMarkdownBlock(" > indented code", { includeBlockquotes: true })).toBe(false);
50 + });
51 +
52 it("detects GFM tables", () => {
53 expect(hasWideMarkdownBlock("| a | b |\n| --- | --- |\n| 1 | 2 |")).toBe(true);
54 expect(hasWideMarkdownBlock("a | b\n:-- | --:\n1 | 2")).toBe(true);
apps/mobile/src/lib/wideMarkdownBlocks.ts
+11 -2
@@ -1,6 +1,7 @@
1 /**
2 - * Detects markdown that the JS renderer draws as a block requiring a definite
3 - * user-bubble width — fenced code blocks, GFM tables, and ordered lists.
2 + * Detects markdown that the renderer draws as a block requiring a definite
3 + * user-bubble width: fenced code blocks, GFM tables, ordered lists, and
4 + * blockquotes when requested by the caller.
5 *
6 * Fenced code blocks and tables report an intrinsic width equal to their
7 * widest line, which is effectively unbounded. A user bubble sizes itself
@@ -31,6 +32,7 @@ const BLOCKQUOTE_PREFIX = /^ {0,3}>[ \t]?/;
32
33 export interface WideMarkdownBlockOptions {
34 readonly includeOrderedLists?: boolean;
35 + readonly includeBlockquotes?: boolean;
36 }
37
38 function stripBlockquotePrefixes(line: string): string {
@@ -41,6 +43,10 @@ function stripBlockquotePrefixes(line: string): string {
43 return content;
44 }
45
46 +function hasBlockquote(text: string): boolean {
47 + return text.split("\n").some((line) => BLOCKQUOTE_PREFIX.test(line));
48 +}
49 +
50 function hasOrderedListItem(text: string): boolean {
51 let previousNonEmptyLine: string | null = null;
52
@@ -80,6 +86,9 @@ export function hasWideMarkdownBlock(
86 if (FENCED_CODE_BLOCK.test(text)) {
87 return true;
88 }
89 + if (options.includeBlockquotes === true && hasBlockquote(text)) {
90 + return true;
91 + }
92 if (options.includeOrderedLists !== false && hasOrderedListItem(text)) {
93 return true;
94 }