feat(core): show ai-island and navigate to chat page if not available in sidebar (#13085)

close AI-318, AI-317

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Updated the AI chat button label to "AFFiNE Intelligence" and changed
its icon for improved clarity.
* Enhanced the AI chat button's placement in the sidebar for better
accessibility.
* Improved the AI chat button’s visibility and interaction logic based
on current view and sidebar state.
* **Style**
* Adjusted button styles to disable interaction when hidden, enhancing
user experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Cats Juice
2025-07-08 21:17:28 +08:00
committed by GitHub
parent 0bd1f10498
commit e04d407b2f
3 changed files with 36 additions and 12 deletions
@@ -18,7 +18,7 @@ import { useI18n } from '@affine/i18n';
import { track } from '@affine/track';
import type { Store } from '@blocksuite/affine/store';
import {
AiIcon,
AiOutlineIcon,
AllDocsIcon,
ImportIcon,
JournalIcon,
@@ -97,8 +97,8 @@ const AIChatButton = () => {
);
return (
<MenuLinkItem icon={<AiIcon />} active={aiChatActive} to={'/chat'}>
<span data-testid="ai-chat">Intelligent</span>
<MenuLinkItem icon={<AiOutlineIcon />} active={aiChatActive} to={'/chat'}>
<span data-testid="ai-chat">AFFiNE Intelligence</span>
</MenuLinkItem>
);
};
@@ -198,10 +198,10 @@ export const RootAppSidebar = memo((): ReactElement => {
/>
<AddPageButton />
</div>
<AIChatButton />
<AllDocsButton />
<AppSidebarJournalButton />
{sessionStatus === 'authenticated' && <NotificationButton />}
<AIChatButton />
<MenuItem
data-testid="slider-bar-workspace-setting-button"
icon={<SettingsIcon />}