GeezerVison is showing github.com — chore: merge main into Azure activity fix · pingdotgg/t3code@15299f1
File treeExpand file treeCollapse file tree Open diff view settings source-control-azure-devops/src/server source-control-bitbucket/src/server source-control-core/src/server source-control-forgejo/src/server source-control-gitcafe/src/server source-control-github/src/server source-control-gitlab/src
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -162,7 +162,7 @@ export function PullRequestMergeControls(props: { | 162 | 162 | }, | 163 | 163 | }); | 164 | 164 | // A stack can partly merge before the provider reports a failure. | 165 | | - refreshDetail(); | | 165 | + if (!AsyncResult.isSuccess(response)) refreshDetail(); | 166 | 166 | refreshActivity(); | 167 | 167 | stack.refresh(); | 168 | 168 | pending.current = false; | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/usePullRequestAction.ts -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,7 +19,6 @@ export function usePullRequestAction(params: PullRequestParams, pr: PullRequestD | 19 | 19 | const target = pullRequestTarget(params); | 20 | 20 | const permissions = usePullRequestPermissions(params, pr); | 21 | 21 | const run = useAtomCommand(composerPullRequests.runAction, { reportFailure: false }); | 22 | | - const refreshDetail = useAtomRefresh(composerPullRequests.detail(target)); | 23 | 22 | const refreshActivity = useAtomRefresh(composerPullRequests.activity(target)); | 24 | 23 | const pending = useRef(false); | 25 | 24 | const [busy, setBusy] = useState(false); | @@ -43,7 +42,6 @@ export function usePullRequestAction(params: PullRequestParams, pr: PullRequestD | 43 | 42 | ); | 44 | 43 | return; | 45 | 44 | } | 46 | | - refreshDetail(); | 47 | 45 | refreshActivity(); | 48 | 46 | }; | 49 | 47 | const confirm = (action: PullRequestAction, title: string, message: string) => | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/usePullRequestListActions.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -94,6 +94,7 @@ export function usePullRequestListActions( | 94 | 94 | throw new Error(`This action isn't available for this ${terminology.singular}.`); | 95 | 95 | const result = await run({ ...target, input: { ...target.input, action } }); | 96 | 96 | if (result._tag === "Failure") throw squashAtomCommandFailure(result); | | 97 | + if (result.value !== undefined) return; | 97 | 98 | onChanged( | 98 | 99 | entry, | 99 | 100 | action === "close" | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/NewTaskDraftScreen.tsx +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -983,6 +983,7 @@ export function NewTaskDraftScreen(props: { | 983 | 983 | onStopThread={() => {}} | 984 | 984 | onResumeQueue={null} | 985 | 985 | onSendMessage={handleStart} | | 986 | + offersSideChat={false} | 986 | 987 | onReconnectEnvironment={() => onReconnectEnvironment(selectedProject.environmentId)} | 987 | 988 | canSwitchThreadProvider | 988 | 989 | onUpdateThreadInteractionMode={flow.planModeEnabled ? flow.setInteractionMode : undefined} | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/PendingApprovalCard.tsx +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -80,7 +80,7 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) { | 80 | 80 | {warning ? ( | 81 | 81 | <Text className="font-sans text-xs leading-normal text-warning-foreground">{warning}</Text> | 82 | 82 | ) : null} | 83 | | - <View className="flex-row flex-wrap gap-2.5"> | | 83 | + <View className="gap-2"> | 84 | 84 | {options.map((option) => ( | 85 | 85 | <Button | 86 | 86 | key={option.decision} | @@ -94,6 +94,7 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) { | 94 | 94 | } | 95 | 95 | disabled={disabled || !props.canOperateThread} | 96 | 96 | onPress={() => void props.onRespond(props.approval.requestId, option.decision)} | | 97 | + fullWidth | 97 | 98 | /> | 98 | 99 | ))} | 99 | 100 | </View> | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadComposer.tsx +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -217,6 +217,7 @@ export interface ThreadComposerProps { | 217 | 217 | readonly hasCompactableConversation: boolean; | 218 | 218 | /** Arms a fresh session for the next message; absent where `/clear` is unavailable. */ | 219 | 219 | readonly onFreshSession?: () => void; | | 220 | + readonly offersSideChat?: boolean; | 220 | 221 | readonly serverConfig: T3ServerConfig | null; | 221 | 222 | readonly queueCount: number; | 222 | 223 | readonly activeThreadBusy: boolean; | @@ -564,6 +565,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps | 564 | 565 | onUsageLimits: | 565 | 566 | usageLimitsOffered && draftAttachments.length === 0 ? openUsageLimits : undefined, | 566 | 567 | ...(props.onFreshSession === undefined ? {} : { onFreshSession: props.onFreshSession }), | | 568 | + offersSideChat: props.offersSideChat === true, | 567 | 569 | }); | 568 | 570 | const voiceInput = useVoiceInputController({ | 569 | 571 | ownerKey: composerDraftKey, | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadDetailScreen.tsx +32-6Lines changed: 32 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -287,6 +287,7 @@ export interface ThreadDetailScreenProps { | 287 | 287 | readonly onStopThread: () => void; | 288 | 288 | /** Present while the thread's queue is held. */ | 289 | 289 | readonly onResumeQueue: (() => Promise<void>) | null; | | 290 | + readonly offersSideChat: boolean; | 290 | 291 | readonly onSendMessage: ( | 291 | 292 | followUp?: ActiveTurnComposerAction, | 292 | 293 | beforeDispatch?: ( | @@ -1019,6 +1020,16 @@ function ThreadDetailBody( | 1019 | 1020 | maxHeight: pendingUserInputMaxHeight.value, | 1020 | 1021 | flexGrow: 0, | 1021 | 1022 | })); | | 1023 | + // Questions overlay the composer on iOS; an approval sits above it, so it gives up its height. | | 1024 | + const approvalHeightStyle = useAnimatedStyle(() => ({ | | 1025 | + maxHeight: derivePendingUserInputMaxHeight({ | | 1026 | + windowHeight: screenAreaHeight, | | 1027 | + keyboardHeight: keyboardStickyEnabled ? -keyboardTranslation.value : 0, | | 1028 | + navigationHeaderHeight, | | 1029 | + composerOverlapHeight, | | 1030 | + }), | | 1031 | + flexGrow: 0, | | 1032 | + })); | 1022 | 1033 | // The usage panel stacks with the composer and any approval card, so it gets | 1023 | 1034 | // whatever room they leave below the header. Measured only while it is open | 1024 | 1035 | // so typing in the composer does not re-render the screen. | @@ -1718,12 +1729,19 @@ function ThreadDetailBody( | 1718 | 1729 | exiting={FadeOut.duration(140)} | 1719 | 1730 | > | 1720 | 1731 | {props.activePendingApproval ? ( | 1721 | | - <PendingApprovalCard | 1722 | | - canOperateThread={props.canOperateThread} | 1723 | | - approval={props.activePendingApproval} | 1724 | | - respondingApprovalId={props.respondingApprovalId} | 1725 | | - onRespond={props.onRespondToApproval} | 1726 | | - /> | | 1732 | + <Animated.ScrollView | | 1733 | + key={props.activePendingApproval.requestId} | | 1734 | + style={approvalHeightStyle} | | 1735 | + keyboardShouldPersistTaps="handled" | | 1736 | + nestedScrollEnabled | | 1737 | + > | | 1738 | + <PendingApprovalCard | | 1739 | + canOperateThread={props.canOperateThread} | | 1740 | + approval={props.activePendingApproval} | | 1741 | + respondingApprovalId={props.respondingApprovalId} | | 1742 | + onRespond={props.onRespondToApproval} | | 1743 | + /> | | 1744 | + </Animated.ScrollView> | 1727 | 1745 | ) : null} | 1728 | 1746 | {props.activePendingUserInput ? ( | 1729 | 1747 | <PendingUserInputCard | @@ -1819,6 +1837,14 @@ function ThreadDetailBody( | 1819 | 1837 | onFreshSession: () => setFreshSessionPending(selectedThreadKey, true), | 1820 | 1838 | } | 1821 | 1839 | : {})} | | 1840 | + offersSideChat={ | | 1841 | + props.offersSideChat && | | 1842 | + !props.draftMode && | | 1843 | + props.canOperateThread && | | 1844 | + props.queuedRunEdit === null && | | 1845 | + props.activePendingApproval === null && | | 1846 | + props.activePendingUserInput === null | | 1847 | + } | 1822 | 1848 | serverConfig={props.serverConfig} | 1823 | 1849 | queueCount={props.selectedThreadQueueCount} | 1824 | 1850 | activeThreadBusy={props.activeThreadBusy} | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadFeed.tsx +4-12Lines changed: 4 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -275,7 +275,7 @@ import { | 275 | 275 | resolveWorkspaceFilePath, | 276 | 276 | resolveWorkspaceRelativeFilePath, | 277 | 277 | } from "../files/filePath"; | 278 | | -import { waitForThreadShellReady } from "./threadForkNavigation"; | | 278 | +import { waitForThreadShell } from "./threadForkNavigation"; | 279 | 279 | import { resolveUserMessageIntentBadge } from "./userMessageIntentBadge"; | 280 | 280 | import { fileChipClipboardPath, fileChipMenu, resolveFileChipTarget } from "./fileChipMenu"; | 281 | 281 | import { useFileChipShare } from "./useFileChipShare"; | @@ -381,16 +381,6 @@ export interface ThreadFeedProps { | 381 | 381 | readonly onUseArtifactTemplate?: (template: CodexArtifactTemplate) => void; | 382 | 382 | } | 383 | 383 |
| 384 | | -async function waitForThreadShell( | 385 | | - environmentId: EnvironmentId, | 386 | | - threadId: ThreadId, | 387 | | -): Promise<boolean> { | 388 | | - const atom = environmentThreadShells.threadShellAtom(scopeThreadRef(environmentId, threadId)); | 389 | | - return waitForThreadShellReady({ | 390 | | - read: () => appAtomRegistry.get(atom) !== null, | 391 | | - }); | 392 | | -} | 393 | | - | 394 | 384 | const USER_MESSAGE_COPY_MENU_ACTIONS = [ | 395 | 385 | { id: "copy-prompt-link", title: "Copy prompt link", image: "link" }, | 396 | 386 | ]; | @@ -470,7 +460,9 @@ function AssistantForkButton(props: { | 470 | 460 | }) | 471 | 461 | .then(async (result) => { | 472 | 462 | if (result._tag !== "Success") return; | 473 | | - const targetThreadReady = await waitForThreadShell(props.environmentId, targetThreadId); | | 463 | + const targetThreadReady = await waitForThreadShell( | | 464 | + scopeThreadRef(props.environmentId, targetThreadId), | | 465 | + ); | 474 | 466 | if (!targetThreadReady) { | 475 | 467 | Dialog.alert( | 476 | 468 | "Fork created", | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadRouteScreen.tsx +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -111,6 +111,7 @@ import { | 111 | 111 | ThreadInspectorPreview, | 112 | 112 | type ThreadInspectorPresentation, | 113 | 113 | } from "./thread-inspector-preview"; | | 114 | +import { useStartSideChat } from "./useStartSideChat"; | 114 | 115 | import type { ThreadInspectorMode, ThreadInspectorTarget } from "./thread-inspector-navigation"; | 115 | 116 | import { useSelectWorkspaceDetail } from "../workspace/useSelectWorkspaceDetail"; | 116 | 117 |
| @@ -368,7 +369,8 @@ function ThreadRouteContent( | 368 | 369 | const selectedThreadDetailState = props.selectedThreadDetailState; | 369 | 370 | const selectedThreadDetail = Option.getOrNull(selectedThreadDetailState.data); | 370 | 371 | const { selectedThreadCwd } = useSelectedThreadWorktree(); | 371 | | - const composer = useThreadComposerState(); | | 372 | + const startSideChat = useStartSideChat(); | | 373 | + const composer = useThreadComposerState({ startSideChat }); | 372 | 374 | const gitState = useSelectedThreadGitState(); | 373 | 375 | const gitActions = useSelectedThreadGitActions(); | 374 | 376 | const requests = useSelectedThreadRequests(); | @@ -1070,6 +1072,7 @@ function ThreadRouteContent( | 1070 | 1072 | composer.queueHeld || composer.resumableRunId !== null ? handleResumeQueue : null | 1071 | 1073 | } | 1072 | 1074 | onSendMessage={composer.onSendMessage} | | 1075 | + offersSideChat={composer.sideChatUnavailableReason === null} | 1073 | 1076 | onReconnectEnvironment={handleReconnectEnvironment} | 1074 | 1077 | canSwitchThreadProvider={composer.canSwitchThreadProvider} | 1075 | 1078 | onUpdateThreadInteractionMode={composer.onUpdateInteractionMode} | |
Collapse file Copy file name to clipboard +16-22Lines changed: 16 additions & 22 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -const DEFAULT_TIMEOUT_MS = 2_000; | 2 | | -const DEFAULT_POLL_INTERVAL_MS = 40; | | 1 | +import type { ScopedThreadRef } from "@t3tools/contracts"; | 3 | 2 |
| 4 | | -export async function waitForThreadShellReady(input: { | 5 | | - readonly read: () => boolean; | 6 | | - readonly timeoutMs?: number; | 7 | | - readonly pollIntervalMs?: number; | 8 | | - readonly now?: () => number; | 9 | | - readonly delay?: (durationMs: number) => Promise<void>; | 10 | | -}): Promise<boolean> { | 11 | | - const now = input.now ?? Date.now; | 12 | | - const delay = | 13 | | - input.delay ?? | 14 | | - ((durationMs: number) => | 15 | | - new Promise<void>((resolve) => { | 16 | | - setTimeout(resolve, durationMs); | 17 | | - })); | 18 | | - const deadline = now() + (input.timeoutMs ?? DEFAULT_TIMEOUT_MS); | 19 | | - const pollIntervalMs = input.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS; | | 3 | +import { appAtomRegistry } from "../../state/atom-registry"; | | 4 | +import { environmentThreadShells } from "../../state/threads"; | 20 | 5 |
| 21 | | - while (!input.read() && now() < deadline) { | 22 | | - await delay(Math.min(pollIntervalMs, deadline - now())); | 23 | | - } | | 6 | +const TIMEOUT_MS = 2_000; | | 7 | +const POLL_INTERVAL_MS = 40; | 24 | 8 |
| 25 | | - return input.read(); | | 9 | +/** Resolves true once a thread this client just created, such as a fork, reaches its state. */ | | 10 | +export async function waitForThreadShell(ref: ScopedThreadRef): Promise<boolean> { | | 11 | + const atom = environmentThreadShells.threadShellAtom(ref); | | 12 | + const read = () => appAtomRegistry.get(atom) !== null; | | 13 | + const deadline = Date.now() + TIMEOUT_MS; | | 14 | + while (!read() && Date.now() < deadline) { | | 15 | + await new Promise<void>((resolve) => { | | 16 | + setTimeout(resolve, Math.min(POLL_INTERVAL_MS, deadline - Date.now())); | | 17 | + }); | | 18 | + } | | 19 | + return read(); | 26 | 20 | } |
|