Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
fix: Web Studio playground mobile fullscreen actions (#2766)
Zayn Jarvisf6732b7dd5d3
diff --git a/docs/images/pr-2766/webstudio-mobile-agent-fullscreen.png b/docs/images/pr-2766/webstudio-mobile-agent-fullscreen.pngnew file mode 100644index 000000000..b242f1d2cBinary files /dev/null and b/docs/images/pr-2766/webstudio-mobile-agent-fullscreen.png differdiff --git a/docs/images/pr-2766/webstudio-mobile-default.png b/docs/images/pr-2766/webstudio-mobile-default.pngnew file mode 100644index 000000000..dd7c8a910Binary files /dev/null and b/docs/images/pr-2766/webstudio-mobile-default.png differdiff --git a/docs/images/pr-2766/webstudio-mobile-terminal-fullscreen.png b/docs/images/pr-2766/webstudio-mobile-terminal-fullscreen.pngnew file mode 100644index 000000000..c019652c2Binary files /dev/null and b/docs/images/pr-2766/webstudio-mobile-terminal-fullscreen.png differdiff --git a/web-studio/src/routes/playground/route.tsx b/web-studio/src/routes/playground/route.tsxindex 4644d8071..0a7bc4c74 100644--- a/web-studio/src/routes/playground/route.tsx+++ b/web-studio/src/routes/playground/route.tsx@@ -2,7 +2,12 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import type { CSSProperties, PointerEvent as ReactPointerEvent } from 'react'import { createFileRoute, useNavigate } from '@tanstack/react-router'import { useTranslation } from 'react-i18next'-import { BotIcon, ClipboardIcon, TerminalIcon } from 'lucide-react'+import {+ ArrowLeftIcon,+ BotIcon,+ ClipboardIcon,+ TerminalIcon,+} from 'lucide-react'import { toast } from 'sonner'import { Button } from '#/components/ui/button'@@ -51,7 +56,11 @@ import {PLAYGROUND_RIGHT_WIDTH,PLAYGROUND_RIGHT_WIDTH_STORAGE_KEY,} from './-lib/constants'-import type { PlaygroundPanel, PlaygroundSearch } from './-lib/types'+import type {+ PlaygroundPanel,+ PlaygroundSearch,+ ResourceOpenHandler,+} from './-lib/types'import {clampNumber,cleanVikingUri,@@ -88,7 +97,7 @@ function PlaygroundRoute() {}function PlaygroundWorkbench() {- const { t } = useTranslation('playground')+ const { t } = useTranslation(['playground', 'resources'])const search = Route.useSearch()const navigate = useNavigate({ from: Route.fullPath })const initialCurrentUri = useMemo(@@ -111,6 +120,8 @@ function PlaygroundWorkbench() {const [activePanel, setActivePanel] = useState<PlaygroundPanel>(search.panel ?? 'agent',)+ const [actionPanelOpen, setActionPanelOpen] = useState(false)+ const isCompactLayout = useIsCompactPlaygroundLayout()const [uploadDialogOpen, setUploadDialogOpen] = useState(() => search.upload ?? false,)@@ -315,6 +326,14 @@ function PlaygroundWorkbench() {[syncSearch],)+ const handleOpenActionPanel = useCallback(+ (panel: PlaygroundPanel) => {+ handlePanelChange(panel)+ setActionPanelOpen(true)+ },+ [handlePanelChange],+ )+const handleOpenProcessingTasks = useCallback(() => {setTaskDialogOpen(true)void refreshTasks()@@ -464,7 +483,7 @@ function PlaygroundWorkbench() {className="flex min-h-0 flex-1 flex-col bg-background lg:flex-row"style={layoutStyle}>- <aside className="flex min-h-[260px] min-w-0 flex-col border-b bg-muted/20 lg:min-h-0 lg:w-[var(--playground-left-width)] lg:min-w-[var(--playground-left-width)] lg:border-b-0">+ <aside className="flex min-h-[180px] min-w-0 shrink-0 basis-[36%] flex-col border-b bg-muted/20 lg:min-h-0 lg:w-[var(--playground-left-width)] lg:min-w-[var(--playground-left-width)] lg:basis-auto lg:border-b-0"><ContextExplorerHeaderactiveTaskCount={activeTaskCount}hasActiveTasks={hasActiveTasks}@@ -498,7 +517,7 @@ function PlaygroundWorkbench() {onPointerDown={(event) => handleResizeStart('context', event)}/>- <main className="flex min-h-[420px] min-w-0 flex-1 flex-col border-b lg:min-h-0 lg:border-b-0">+ <main className="flex min-h-0 min-w-0 flex-1 flex-col lg:border-b-0"><div className="flex min-h-14 items-center gap-3 border-b px-4"><buttontype="button"@@ -525,6 +544,28 @@ function PlaygroundWorkbench() {><ClipboardIcon className="size-4" /></Button>+ <div className="flex shrink-0 items-center gap-1 lg:hidden">+ <Button+ type="button"+ size="icon-sm"+ variant={activePanel === 'terminal' ? 'secondary' : 'ghost'}+ title={t('tabs.terminal')}+ aria-label={t('tabs.terminal')}+ onClick={() => handleOpenActionPanel('terminal')}+ >+ <TerminalIcon className="size-4" />+ </Button>+ <Button+ type="button"+ size="icon-sm"+ variant={activePanel === 'agent' ? 'secondary' : 'ghost'}+ title={t('tabs.agent')}+ aria-label={t('tabs.agent')}+ onClick={() => handleOpenActionPanel('agent')}+ >+ <BotIcon className="size-4" />+ </Button>+ </div></div><div className="min-h-0 flex-1"><FilePreview@@ -541,48 +582,41 @@ function PlaygroundWorkbench() {onPointerDown={(event) => handleResizeStart('action', event)}/>- <aside className="flex min-h-[460px] min-w-0 flex-col bg-muted/15 lg:min-h-0 lg:w-[var(--playground-right-width)] lg:min-w-[var(--playground-right-width)]">- <div className="flex h-14 items-center border-b px-3">- <div className="inline-flex rounded-lg border bg-background p-1">- <PanelTab- active={activePanel === 'terminal'}- icon={TerminalIcon}- label={t('tabs.terminal')}- onClick={() => handlePanelChange('terminal')}- />- <PanelTab- active={activePanel === 'agent'}- icon={BotIcon}- label={t('tabs.agent')}- onClick={() => handlePanelChange('agent')}- />- </div>- </div>-- {activePanel === 'terminal' ? (- <TerminalPanel+ {!isCompactLayout ? (+ <aside className="hidden min-h-0 min-w-0 flex-col bg-muted/15 lg:flex lg:w-[var(--playground-right-width)] lg:min-w-[var(--playground-right-width)]">+ <PlaygroundActionPanel+ activePanel={activePanel}currentUri={currentUri}entries={entries}onOpenAddResource={() => setUploadDialogOpen(true)}onOpenResource={revealResource}+ onPanelChange={handlePanelChange}onSessionChange={(sessionId) =>syncSearch({ session: sessionId })}openingUri={openingUri}sessionId={search.session}/>- ) : (- <AgentPanel- initialSessionId={search.session}- onOpenResource={revealResource}- onSessionChange={(sessionId) =>- syncSearch({ session: sessionId })- }- />- )}- </aside>+ </aside>+ ) : null}</div>+ {isCompactLayout ? (+ <PlaygroundMobileActionScreen+ activePanel={activePanel}+ currentUri={currentUri}+ entries={entries}+ onClose={() => setActionPanelOpen(false)}+ onOpenAddResource={() => setUploadDialogOpen(true)}+ onOpenResource={revealResource}+ onPanelChange={handlePanelChange}+ onSessionChange={(sessionId) => syncSearch({ session: sessionId })}+ open={actionPanelOpen}+ openingUri={openingUri}+ sessionId={search.session}+ />+ ) : null}+<Dialogopen={uploadDialogOpen}onOpenChange={handleUploadDialogOpenChange}@@ -622,3 +656,204 @@ function PlaygroundWorkbench() {</div>)}++function useIsCompactPlaygroundLayout() {+ const [isCompact, setIsCompact] = useState(() =>+ typeof window !== 'undefined' && typeof window.matchMedia === 'function'+ ? window.matchMedia('(max-width: 1023px)').matches+ : false,+ )++ useEffect(() => {+ if (typeof window.matchMedia !== 'function') {+ return+ }+ const mql = window.matchMedia('(max-width: 1023px)')+ const onChange = () => setIsCompact(mql.matches)+ onChange()+ mql.addEventListener('change', onChange)+ return () => mql.removeEventListener('change', onChange)+ }, [])++ return isCompact+}++function PlaygroundActionPanel({+ activePanel,+ currentUri,+ entries,+ onOpenAddResource,+ onOpenResource,+ onPanelChange,+ onSessionChange,+ openingUri,+ sessionId,+}: {+ activePanel: PlaygroundPanel+ currentUri: string+ entries: VikingFsEntry[]+ onOpenAddResource: () => void+ onOpenResource: ResourceOpenHandler+ onPanelChange: (panel: PlaygroundPanel) => void+ onSessionChange: (sessionId: string) => void+ openingUri: string | null+ sessionId?: string+}) {+ const { t } = useTranslation('playground')++ return (+ <div className="flex h-full min-h-0 flex-col">+ <div className="flex h-14 shrink-0 items-center border-b px-3">+ <PlaygroundActionTabs+ activePanel={activePanel}+ onPanelChange={onPanelChange}+ />+ </div>++ <PlaygroundActionContent+ activePanel={activePanel}+ currentUri={currentUri}+ entries={entries}+ onOpenAddResource={onOpenAddResource}+ onOpenResource={onOpenResource}+ onSessionChange={onSessionChange}+ openingUri={openingUri}+ sessionId={sessionId}+ />+ </div>+ )+}++function PlaygroundMobileActionScreen({+ activePanel,+ currentUri,+ entries,+ onClose,+ onOpenAddResource,+ onOpenResource,+ onPanelChange,+ onSessionChange,+ open,+ openingUri,+ sessionId,+}: {+ activePanel: PlaygroundPanel+ currentUri: string+ entries: VikingFsEntry[]+ onClose: () => void+ onOpenAddResource: () => void+ onOpenResource: ResourceOpenHandler+ onPanelChange: (panel: PlaygroundPanel) => void+ onSessionChange: (sessionId: string) => void+ open: boolean+ openingUri: string | null+ sessionId?: string+}) {+ const { t } = useTranslation(['playground', 'resources'])++ if (!open) {+ return null+ }++ return (+ <div className="fixed inset-0 z-50 flex min-h-0 flex-col bg-background lg:hidden">+ <div className="flex h-14 shrink-0 items-center gap-2 border-b bg-background px-3">+ <Button+ type="button"+ size="icon-sm"+ variant="ghost"+ title={t('dirBrowser.back', { ns: 'resources' })}+ aria-label={t('dirBrowser.back', { ns: 'resources' })}+ onClick={onClose}+ >+ <ArrowLeftIcon className="size-4" />+ </Button>+ <PlaygroundActionTabs+ activePanel={activePanel}+ onPanelChange={onPanelChange}+ />+ </div>+ <div className="min-h-0 flex-1">+ <PlaygroundActionContent+ activePanel={activePanel}+ currentUri={currentUri}+ entries={entries}+ onOpenAddResource={onOpenAddResource}+ onOpenResource={onOpenResource}+ onSessionChange={onSessionChange}+ openingUri={openingUri}+ sessionId={sessionId}+ />+ </div>+ </div>+ )+}++function PlaygroundActionTabs({+ activePanel,+ onPanelChange,+}: {+ activePanel: PlaygroundPanel+ onPanelChange: (panel: PlaygroundPanel) => void+}) {+ const { t } = useTranslation('playground')++ return (+ <div className="inline-flex rounded-lg border bg-background p-1">+ <PanelTab+ active={activePanel === 'terminal'}+ icon={TerminalIcon}+ label={t('tabs.terminal')}+ onClick={() => onPanelChange('terminal')}+ />+ <PanelTab+ active={activePanel === 'agent'}+ icon={BotIcon}+ label={t('tabs.agent')}+ onClick={() => onPanelChange('agent')}+ />+ </div>+ )+}++function PlaygroundActionContent({+ activePanel,+ currentUri,+ entries,+ onOpenAddResource,+ onOpenResource,+ onSessionChange,+ openingUri,+ sessionId,+}: {+ activePanel: PlaygroundPanel+ currentUri: string+ entries: VikingFsEntry[]+ onOpenAddResource: () => void+ onOpenResource: ResourceOpenHandler+ onSessionChange: (sessionId: string) => void+ openingUri: string | null+ sessionId?: string+}) {+ return (+ <div className="flex h-full min-h-0 flex-col">+ {activePanel === 'terminal' ? (+ <TerminalPanel+ currentUri={currentUri}+ entries={entries}+ onOpenAddResource={onOpenAddResource}+ onOpenResource={onOpenResource}+ onSessionChange={onSessionChange}+ openingUri={openingUri}+ sessionId={sessionId}+ />+ ) : (+ <AgentPanel+ initialSessionId={sessionId}+ onOpenResource={onOpenResource}+ onSessionChange={onSessionChange}+ />+ )}+ </div>+ )+}