refactor: remove unused dead-code exports flagged by react-doctor

Low-risk subset only — each verified to have zero external references
(tsc + eslint green); API clients, stores, icons and constants left
untouched.

- libs/util.ts: unexport `is` (still used internally by isNumber)
- components/tree-select/libs/util.ts: drop unused recursive `findLabel`
- app/person/workload/config.ts: drop unused `dimensionOpts`
- components/login/libs/session-cache.ts: drop unused `getCachedSession`
- components/setting/PageSurface.tsx: drop 3 unused layout components
  (SettingTableViewport, SettingSectionHeader, SettingFilterStack)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
zhangheng
2026-06-05 12:39:27 +08:00
parent f930432ffe
commit fb3ffe3dfd
5 changed files with 1 additions and 102 deletions

View File

@@ -27,9 +27,6 @@ const getValidCachedSession = <T>(redisKey: string) => {
return cacheEntry.data as T
}
export const getCachedSession = <T>(redisKey: string) =>
getValidCachedSession<T>(redisKey)
export const setCachedSession = <T>(redisKey: string, data: T) => {
sessionCache.set(redisKey, {
data,

View File

@@ -386,12 +386,6 @@ export function SettingCustomPageSizeControl({
)
}
type SettingTableViewportProps = PropsWithChildren<{
maxHeight: number | string
className?: string
style?: CSSProperties
}>
export function SettingPage({
className,
...props
@@ -428,21 +422,6 @@ export function SettingPanel({
)
}
export function SettingTableViewport({
maxHeight,
className,
style,
children,
}: SettingTableViewportProps) {
return (
<div
style={{ maxHeight, ...style }}
className={mergeClassName(classes.tableViewport, className)}>
{children}
</div>
)
}
export function SettingFilterPanel({
className,
...props
@@ -467,43 +446,6 @@ export function SettingContentPanel({
)
}
type SettingSectionHeaderProps = GroupProps & {
eyebrow?: string
title: ReactNode
description?: ReactNode
actions?: ReactNode
}
export function SettingSectionHeader({
eyebrow,
title,
description,
actions,
className,
...props
}: SettingSectionHeaderProps) {
return (
<Group
justify="space-between"
align="flex-start"
gap="sm"
wrap="wrap"
className={mergeClassName(classes.sectionHeader, className)}
{...props}>
<Stack gap={2}>
{eyebrow ? (
<Text className={classes.sectionEyebrow}>{eyebrow}</Text>
) : null}
<Text className={classes.sectionTitle}>{title}</Text>
{description ? (
<Text className={classes.sectionDescription}>{description}</Text>
) : null}
</Stack>
{actions}
</Group>
)
}
type SettingListHeaderProps = {
title: ReactNode
count?: ReactNode
@@ -569,20 +511,6 @@ export function SettingFilterActions({
)
}
export function SettingFilterStack({
className,
gap = 12,
...props
}: PropsWithChildren<StackProps>) {
return (
<Stack
gap={gap}
className={mergeClassName(classes.filterStack, className)}
{...props}
/>
)
}
type SettingInlineFilterFieldProps = {
label: ReactNode
children: ReactNode

View File

@@ -75,24 +75,6 @@ export const buildTreeValueMap = (
return acc
}
export const findLabel = (
nodes: TreeNodeData[],
targetValue: string,
pathArr: string[] = [] // 内部用,调用端无需传入
): FindResult => {
for (const node of nodes) {
const curPath = [...pathArr, node.label as string] // 复制一份,避免污染上层
if (node.value === targetValue) {
return { path: curPath.join(TREE_PATH_SEPARATOR), node }
}
if (node.children) {
const found = findLabel(node.children, targetValue, curPath)
if (found.node) return found
}
}
return { path: "", node: null }
}
export const findNodesByValues = (
valueMap: Record<string, TreeValueMeta>,
targetValues: string[]