|
|
@@ -54,6 +54,7 @@ export interface ExtensionStateContextType extends ExtensionState {
|
|
|
hooksEnabled?: ClineFeatureSetting
|
|
|
mcpTab?: McpViewTab
|
|
|
showSettings: boolean
|
|
|
+ settingsTargetSection?: string
|
|
|
showHistory: boolean
|
|
|
showAccount: boolean
|
|
|
showAnnouncement: boolean
|
|
|
@@ -97,7 +98,7 @@ export interface ExtensionStateContextType extends ExtensionState {
|
|
|
|
|
|
// Navigation functions
|
|
|
navigateToMcp: (tab?: McpViewTab) => void
|
|
|
- navigateToSettings: () => void
|
|
|
+ navigateToSettings: (targetSection?: string) => void
|
|
|
navigateToHistory: () => void
|
|
|
navigateToAccount: () => void
|
|
|
navigateToChat: () => void
|
|
|
@@ -123,6 +124,7 @@ export const ExtensionStateContextProvider: React.FC<{
|
|
|
const [showMcp, setShowMcp] = useState(false)
|
|
|
const [mcpTab, setMcpTab] = useState<McpViewTab | undefined>(undefined)
|
|
|
const [showSettings, setShowSettings] = useState(false)
|
|
|
+ const [settingsTargetSection, setSettingsTargetSection] = useState<string | undefined>(undefined)
|
|
|
const [showHistory, setShowHistory] = useState(false)
|
|
|
const [showAccount, setShowAccount] = useState(false)
|
|
|
const [showAnnouncement, setShowAnnouncement] = useState(false)
|
|
|
@@ -135,7 +137,10 @@ export const ExtensionStateContextProvider: React.FC<{
|
|
|
}, [setShowMcp, setMcpTab])
|
|
|
|
|
|
// Hide functions
|
|
|
- const hideSettings = useCallback(() => setShowSettings(false), [setShowSettings])
|
|
|
+ const hideSettings = useCallback(() => {
|
|
|
+ setShowSettings(false)
|
|
|
+ setSettingsTargetSection(undefined)
|
|
|
+ }, [])
|
|
|
const hideHistory = useCallback(() => setShowHistory(false), [setShowHistory])
|
|
|
const hideAccount = useCallback(() => setShowAccount(false), [setShowAccount])
|
|
|
const hideAnnouncement = useCallback(() => setShowAnnouncement(false), [setShowAnnouncement])
|
|
|
@@ -155,12 +160,16 @@ export const ExtensionStateContextProvider: React.FC<{
|
|
|
[setShowMcp, setMcpTab, setShowSettings, setShowHistory, setShowAccount],
|
|
|
)
|
|
|
|
|
|
- const navigateToSettings = useCallback(() => {
|
|
|
- setShowHistory(false)
|
|
|
- closeMcpView()
|
|
|
- setShowAccount(false)
|
|
|
- setShowSettings(true)
|
|
|
- }, [setShowSettings, setShowHistory, closeMcpView, setShowAccount])
|
|
|
+ const navigateToSettings = useCallback(
|
|
|
+ (targetSection?: string) => {
|
|
|
+ setShowHistory(false)
|
|
|
+ closeMcpView()
|
|
|
+ setShowAccount(false)
|
|
|
+ setSettingsTargetSection(targetSection)
|
|
|
+ setShowSettings(true)
|
|
|
+ },
|
|
|
+ [closeMcpView],
|
|
|
+ )
|
|
|
|
|
|
const navigateToHistory = useCallback(() => {
|
|
|
setShowSettings(false)
|
|
|
@@ -705,6 +714,7 @@ export const ExtensionStateContextProvider: React.FC<{
|
|
|
showMcp,
|
|
|
mcpTab,
|
|
|
showSettings,
|
|
|
+ settingsTargetSection,
|
|
|
showHistory,
|
|
|
showAccount,
|
|
|
showAnnouncement,
|