diff --git a/apps/web/src/components/ComposerPromptEditor.tsx b/apps/web/src/components/ComposerPromptEditor.tsx index f889b8f6ec8..d56cb448795 100644 --- a/apps/web/src/components/ComposerPromptEditor.tsx +++ b/apps/web/src/components/ComposerPromptEditor.tsx @@ -1490,10 +1490,22 @@ function ComposerPromptEditorInner({ const rootElement = editor.getRootElement(); if (!rootElement) return; const boundedCursor = clampCollapsedComposerCursor(snapshotRef.current.value, nextCursor); - rootElement.focus(); + const scrollX = window.scrollX; + const scrollY = window.scrollY; + const restoreScroll = () => { + if (window.scrollX !== scrollX || window.scrollY !== scrollY) { + window.scrollTo(scrollX, scrollY); + } + }; + rootElement.focus({ preventScroll: true }); editor.update(() => { $setSelectionAtComposerOffset(boundedCursor); }); + restoreScroll(); + requestAnimationFrame(() => { + restoreScroll(); + requestAnimationFrame(restoreScroll); + }); snapshotRef.current = { value: snapshotRef.current.value, cursor: boundedCursor, diff --git a/apps/web/src/components/NoActiveThreadState.tsx b/apps/web/src/components/NoActiveThreadState.tsx index cd1f76ed2c2..c3e5ff0e054 100644 --- a/apps/web/src/components/NoActiveThreadState.tsx +++ b/apps/web/src/components/NoActiveThreadState.tsx @@ -5,7 +5,7 @@ import { cn } from "~/lib/utils"; export function NoActiveThreadState() { return ( - +
)} - - + + {project.displayName} {project.groupedProjectCount > 1 ? ( @@ -2006,7 +2009,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec ? "Remote project" : "Available in multiple environments" } - className="pointer-events-none absolute top-1 right-1.5 inline-flex size-5 items-center justify-center rounded-md text-muted-foreground/50 transition-opacity duration-150 group-hover/project-header:opacity-0 group-focus-within/project-header:opacity-0" + className="pointer-events-none absolute top-1 right-1.5 inline-flex size-5 items-center justify-center rounded-md text-muted-foreground/50 transition-opacity duration-150 pointer-coarse:opacity-0 group-hover/project-header:opacity-0 group-focus-within/project-header:opacity-0" /> } > @@ -2020,7 +2023,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec +
- ) : null} + )}
{composerMenuOpen && !isComposerApprovalState && ( @@ -1876,7 +1992,8 @@ export const ChatComposer = memo(
)} - {!isComposerApprovalState && + {!isComposerCollapsedMobile && + !isComposerApprovalState && pendingUserInputs.length === 0 && composerImages.length > 0 && (
@@ -1979,7 +2096,7 @@ export const ChatComposer = memo(
{/* Bottom toolbar */} - {activePendingApproval ? ( + {isComposerCollapsedMobile ? null : activePendingApproval ? (
e.preventDefault()} disabled={ pendingAction.isResponding || (pendingAction.isLastQuestion ? !pendingAction.isComplete : !pendingAction.canAdvance) @@ -128,6 +129,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({ type="submit" size="sm" className={cn("rounded-full", compact ? "h-9 px-3 sm:h-8" : "h-9 px-4 sm:h-8")} + onPointerDown={(e) => e.preventDefault()} disabled={isSendBusy || isConnecting} > {isConnecting || isSendBusy ? "Sending..." : "Refine"} @@ -141,6 +143,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({ type="submit" size="sm" className="h-9 rounded-l-full rounded-r-none px-4 sm:h-8" + onPointerDown={(e) => e.preventDefault()} disabled={isSendBusy || isConnecting} > {isConnecting || isSendBusy ? "Sending..." : "Implement"} @@ -176,6 +179,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({