@devries-cameron20 / t3code Mirror · read-only / commits / ccde655b8f
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 22, 03:15 UTC

fix(desktop): let the window shrink to 400x360 so it fits half-screen tiles (#28223)

Co-authored-by: Priyansh4444 <105874877+Priyansh4444@users.noreply.github.com> Co-authored-by: Tanner Polley <42780259+tannerpolley@users.noreply.github.com> Co-authored-by: Maria <maria-rcks@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

shivam committed Nov 6, 2026 at 12:41 UTC ccde655b8f3d39af08d5b2e6b56773e4db1b2f89
9 files changed +343 -293
apps/desktop/src/settings/DesktopAppSettings.test.ts
+25 -12
@@ -200,16 +200,22 @@ describe("DesktopSettings", () => {
200 withSettings(
201 Effect.gen(function* () {
202 const settings = yield* DesktopAppSettings.DesktopAppSettings;
203 - yield* writeSettingsPatch({
204 - mainWindowBounds: { x: 10.5, y: 20, width: 839, height: 620 },
205 - mainWindowMaximized: true,
206 - serverExposureMode: "network-accessible",
207 - });
208 -
209 - const loaded = yield* settings.load;
210 - assert.isNull(loaded.mainWindowBounds);
211 - assert.isFalse(loaded.mainWindowMaximized);
212 - assert.equal(loaded.serverExposureMode, "network-accessible");
203 + for (const bounds of [
204 + { x: 10.5, y: 20, width: 400, height: 360 },
205 + { x: 10, y: 20, width: 399, height: 360 },
206 + { x: 10, y: 20, width: 400, height: 359 },
207 + ]) {
208 + yield* writeSettingsPatch({
209 + mainWindowBounds: bounds,
210 + mainWindowMaximized: true,
211 + serverExposureMode: "network-accessible",
212 + });
213 +
214 + const loaded = yield* settings.load;
215 + assert.isNull(loaded.mainWindowBounds);
216 + assert.isFalse(loaded.mainWindowMaximized);
217 + assert.equal(loaded.serverExposureMode, "network-accessible");
218 + }
219 }),
220 ),
221 );
@@ -221,17 +227,24 @@ describe("DesktopSettings", () => {
227 const fileSystem = yield* FileSystem.FileSystem;
228 const settings = yield* DesktopAppSettings.DesktopAppSettings;
229
224 - yield* settings.setMainWindowBounds({ x: -1200, y: 40, width: 1440, height: 960 }, true);
230 + yield* settings.setMainWindowBounds({ x: -1200, y: 40, width: 400, height: 360 }, true);
231 yield* settings.setServerExposureMode("network-accessible");
232
233 const persisted = yield* decodeDesktopSettingsPatch(
234 yield* fileSystem.readFileString(environment.desktopSettingsPath),
235 );
236 assert.deepEqual(persisted, {
231 - mainWindowBounds: { x: -1200, y: 40, width: 1440, height: 960 },
237 + mainWindowBounds: { x: -1200, y: 40, width: 400, height: 360 },
238 mainWindowMaximized: true,
239 serverExposureMode: "network-accessible",
240 } satisfies typeof DesktopSettingsPatch.Type);
241 +
242 + const restored = yield* Effect.gen(function* () {
243 + const freshSettings = yield* DesktopAppSettings.DesktopAppSettings;
244 + return yield* freshSettings.load;
245 + }).pipe(Effect.provide(DesktopAppSettings.layer));
246 + assert.deepEqual(restored.mainWindowBounds, persisted.mainWindowBounds);
247 + assert.isTrue(restored.mainWindowMaximized);
248 }),
249 ),
250 );
apps/desktop/src/settings/DesktopAppSettings.ts
+6 -3
@@ -47,9 +47,12 @@ export interface DesktopSettingsChange {
47 }
48
49 const DEFAULT_TAILSCALE_SERVE_PORT = 443;
50 -const MIN_MAIN_WINDOW_SIZE = {
51 - width: 840,
52 - height: 620,
50 +// Fits half and third tiles of common scaled displays (down to 480x432 DIP) on
51 +// Wayland, where Electron's client-side frame adds 32x42 DIP to the enforced
52 +// minimum. The web layout already handles phone widths.
53 +export const MIN_MAIN_WINDOW_SIZE = {
54 + width: 400,
55 + height: 360,
56 } as const;
57 export const DesktopWindowBoundsSchema = Schema.Struct({
58 x: Schema.Int,
apps/desktop/src/window/DesktopWindow.ts
+2 -2
@@ -399,8 +399,8 @@ export const make = Effect.gen(function* () {
399 if (yield* Ref.get(desktopState.quitting)) return Option.none();
400 const window = yield* electronWindow.create({
401 ...initialBounds,
402 - minWidth: 840,
403 - minHeight: 620,
402 + minWidth: DesktopAppSettings.MIN_MAIN_WINDOW_SIZE.width,
403 + minHeight: DesktopAppSettings.MIN_MAIN_WINDOW_SIZE.height,
404 show: false,
405 autoHideMenuBar: true,
406 ...(environment.platform === "darwin" ? { disableAutoHideCursor: true } : {}),
apps/web/src/components/AppRouteModal.tsx
+20 -3
@@ -1,7 +1,8 @@
1 import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2 import { XIcon } from "lucide-react";
3 -import { useRef, useState, type ReactNode } from "react";
3 +import { useRef, useState, type CSSProperties, type ReactNode } from "react";
4
5 +import { useNativeTitlebarHeight } from "../lib/windowControlsOverlay";
6 import { useCloseAppModal } from "./sidebar/mainAppLocation";
7 import { Button } from "./ui/button";
8 import { DialogBackdrop } from "./ui/dialog";
@@ -20,6 +21,10 @@ export function AppRouteModal({ label, children }: { label: string; children: Re
21 // Focus the surface, not its first control: no stray focus ring, no phone keyboard.
22 // On close, leave focus alone; returning it to the opener paints a focus ring.
23 const popupRef = useRef<HTMLDivElement>(null);
24 + // Clear the native window controls (macOS traffic lights, the Windows and Linux caption
25 + // buttons). Below sm the modal fills the window and leaves that strip empty; up to lg its
26 + // 1.5rem inset is shorter than the strip.
27 + const nativeTitlebarHeight = useNativeTitlebarHeight();
28
29 return (
30 <DialogPrimitive.Root
@@ -41,7 +46,14 @@ export function AppRouteModal({ label, children }: { label: string; children: Re
46 <DialogPrimitive.Portal>
47 <DialogBackdrop />
48 <DialogPrimitive.Viewport
44 - className="fixed inset-0 z-50 flex items-center justify-center sm:p-6 lg:p-10"
49 + style={
50 + {
51 + "--app-modal-titlebar-height": `${nativeTitlebarHeight}px`,
52 + "--app-modal-top-inset": `max(env(safe-area-inset-top), ${nativeTitlebarHeight}px)`,
53 + "--app-modal-sm-top": `max(1.5rem, ${nativeTitlebarHeight}px)`,
54 + } as CSSProperties
55 + }
56 + className="fixed inset-0 z-50 flex items-center justify-center sm:p-6 sm:pt-(--app-modal-sm-top) lg:p-10"
57 onPointerDown={(event) => {
58 backdropPressRef.current = event.target === event.currentTarget;
59 }}
@@ -57,8 +69,13 @@ export function AppRouteModal({ label, children }: { label: string; children: Re
69 aria-label={label}
70 data-slot="dialog-popup"
71 data-app-modal=""
60 - className="relative flex size-full min-h-0 min-w-0 flex-col overflow-hidden bg-background max-sm:pt-safe max-sm:pb-safe text-foreground outline-none transition-[opacity,scale] duration-150 ease-out [-webkit-app-region:no-drag] data-ending-style:scale-[0.985] data-ending-style:opacity-0 data-starting-style:scale-[0.985] data-starting-style:opacity-0 sm:max-h-[60rem] sm:max-w-[80rem] sm:rounded-2xl sm:border sm:shadow-2xl/40"
72 + className="relative flex size-full min-h-0 min-w-0 flex-col overflow-hidden bg-background max-sm:pt-(--app-modal-top-inset) max-sm:pb-safe text-foreground outline-none transition-[opacity,scale] duration-150 ease-out [-webkit-app-region:no-drag] data-ending-style:scale-[0.985] data-ending-style:opacity-0 data-starting-style:scale-[0.985] data-starting-style:opacity-0 sm:max-h-[60rem] sm:max-w-[80rem] sm:rounded-2xl sm:border sm:shadow-2xl/40"
73 >
74 + {/* The emptied strip still moves the window, as the titlebar it replaces does. */}
75 + <div
76 + aria-hidden
77 + className="absolute inset-x-0 top-0 hidden h-(--app-modal-titlebar-height) [-webkit-app-region:drag] max-sm:block"
78 + />
79 {children}
80 </DialogPrimitive.Popup>
81 </DialogPrimitive.Viewport>
apps/web/src/components/ChatView.tsx
+271 -263
@@ -3540,7 +3540,7 @@ export default function ChatView(props: ChatViewProps) {
3540 data-chat-composer-overlay="true"
3541 className={
3542 isDraftHeroState
3543 - ? "pointer-events-none absolute inset-0 z-20 flex items-center"
3543 + ? "pointer-events-none absolute inset-0 z-20 flex items-center [@media(max-height:34rem)]:items-end"
3544 : "pointer-events-none absolute inset-x-0 bottom-0 z-20 pt-1.5 sm:pt-2"
3545 }
3546 >
@@ -3577,278 +3577,286 @@ export default function ChatView(props: ChatViewProps) {
3577 }
3578 >
3579 <ChildThreadApprovals threadRef={activeThreadRef} />
3580 - <ComposerSurface.Shell contextRow={showComposerContextStrip}>
3581 - <ComposerSurface.Host
3582 - inert={queuedRunEdit.isSaving}
3583 - aria-busy={queuedRunEdit.isSaving}
3584 - >
3585 - <div className="relative z-10">
3586 - {showProviderSubagentBar ? (
3587 - <ProviderSubagentBar
3588 - provider={selectedProviderEntry ?? null}
3589 - showInstanceBadge={
3590 - selectedProviderEntry !== undefined &&
3591 - shouldShowInstanceBadge(
3592 - selectedProviderEntry,
3593 - providerInstanceEntries,
3594 - )
3595 - }
3596 - modelLabel={providerSubagentModelLabel}
3597 - effortLabel={providerSubagentEffortLabel}
3598 - status={providerSubagentStatus}
3599 - onOpenParent={parentThreadLink?.open ?? null}
3600 - actions={
3601 - selectedProviderEntry?.driverKind === "antigravity" ? (
3602 - <NativeChildWorkDialog
3603 - environmentId={environmentId}
3604 - threadId={threadId}
3605 - />
3606 - ) : null
3607 - }
3608 - />
3609 - ) : null}
3610 - {!composerMounted ? null : (
3611 - <ChatComposer
3612 - canOperateThread={canOperateThread}
3613 - reportedModelSelection={reportedModelSelection}
3614 - multipleModelSelections={multipleModelSelections}
3615 - supportsMultipleModels={
3616 - serverConfig?.environment.capabilities.requiredWorktreeBootstrap ===
3617 - true
3618 - }
3619 - onMultipleModelSelectionsChange={setMultipleModelSelectionsStable}
3620 - composerRef={composerRef}
3621 - composerDraftTarget={composerDraftTarget}
3622 - environmentId={environmentId}
3623 - attachmentUploadsCapabilityKnown={attachmentUploadsCapabilityKnown}
3624 - supportsAttachmentUploads={supportsAttachmentUploads}
3625 - supportsQuestionAttachments={supportsQuestionAttachments}
3626 - maxFileAttachmentBytes={maxFileAttachmentBytes}
3627 - routeKind={routeKind}
3628 - routeThreadRef={routeThreadRef}
3629 - draftId={draftId}
3630 - activeThreadId={activeThreadId}
3631 - activeThread={activeThread}
3632 - activeThreadShell={activeThreadShell}
3633 - promptHistoryEntries={timelineEntries}
3634 - forceExpandedOnMobile={
3635 - forceExpandedMobileComposer && isDraftHeroState
3636 - }
3637 - projectSelectionRequired={
3638 - isLocalDraftThread && activeProject === null
3639 - }
3640 - phase={phase}
3641 - isCompacting={isCompacting}
3642 - canInterrupt={canInterruptRunningThread}
3643 - isSendBusy={
3644 - (isSendBusy && !sendQueuesBehindSetup) ||
3645 - (setupQueueSendThreadKey !== null &&
3646 - setupQueueSendThreadKey === activeThreadKey) ||
3647 - queuedRunEdit.isSaving ||
3648 - isResuming
3649 - }
3650 - canResume={resumableRunId !== null || hasHeldQueuedRuns}
3651 - isRevertingCheckpoint={isRevertingCheckpoint}
3652 - sendDisabledReason={
3653 - !canOperateThread
3654 - ? "This connection cannot change threads."
3655 - : isEnvironmentChanging
3656 - ? "Preparing machine"
3657 - : isRevertingCheckpoint
3658 - ? "Rewinding conversation"
3659 - : feedbackUploading
3660 - ? "Sending feedback"
3661 - : threadDetailLoading
3662 - ? "Messages loading"
3663 - : worktreeSetupBlocksSend
3664 - ? "Preparing worktree"
3665 - : projectCloneSendBlockReason
3666 - }
3667 - isPreparingWorktree={isPreparingWorktree && !sendQueuesBehindSetup}
3668 - bannerItems={
3669 - isDraftHeroState || composerBannerItems.length === 0
3670 - ? EMPTY_COMPOSER_BANNER_ITEMS
3671 - : composerBannerItems
3672 - }
3673 - resumeCompactionTokens={resumeCompactionTokens}
3674 - keepFullHistory={keepFullHistory}
3675 - onToggleKeepFullHistory={toggleKeepFullHistoryStable}
3676 - sideChatAvailable={sideChat.available}
3677 - sideChatDisabledReason={sideChatDisabledReason}
3678 - onFreshSession={
3679 - freshSessionCommandAvailable ? armFreshSessionStable : undefined
3680 - }
3681 - onUsageLimitsCommand={
3682 - usageLimitsOffered &&
3683 - usageLimitsKey !== null &&
3684 - !composerHasNonPromptContent
3685 - ? openUsageLimits
3686 - : undefined
3687 - }
3688 - environmentUnavailable={activeEnvironmentUnavailableState}
3689 - activePendingApproval={activePendingApproval}
3690 - pendingApprovals={pendingApprovals}
3691 - onHeldRequestIdsChange={onHeldRequestIdsChange}
3692 - pendingUserInputs={pendingUserInputs}
3693 - activePendingProgress={activePendingProgress}
3694 - activePendingResolvedAnswers={activePendingResolvedAnswers}
3695 - activePendingIsResponding={activePendingIsResponding}
3696 - activePendingDraftAnswers={activePendingDraftAnswers}
3697 - activePendingQuestionIndex={activePendingQuestionIndex}
3698 - respondingRequestIds={respondingRequestIds}
3699 - showPlanFollowUpPrompt={showPlanFollowUpPrompt}
3700 - activeProposedPlan={activeProposedPlan}
3701 - threadSyncPhase={
3702 - activeEnvironmentUnavailable ? null : threadSyncPhase
3703 - }
3704 - runtimeMode={runtimeMode}
3705 - defaultRuntimeMode={defaultRuntimeMode}
3706 - interactionMode={interactionMode}
3707 - lockedProvider={modelPickerLockedProvider}
3708 - providerStatuses={providerStatuses as ServerProvider[]}
3709 - providerCatalogKnown={serverConfig !== null}
3710 - activeProjectDefaultModelSelection={
3711 - activeProjectDefaultModelSelection
3712 - }
3713 - activeThreadModelSelection={activeThread?.modelSelection}
3714 - activeProjectId={activeProject?.id ?? null}
3715 - projectName={activeProject?.title}
3716 - contextWindowEntries={serverVisibleTurnItems}
3717 - contextWindowLiveUsage={activeThreadLiveTokenUsage}
3718 - contextWindowProviderThread={activeProviderThread}
3719 - compactThreadUnavailable={compactThreadUnavailable}
3720 - compactDisabled={compactDisabled}
3721 - compactDisabledReason={compactDisabledReason}
3722 - resolvedTheme={resolvedTheme}
3723 - settings={settings}
3724 - keybindings={keybindings}
3725 - terminalOpen={Boolean(terminalUiState.terminalOpen)}
3726 - gitCwd={gitCwd}
3727 - pullRequestProjectId={
3728 - supportsPullRequests ? (activeProject?.id ?? null) : null
3729 - }
3730 - pullRequestRepository={
3731 - supportsPullRequests ? activeProjectRepository : null
3732 - }
3733 - threadPullRequests={(activeThreadShell ?? activeThread)?.pullRequests}
3734 - onComposerOverlayHeightChange={publishComposerOverlayHeightStable}
3735 - permissionsShownInStrip={showComposerContextStrip && !isServerThread}
3736 - promptRef={promptRef}
3737 - composerImagesRef={composerImagesRef}
3738 - composerFilesRef={composerFilesRef}
3739 - composerTerminalContextsRef={composerTerminalContextsRef}
3740 - onPageScrollKeyDown={onComposerPageScrollKeyDownStable}
3741 - onPageScrollKeyUp={onComposerPageScrollKeyUpStable}
3742 - onPageScrollRelease={onComposerPageScrollReleaseStable}
3743 - onCompactContext={onComposerCompactContextStable}
3744 - onSend={onComposerSendStable}
3745 - onResume={onComposerResumeStable}
3746 - onInterrupt={onInterruptStable}
3747 - onImplementPlanInNewThread={onImplementPlanInNewThreadStable}
3748 - onSelectActivePendingUserInputOption={
3749 - onSelectActivePendingUserInputOptionStable
3750 - }
3751 - onAdvanceActivePendingUserInput={
3752 - onAdvanceActivePendingUserInputStable
3753 - }
3754 - onDismissActivePendingUserInput={onDismissUserInputStable}
3755 - onPreviousActivePendingUserInputQuestion={
3756 - onPreviousActivePendingUserInputQuestionStable
3757 - }
3758 - onChangeActivePendingUserInputCustomAnswer={
3759 - onChangeActivePendingUserInputCustomAnswer
3760 - }
3761 - onProviderModelSelect={onProviderModelSelectStable}
3762 - onOpenProviderSetup={openProviderSetupStable}
3763 - getModelDisabledReason={getModelDisabledReason}
3764 - toggleInteractionMode={toggleInteractionModeStable}
3765 - handleRuntimeModeChange={handleRuntimeModeChangeStable}
3766 - handleInteractionModeChange={handleInteractionModeChangeStable}
3767 - focusComposer={focusComposerStable}
3768 - scheduleComposerFocus={scheduleComposerFocusStable}
3769 - setThreadError={setThreadError}
3770 - onExpandImage={onExpandTimelineImageStable}
3771 - onFileOpen={openFileAttachmentStable}
3772 - editingQueuedAttachments={queuedRunEdit.editingAttachments}
3773 - onRemoveEditingQueuedAttachment={
3774 - queuedRunEdit.removeEditingAttachment
3775 - }
3776 - />
3777 - )}
3778 - </div>
3779 - </ComposerSurface.Host>
3780 - <div className="min-h-0">
3781 - <div
3782 - data-terminal-open={terminalUiState.terminalOpen ? "true" : undefined}
3783 - className="relative z-0"
3580 + <div className="relative">
3581 + <ComposerSurface.Shell contextRow={showComposerContextStrip}>
3582 + <ComposerSurface.Host
3583 + inert={queuedRunEdit.isSaving}
3584 + aria-busy={queuedRunEdit.isSaving}
3585 >
3785 - {showComposerContextStrip && (
3786 - <div className="pointer-events-auto">
3787 - <BranchToolbar
3788 - forceNewWorktree={multipleModelSelections !== null}
3789 - ref={branchToolbarRef}
3790 - environmentId={activeThread.environmentId}
3791 - threadId={activeThread.id}
3792 - projectId={activeThread.projectId}
3793 - worktreePath={activeThread.worktreePath}
3794 - isServerThread={isServerThread}
3795 - showGitControls={isGitRepo}
3796 - {...(routeKind === "draft" && draftId ? { draftId } : {})}
3797 - onEnvModeChange={onEnvModeChangeStable}
3798 - startFromOrigin={startFromOrigin}
3799 - onStartFromOriginChange={onStartFromOriginChange}
3800 - envMode={envMode}
3801 - {...(canOverrideServerThreadEnvMode
3802 - ? {
3803 - activeThreadBranchOverride: activeThreadBranch,
3804 - onActiveThreadBranchOverrideChange:
3805 - setPendingServerThreadBranch,
3806 - }
3807 - : {})}
3808 - envLocked={envLocked}
3809 - onComposerFocusRequest={scheduleComposerFocusStable}
3810 - {...(canCheckoutPullRequestIntoThread
3811 - ? { onCheckoutPullRequestRequest: openPullRequestDialogStable }
3812 - : {})}
3813 - {...(canChangeEnvironment
3814 - ? { onEnvironmentChange: onEnvironmentChangeStable }
3815 - : {})}
3816 - autoEnvironmentLabel={autoEnvironmentLabel}
3817 - onAutoEnvironment={
3818 - draftId &&
3819 - !envLocked &&
3820 - canAutoBalanceEnvironments &&
3821 - loadBalancingSettings.loadBalancingEnabled
3822 - ? onAutoEnvironmentStable
3586 + <div className="relative z-10">
3587 + {showProviderSubagentBar ? (
3588 + <ProviderSubagentBar
3589 + provider={selectedProviderEntry ?? null}
3590 + showInstanceBadge={
3591 + selectedProviderEntry !== undefined &&
3592 + shouldShowInstanceBadge(
3593 + selectedProviderEntry,
3594 + providerInstanceEntries,
3595 + )
3596 + }
3597 + modelLabel={providerSubagentModelLabel}
3598 + effortLabel={providerSubagentEffortLabel}
3599 + status={providerSubagentStatus}
3600 + onOpenParent={parentThreadLink?.open ?? null}
3601 + actions={
3602 + selectedProviderEntry?.driverKind === "antigravity" ? (
3603 + <NativeChildWorkDialog
3604 + environmentId={environmentId}
3605 + threadId={threadId}
3606 + />
3607 + ) : null
3608 + }
3609 + />
3610 + ) : null}
3611 + {!composerMounted ? null : (
3612 + <ChatComposer
3613 + canOperateThread={canOperateThread}
3614 + reportedModelSelection={reportedModelSelection}
3615 + multipleModelSelections={multipleModelSelections}
3616 + supportsMultipleModels={
3617 + serverConfig?.environment.capabilities
3618 + .requiredWorktreeBootstrap === true
3619 + }
3620 + onMultipleModelSelectionsChange={setMultipleModelSelectionsStable}
3621 + composerRef={composerRef}
3622 + composerDraftTarget={composerDraftTarget}
3623 + environmentId={environmentId}
3624 + attachmentUploadsCapabilityKnown={attachmentUploadsCapabilityKnown}
3625 + supportsAttachmentUploads={supportsAttachmentUploads}
3626 + supportsQuestionAttachments={supportsQuestionAttachments}
3627 + maxFileAttachmentBytes={maxFileAttachmentBytes}
3628 + routeKind={routeKind}
3629 + routeThreadRef={routeThreadRef}
3630 + draftId={draftId}
3631 + activeThreadId={activeThreadId}
3632 + activeThread={activeThread}
3633 + activeThreadShell={activeThreadShell}
3634 + promptHistoryEntries={timelineEntries}
3635 + forceExpandedOnMobile={
3636 + forceExpandedMobileComposer && isDraftHeroState
3637 + }
3638 + projectSelectionRequired={
3639 + isLocalDraftThread && activeProject === null
3640 + }
3641 + phase={phase}
3642 + isCompacting={isCompacting}
3643 + canInterrupt={canInterruptRunningThread}
3644 + isSendBusy={
3645 + (isSendBusy && !sendQueuesBehindSetup) ||
3646 + (setupQueueSendThreadKey !== null &&
3647 + setupQueueSendThreadKey === activeThreadKey) ||
3648 + queuedRunEdit.isSaving ||
3649 + isResuming
3650 + }
3651 + canResume={resumableRunId !== null || hasHeldQueuedRuns}
3652 + isRevertingCheckpoint={isRevertingCheckpoint}
3653 + sendDisabledReason={
3654 + !canOperateThread
3655 + ? "This connection cannot change threads."
3656 + : isEnvironmentChanging
3657 + ? "Preparing machine"
3658 + : isRevertingCheckpoint
3659 + ? "Rewinding conversation"
3660 + : feedbackUploading
3661 + ? "Sending feedback"
3662 + : threadDetailLoading
3663 + ? "Messages loading"
3664 + : worktreeSetupBlocksSend
3665 + ? "Preparing worktree"
3666 + : projectCloneSendBlockReason
3667 + }
3668 + isPreparingWorktree={isPreparingWorktree && !sendQueuesBehindSetup}
3669 + bannerItems={
3670 + isDraftHeroState || composerBannerItems.length === 0
3671 + ? EMPTY_COMPOSER_BANNER_ITEMS
3672 + : composerBannerItems
3673 + }
3674 + resumeCompactionTokens={resumeCompactionTokens}
3675 + keepFullHistory={keepFullHistory}
3676 + onToggleKeepFullHistory={toggleKeepFullHistoryStable}
3677 + sideChatAvailable={sideChat.available}
3678 + sideChatDisabledReason={sideChatDisabledReason}
3679 + onFreshSession={
3680 + freshSessionCommandAvailable ? armFreshSessionStable : undefined
3681 + }
3682 + onUsageLimitsCommand={
3683 + usageLimitsOffered &&
3684 + usageLimitsKey !== null &&
3685 + !composerHasNonPromptContent
3686 + ? openUsageLimits
3687 : undefined
3688 }
3825 - availableEnvironments={logicalProjectEnvironments}
3826 - {...(isServerThread
3827 - ? {}
3828 - : {
3829 - trailing: (
3830 - <ComposerContextPermissions
3831 - environmentId={environmentId}
3832 - runtimeMode={runtimeMode}
3833 - supportedRuntimeModes={
3834 - activeProviderStatus?.supportedRuntimeModes
3835 - }
3836 - onRuntimeModeChange={handleRuntimeModeChangeStable}
3837 - />
3838 - ),
3839 - })}
3689 + environmentUnavailable={activeEnvironmentUnavailableState}
3690 + activePendingApproval={activePendingApproval}
3691 + pendingApprovals={pendingApprovals}
3692 + onHeldRequestIdsChange={onHeldRequestIdsChange}
3693 + pendingUserInputs={pendingUserInputs}
3694 + activePendingProgress={activePendingProgress}
3695 + activePendingResolvedAnswers={activePendingResolvedAnswers}
3696 + activePendingIsResponding={activePendingIsResponding}
3697 + activePendingDraftAnswers={activePendingDraftAnswers}
3698 + activePendingQuestionIndex={activePendingQuestionIndex}
3699 + respondingRequestIds={respondingRequestIds}
3700 + showPlanFollowUpPrompt={showPlanFollowUpPrompt}
3701 + activeProposedPlan={activeProposedPlan}
3702 + threadSyncPhase={
3703 + activeEnvironmentUnavailable ? null : threadSyncPhase
3704 + }
3705 + runtimeMode={runtimeMode}
3706 + defaultRuntimeMode={defaultRuntimeMode}
3707 + interactionMode={interactionMode}
3708 + lockedProvider={modelPickerLockedProvider}
3709 + providerStatuses={providerStatuses as ServerProvider[]}
3710 + providerCatalogKnown={serverConfig !== null}
3711 + activeProjectDefaultModelSelection={
3712 + activeProjectDefaultModelSelection
3713 + }
3714 + activeThreadModelSelection={activeThread?.modelSelection}
3715 + activeProjectId={activeProject?.id ?? null}
3716 + projectName={activeProject?.title}
3717 + contextWindowEntries={serverVisibleTurnItems}
3718 + contextWindowLiveUsage={activeThreadLiveTokenUsage}
3719 + contextWindowProviderThread={activeProviderThread}
3720 + compactThreadUnavailable={compactThreadUnavailable}
3721 + compactDisabled={compactDisabled}
3722 + compactDisabledReason={compactDisabledReason}
3723 + resolvedTheme={resolvedTheme}
3724 + settings={settings}
3725 + keybindings={keybindings}
3726 + terminalOpen={Boolean(terminalUiState.terminalOpen)}
3727 + gitCwd={gitCwd}
3728 + pullRequestProjectId={
3729 + supportsPullRequests ? (activeProject?.id ?? null) : null
3730 + }
3731 + pullRequestRepository={
3732 + supportsPullRequests ? activeProjectRepository : null
3733 + }
3734 + threadPullRequests={
3735 + (activeThreadShell ?? activeThread)?.pullRequests
3736 + }
3737 + onComposerOverlayHeightChange={publishComposerOverlayHeightStable}
3738 + permissionsShownInStrip={
3739 + showComposerContextStrip && !isServerThread
3740 + }
3741 + promptRef={promptRef}
3742 + composerImagesRef={composerImagesRef}
3743 + composerFilesRef={composerFilesRef}
3744 + composerTerminalContextsRef={composerTerminalContextsRef}
3745 + onPageScrollKeyDown={onComposerPageScrollKeyDownStable}
3746 + onPageScrollKeyUp={onComposerPageScrollKeyUpStable}
3747 + onPageScrollRelease={onComposerPageScrollReleaseStable}
3748 + onCompactContext={onComposerCompactContextStable}
3749 + onSend={onComposerSendStable}
3750 + onResume={onComposerResumeStable}
3751 + onInterrupt={onInterruptStable}
3752 + onImplementPlanInNewThread={onImplementPlanInNewThreadStable}
3753 + onSelectActivePendingUserInputOption={
3754 + onSelectActivePendingUserInputOptionStable
3755 + }
3756 + onAdvanceActivePendingUserInput={
3757 + onAdvanceActivePendingUserInputStable
3758 + }
3759 + onDismissActivePendingUserInput={onDismissUserInputStable}
3760 + onPreviousActivePendingUserInputQuestion={
3761 + onPreviousActivePendingUserInputQuestionStable
3762 + }
3763 + onChangeActivePendingUserInputCustomAnswer={
3764 + onChangeActivePendingUserInputCustomAnswer
3765 + }
3766 + onProviderModelSelect={onProviderModelSelectStable}
3767 + onOpenProviderSetup={openProviderSetupStable}
3768 + getModelDisabledReason={getModelDisabledReason}
3769 + toggleInteractionMode={toggleInteractionModeStable}
3770 + handleRuntimeModeChange={handleRuntimeModeChangeStable}
3771 + handleInteractionModeChange={handleInteractionModeChangeStable}
3772 + focusComposer={focusComposerStable}
3773 + scheduleComposerFocus={scheduleComposerFocusStable}
3774 + setThreadError={setThreadError}
3775 + onExpandImage={onExpandTimelineImageStable}
3776 + onFileOpen={openFileAttachmentStable}
3777 + editingQueuedAttachments={queuedRunEdit.editingAttachments}
3778 + onRemoveEditingQueuedAttachment={
3779 + queuedRunEdit.removeEditingAttachment
3780 + }
3781 />
3841 - </div>
3842 - )}
3782 + )}
3783 + </div>
3784 + </ComposerSurface.Host>
3785 + <div className="min-h-0">
3786 + <div
3787 + data-terminal-open={terminalUiState.terminalOpen ? "true" : undefined}
3788 + className="relative z-0"
3789 + >
3790 + {showComposerContextStrip && (
3791 + <div className="pointer-events-auto">
3792 + <BranchToolbar
3793 + forceNewWorktree={multipleModelSelections !== null}
3794 + ref={branchToolbarRef}
3795 + environmentId={activeThread.environmentId}
3796 + threadId={activeThread.id}
3797 + projectId={activeThread.projectId}
3798 + worktreePath={activeThread.worktreePath}
3799 + isServerThread={isServerThread}
3800 + showGitControls={isGitRepo}
3801 + {...(routeKind === "draft" && draftId ? { draftId } : {})}
3802 + onEnvModeChange={onEnvModeChangeStable}
3803 + startFromOrigin={startFromOrigin}
3804 + onStartFromOriginChange={onStartFromOriginChange}
3805 + envMode={envMode}
3806 + {...(canOverrideServerThreadEnvMode
3807 + ? {
3808 + activeThreadBranchOverride: activeThreadBranch,
3809 + onActiveThreadBranchOverrideChange:
3810 + setPendingServerThreadBranch,
3811 + }
3812 + : {})}
3813 + envLocked={envLocked}
3814 + onComposerFocusRequest={scheduleComposerFocusStable}
3815 + {...(canCheckoutPullRequestIntoThread
3816 + ? { onCheckoutPullRequestRequest: openPullRequestDialogStable }
3817 + : {})}
3818 + {...(canChangeEnvironment
3819 + ? { onEnvironmentChange: onEnvironmentChangeStable }
3820 + : {})}
3821 + autoEnvironmentLabel={autoEnvironmentLabel}
3822 + onAutoEnvironment={
3823 + draftId &&
3824 + !envLocked &&
3825 + canAutoBalanceEnvironments &&
3826 + loadBalancingSettings.loadBalancingEnabled
3827 + ? onAutoEnvironmentStable
3828 + : undefined
3829 + }
3830 + availableEnvironments={logicalProjectEnvironments}
3831 + {...(isServerThread
3832 + ? {}
3833 + : {
3834 + trailing: (
3835 + <ComposerContextPermissions
3836 + environmentId={environmentId}
3837 + runtimeMode={runtimeMode}
3838 + supportedRuntimeModes={
3839 + activeProviderStatus?.supportedRuntimeModes
3840 + }
3841 + onRuntimeModeChange={handleRuntimeModeChangeStable}
3842 + />
3843 + ),
3844 + })}
3845 + />
3846 + </div>
3847 + )}
3848 + </div>
3849 </div>
3844 - </div>
3850 + </ComposerSurface.Shell>
3851 {isDraftHeroState && composerBannerItems.length > 0 ? (
3852 // Out of flow, like the headline, so a notice never moves the centered composer.
3847 - <div className="absolute inset-x-0 top-full flex flex-col gap-1 pt-4">
3853 + // Short windows pin the composer to the bottom, where an out-of-flow notice
3854 + // would fall off-screen, so there it takes space and lifts the composer.
3855 + <div className="absolute inset-x-0 top-full flex flex-col gap-1 pt-4 [@media(max-height:34rem)]:static">
3856 <ComposerBannerStack items={composerBannerItems} detached />
3857 </div>
3858 ) : null}
3851 - </ComposerSurface.Shell>
3859 + </div>
3860 <div
3861 aria-hidden
3862 className="h-[calc(env(safe-area-inset-bottom)+1rem)] sm:h-[calc(env(safe-area-inset-bottom)+1.25rem)]"
apps/web/src/components/chat/DraftHeroProjectHeading.tsx
+4 -2
@@ -46,14 +46,16 @@ export function DraftHeroProjectHeading({
46 </span>
47 </span>
48 <h1 className="flex w-full flex-col items-center justify-center gap-2 text-center font-normal text-2xl text-foreground tracking-tight sm:text-3xl lg:group-data-[inline=true]/draft-hero:flex-row">
49 - <span className="max-w-full lg:group-data-[inline=true]/draft-hero:shrink-0">
49 + <span className="max-w-full lg:group-data-[inline=true]/draft-hero:shrink-0 [@media(max-height:28rem)]:sr-only">
50 What should we build
51 <span className="lg:group-data-[inline=true]/draft-hero:hidden">?</span>
52 <span className="hidden lg:group-data-[inline=true]/draft-hero:inline"> in</span>
53 </span>
54 <span className="flex min-w-0 max-w-full items-baseline justify-center text-base tracking-normal lg:group-data-[inline=true]/draft-hero:text-3xl lg:group-data-[inline=true]/draft-hero:tracking-tight">
55 <span className="min-w-0">{children}</span>
56 - <span className="hidden shrink-0 lg:group-data-[inline=true]/draft-hero:inline">?</span>
56 + <span className="hidden shrink-0 lg:group-data-[inline=true]/draft-hero:inline [@media(max-height:28rem)]:hidden!">
57 + ?
58 + </span>
59 </span>
60 </h1>
61 </div>
apps/web/src/components/settings/SnoozePresetsSettings.tsx
+5 -5
@@ -339,7 +339,7 @@ function SnoozePresetFields(props: {
339 // misclick on "When" can be undone without retyping it.
340 const [memory, setMemory] = useState<KindMemory>({ minutes: 60, time: "09:00" });
341 return (
342 - <div className="flex items-center gap-2">
342 + <div className="flex min-w-0 flex-wrap items-center gap-2">
343 <Select
344 value={when}
345 items={WHEN_LABELS}
@@ -373,7 +373,7 @@ function SnoozePresetFields(props: {
373 onChange={(minutes) => onChange({ ...preset, minutes })}
374 />
375 ) : (
376 - <>
376 + <div className="flex min-w-0 flex-wrap items-center gap-2">
377 <span className="text-xs text-muted-foreground">at</span>
378 <Input
379 nativeInput
@@ -388,7 +388,7 @@ function SnoozePresetFields(props: {
388 }
389 }}
390 />
391 - </>
391 + </div>
392 )}
393 </div>
394 );
@@ -410,7 +410,7 @@ function DurationFields(props: { minutes: number; onChange: (minutes: number) =>
410 setDraft(amount);
411 }
412 return (
413 - <>
413 + <div className="flex min-w-0 flex-wrap items-center gap-2">
414 <NumberField
415 size="sm"
416 className="w-32"
@@ -465,6 +465,6 @@ function DurationFields(props: { minutes: number; onChange: (minutes: number) =>
465 ))}
466 </SelectPopup>
467 </Select>
468 - </>
468 + </div>
469 );
470 }
apps/web/src/components/settings/TypographySettings.tsx
+2 -2
@@ -493,8 +493,8 @@ function FontFamilySettingsRow({
493 />
494 );
495 const control = (
496 - <div className="flex w-full items-center gap-2 sm:w-auto">
497 - <div className="min-w-0 flex-1 sm:w-44 sm:flex-none">{familyControl}</div>
496 + <div className="flex w-full flex-wrap items-center gap-2 sm:w-auto @min-[32rem]/settings-row:flex-nowrap">
497 + <div className="min-w-36 flex-1 sm:w-44 sm:flex-none">{familyControl}</div>
498 <Select
499 value={String(size.value)}
500 onValueChange={(next) => {
apps/web/src/components/ui/command.tsx
+8 -1
@@ -3,6 +3,7 @@ import { SearchIcon } from "lucide-react";
3 import { useRef } from "react";
4 import type * as React from "react";
5 import { cn } from "~/lib/utils";
6 +import { useNativeTitlebarHeight } from "~/lib/windowControlsOverlay";
7 import {
8 Autocomplete,
9 AutocompleteCollection,
@@ -36,13 +37,19 @@ function CommandDialogBackdrop({ className, ...props }: CommandDialogPrimitive.B
37 }
38
39 function CommandDialogViewport({ className, ...props }: CommandDialogPrimitive.Viewport.Props) {
40 + // Short desktop windows would put the search field under the native window controls.
41 + const nativeTitlebarHeight = useNativeTitlebarHeight();
42 + const titlebarStyle = {
43 + "--command-titlebar-height": `${nativeTitlebarHeight}px`,
44 + } as React.CSSProperties;
45 return (
46 <CommandDialogPrimitive.Viewport
47 className={cn(
42 - "pointer-events-none fixed inset-0 z-50 flex flex-col items-center px-4 py-[max(--spacing(4),4vh)] sm:py-[10vh]",
48 + "pointer-events-none fixed inset-0 z-50 flex flex-col items-center px-4 pt-[max(--spacing(4),4vh,calc(var(--command-titlebar-height)+--spacing(2)))] pb-[max(--spacing(4),4vh)] sm:pt-[max(10vh,calc(var(--command-titlebar-height)+--spacing(2)))] sm:pb-[10vh]",
49 className,
50 )}
51 data-slot="command-dialog-viewport"
52 + style={titlebarStyle}
53 {...props}
54 />
55 );