@@ -19,10 +19,12 @@ import { Layout, Tabs, Button, Tooltip, Dropdown } from 'antd'
1919import type { MenuProps } from 'antd'
2020import { useTranslation } from 'react-i18next'
2121import styled from '@emotion/styled'
22- import { PanelRightClose , Folder , Terminal , FileSearch , Maximize , Minimize , Plus , PlayCircle } from 'lucide-react'
22+ import { PanelRightClose , Folder , FileSearch , Maximize , Minimize , Plus } from 'lucide-react'
2323import FileTreeView from '@/components/files/FileTreeView'
2424import FileContentView from '@/components/files/FileContentView'
25+ import { ActivateCover } from '@/components/ui/ActivateCover'
2526import { InspectorEmptyState } from './InspectorEmptyState'
27+ import { INSPECTOR_ACTIONS } from './inspectorActions'
2628import { useIsMobile } from '@/core/data/hooks/useMediaQuery'
2729import { useSessionActions } from '@/core/data/hooks/mutations/useSessionActions'
2830import { useWorkspaceStore , type InspectorTabEntry } from '@/core/data/stores/workspaceStore'
@@ -131,7 +133,7 @@ export function InspectorPane({ sessionId, active = true }: InspectorPaneProps)
131133 if ( ! active ) {
132134 return (
133135 < Layout style = { { height : '100%' , position : 'relative' } } >
134- < ResumeCover loading = { isResumePending } onResume = { ( ) => resumeSession ( ) } label = { t ( 'composer.activate' ) } />
136+ < ActivateCover loading = { isResumePending } onActivate = { ( ) => resumeSession ( ) } />
135137 < div style = { { position : 'absolute' , top : 4 , right : 8 , zIndex : 2 } } > { rightChrome } </ div >
136138 </ Layout >
137139 )
@@ -149,16 +151,17 @@ export function InspectorPane({ sessionId, active = true }: InspectorPaneProps)
149151
150152 if ( ! everExpanded ) return < Layout style = { { height : '100%' } } />
151153
152- const addMenuItems : MenuProps [ 'items' ] = [
153- {
154- key : 'file' ,
155- icon : < Folder size = { 14 } /> ,
156- label : t ( 'session.inspector.openFile' ) ,
157- onClick : ( ) => openFileTreeTab ( sessionId ) ,
158- } ,
159- { key : 'terminal' , icon : < Terminal size = { 14 } /> , label : t ( 'session.inspector.terminal' ) , disabled : true } ,
160- { key : 'review' , icon : < FileSearch size = { 14 } /> , label : t ( 'session.inspector.review' ) , disabled : true } ,
161- ]
154+ // 「+」下拉菜单:与空态卡片共用 INSPECTOR_ACTIONS,仅「文件」可点
155+ const addMenuItems : MenuProps [ 'items' ] = INSPECTOR_ACTIONS . map ( ( action ) => {
156+ const { Icon } = action
157+ return {
158+ key : action . key ,
159+ icon : < Icon size = { 14 } /> ,
160+ label : t ( action . labelKey ) ,
161+ disabled : action . disabled ,
162+ onClick : action . disabled ? undefined : ( ) => openFileTreeTab ( sessionId ) ,
163+ }
164+ } )
162165
163166 const renderTabContent = ( tab : InspectorTabEntry ) : ReactNode => {
164167 if ( tab . mode === 'file' && tab . filePath ) {
@@ -232,24 +235,6 @@ export function InspectorPane({ sessionId, active = true }: InspectorPaneProps)
232235 )
233236}
234237
235- /** session 离线覆盖层:居中「恢复会话」按钮,覆盖整个检视面板内容区。 */
236- function ResumeCover ( { loading, onResume, label } : {
237- loading : boolean
238- onResume : ( ) => void
239- label : string
240- } ) {
241- return (
242- < div style = { {
243- position : 'absolute' , inset : 0 , zIndex : 1 ,
244- display : 'flex' , alignItems : 'center' , justifyContent : 'center' ,
245- } } >
246- < Button type = "primary" icon = { < PlayCircle size = { 18 } /> } loading = { loading } onClick = { onResume } >
247- { label }
248- </ Button >
249- </ div >
250- )
251- }
252-
253238/** 右上角 chrome:最大化/恢复 + 收起。空态与 Tab 态共用。 */
254239function RightChrome ( {
255240 isMobile,
0 commit comments