会话支持平铺模式显示
This commit is contained in:
@@ -13,11 +13,13 @@ export function TabBar() {
|
||||
const {
|
||||
tabs,
|
||||
activeTabId,
|
||||
isTileMode,
|
||||
switchTab,
|
||||
closeTab,
|
||||
closeOtherTabs,
|
||||
closeAllTabs,
|
||||
pinTab,
|
||||
toggleTileMode,
|
||||
reorderTabs,
|
||||
} = useTabContext()
|
||||
const { mode, activePane } = useWorkspaceContext()
|
||||
@@ -89,11 +91,13 @@ export function TabBar() {
|
||||
key={tab.id}
|
||||
tab={tab}
|
||||
isActive={tab.id === activeTabId}
|
||||
isTileMode={isTileMode}
|
||||
onSwitch={switchTab}
|
||||
onClose={closeTab}
|
||||
onCloseOthers={closeOtherTabs}
|
||||
onCloseAll={closeAllTabs}
|
||||
onPin={pinTab}
|
||||
onToggleTile={toggleTileMode}
|
||||
/>
|
||||
))}
|
||||
</Reorder.Group>
|
||||
|
||||
@@ -19,21 +19,25 @@ import type { TabItem as TabItemData } from "@/contexts/tab-context"
|
||||
interface TabItemProps {
|
||||
tab: TabItemData
|
||||
isActive: boolean
|
||||
isTileMode: boolean
|
||||
onSwitch: (tabId: string) => void
|
||||
onClose: (tabId: string) => void
|
||||
onCloseOthers: (tabId: string) => void
|
||||
onCloseAll: () => void
|
||||
onPin: (tabId: string) => void
|
||||
onToggleTile: () => void
|
||||
}
|
||||
|
||||
export const TabItem = memo(function TabItem({
|
||||
tab,
|
||||
isActive,
|
||||
isTileMode,
|
||||
onSwitch,
|
||||
onClose,
|
||||
onCloseOthers,
|
||||
onCloseAll,
|
||||
onPin,
|
||||
onToggleTile,
|
||||
}: TabItemProps) {
|
||||
const t = useTranslations("Folder.tabs")
|
||||
const isDragging = useRef(false)
|
||||
@@ -143,6 +147,10 @@ export const TabItem = memo(function TabItem({
|
||||
{t("closeOthers")}
|
||||
</ContextMenuItem>
|
||||
<ContextMenuSeparator />
|
||||
<ContextMenuItem onSelect={onToggleTile}>
|
||||
{isTileMode ? t("untileDisplay") : t("tileDisplay")}
|
||||
</ContextMenuItem>
|
||||
<ContextMenuSeparator />
|
||||
<ContextMenuItem onSelect={onCloseAll}>
|
||||
{t("closeAll")}
|
||||
</ContextMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user