Removed active selection for now

This commit is contained in:
Matt Rubens
2025-02-01 11:45:57 -05:00
parent 064dc4e52f
commit 1e5a257e52
4 changed files with 2 additions and 58 deletions

View File

@@ -50,8 +50,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
},
ref,
) => {
const { filePaths, openedTabs, activeSelection, currentApiConfigName, listApiConfigMeta, customModes } =
useExtensionState()
const { filePaths, openedTabs, currentApiConfigName, listApiConfigMeta, customModes } = useExtensionState()
const [gitCommits, setGitCommits] = useState<any[]>([])
const [showDropdown, setShowDropdown] = useState(false)
@@ -158,15 +157,8 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
})),
]
if (activeSelection) {
items.unshift({
type: ContextMenuOptionType.OpenedFile,
value: `/${activeSelection.file}:${activeSelection.selection.startLine + 1}-${activeSelection.selection.endLine + 1}`,
})
}
return items
}, [filePaths, openedTabs, activeSelection])
}, [filePaths, openedTabs])
useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {

View File

@@ -28,10 +28,6 @@ export interface ExtensionStateContextType extends ExtensionState {
mcpServers: McpServer[]
filePaths: string[]
openedTabs: Array<{ label: string; isActive: boolean; path?: string }>
activeSelection: {
file: string
selection: { startLine: number; endLine: number }
} | null
setApiConfiguration: (config: ApiConfiguration) => void
setCustomInstructions: (value?: string) => void
setAlwaysAllowReadOnly: (value: boolean) => void
@@ -122,10 +118,6 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
[glamaDefaultModelId]: glamaDefaultModelInfo,
})
const [openedTabs, setOpenedTabs] = useState<Array<{ label: string; isActive: boolean; path?: string }>>([])
const [activeSelection, setActiveSelection] = useState<{
file: string
selection: { startLine: number; endLine: number }
} | null>(null)
const [openRouterModels, setOpenRouterModels] = useState<Record<string, ModelInfo>>({
[openRouterDefaultModelId]: openRouterDefaultModelInfo,
})
@@ -188,11 +180,9 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
case "workspaceUpdated": {
const paths = message.filePaths ?? []
const tabs = message.openedTabs ?? []
const selection = message.activeSelection ?? null
setFilePaths(paths)
setOpenedTabs(tabs)
setActiveSelection(selection)
break
}
case "partialMessage": {
@@ -260,7 +250,6 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
mcpServers,
filePaths,
openedTabs,
activeSelection,
soundVolume: state.soundVolume,
fuzzyMatchThreshold: state.fuzzyMatchThreshold,
writeDelayMs: state.writeDelayMs,