mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-10 22:41:14 +00:00
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:
parent
9ffc778491
commit
946ab9fabe
3 changed files with 6 additions and 19 deletions
|
|
@ -5,8 +5,6 @@ import { PathTooltip } from "../ui/PathTooltip"
|
|||
|
||||
interface DirPermissionItem {
|
||||
path: string
|
||||
recursive: boolean
|
||||
isOutsideWorkspace?: boolean
|
||||
key: string
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue