-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[AI] Match ai chat composer to figma #18874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ehconitin
wants to merge
19
commits into
main
Choose a base branch
from
ai-fast-follows-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+601
−400
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
40e9940
feat: add hover on rounded icon button
ehconitin b5c6dc1
Merge remote-tracking branch 'upstream/main' into ai-fast-follows-1
ehconitin 681fb56
Add model selector dropdown to chat composer and fix ModelFamily enum…
ehconitin 30f9584
Clean up model select: declarative array, remove unused import, fix o…
ehconitin 2728444
Merge remote-tracking branch 'upstream/main' into ai-fast-follows-1
ehconitin 9e4cc2d
Make chat model picker a user-level localStorage preference instead o…
ehconitin bca4d81
Validate stored model against current workspace before using it
ehconitin 368a05b
chore: lint
ehconitin a74dad5
Refactor AIChatEditorSection to use resolved model ID and update stat…
ehconitin f4be8b3
Merge branch 'main' into ai-fast-follows-1
FelixMalfait e9b0351
refactor(ai): use workspace default chat model selection
ehconitin 74988c1
Merge remote-tracking branch 'upstream/ai-fast-follows-1' into ai-fas…
ehconitin 0247fd3
Merge remote-tracking branch 'upstream/main' into ai-fast-follows-1
ehconitin cac7686
revert: auto generated file
ehconitin 37077c2
Merge remote-tracking branch 'upstream/main' into ai-fast-follows-1
ehconitin ca7d7b1
reviuew
ehconitin a4613fa
Merge branch 'main' into ai-fast-follows-1
FelixMalfait 9d31090
Begin small refacto
FelixMalfait 3d7346d
UI improvements
FelixMalfait File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
1 change: 0 additions & 1 deletion
1
packages/twenty-front/src/modules/ai/constants/DefaultFastModel.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/twenty-front/src/modules/ai/constants/DefaultSmartModel.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
23 changes: 23 additions & 0 deletions
23
packages/twenty-front/src/modules/ai/hooks/useAgentChatModelId.ts
This file contains hidden or 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,23 @@ | ||
| import { isDefined } from 'twenty-shared/utils'; | ||
|
|
||
| import { useWorkspaceAiModelAvailability } from '@/ai/hooks/useWorkspaceAiModelAvailability'; | ||
| import { agentChatUserSelectedModelState } from '@/ai/states/agentChatUserSelectedModelState'; | ||
| import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; | ||
|
|
||
| export const useAgentChatModelId = () => { | ||
| const { enabledModels } = useWorkspaceAiModelAvailability(); | ||
| const agentChatUserSelectedModel = useAtomStateValue( | ||
| agentChatUserSelectedModelState, | ||
| ); | ||
|
|
||
| const isUserModelAvailable = | ||
| !isDefined(agentChatUserSelectedModel) || | ||
| enabledModels.some((model) => model.modelId === agentChatUserSelectedModel); | ||
|
|
||
| const selectedModelId = isUserModelAvailable | ||
| ? agentChatUserSelectedModel | ||
| : null; | ||
| const modelIdForRequest = selectedModelId ?? undefined; | ||
|
|
||
| return { selectedModelId, modelIdForRequest }; | ||
| }; |
This file contains hidden or 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 hidden or 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
8 changes: 8 additions & 0 deletions
8
packages/twenty-front/src/modules/ai/states/agentChatUserSelectedModelState.ts
This file contains hidden or 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,8 @@ | ||
| import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState'; | ||
|
|
||
| export const agentChatUserSelectedModelState = createAtomState<string | null>({ | ||
| key: 'ai/agentChatUserSelectedModel', | ||
| defaultValue: null, | ||
| useLocalStorage: true, | ||
| localStorageOptions: { getOnInit: true }, | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.