mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Cleanup and release
This commit is contained in:
5
.changeset/blue-masks-camp.md
Normal file
5
.changeset/blue-masks-camp.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"roo-cline": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add shortcuts to the currently open tabs in the "Add File" section of @-mentions (thanks @olup!)
|
||||||
@@ -89,7 +89,6 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
|
|||||||
return () => window.removeEventListener("message", messageHandler)
|
return () => window.removeEventListener("message", messageHandler)
|
||||||
}, [setInputValue])
|
}, [setInputValue])
|
||||||
|
|
||||||
const [isTextAreaFocused, setIsTextAreaFocused] = useState(false)
|
|
||||||
const [thumbnailsHeight, setThumbnailsHeight] = useState(0)
|
const [thumbnailsHeight, setThumbnailsHeight] = useState(0)
|
||||||
const [textAreaBaseHeight, setTextAreaBaseHeight] = useState<number | undefined>(undefined)
|
const [textAreaBaseHeight, setTextAreaBaseHeight] = useState<number | undefined>(undefined)
|
||||||
const [showContextMenu, setShowContextMenu] = useState(false)
|
const [showContextMenu, setShowContextMenu] = useState(false)
|
||||||
@@ -136,18 +135,15 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
|
|||||||
}, [inputValue, textAreaDisabled, setInputValue])
|
}, [inputValue, textAreaDisabled, setInputValue])
|
||||||
|
|
||||||
const queryItems = useMemo(() => {
|
const queryItems = useMemo(() => {
|
||||||
const items = [
|
return [
|
||||||
{ type: ContextMenuOptionType.Problems, value: "problems" },
|
{ type: ContextMenuOptionType.Problems, value: "problems" },
|
||||||
...gitCommits,
|
...gitCommits,
|
||||||
// Add opened tabs
|
|
||||||
...openedTabs
|
...openedTabs
|
||||||
.filter((tab) => tab.path)
|
.filter((tab) => tab.path)
|
||||||
.map((tab) => ({
|
.map((tab) => ({
|
||||||
type: ContextMenuOptionType.OpenedFile,
|
type: ContextMenuOptionType.OpenedFile,
|
||||||
value: "/" + tab.path,
|
value: "/" + tab.path,
|
||||||
})),
|
})),
|
||||||
|
|
||||||
// Add regular file paths
|
|
||||||
...filePaths
|
...filePaths
|
||||||
.map((file) => "/" + file)
|
.map((file) => "/" + file)
|
||||||
.filter((path) => !openedTabs.some((tab) => tab.path && "/" + tab.path === path)) // Filter out paths that are already in openedTabs
|
.filter((path) => !openedTabs.some((tab) => tab.path && "/" + tab.path === path)) // Filter out paths that are already in openedTabs
|
||||||
@@ -156,9 +152,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
|
|||||||
value: path,
|
value: path,
|
||||||
})),
|
})),
|
||||||
]
|
]
|
||||||
|
}, [filePaths, gitCommits, openedTabs])
|
||||||
return items
|
|
||||||
}, [filePaths, openedTabs])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleClickOutside = (event: MouseEvent) => {
|
const handleClickOutside = (event: MouseEvent) => {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
|
|||||||
const getIconForOption = (option: ContextMenuQueryItem): string => {
|
const getIconForOption = (option: ContextMenuQueryItem): string => {
|
||||||
switch (option.type) {
|
switch (option.type) {
|
||||||
case ContextMenuOptionType.OpenedFile:
|
case ContextMenuOptionType.OpenedFile:
|
||||||
return "star-full"
|
return "window"
|
||||||
case ContextMenuOptionType.File:
|
case ContextMenuOptionType.File:
|
||||||
return "file"
|
return "file"
|
||||||
case ContextMenuOptionType.Folder:
|
case ContextMenuOptionType.Folder:
|
||||||
|
|||||||
@@ -132,12 +132,6 @@ export function getContextMenuOptions(
|
|||||||
}
|
}
|
||||||
if (query.startsWith("http")) {
|
if (query.startsWith("http")) {
|
||||||
suggestions.push({ type: ContextMenuOptionType.URL, value: query })
|
suggestions.push({ type: ContextMenuOptionType.URL, value: query })
|
||||||
} else {
|
|
||||||
suggestions.push(
|
|
||||||
...queryItems
|
|
||||||
.filter((item) => item.type !== ContextMenuOptionType.OpenedFile)
|
|
||||||
.filter((item) => item.value?.toLowerCase().includes(lowerQuery)),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add exact SHA matches to suggestions
|
// Add exact SHA matches to suggestions
|
||||||
@@ -175,12 +169,16 @@ export function getContextMenuOptions(
|
|||||||
|
|
||||||
// Separate matches by type
|
// Separate matches by type
|
||||||
const fileMatches = matchingItems.filter(
|
const fileMatches = matchingItems.filter(
|
||||||
(item) => item.type === ContextMenuOptionType.File || item.type === ContextMenuOptionType.Folder,
|
(item) =>
|
||||||
|
item.type === ContextMenuOptionType.File ||
|
||||||
|
item.type === ContextMenuOptionType.OpenedFile ||
|
||||||
|
item.type === ContextMenuOptionType.Folder,
|
||||||
)
|
)
|
||||||
const gitMatches = matchingItems.filter((item) => item.type === ContextMenuOptionType.Git)
|
const gitMatches = matchingItems.filter((item) => item.type === ContextMenuOptionType.Git)
|
||||||
const otherMatches = matchingItems.filter(
|
const otherMatches = matchingItems.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.type !== ContextMenuOptionType.File &&
|
item.type !== ContextMenuOptionType.File &&
|
||||||
|
item.type !== ContextMenuOptionType.OpenedFile &&
|
||||||
item.type !== ContextMenuOptionType.Folder &&
|
item.type !== ContextMenuOptionType.Folder &&
|
||||||
item.type !== ContextMenuOptionType.Git,
|
item.type !== ContextMenuOptionType.Git,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user