feat: align mini chat draft layout
Centers the welcome prompt in mini chat drafts Keeps the mini chat composer at the bottom Preserves the standard desktop draft layout
This commit is contained in:
@@ -15,6 +15,7 @@ import { useChatAutoFollow, type AnimationHandlers, type ContentChangeReason } f
|
|||||||
import { useChatTimelineController } from './hooks/useChatTimelineController';
|
import { useChatTimelineController } from './hooks/useChatTimelineController';
|
||||||
import { TimelineDialog } from './TimelineDialog';
|
import { TimelineDialog } from './TimelineDialog';
|
||||||
import { useChatTurnNavigation } from './hooks/useChatTurnNavigation';
|
import { useChatTurnNavigation } from './hooks/useChatTurnNavigation';
|
||||||
|
import { useChatSurfaceMode } from './useChatSurfaceMode';
|
||||||
import { useDeviceInfo } from '@/lib/device';
|
import { useDeviceInfo } from '@/lib/device';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { OverlayScrollbar } from '@/components/ui/OverlayScrollbar';
|
import { OverlayScrollbar } from '@/components/ui/OverlayScrollbar';
|
||||||
@@ -529,9 +530,10 @@ export const ChatContainer: React.FC<ChatContainerProps> = ({ autoOpenDraft = tr
|
|||||||
|
|
||||||
const { isMobile } = useDeviceInfo();
|
const { isMobile } = useDeviceInfo();
|
||||||
const isVSCode = isVSCodeRuntime();
|
const isVSCode = isVSCodeRuntime();
|
||||||
|
const chatSurfaceMode = useChatSurfaceMode();
|
||||||
const draftOpen = Boolean(newSessionDraft?.open);
|
const draftOpen = Boolean(newSessionDraft?.open);
|
||||||
const isDesktopExpandedInput = isExpandedInput && !isMobile;
|
const isDesktopExpandedInput = isExpandedInput && !isMobile;
|
||||||
const useCompactDraftLayout = isMobile || isVSCode;
|
const useCompactDraftLayout = isMobile || isVSCode || chatSurfaceMode === 'mini-chat';
|
||||||
const messageListRef = React.useRef<MessageListHandle | null>(null);
|
const messageListRef = React.useRef<MessageListHandle | null>(null);
|
||||||
const draftProjectLabel = React.useMemo(() => {
|
const draftProjectLabel = React.useMemo(() => {
|
||||||
const selectedProject = newSessionDraft?.selectedProjectId
|
const selectedProject = newSessionDraft?.selectedProjectId
|
||||||
|
|||||||
@@ -3787,7 +3787,7 @@ const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollTo
|
|||||||
)}
|
)}
|
||||||
style={isMobile && inputBarOffset > 0 ? { marginBottom: `${inputBarOffset}px` } : undefined}
|
style={isMobile && inputBarOffset > 0 ? { marginBottom: `${inputBarOffset}px` } : undefined}
|
||||||
>
|
>
|
||||||
{newSessionDraftOpen && !isDesktopExpanded && !isMobile && !isVSCode ? (
|
{newSessionDraftOpen && !isDesktopExpanded && !isMobile && !isVSCode && !isMiniChatSurface ? (
|
||||||
<div className="chat-input-column mb-7 text-center">
|
<div className="chat-input-column mb-7 text-center">
|
||||||
<h1 className="text-balance text-2xl font-medium tracking-tight text-foreground md:text-3xl">
|
<h1 className="text-balance text-2xl font-medium tracking-tight text-foreground md:text-3xl">
|
||||||
{draftProjectLabel
|
{draftProjectLabel
|
||||||
|
|||||||
Reference in New Issue
Block a user