-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(toolkit): New Command Dialog (#722)
* feat(toolkit): improved command menu * feat(toolkit): improved command menu * feat(toolkit): improved command menu * filter out global commands * add custom action * improve dialog styling * add close on select option * new command menu
- Loading branch information
Showing
13 changed files
with
574 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,4 +122,4 @@ | |
"storybook": "^8.2.6", | ||
"vitest": "^2.0.5" | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/interfaces/assistants_web/src/components/Agents/AgentLogo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { AgentPublic } from '@/cohere-client'; | ||
import { CoralLogo, Text } from '@/components/Shared'; | ||
import { useBrandedColors } from '@/hooks/brandedColors'; | ||
import { cn } from '@/utils'; | ||
|
||
export const AgentLogo = ({ agent }: { agent: AgentPublic }) => { | ||
const isBaseAgent = !agent.id; | ||
const { bg, contrastText, contrastFill } = useBrandedColors(agent.id); | ||
|
||
return ( | ||
<div className={cn('flex size-5 flex-shrink-0 items-center justify-center rounded', bg)}> | ||
{isBaseAgent && <CoralLogo className={cn(contrastFill, 'size-3')} />} | ||
{!isBaseAgent && ( | ||
<Text className={cn('uppercase', contrastText)} styleAs="p-sm"> | ||
{agent.name[0]} | ||
</Text> | ||
)} | ||
</div> | ||
); | ||
}; |
75 changes: 53 additions & 22 deletions
75
src/interfaces/assistants_web/src/components/Shared/HotKeys/CommandAction.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
src/interfaces/assistants_web/src/components/Shared/HotKeys/HotKeys.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
'use client'; | ||
|
||
import { HotKeysProvider } from '@/components/Shared/HotKeys/HotKeysProvider'; | ||
import { useChatHotKeys, useLayoutHotKeys } from '@/hooks/actions'; | ||
import { | ||
useAssistantHotKeys, | ||
useConversationHotKeys, | ||
useSettingsHotKeys, | ||
useViewHotKeys, | ||
} from '@/hooks/actions'; | ||
|
||
export const HotKeys: React.FC = () => { | ||
const chatHotKeys = useChatHotKeys(); | ||
const layoutHotKeys = useLayoutHotKeys(); | ||
const hotKeys = [...chatHotKeys, ...layoutHotKeys]; | ||
const conversationHotKeys = useConversationHotKeys(); | ||
const viewHotKeys = useViewHotKeys(); | ||
const settingsHotKeys = useSettingsHotKeys(); | ||
const assistantHotKeys = useAssistantHotKeys({ displayRecentAgentsInDialog: false }); | ||
const hotKeys = [...conversationHotKeys, ...viewHotKeys, ...assistantHotKeys, ...settingsHotKeys]; | ||
|
||
return <HotKeysProvider hotKeys={hotKeys} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.