fix: update sidebar icons and enhance DiscoverPage layout

- Updated DiscoverPage to include full height and width styling for better layout.
- Modified sidebar icon visibility logic in migration to ensure 'discover' is added correctly while filtering out specific icons.
- Changed default sidebar icons to replace 'store' with 'discover' for consistency.
This commit is contained in:
MyPrototypeWhat 2025-06-09 15:27:48 +08:00
parent c6d5faff73
commit 278397f7c8
3 changed files with 9 additions and 4 deletions

View File

@ -43,7 +43,7 @@ export default function DiscoverPage() {
const vercelTabsData = adaptCategoriesForVercelTabs(categories) const vercelTabsData = adaptCategoriesForVercelTabs(categories)
return ( return (
<div> <div className="h-full w-full">
<div className="flex h-full w-full flex-col overflow-hidden"> <div className="flex h-full w-full flex-col overflow-hidden">
<Navbar className="h-auto flex-shrink-0"> <Navbar className="h-auto flex-shrink-0">
<NavbarCenter>{t('discover.title')}</NavbarCenter> <NavbarCenter>{t('discover.title')}</NavbarCenter>

View File

@ -1515,13 +1515,18 @@ const migrateConfig = {
}, },
'112': (state: RootState) => { '112': (state: RootState) => {
try { try {
const visibleIcons = state.settings.sidebarIcons.visible
if (visibleIcons.includes('discover')) {
return state
}
const filteredIcons = visibleIcons.filter((icon) => icon !== 'agents' && icon !== 'minapp')
return { return {
...state, ...state,
settings: { settings: {
...state.settings, ...state.settings,
sidebarIcons: { sidebarIcons: {
...state.settings.sidebarIcons, ...state.settings.sidebarIcons,
visible: [...state.settings.sidebarIcons.visible, 'discover'] visible: [...filteredIcons, 'discover']
} }
} }
} }

View File

@ -24,7 +24,7 @@ export type SidebarIcon =
| 'minapp' | 'minapp'
| 'knowledge' | 'knowledge'
| 'files' | 'files'
| 'store' | 'discover'
export const DEFAULT_SIDEBAR_ICONS: SidebarIcon[] = [ export const DEFAULT_SIDEBAR_ICONS: SidebarIcon[] = [
'assistants', 'assistants',
@ -34,7 +34,7 @@ export const DEFAULT_SIDEBAR_ICONS: SidebarIcon[] = [
'minapp', 'minapp',
'knowledge', 'knowledge',
'files', 'files',
'store' 'discover'
] ]
export interface NutstoreSyncRuntime extends WebDAVSyncState {} export interface NutstoreSyncRuntime extends WebDAVSyncState {}