mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 04:36:13 +08:00
feat(core): add team badge to user info menu (#12144)
close AF-2545 fix(core): go to workspace command does not work using CMDK feat(core): add team badge to user info  <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a redesigned user info section in the sidebar, including enhanced account details, cloud and AI usage indicators, and team workspace listing with improved navigation. - Workspace selector now supports controlled open/close state for smoother sidebar integration. - Team workspaces are grouped and displayed with role-based badges and tooltips. - Added new localization for team roles and workspace tooltips. - **Improvements** - Updated theming and styling for user plan buttons and usage indicators for a more consistent look. - Sidebar user info UI is now more modular and responsive. - **Bug Fixes** - Improved error handling and loading states for quota and usage displays. - **Chores** - Refactored internal state management and code structure for better maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -2,25 +2,24 @@ import type { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { Workspace } from '@blocksuite/affine/store';
|
||||
import { ArrowRightBigIcon } from '@blocksuite/icons/rc';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
import { openWorkspaceListModalAtom } from '../components/atoms';
|
||||
import type { useNavigateHelper } from '../components/hooks/use-navigate-helper';
|
||||
import type { WorkspaceDialogService } from '../modules/dialogs';
|
||||
import type { WorkbenchService } from '../modules/workbench';
|
||||
import { registerAffineCommand } from './registry';
|
||||
|
||||
export function registerAffineNavigationCommands({
|
||||
t,
|
||||
store,
|
||||
docCollection,
|
||||
navigationHelper,
|
||||
workspaceDialogService,
|
||||
workbenchService,
|
||||
}: {
|
||||
t: ReturnType<typeof useI18n>;
|
||||
store: ReturnType<typeof createStore>;
|
||||
navigationHelper: ReturnType<typeof useNavigateHelper>;
|
||||
docCollection: Workspace;
|
||||
workspaceDialogService: WorkspaceDialogService;
|
||||
workbenchService?: WorkbenchService;
|
||||
}) {
|
||||
const unsubs: Array<() => void> = [];
|
||||
unsubs.push(
|
||||
@@ -82,7 +81,7 @@ export function registerAffineNavigationCommands({
|
||||
to: 'workspace',
|
||||
});
|
||||
|
||||
store.set(openWorkspaceListModalAtom, true);
|
||||
workbenchService?.workbench.openWorkspaceSelector();
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user