GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge remote-tracking branch 'origin/main' into t3/mobile-model-comma… · pingdotgg/t3code@c70c3a0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/mobile
    • modules/t3-native-controls/ios
      • T3ScrollEdgeBleedView.swift
    • src
      • components
        • ComposerAttachmentStrip.tsx
      • features/threads
        • ThreadDetailScreen.tsx
        • ThreadFeed.tsx
        • ThreadRouteScreen.tsx
        • worktree-setup-card.tsx
      • lib
        • sentImageHandoff.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/mobile/modules/t3-native-controls/ios/T3ScrollEdgeBleedView.swift‎

Copy file name to clipboardExpand all lines: apps/mobile/modules/t3-native-controls/ios/T3ScrollEdgeBleedView.swift
+3-25Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import UIKit
44
/// Wraps a screen's header scroll view. Where a column pads its content away from the iPhone Duo's
55
/// vertical bar, this widens the scroll view under the bar, like the system apps' lists. UIKit
66
/// draws the header's scroll-edge effect inside the scroll view, so the blur reaches the bar while
7-
/// the content stays in the safe area. Everything happens in UIKit layout, so folds move the blur
8-
/// and the content together.
7+
/// the content stays in the safe area, and the scroll indicator runs along the screen edge past the
8+
/// bar, as in Messages. Everything happens in UIKit layout, so folds move the blur and the content
9+
/// together.
910
final class T3ScrollEdgeBleedView: ExpoView {
1011
// Fabric recycles scroll views, so everything changed here is put back before this view leaves
1112
// the window, which unmounting does before any recycling.
@@ -19,7 +20,6 @@ final class T3ScrollEdgeBleedView: ExpoView {
1920
/// React Native's clipping, saved while bleeding. React Native only rewrites it when the
2021
/// `overflow` style changes, so it stays off while bleeding.
2122
private var containerClipped: Bool?
22-
private var indicatorObservations: [NSKeyValueObservation] = []
2323

2424
required init(appContext: AppContext? = nil) {
2525
super.init(appContext: appContext)
@@ -137,31 +137,9 @@ final class T3ScrollEdgeBleedView: ExpoView {
137137
containerClipped = containerClipped ?? true
138138
container.layer.masksToBounds = false
139139
}
140-
applyIndicatorInset()
141-
// React Native rewrites every indicator inset when its `scrollIndicatorInsets` prop changes,
142-
// which the keyboard-aware list animates while a reply streams; put the inset back at once.
143-
if bleeding, indicatorObservations.isEmpty {
144-
let keyPaths = [\UIScrollView.verticalScrollIndicatorInsets, \.scrollIndicatorInsets]
145-
indicatorObservations = keyPaths.map {
146-
scrollView.observe($0) { [weak self] _, _ in
147-
MainActor.assumeIsolated { self?.applyIndicatorInset() }
148-
}
149-
}
150-
} else if !bleeding {
151-
indicatorObservations = []
152-
}
153140
applied = bleeding
154141
}
155142

156-
private func applyIndicatorInset() {
157-
guard let scrollView else { return }
158-
var indicators = scrollView.verticalScrollIndicatorInsets
159-
if indicators.right != bleed.right {
160-
indicators.right = bleed.right
161-
scrollView.verticalScrollIndicatorInsets = indicators
162-
}
163-
}
164-
165143
private func detach() {
166144
guard scrollView != nil else { return }
167145
bleed = .zero
Collapse file

‎apps/mobile/src/components/ComposerAttachmentStrip.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/components/ComposerAttachmentStrip.tsx
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
type DraftComposerImageAttachment,
1919
} from "../lib/composerImages";
2020
import { resolveOwnedComposerAttachmentFileUri } from "../lib/composerAttachmentFiles";
21+
import { rememberDraftImage } from "../lib/sentImageHandoff";
2122
import { VideoAttachmentTile } from "./VideoAttachmentTile";
2223
import { type MediaActionsSource } from "../lib/mediaActionsSource";
2324
import { PresentationSource } from "./ui/NativePresentation";
@@ -161,6 +162,13 @@ function ComposerImageAttachment(
161162
style={style}
162163
className="bg-subtle"
163164
resizeMode="cover"
165+
onLoad={({ nativeEvent: { source } }) => {
166+
if (previewUri !== null)
167+
rememberDraftImage(attachment.id, {
168+
uri: previewUri,
169+
aspectRatio: source.width / source.height,
170+
});
171+
}}
164172
/>
165173
</Pressable>
166174
</PresentationSource>
Collapse file

‎apps/mobile/src/features/threads/ThreadDetailScreen.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,17 +882,23 @@ function ThreadDetailBody(
882882
return null;
883883
})();
884884
const showWorkingControl = floatingStatus !== null;
885+
// A pending message holds the pill's row for its Starting/Working pill. Worktree setup reports
886+
// progress in the feed instead, so holding the row there only leaves a gap that later closes.
887+
const worktreeSetupInFeed =
888+
props.worktreeSetup?.snapshot.phase === "running" ||
889+
(props.creationState?.kind === "preparing" && props.creationState.preparingWorktree);
885890
const showFloatingStatus =
886891
showWorkingControl ||
887892
queuedCount > 0 ||
888893
agentsSegment !== null ||
889894
devicePreviews.length > 0 ||
890895
browserTabs.tabs.length > 0 ||
891896
props.connectionStateLabel !== "connected" ||
892-
props.queuedMessages.length > 0 ||
893-
props.selectedThreadFeed.some(
894-
(entry) => "acknowledged" in entry && entry.acknowledged === true,
895-
);
897+
(!worktreeSetupInFeed &&
898+
(props.queuedMessages.length > 0 ||
899+
props.selectedThreadFeed.some(
900+
(entry) => "acknowledged" in entry && entry.acknowledged === true,
901+
)));
896902
const selectedThreadFeed = props.selectedThreadFeed;
897903
// A palette message result opens the thread at that message: earlier
898904
// history loads until the message is in the feed, which then scrolls to it.
Collapse file

‎apps/mobile/src/features/threads/ThreadFeed.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadFeed.tsx
+52-10Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ import { assetImageSource } from "../../lib/assetImageSource";
137137
import { composerImageGallery } from "../../lib/composerImageGallery";
138138
import { isFileBackedComposerAttachment } from "../../lib/composerImages";
139139
import { useLocalAttachmentPreview } from "../../lib/localAttachmentPreview";
140+
import {
141+
rememberSentImage,
142+
sentImageHandoff,
143+
type SentImageHandoff,
144+
} from "../../lib/sentImageHandoff";
140145
import { messageImageGallery } from "./messageImageGallery";
141146
import { MARKDOWN_IMAGE_MAX_WIDTH, resolveMarkdownImageDisplaySize } from "./markdownImageSize";
142147
import { FilePreviewModal, type FilePreviewSource } from "../../components/ui/FilePreviewModal";
@@ -483,12 +488,18 @@ function MessageImage(props: {
483488
readonly maxWidth?: number;
484489
readonly height?: number;
485490
readonly accessibilityLabel: string;
491+
readonly handoff?: SentImageHandoff;
486492
readonly onPress: () => void;
487-
readonly onLoad?: () => void;
493+
readonly onLoad?: (size: { readonly width: number; readonly height: number }) => void;
488494
readonly onError?: () => void;
489495
}) {
490496
const imageStyle = useResolveClassNames(props.className);
491-
const [size, setSize] = useState<{ width: number; height: number } | null>(null);
497+
const [loadedSize, setSize] = useState<{ width: number; height: number } | null>(null);
498+
// Until it loads, assume a handed-off image is a photo larger than the bubble's caps.
499+
const size =
500+
loadedSize ??
501+
(props.handoff ? { width: props.handoff.aspectRatio * 4096, height: 4096 } : null);
502+
const contentFit = props.maxWidth === undefined ? "cover" : "contain";
492503
const displaySize =
493504
props.maxWidth !== undefined && size !== null
494505
? resolveMarkdownImageDisplaySize({
@@ -519,10 +530,12 @@ function MessageImage(props: {
519530
source={props.source}
520531
cachePolicy="memory-disk"
521532
style={{ width: "100%", height: "100%" }}
522-
contentFit={props.maxWidth === undefined ? "cover" : "contain"}
533+
contentFit={contentFit}
534+
placeholder={props.handoff ? { uri: props.handoff.uri } : undefined}
535+
placeholderContentFit={contentFit}
523536
onLoad={(event) => {
524537
if (props.maxWidth !== undefined) setSize(event.source);
525-
props.onLoad?.();
538+
props.onLoad?.(event.source);
526539
}}
527540
onError={props.onError}
528541
/>
@@ -538,6 +551,8 @@ function MessageAttachmentImage(props: {
538551
readonly className: string;
539552
readonly maxWidth?: number;
540553
readonly height?: number;
554+
readonly handoff?: SentImageHandoff;
555+
readonly onImageLoad?: (image: SentImageHandoff) => void;
541556
readonly onPressPreview: (source: FilePreviewSource) => void;
542557
}) {
543558
const withGallery = useFilePreviewGallery();
@@ -551,8 +566,15 @@ function MessageAttachmentImage(props: {
551566
const uri = useAssetUrl(props.environmentId, resource);
552567
const refreshAssetUrl = useRefreshAssetUrl(props.environmentId, resource);
553568
const retriedImage = useRef(false);
569+
const { handoff } = props;
570+
const source =
571+
uri !== null
572+
? assetImageSource(props.environmentId, resource, uri)
573+
: handoff !== undefined
574+
? { uri: handoff.uri }
575+
: null;
554576

555-
if (uri === null) {
577+
if (source === null) {
556578
return (
557579
<View
558580
className={`${props.className} items-center justify-center`}
@@ -573,11 +595,12 @@ function MessageAttachmentImage(props: {
573595
<PresentationSource identifier={sourceIdentifier}>
574596
<MessageImage
575597
key={props.attachmentId}
576-
source={assetImageSource(props.environmentId, resource, uri)}
598+
source={source}
577599
className={props.className}
578600
maxWidth={props.maxWidth}
579601
height={props.height}
580602
accessibilityLabel={`Open ${props.name}`}
603+
{...handoffProps(handoff)}
581604
onPress={() =>
582605
props.onPressPreview(
583606
withGallery({
@@ -595,8 +618,10 @@ function MessageAttachmentImage(props: {
595618
}),
596619
)
597620
}
598-
onLoad={() => {
621+
onLoad={(size) => {
599622
retriedImage.current = false;
623+
if (handoff)
624+
props.onImageLoad?.({ uri: handoff.uri, aspectRatio: size.width / size.height });
600625
}}
601626
onError={() => {
602627
if (retriedImage.current) return;
@@ -835,7 +860,10 @@ function MessageAttachmentFile(props: {
835860
);
836861
}
837862

863+
const handoffProps = (handoff: SentImageHandoff | undefined) => (handoff ? { handoff } : {});
864+
838865
function UserMessageMedia(props: {
866+
readonly messageId: string;
839867
readonly attachments: ReadonlyArray<ChatAttachment>;
840868
readonly pendingAttachments: QueuedThreadMessage["attachments"];
841869
readonly environmentId: EnvironmentId;
@@ -870,6 +898,8 @@ function UserMessageMedia(props: {
870898
name={attachment.name}
871899
mimeType={attachment.mimeType}
872900
{...imageProps(index)}
901+
{...handoffProps(sentImageHandoff(props.messageId, index, attachment.id))}
902+
onImageLoad={(loaded) => rememberSentImage(props.messageId, index, loaded)}
873903
onPressPreview={props.onPressPreview}
874904
/>
875905
) : !image && attachment.uploadedAttachmentId ? (
@@ -886,6 +916,8 @@ function UserMessageMedia(props: {
886916
<PendingMessageMedia
887917
attachment={attachment}
888918
{...imageProps(index)}
919+
{...handoffProps(sentImageHandoff(props.messageId, index, attachment.id))}
920+
onImageLoad={(image) => rememberSentImage(props.messageId, index, image)}
889921
onPressPreview={props.onPressPreview}
890922
onPlaybackStart={props.onPlaybackStart}
891923
/>
@@ -902,6 +934,7 @@ function UserMessageMedia(props: {
902934
name={attachment.name}
903935
mimeType={attachment.mimeType}
904936
{...imageProps(props.pendingAttachments.length + index)}
937+
{...handoffProps(sentImageHandoff(props.messageId, index))}
905938
onPressPreview={props.onPressPreview}
906939
/>
907940
) : isFileAttachment(attachment) ? (
@@ -968,23 +1001,31 @@ function PendingMessageMedia(props: {
9681001
readonly className: string;
9691002
readonly maxWidth?: number;
9701003
readonly height?: number;
1004+
readonly handoff?: SentImageHandoff;
1005+
readonly onImageLoad?: (image: SentImageHandoff) => void;
9711006
readonly onPressPreview: (source: FilePreviewSource) => void;
9721007
readonly onPlaybackStart: () => void;
9731008
}) {
9741009
const withGallery = useFilePreviewGallery();
975-
const { attachment } = props;
1010+
const { attachment, handoff } = props;
9761011
const fileBacked = isFileBackedComposerAttachment(attachment);
9771012
const preview = useLocalAttachmentPreview(fileBacked ? attachment : null);
9781013
if (isImageAttachment(attachment)) {
979-
const uri = fileBacked ? preview.uri : (attachment.dataUrl ?? attachment.previewUri);
1014+
// The composer already showed this image; reuse its pixels and shape instead of a blank box.
1015+
const uri =
1016+
handoff?.uri ?? (fileBacked ? preview.uri : (attachment.dataUrl ?? attachment.previewUri));
9801017
return (
9811018
<MessageImage
9821019
key={attachment.id}
983-
source={uri === null ? undefined : { uri }}
1020+
source={uri == null ? undefined : { uri }}
9841021
className={props.className}
9851022
maxWidth={props.maxWidth}
9861023
height={props.height}
9871024
accessibilityLabel={`Open ${attachment.name}`}
1025+
{...handoffProps(handoff)}
1026+
onLoad={(size) => {
1027+
if (uri) props.onImageLoad?.({ uri, aspectRatio: size.width / size.height });
1028+
}}
9881029
onPress={() => {
9891030
const source = composerImageGallery([attachment])[0];
9901031
if (source) props.onPressPreview(withGallery(source));
@@ -2061,6 +2102,7 @@ function renderFeedEntry(
20612102
style={{ width: props.duoColumns ? "85%" : props.userBubbleMaxWidth }}
20622103
>
20632104
<UserMessageMedia
2105+
messageId={message.id}
20642106
attachments={mediaAttachments}
20652107
pendingAttachments={pendingMedia}
20662108
environmentId={props.environmentId}
Collapse file

‎apps/mobile/src/features/threads/ThreadRouteScreen.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadRouteScreen.tsx
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,10 @@ function ThreadRouteContent(
964964
// Shown in the header subtitle so the composer's status slot doesn't jump while history syncs.
965965
const threadSyncLabel = useDelayedStatus(
966966
selectedThread === null ? "" : scopedThreadKey(selectedThread.environmentId, selectedThread.id),
967-
threadSyncStatusLabel(selectedThreadDetailState.status, contentPresentation.kind),
967+
// A thread this client is creating has nothing older to sync.
968+
creationState === null
969+
? threadSyncStatusLabel(selectedThreadDetailState.status, contentPresentation.kind)
970+
: null,
968971
);
969972
const inspectorHeader = props.inspectorPresentation ? (
970973
<ThreadInspectorHeader
Collapse file

‎apps/mobile/src/features/threads/worktree-setup-card.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/worktree-setup-card.tsx
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Button } from "../../components/ui/Button";
22
import {
3+
WORKTREE_SETUP_STAGE_ORDER,
34
worktreeSetupStageLabel,
45
type WorktreeSetupSnapshot,
56
type WorktreeSetupStage,
@@ -148,12 +149,30 @@ export function WorktreeSetupCard(props: WorktreeSetupCardProps) {
148149
}
149150

150151
/** Holds the card's place until the server publishes the first setup snapshot. */
152+
// Same rows the first snapshot brings, so the card keeps its height when that snapshot lands.
153+
const PREPARING_STAGES: ReadonlyArray<WorktreeSetupStage> = WORKTREE_SETUP_STAGE_ORDER.filter(
154+
(id) => id !== "agent",
155+
).map((id) => ({
156+
id,
157+
status: "pending",
158+
startedAt: null,
159+
endedAt: null,
160+
percent: null,
161+
detail: null,
162+
tail: [],
163+
}));
164+
151165
export function WorktreePreparingHeader() {
152166
return (
153167
<View className="py-1">
154168
<View className="min-h-11 flex-row items-center border-b border-border px-1">
155169
<HeaderLabel label="Setting up worktree…" active />
156170
</View>
171+
<View className="pt-1 pb-2">
172+
{PREPARING_STAGES.map((stage) => (
173+
<StageRow key={stage.id} stage={stage} scriptName={null} now={0} compact />
174+
))}
175+
</View>
157176
</View>
158177
);
159178
}
Collapse file

‎apps/mobile/src/lib/sentImageHandoff.ts‎

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export interface SentImageHandoff {
2+
readonly uri: string;
3+
readonly aspectRatio: number;
4+
}
5+
6+
// A sent image's local pixels and shape, so the pending bubble and then the delivered copy open at
7+
// their final size over pixels already on screen instead of a placeholder that later resizes.
8+
// The server re-ids attachments into the thread, so delivered images match by message and position.
9+
const MAX_ENTRIES = 64;
10+
const images = new Map<string, SentImageHandoff>();
11+
12+
function remember(key: string, image: SentImageHandoff) {
13+
if (!Number.isFinite(image.aspectRatio) || image.aspectRatio <= 0) return;
14+
images.delete(key);
15+
images.set(key, image);
16+
if (images.size > MAX_ENTRIES) images.delete(images.keys().next().value!);
17+
}
18+
19+
export function rememberDraftImage(attachmentId: string, image: SentImageHandoff): void {
20+
remember(`draft:${attachmentId}`, image);
21+
}
22+
23+
export function rememberSentImage(messageId: string, index: number, image: SentImageHandoff): void {
24+
remember(`message:${messageId}:${index}`, image);
25+
}
26+
27+
export function sentImageHandoff(
28+
messageId: string,
29+
index: number,
30+
draftAttachmentId?: string,
31+
): SentImageHandoff | undefined {
32+
return (
33+
images.get(`message:${messageId}:${index}`) ??
34+
(draftAttachmentId === undefined ? undefined : images.get(`draft:${draftAttachmentId}`))
35+
);
36+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.