feat: enhance workspace toggle and mobile topbar
This commit is contained in:
parent
8655e64ed7
commit
4563fad2d9
1
static/icons/layers.svg
Normal file
1
static/icons/layers.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="48" height="48" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="opacity:1;"><path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"/><path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"/><path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"/></svg>
|
||||||
|
After Width: | Height: | Size: 491 B |
@ -50,26 +50,41 @@
|
|||||||
@personal="openPersonalPage"
|
@personal="openPersonalPage"
|
||||||
@delete="deleteConversation"
|
@delete="deleteConversation"
|
||||||
@duplicate="duplicateConversation"
|
@duplicate="duplicateConversation"
|
||||||
|
@toggle-workspace="handleWorkspaceToggle"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LeftPanel
|
<div v-if="!isMobileViewport" class="workspace-region">
|
||||||
v-if="!isMobileViewport"
|
<LeftPanel
|
||||||
ref="leftPanel"
|
ref="leftPanel"
|
||||||
:width="leftWidth"
|
class="workspace-panel"
|
||||||
:icon-style="iconStyle"
|
:class="{ 'workspace-panel--collapsed': workspaceCollapsed }"
|
||||||
:agent-version="agentVersion"
|
:width="leftWidth"
|
||||||
:thinking-mode="thinkingMode"
|
:collapsed="workspaceCollapsed"
|
||||||
:is-connected="isConnected"
|
:icon-style="iconStyle"
|
||||||
:panel-menu-open="panelMenuOpen"
|
:agent-version="agentVersion"
|
||||||
:panel-mode="panelMode"
|
:thinking-mode="thinkingMode"
|
||||||
@toggle-panel-menu="togglePanelMenu"
|
:is-connected="isConnected"
|
||||||
@select-panel="selectPanelMode"
|
:panel-menu-open="panelMenuOpen"
|
||||||
@open-file-manager="openGuiFileManager"
|
:panel-mode="panelMode"
|
||||||
/>
|
@toggle-panel-menu="togglePanelMenu"
|
||||||
|
@select-panel="selectPanelMode"
|
||||||
|
@open-file-manager="openGuiFileManager"
|
||||||
|
/>
|
||||||
|
|
||||||
<div v-if="!isMobileViewport" class="resize-handle" @mousedown="startResize('left', $event)"></div>
|
<div
|
||||||
|
v-if="!workspaceCollapsed"
|
||||||
|
class="resize-handle"
|
||||||
|
@mousedown="startResize('left', $event)"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main class="chat-container">
|
<main
|
||||||
|
class="chat-container"
|
||||||
|
:class="{
|
||||||
|
'chat-container--immersive': workspaceCollapsed,
|
||||||
|
'chat-container--mobile': isMobileViewport
|
||||||
|
}"
|
||||||
|
>
|
||||||
<TokenDrawer
|
<TokenDrawer
|
||||||
:visible="Boolean(currentConversationId)"
|
:visible="Boolean(currentConversationId)"
|
||||||
:collapsed="tokenPanelCollapsed"
|
:collapsed="tokenPanelCollapsed"
|
||||||
@ -180,9 +195,14 @@
|
|||||||
:class="{ 'is-hidden': Boolean(activeMobileOverlay) }"
|
:class="{ 'is-hidden': Boolean(activeMobileOverlay) }"
|
||||||
ref="mobilePanelTrigger"
|
ref="mobilePanelTrigger"
|
||||||
>
|
>
|
||||||
<button type="button" class="mobile-panel-fab" aria-label="打开更多工作区面板" @click="toggleMobileOverlayMenu">
|
<div class="mobile-panel-topbar">
|
||||||
<img :src="mobilePanelIcon" alt="" aria-hidden="true" />
|
<button type="button" class="mobile-panel-fab" aria-label="切换工作区" @click="toggleMobileOverlayMenu">
|
||||||
</button>
|
<img :src="mobilePanelIcon" alt="" aria-hidden="true" />
|
||||||
|
</button>
|
||||||
|
<div class="mobile-topbar-title" :title="currentConversationTitle || '未命名对话'">
|
||||||
|
{{ currentConversationTitle || '未命名对话' }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<transition name="mobile-panel-menu">
|
<transition name="mobile-panel-menu">
|
||||||
<div v-if="mobileOverlayMenuOpen" class="mobile-panel-menu">
|
<div v-if="mobileOverlayMenuOpen" class="mobile-panel-menu">
|
||||||
<button
|
<button
|
||||||
@ -230,7 +250,7 @@
|
|||||||
:format-time="formatTime"
|
:format-time="formatTime"
|
||||||
:show-collapse-button="true"
|
:show-collapse-button="true"
|
||||||
collapse-button-variant="close"
|
collapse-button-variant="close"
|
||||||
@toggle="toggleSidebar"
|
@toggle="closeMobileOverlay"
|
||||||
@create="createNewConversation"
|
@create="createNewConversation"
|
||||||
@search="handleSidebarSearch"
|
@search="handleSidebarSearch"
|
||||||
@select="handleMobileOverlaySelect($event)"
|
@select="handleMobileOverlaySelect($event)"
|
||||||
|
|||||||
@ -196,6 +196,7 @@ const appOptions = {
|
|||||||
...mapState(useFileStore, ['contextMenu', 'fileTree', 'expandedFolders', 'todoList']),
|
...mapState(useFileStore, ['contextMenu', 'fileTree', 'expandedFolders', 'todoList']),
|
||||||
...mapWritableState(useUiStore, [
|
...mapWritableState(useUiStore, [
|
||||||
'sidebarCollapsed',
|
'sidebarCollapsed',
|
||||||
|
'workspaceCollapsed',
|
||||||
'panelMode',
|
'panelMode',
|
||||||
'panelMenuOpen',
|
'panelMenuOpen',
|
||||||
'leftWidth',
|
'leftWidth',
|
||||||
@ -398,6 +399,16 @@ const appOptions = {
|
|||||||
}
|
}
|
||||||
this.uiSetMobileOverlayMenuOpen(false);
|
this.uiSetMobileOverlayMenuOpen(false);
|
||||||
},
|
},
|
||||||
|
handleWorkspaceToggle() {
|
||||||
|
if (this.isMobileViewport) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const nextState = !this.workspaceCollapsed;
|
||||||
|
this.uiSetWorkspaceCollapsed(nextState);
|
||||||
|
if (nextState) {
|
||||||
|
this.uiSetPanelMenuOpen(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
handleMobileOverlayEscape(event) {
|
handleMobileOverlayEscape(event) {
|
||||||
if (event.key !== 'Escape' || !this.isMobileViewport) {
|
if (event.key !== 'Escape' || !this.isMobileViewport) {
|
||||||
return;
|
return;
|
||||||
@ -413,6 +424,8 @@ const appOptions = {
|
|||||||
...mapActions(useUiStore, {
|
...mapActions(useUiStore, {
|
||||||
uiToggleSidebar: 'toggleSidebar',
|
uiToggleSidebar: 'toggleSidebar',
|
||||||
uiSetSidebarCollapsed: 'setSidebarCollapsed',
|
uiSetSidebarCollapsed: 'setSidebarCollapsed',
|
||||||
|
uiSetWorkspaceCollapsed: 'setWorkspaceCollapsed',
|
||||||
|
uiToggleWorkspaceCollapsed: 'toggleWorkspaceCollapsed',
|
||||||
uiSetPanelMode: 'setPanelMode',
|
uiSetPanelMode: 'setPanelMode',
|
||||||
uiSetPanelMenuOpen: 'setPanelMenuOpen',
|
uiSetPanelMenuOpen: 'setPanelMenuOpen',
|
||||||
uiTogglePanelMenu: 'togglePanelMenu',
|
uiTogglePanelMenu: 'togglePanelMenu',
|
||||||
|
|||||||
@ -1,161 +1,158 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="messages-area" ref="rootEl">
|
<div class="messages-area" ref="rootEl">
|
||||||
<div v-for="(msg, index) in messages" :key="index" class="message-block">
|
<div class="messages-flow">
|
||||||
<div v-if="msg.role === 'user'" class="user-message">
|
<div v-for="(msg, index) in messages" :key="index" class="message-block">
|
||||||
<div class="message-header icon-label">
|
<div v-if="msg.role === 'user'" class="user-message">
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('user')" aria-hidden="true"></span>
|
<div class="message-header icon-label">
|
||||||
<span>用户</span>
|
<span class="icon icon-sm" :style="iconStyleSafe('user')" aria-hidden="true"></span>
|
||||||
|
<span>用户</span>
|
||||||
|
</div>
|
||||||
|
<div class="message-text">{{ msg.content }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="message-text">{{ msg.content }}</div>
|
<div v-else-if="msg.role === 'assistant'" class="assistant-message">
|
||||||
</div>
|
<div class="message-header icon-label">
|
||||||
<div v-else-if="msg.role === 'assistant'" class="assistant-message">
|
<span class="icon icon-sm" :style="iconStyleSafe('bot')" aria-hidden="true"></span>
|
||||||
<div class="message-header icon-label">
|
<span>AI Assistant</span>
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('bot')" aria-hidden="true"></span>
|
</div>
|
||||||
<span>AI Assistant</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-for="(action, actionIndex) in msg.actions || []"
|
|
||||||
:key="action.id || `${index}-${actionIndex}`"
|
|
||||||
class="action-item"
|
|
||||||
:class="{
|
|
||||||
'streaming-content': action.streaming,
|
|
||||||
'completed-tool': action.type === 'tool' && !action.streaming,
|
|
||||||
'immediate-show': action.streaming || action.type === 'text'
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
v-if="action.type === 'thinking'"
|
v-for="(action, actionIndex) in msg.actions || []"
|
||||||
class="collapsible-block thinking-block"
|
:key="action.id || `${index}-${actionIndex}`"
|
||||||
|
class="action-item"
|
||||||
:class="{
|
:class="{
|
||||||
expanded: expandedBlocks?.has(action.blockId || `${index}-thinking-${actionIndex}`)
|
'streaming-content': action.streaming,
|
||||||
|
'completed-tool': action.type === 'tool' && !action.streaming,
|
||||||
|
'immediate-show': action.streaming || action.type === 'text'
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="collapsible-header"
|
v-if="action.type === 'thinking'"
|
||||||
@click="toggleBlock(action.blockId || `${index}-thinking-${actionIndex}`)"
|
class="collapsible-block thinking-block"
|
||||||
|
:class="{ expanded: expandedBlocks?.has(action.blockId || `${index}-thinking-${actionIndex}`) }"
|
||||||
>
|
>
|
||||||
<div class="arrow"></div>
|
<div class="collapsible-header" @click="toggleBlock(action.blockId || `${index}-thinking-${actionIndex}`)">
|
||||||
<div class="status-icon">
|
<div class="arrow"></div>
|
||||||
<span class="thinking-icon" :class="{ 'thinking-animation': action.streaming }">
|
<div class="status-icon">
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('brain')" aria-hidden="true"></span>
|
<span class="thinking-icon" :class="{ 'thinking-animation': action.streaming }">
|
||||||
</span>
|
<span class="icon icon-sm" :style="iconStyleSafe('brain')" aria-hidden="true"></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span class="status-text">{{ action.streaming ? '正在思考...' : '思考过程' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="status-text">{{ action.streaming ? '正在思考...' : '思考过程' }}</span>
|
<div class="collapsible-content">
|
||||||
|
<div
|
||||||
|
class="content-inner thinking-content"
|
||||||
|
:ref="el => registerThinkingRef(action.blockId || `${index}-thinking-${actionIndex}`, el)"
|
||||||
|
@scroll="
|
||||||
|
handleThinkingScroll(
|
||||||
|
action.blockId || `${index}-thinking-${actionIndex}`,
|
||||||
|
$event
|
||||||
|
)
|
||||||
|
"
|
||||||
|
style="max-height: 240px; overflow-y: auto;"
|
||||||
|
>
|
||||||
|
{{ action.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="action.streaming" class="progress-indicator"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="collapsible-content">
|
|
||||||
<div
|
<div v-else-if="action.type === 'text'" class="text-output">
|
||||||
class="content-inner thinking-content"
|
<div class="text-content" :class="{ 'streaming-text': action.streaming }">
|
||||||
:ref="el => registerThinkingRef(action.blockId || `${index}-thinking-${actionIndex}`, el)"
|
<div v-if="action.streaming" v-html="renderMarkdown(action.content, true)"></div>
|
||||||
@scroll="
|
<div v-else v-html="renderMarkdown(action.content, false)"></div>
|
||||||
handleThinkingScroll(
|
</div>
|
||||||
action.blockId || `${index}-thinking-${actionIndex}`,
|
</div>
|
||||||
$event
|
|
||||||
)
|
<div v-else-if="action.type === 'system'" class="system-action">
|
||||||
"
|
<div class="system-action-content">
|
||||||
style="max-height: 240px; overflow-y: auto;"
|
|
||||||
>
|
|
||||||
{{ action.content }}
|
{{ action.content }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="action.streaming" class="progress-indicator"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else-if="action.type === 'text'" class="text-output">
|
<div
|
||||||
<div class="text-content" :class="{ 'streaming-text': action.streaming }">
|
v-else-if="action.type === 'append_payload'"
|
||||||
<div v-if="action.streaming" v-html="renderMarkdown(action.content, true)"></div>
|
class="append-placeholder"
|
||||||
<div v-else v-html="renderMarkdown(action.content, false)"></div>
|
:class="{ 'append-error': action.append?.success === false }"
|
||||||
|
>
|
||||||
|
<div class="append-placeholder-content">
|
||||||
|
<template v-if="action.append?.success !== false">
|
||||||
|
<div class="icon-label append-status">
|
||||||
|
<span class="icon icon-sm" :style="iconStyleSafe('pencil')" aria-hidden="true"></span>
|
||||||
|
<span>已写入 {{ action.append?.path || '目标文件' }} 的追加内容(内容已保存至文件)</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="icon-label append-status append-error-text">
|
||||||
|
<span class="icon icon-sm" :style="iconStyleSafe('x')" aria-hidden="true"></span>
|
||||||
|
<span>向 {{ action.append?.path || '目标文件' }} 写入失败,内容已截获供后续修复。</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="append-meta" v-if="action.append">
|
||||||
|
<span v-if="action.append.lines !== null && action.append.lines !== undefined">
|
||||||
|
· 行数 {{ action.append.lines }}
|
||||||
|
</span>
|
||||||
|
<span v-if="action.append.bytes !== null && action.append.bytes !== undefined">
|
||||||
|
· 字节 {{ action.append.bytes }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="append-warning icon-label" v-if="action.append?.forced">
|
||||||
|
<span class="icon icon-sm" :style="iconStyleSafe('triangleAlert')" aria-hidden="true"></span>
|
||||||
|
<span>未检测到结束标记,请根据提示继续补充。</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else-if="action.type === 'system'" class="system-action">
|
<div
|
||||||
<div class="system-action-content">
|
v-else-if="action.type === 'append'"
|
||||||
{{ action.content }}
|
class="append-placeholder"
|
||||||
</div>
|
:class="{ 'append-error': action.append?.success === false }"
|
||||||
</div>
|
>
|
||||||
|
<div class="append-placeholder-content">
|
||||||
<div
|
|
||||||
v-else-if="action.type === 'append_payload'"
|
|
||||||
class="append-placeholder"
|
|
||||||
:class="{ 'append-error': action.append?.success === false }"
|
|
||||||
>
|
|
||||||
<div class="append-placeholder-content">
|
|
||||||
<template v-if="action.append?.success !== false">
|
|
||||||
<div class="icon-label append-status">
|
<div class="icon-label append-status">
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('pencil')" aria-hidden="true"></span>
|
<span class="icon icon-sm" :style="iconStyleSafe('pencil')" aria-hidden="true"></span>
|
||||||
<span>已写入 {{ action.append?.path || '目标文件' }} 的追加内容(内容已保存至文件)</span>
|
<span>{{ action.append?.summary || '文件追加完成' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<div class="append-meta" v-if="action.append">
|
||||||
<template v-else>
|
<span>{{ action.append.path || '目标文件' }}</span>
|
||||||
<div class="icon-label append-status append-error-text">
|
<span v-if="action.append.lines">· 行数 {{ action.append.lines }}</span>
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('x')" aria-hidden="true"></span>
|
<span v-if="action.append.bytes">· 字节 {{ action.append.bytes }}</span>
|
||||||
<span>向 {{ action.append?.path || '目标文件' }} 写入失败,内容已截获供后续修复。</span>
|
</div>
|
||||||
|
<div class="append-warning icon-label" v-if="action.append?.forced">
|
||||||
|
<span class="icon icon-sm" :style="iconStyleSafe('triangleAlert')" aria-hidden="true"></span>
|
||||||
|
<span>未检测到结束标记,请按提示继续补充。</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
<div class="append-meta" v-if="action.append">
|
|
||||||
<span v-if="action.append.lines !== null && action.append.lines !== undefined">
|
|
||||||
· 行数 {{ action.append.lines }}
|
|
||||||
</span>
|
|
||||||
<span v-if="action.append.bytes !== null && action.append.bytes !== undefined">
|
|
||||||
· 字节 {{ action.append.bytes }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="append-warning icon-label" v-if="action.append?.forced">
|
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('triangleAlert')" aria-hidden="true"></span>
|
|
||||||
<span>未检测到结束标记,请根据提示继续补充。</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
<ToolAction
|
||||||
v-else-if="action.type === 'append'"
|
v-else-if="action.type === 'tool'"
|
||||||
class="append-placeholder"
|
:action="action"
|
||||||
:class="{ 'append-error': action.append?.success === false }"
|
:expanded="expandedBlocks?.has(action.blockId || `${index}-tool-${actionIndex}`)"
|
||||||
>
|
:icon-style="iconStyleSafe"
|
||||||
<div class="append-placeholder-content">
|
:get-tool-animation-class="getToolAnimationClass"
|
||||||
<div class="icon-label append-status">
|
:get-tool-icon="getToolIcon"
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('pencil')" aria-hidden="true"></span>
|
:get-tool-status-text="getToolStatusText"
|
||||||
<span>{{ action.append?.summary || '文件追加完成' }}</span>
|
:get-tool-description="getToolDescription"
|
||||||
</div>
|
:format-search-topic="formatSearchTopic"
|
||||||
<div class="append-meta" v-if="action.append">
|
:format-search-time="formatSearchTime"
|
||||||
<span>{{ action.append.path || '目标文件' }}</span>
|
:streaming-message="streamingMessage"
|
||||||
<span v-if="action.append.lines">· 行数 {{ action.append.lines }}</span>
|
@toggle="toggleBlock(action.blockId || `${index}-tool-${actionIndex}`)"
|
||||||
<span v-if="action.append.bytes">· 字节 {{ action.append.bytes }}</span>
|
/>
|
||||||
</div>
|
|
||||||
<div class="append-warning icon-label" v-if="action.append?.forced">
|
|
||||||
<span class="icon icon-sm" :style="iconStyleSafe('triangleAlert')" aria-hidden="true"></span>
|
|
||||||
<span>未检测到结束标记,请按提示继续补充。</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ToolAction
|
|
||||||
v-else-if="action.type === 'tool'"
|
|
||||||
:action="action"
|
|
||||||
:expanded="expandedBlocks?.has(action.blockId || `${index}-tool-${actionIndex}`)"
|
|
||||||
:icon-style="iconStyleSafe"
|
|
||||||
:get-tool-animation-class="getToolAnimationClass"
|
|
||||||
:get-tool-icon="getToolIcon"
|
|
||||||
:get-tool-status-text="getToolStatusText"
|
|
||||||
:get-tool-description="getToolDescription"
|
|
||||||
:format-search-topic="formatSearchTopic"
|
|
||||||
:format-search-time="formatSearchTime"
|
|
||||||
:streaming-message="streamingMessage"
|
|
||||||
@toggle="toggleBlock(action.blockId || `${index}-tool-${actionIndex}`)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div v-else class="system-message">
|
||||||
<div v-else class="system-message">
|
<div class="collapsible-block system-block" :class="{ expanded: expandedBlocks?.has(`system-${index}`) }">
|
||||||
<div class="collapsible-block system-block" :class="{ expanded: expandedBlocks?.has(`system-${index}`) }">
|
<div class="collapsible-header" @click="toggleBlock(`system-${index}`)">
|
||||||
<div class="collapsible-header" @click="toggleBlock(`system-${index}`)">
|
<div class="arrow"></div>
|
||||||
<div class="arrow"></div>
|
<div class="status-icon">
|
||||||
<div class="status-icon">
|
<span class="tool-icon icon icon-md" :style="iconStyleSafe('info')" aria-hidden="true"></span>
|
||||||
<span class="tool-icon icon icon-md" :style="iconStyleSafe('info')" aria-hidden="true"></span>
|
</div>
|
||||||
|
<span class="status-text">系统消息</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="status-text">系统消息</span>
|
<div class="collapsible-content">
|
||||||
</div>
|
<div class="content-inner">
|
||||||
<div class="collapsible-content">
|
{{ msg.content }}
|
||||||
<div class="content-inner">
|
</div>
|
||||||
{{ msg.content }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<aside class="sidebar left-sidebar" :style="{ width: width + 'px' }">
|
<aside class="sidebar left-sidebar" :style="panelStyle">
|
||||||
<div class="sidebar-status">
|
<div class="sidebar-status">
|
||||||
<div class="compact-status-card">
|
<div class="compact-status-card">
|
||||||
<div class="status-line">
|
<div class="status-line">
|
||||||
@ -122,7 +122,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import FileNode from '@/components/files/FileNode.vue';
|
import FileNode from '@/components/files/FileNode.vue';
|
||||||
import { useFileStore } from '@/stores/file';
|
import { useFileStore } from '@/stores/file';
|
||||||
@ -132,6 +132,7 @@ defineOptions({ name: 'LeftPanel' });
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
width: number;
|
width: number;
|
||||||
|
collapsed?: boolean;
|
||||||
iconStyle: (key: string) => Record<string, string>;
|
iconStyle: (key: string) => Record<string, string>;
|
||||||
agentVersion: string | null;
|
agentVersion: string | null;
|
||||||
thinkingMode: boolean;
|
thinkingMode: boolean;
|
||||||
@ -147,6 +148,19 @@ defineEmits<{
|
|||||||
}>();
|
}>();
|
||||||
|
|
||||||
const panelMenuWrapper = ref<HTMLElement | null>(null);
|
const panelMenuWrapper = ref<HTMLElement | null>(null);
|
||||||
|
const panelStyle = computed(() => {
|
||||||
|
if (props.collapsed) {
|
||||||
|
return {
|
||||||
|
width: '0px',
|
||||||
|
minWidth: '0px'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const px = `${props.width}px`;
|
||||||
|
return {
|
||||||
|
width: px,
|
||||||
|
minWidth: px
|
||||||
|
};
|
||||||
|
});
|
||||||
const fileStore = useFileStore();
|
const fileStore = useFileStore();
|
||||||
const subAgentStore = useSubAgentStore();
|
const subAgentStore = useSubAgentStore();
|
||||||
const { fileTree, expandedFolders, todoList } = storeToRefs(fileStore);
|
const { fileTree, expandedFolders, todoList } = storeToRefs(fileStore);
|
||||||
|
|||||||
@ -73,6 +73,24 @@
|
|||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="collapsed" class="workspace-immersive-toggle" :class="{ collapsed }">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="workspace-immersive-btn"
|
||||||
|
:class="{ active: workspaceCollapsed }"
|
||||||
|
:title="workspaceCollapsed ? '显示工作区' : '隐藏工作区'"
|
||||||
|
@click="$emit('toggle-workspace')"
|
||||||
|
>
|
||||||
|
<span class="sr-only">{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}</span>
|
||||||
|
<span class="workspace-immersive-icon" aria-hidden="true">
|
||||||
|
<img :src="workspaceToggleIcon" alt="" />
|
||||||
|
</span>
|
||||||
|
<span v-if="!collapsed" class="workspace-immersive-label">
|
||||||
|
{{ workspaceCollapsed ? '显示工作区' : '隐藏工作区' }}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<template v-if="!collapsed">
|
<template v-if="!collapsed">
|
||||||
<div class="conversation-search">
|
<div class="conversation-search">
|
||||||
<input
|
<input
|
||||||
@ -186,13 +204,14 @@ defineEmits<{
|
|||||||
(event: 'personal'): void;
|
(event: 'personal'): void;
|
||||||
(event: 'delete', id: string): void;
|
(event: 'delete', id: string): void;
|
||||||
(event: 'duplicate', id: string): void;
|
(event: 'duplicate', id: string): void;
|
||||||
|
(event: 'toggle-workspace'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const uiStore = useUiStore();
|
const uiStore = useUiStore();
|
||||||
const conversationStore = useConversationStore();
|
const conversationStore = useConversationStore();
|
||||||
const personalizationStore = usePersonalizationStore();
|
const personalizationStore = usePersonalizationStore();
|
||||||
|
|
||||||
const { sidebarCollapsed: collapsed } = storeToRefs(uiStore);
|
const { sidebarCollapsed: collapsed, workspaceCollapsed } = storeToRefs(uiStore);
|
||||||
const {
|
const {
|
||||||
searchQuery,
|
searchQuery,
|
||||||
conversations,
|
conversations,
|
||||||
@ -207,4 +226,6 @@ const formatTime = (value: unknown) => (props.formatTime ? props.formatTime(valu
|
|||||||
const iconStyle = (key: string) => (props.iconStyle ? props.iconStyle(key) : {});
|
const iconStyle = (key: string) => (props.iconStyle ? props.iconStyle(key) : {});
|
||||||
const resolvedShowCollapseButton = computed(() => props.showCollapseButton);
|
const resolvedShowCollapseButton = computed(() => props.showCollapseButton);
|
||||||
const resolvedCollapseButtonVariant = computed(() => props.collapseButtonVariant);
|
const resolvedCollapseButtonVariant = computed(() => props.collapseButtonVariant);
|
||||||
|
|
||||||
|
const workspaceToggleIcon = new URL('../../../icons/layers.svg', import.meta.url).href;
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -49,6 +49,7 @@ interface EasterEggState {
|
|||||||
|
|
||||||
interface UiState {
|
interface UiState {
|
||||||
sidebarCollapsed: boolean;
|
sidebarCollapsed: boolean;
|
||||||
|
workspaceCollapsed: boolean;
|
||||||
panelMode: PanelMode;
|
panelMode: PanelMode;
|
||||||
panelMenuOpen: boolean;
|
panelMenuOpen: boolean;
|
||||||
leftWidth: number;
|
leftWidth: number;
|
||||||
@ -73,6 +74,7 @@ interface UiState {
|
|||||||
export const useUiStore = defineStore('ui', {
|
export const useUiStore = defineStore('ui', {
|
||||||
state: (): UiState => ({
|
state: (): UiState => ({
|
||||||
sidebarCollapsed: true,
|
sidebarCollapsed: true,
|
||||||
|
workspaceCollapsed: false,
|
||||||
panelMode: 'files',
|
panelMode: 'files',
|
||||||
panelMenuOpen: false,
|
panelMenuOpen: false,
|
||||||
leftWidth: 350,
|
leftWidth: 350,
|
||||||
@ -108,6 +110,12 @@ export const useUiStore = defineStore('ui', {
|
|||||||
toggleSidebar() {
|
toggleSidebar() {
|
||||||
this.sidebarCollapsed = !this.sidebarCollapsed;
|
this.sidebarCollapsed = !this.sidebarCollapsed;
|
||||||
},
|
},
|
||||||
|
setWorkspaceCollapsed(collapsed: boolean) {
|
||||||
|
this.workspaceCollapsed = collapsed;
|
||||||
|
},
|
||||||
|
toggleWorkspaceCollapsed() {
|
||||||
|
this.workspaceCollapsed = !this.workspaceCollapsed;
|
||||||
|
},
|
||||||
setPanelMode(mode: PanelMode) {
|
setPanelMode(mode: PanelMode) {
|
||||||
this.panelMode = mode;
|
this.panelMode = mode;
|
||||||
},
|
},
|
||||||
|
|||||||
@ -22,6 +22,13 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.messages-flow {
|
||||||
|
width: min(960px, 100%);
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
.chat-container .input-area {
|
.chat-container .input-area {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -58,6 +65,18 @@
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chat-container--immersive .messages-flow {
|
||||||
|
width: min(900px, 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-container--immersive .scroll-lock-toggle {
|
||||||
|
right: calc((100% - min(900px, 100%)) / 2 + 24px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-container--mobile {
|
||||||
|
padding-top: 68px;
|
||||||
|
}
|
||||||
|
|
||||||
.scroll-lock-btn {
|
.scroll-lock-btn {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
|||||||
@ -174,36 +174,49 @@
|
|||||||
|
|
||||||
.mobile-panel-trigger {
|
.mobile-panel-trigger {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 16px;
|
top: 0;
|
||||||
left: 16px;
|
left: 0;
|
||||||
|
right: 0;
|
||||||
z-index: 1500;
|
z-index: 1500;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: stretch;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: opacity 0.2s ease;
|
transition: opacity 0.2s ease;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-panel-trigger.is-hidden {
|
.mobile-panel-trigger.is-hidden {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mobile-panel-topbar {
|
||||||
|
background: var(--claude-left-rail);
|
||||||
|
padding: 10px 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
box-shadow: 0 10px 20px rgba(51, 35, 20, 0.1);
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.mobile-panel-fab {
|
.mobile-panel-fab {
|
||||||
width: 48px;
|
width: 44px;
|
||||||
height: 48px;
|
height: 44px;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 6px;
|
padding: 0;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--claude-accent);
|
color: var(--claude-text);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-panel-fab img {
|
.mobile-panel-fab img {
|
||||||
@ -221,6 +234,20 @@
|
|||||||
background: rgba(255, 255, 255, 0.35);
|
background: rgba(255, 255, 255, 0.35);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
box-shadow: 0 12px 30px rgba(38, 28, 18, 0.15);
|
box-shadow: 0 12px 30px rgba(38, 28, 18, 0.15);
|
||||||
|
align-self: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-topbar-title {
|
||||||
|
flex: 0 0 50%;
|
||||||
|
max-width: 50%;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--claude-text);
|
||||||
|
margin-left: auto;
|
||||||
|
text-align: right;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-menu-btn {
|
.mobile-menu-btn {
|
||||||
@ -269,7 +296,7 @@
|
|||||||
inset: 0;
|
inset: 0;
|
||||||
background: rgba(16, 11, 7, 0.45);
|
background: rgba(16, 11, 7, 0.45);
|
||||||
backdrop-filter: blur(6px);
|
backdrop-filter: blur(6px);
|
||||||
z-index: 1400;
|
z-index: 2000;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
@ -12,6 +12,12 @@
|
|||||||
background: rgba(218, 119, 86, 0.22);
|
background: rgba(218, 119, 86, 0.22);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.workspace-region {
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* 侧边栏 */
|
/* 侧边栏 */
|
||||||
.sidebar {
|
.sidebar {
|
||||||
background: var(--claude-left-rail);
|
background: var(--claude-left-rail);
|
||||||
@ -23,6 +29,32 @@
|
|||||||
.sidebar.left-sidebar {
|
.sidebar.left-sidebar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
transition:
|
||||||
|
width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
|
||||||
|
min-width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
|
||||||
|
opacity 0.35s ease,
|
||||||
|
transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-panel {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
will-change: width, transform, opacity;
|
||||||
|
transition:
|
||||||
|
width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
|
||||||
|
min-width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
|
||||||
|
opacity 0.35s ease,
|
||||||
|
transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-panel--collapsed {
|
||||||
|
flex: 0 0 0 !important;
|
||||||
|
width: 0 !important;
|
||||||
|
min-width: 0 !important;
|
||||||
|
max-width: 0 !important;
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-70px);
|
||||||
|
overflow: hidden;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-status {
|
.sidebar-status {
|
||||||
|
|||||||
@ -62,6 +62,72 @@
|
|||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-toggle {
|
||||||
|
padding: 12px 16px 8px;
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-toggle.collapsed {
|
||||||
|
padding: 12px 0 8px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-btn {
|
||||||
|
width: 100%;
|
||||||
|
border: none;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--claude-text);
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 10px 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: color 0.2s ease, background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-btn .workspace-immersive-icon {
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-btn .workspace-immersive-icon img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-btn .workspace-immersive-label {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-btn:hover,
|
||||||
|
.workspace-immersive-btn:focus-visible {
|
||||||
|
color: var(--claude-accent);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-btn.active {
|
||||||
|
color: var(--claude-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-toggle.collapsed .workspace-immersive-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-immersive-toggle.collapsed .workspace-immersive-btn .workspace-immersive-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.collapsed-header-buttons {
|
.collapsed-header-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user