refactor(tabs): remove close-folder-tabs and reveal-in-sidebar menu items

This commit is contained in:
xintaofei
2026-04-21 22:14:19 +08:00
parent b77842ee66
commit dd2b542df9
14 changed files with 11 additions and 116 deletions

View File

@@ -26,8 +26,6 @@ interface TabItemProps {
onClose: (tabId: string) => void
onCloseOthers: (tabId: string) => void
onCloseAll: () => void
onCloseFolderTabs: (folderId: number) => void
onRevealInSidebar: (folderId: number) => void
onPin: (tabId: string) => void
onToggleTile: () => void
}
@@ -42,8 +40,6 @@ export const TabItem = memo(function TabItem({
onClose,
onCloseOthers,
onCloseAll,
onCloseFolderTabs,
onRevealInSidebar,
onPin,
onToggleTile,
}: TabItemProps) {
@@ -56,14 +52,6 @@ export const TabItem = memo(function TabItem({
? `${resolvedFolderName} · ${folderBranch}${tab.title}`
: `${resolvedFolderName}${tab.title}`
const handleCloseFolderTabs = useCallback(() => {
onCloseFolderTabs(tab.folderId)
}, [onCloseFolderTabs, tab.folderId])
const handleRevealInSidebar = useCallback(() => {
onRevealInSidebar(tab.folderId)
}, [onRevealInSidebar, tab.folderId])
const clearResidualStyles = useCallback(() => {
const el = itemRef.current
if (!el) return
@@ -167,13 +155,7 @@ export const TabItem = memo(function TabItem({
<ContextMenuItem onSelect={handleCloseOthers}>
{t("closeOthers")}
</ContextMenuItem>
<ContextMenuItem onSelect={handleCloseFolderTabs}>
{t("closeFolderTabs", { folder: resolvedFolderName })}
</ContextMenuItem>
<ContextMenuSeparator />
<ContextMenuItem onSelect={handleRevealInSidebar}>
{t("revealInSidebar")}
</ContextMenuItem>
<ContextMenuItem onSelect={onToggleTile}>
{isTileMode ? t("untileDisplay") : t("tileDisplay")}
</ContextMenuItem>