chore(compat): drop unused GitLens store and folder-icon parameter

This commit is contained in:
Menghuan1918 committed 2026-11-13 01:21:39 +08:00
1 parent c56c6efeff
commit e4c9366d5c
11 files changed
+14 -29

No files matched your search

+3 -3
View File
@@ -421,7 +421,7 @@ const DirRow = memo(function DirRow(props: DirRowProps): ReactNode {
// the user sees expanded (`a/b/c`), so dropping into it, renaming it or
// opening a menu on it must address `c`, not the fold head `a`.
const target = chain[chain.length - 1]!
const icon = service !== undefined ? service.folderIcon(target.path, expanded, 14) : builtinFolderIcon(expanded, 14)
const icon = service !== undefined ? service.folderIcon(target.path, expanded, 14) : builtinFolderIcon(14)
return (
<div
role="button"
@@ -499,7 +499,7 @@ interface RootRowProps {
const RootRow = memo(function RootRow(props: RootRowProps): ReactNode {
const { path, iconsVersion, service, dropTarget, gitChanged, copied, actions } = props
void iconsVersion
const icon = service !== undefined ? service.folderIcon(path, true, 14) : builtinFolderIcon(true, 14)
const icon = service !== undefined ? service.folderIcon(path, true, 14) : builtinFolderIcon(14)
return (
<div
className={clsx(css.explorerRow, dropTarget && css.explorerRowDropTarget)}
@@ -693,7 +693,7 @@ export function FileTree(props: {
/** One directory's leading glyph for the surfaces WITHOUT a memoized row
* (the inline rename and new-folder editors). */
const dirRowIcon = (path: string, open: boolean): ReactNode =>
service !== undefined ? service.folderIcon(path, open, 14) : builtinFolderIcon(open, 14)
service !== undefined ? service.folderIcon(path, open, 14) : builtinFolderIcon(14)
const dataRef = useRef(data)
/** Bumped whenever the cache is wiped: a response from an older generation is dropped. */
const generationRef = useRef(0)
+1 -2
View File
@@ -79,7 +79,7 @@ type PreviewSelection =
| { kind: 'git'; ref: SidebarDiffRef }
| { kind: 'op'; path: string; callId: string }
export function ChangesTab({ ctx, store, scope, tab, visible, onOpenFile, onOpenDiff }: TabComponentProps) {
export function ChangesTab({ ctx, scope, tab, visible, onOpenFile, onOpenDiff }: TabComponentProps) {
const meta = (tab.meta ?? {}) as ChangesMeta
const lensId = useId()
const [lens, setLens] = useState<Lens>(meta.lens === 'session' ? 'session' : 'git')
@@ -278,7 +278,6 @@ export function ChangesTab({ ctx, store, scope, tab, visible, onOpenFile, onOpen
<GitLens
ctx={ctx}
scope={scope}
store={store}
visible={visible}
active={lens === 'git'}
onOpenFile={onOpenFile ?? (() => { /* no-op */ })}
+2 -5
View File
@@ -23,7 +23,7 @@ import { baseName, relativeTo } from '../paths.ts'
import { resolveSidebarPath } from '../paths.ts'
import { isZh, t } from '../locales.ts'
import { GitGraphSection, type GraphDetailsSelection } from './GitGraphSection.tsx'
import type { SidebarDiffRef, SidebarStore } from '../state.ts'
import type { SidebarDiffRef } from '../state.ts'
import {
ConfirmDialog, IconButton, Notice, StatusBadge, invalidateGitStatus, statusOfXY,
useGitStatus, type GitFileStatus, type GitTone, type StatusTone,
@@ -358,9 +358,6 @@ type CommitRow = Pick<GitLogEntry, 'hash' | 'hashFull' | 'subject'>
export interface GitLensProps {
scope: SessionScope
/** @deprecated The sidebar store is no longer read here (the fence guard it
* fed is gone); the prop stays for the caller's shape. */
store: SidebarStore
onOpenFile: (path: string) => void
/** Preview one change in the shared bottom pane (worktree or commit ref). */
onPreview: (ref: SidebarDiffRef) => void
@@ -397,7 +394,7 @@ export function GitLens(props: GitLensProps) {
service === undefined ? builtinFileIcon(path, 14) : service.fileIcon(path, 14)
), [service])
const folderGlyph = useCallback((path: string, open: boolean): ReactNode => (
service === undefined ? builtinFolderIcon(open, 14) : service.folderIcon(path, open, 14)
service === undefined ? builtinFolderIcon(14) : service.folderIcon(path, open, 14)
), [service])
const [worktrees, setWorktrees] = useState<GitWorktree[]>([])
+1 -2
View File
@@ -42,11 +42,10 @@ export function builtinFileIcon(path: string, size: number): ReactNode {
* its own. The expansion state is already legible from the tree's own chevron
* and row affordances, so this deliberately does not invent a second folder
* drawing.
* @param _open - whether the row is expanded (accepted for API compatibility).
* @param size - the square edge in px.
* @returns the host's folder glyph.
*/
export function builtinFolderIcon(_open: boolean, size: number): ReactNode {
export function builtinFolderIcon(size: number): ReactNode {
return <FileTypeIcon kind="folder" size={size} />
}
+1 -1
View File
@@ -1286,7 +1286,7 @@ export function createBetterSidebarService(store: SidebarStore): BetterSidebarSe
const icon = safeIcon(registered, path, size, open)
if (icon !== undefined) return icon
}
return builtinFolderIcon(open, size)
return builtinFolderIcon(size)
}
// The enable switches come from the user's side card prefs (the shared