chore: minor type cleanup (out-of-scope housekeeping)

- Trim unused recursive/isOutsideWorkspace from DirPermissionItem interface
- Remove 4 pre-existing `as any` casts in ChatView.tsx:
  - window cast → precise inline type
  - checkpoint bracket access → removed unnecessary casts
  - condensing message → `as ClineMessage`
  - debounce cancel → `.clear()` (correct API)
- Update BatchListFilesPermission test data to match trimmed interface
This commit is contained in:
Hannes Rudolph 2026-02-06 17:50:41 -07:00
parent 9ffc778491
commit 946ab9fabe
3 changed files with 6 additions and 19 deletions

View file

@ -5,8 +5,6 @@ import { PathTooltip } from "../ui/PathTooltip"
interface DirPermissionItem {
path: string
recursive: boolean
isOutsideWorkspace?: boolean
key: string
}

View file

@ -72,8 +72,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
const isMountedRef = useRef(true)
const [audioBaseUri] = useState(() => {
const w = window as any
return w.AUDIO_BASE_URI || ""
return (window as unknown as { AUDIO_BASE_URI?: string }).AUDIO_BASE_URI || ""
})
const { t } = useAppTranslation()
@ -976,10 +975,10 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
if (
msg.say === "user_feedback" &&
msg.checkpoint &&
(msg.checkpoint as any).type === "user_message" &&
(msg.checkpoint as any).hash
msg.checkpoint["type"] === "user_message" &&
msg.checkpoint["hash"]
) {
userMessageCheckpointHashes.add((msg.checkpoint as any).hash)
userMessageCheckpointHashes.add(msg.checkpoint["hash"] as string)
}
})
@ -1303,7 +1302,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
say: "condense_context",
ts: Date.now(),
partial: true,
} as any)
} as ClineMessage)
}
return result
}, [isCondensing, visibleMessages, isBrowserSessionMessage])
@ -1320,9 +1319,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
useEffect(() => {
return () => {
if (scrollToBottomSmooth && typeof (scrollToBottomSmooth as any).cancel === "function") {
;(scrollToBottomSmooth as any).cancel()
}
scrollToBottomSmooth.clear()
}
}, [scrollToBottomSmooth])

View file

@ -9,20 +9,14 @@ describe("BatchListFilesPermission", () => {
{
key: "apps/cli",
path: "apps/cli",
recursive: false,
isOutsideWorkspace: false,
},
{
key: "apps/web-roo-code",
path: "apps/web-roo-code",
recursive: false,
isOutsideWorkspace: false,
},
{
key: "packages/core",
path: "packages/core",
recursive: true,
isOutsideWorkspace: false,
},
]
@ -90,8 +84,6 @@ describe("BatchListFilesPermission", () => {
{
key: "apps/cli",
path: "apps/cli",
recursive: false,
isOutsideWorkspace: false,
},
]