mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-03 01:22:07 +08:00
fix(skills): remove redundant navigation buttons in skills pages
- Remove duplicate "Repo Manager" button from installed skills view (should only appear in discovery view) - Remove redundant back button from SkillsPage component (header already provides unified navigation) - Clean up unused openRepoManagerOnDiscovery state and related useEffect - Remove unused onClose prop and ArrowLeft import from SkillsPage
This commit is contained in:
22
src/App.tsx
22
src/App.tsx
@@ -84,8 +84,6 @@ function App() {
|
||||
const promptPanelRef = useRef<any>(null);
|
||||
const mcpPanelRef = useRef<any>(null);
|
||||
const skillsPageRef = useRef<any>(null);
|
||||
const [openRepoManagerOnDiscovery, setOpenRepoManagerOnDiscovery] =
|
||||
useState(false);
|
||||
const addActionButtonClass =
|
||||
"bg-orange-500 hover:bg-orange-600 dark:bg-orange-500 dark:hover:bg-orange-600 text-white shadow-lg shadow-orange-500/30 dark:shadow-orange-500/40 rounded-full w-8 h-8";
|
||||
|
||||
@@ -122,13 +120,6 @@ function App() {
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (currentView === "skillsDiscovery" && openRepoManagerOnDiscovery) {
|
||||
skillsPageRef.current?.openRepoManager?.();
|
||||
setOpenRepoManagerOnDiscovery(false);
|
||||
}
|
||||
}, [currentView, openRepoManagerOnDiscovery]);
|
||||
|
||||
// 🎯 使用 useProviderActions Hook 统一管理所有 Provider 操作
|
||||
const {
|
||||
addProvider,
|
||||
@@ -448,7 +439,6 @@ function App() {
|
||||
return (
|
||||
<SkillsPage
|
||||
ref={skillsPageRef}
|
||||
onClose={() => setCurrentView("skills")}
|
||||
initialApp={activeApp}
|
||||
/>
|
||||
);
|
||||
@@ -685,18 +675,6 @@ function App() {
|
||||
<Search className="w-4 h-4 mr-2" />
|
||||
{t("skills.discover")}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
setOpenRepoManagerOnDiscovery(true);
|
||||
setCurrentView("skillsDiscovery");
|
||||
}}
|
||||
className="hover:bg-black/5 dark:hover:bg-white/5"
|
||||
>
|
||||
<Settings className="w-4 h-4 mr-2" />
|
||||
{t("skills.repoManager")}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{currentView === "skillsDiscovery" && (
|
||||
|
||||
Reference in New Issue
Block a user