mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-05 17:13:43 +00:00
feat(core): hide model switch menu (#13070)
Close [AI-307](https://linear.app/affine-design/issue/AI-307)  <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Simplified the preference popup by removing the model selection submenu and displaying a static model label ("Claude"). * Only the "Extended Thinking" and "Web Search" toggle options remain in the popup menu. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
} from '@blocksuite/affine/components/context-menu';
|
||||
import { SignalWatcher, WithDisposable } from '@blocksuite/affine/global/lit';
|
||||
import {
|
||||
AiOutlineIcon,
|
||||
ArrowDownSmallIcon,
|
||||
ThinkingIcon,
|
||||
WebIcon,
|
||||
@@ -82,9 +81,9 @@ export class ChatInputPreference extends SignalWatcher(
|
||||
| undefined;
|
||||
// --------- search props end ---------
|
||||
|
||||
private readonly _onModelChange = (modelId: string) => {
|
||||
this.onModelChange?.(modelId);
|
||||
};
|
||||
// private readonly _onModelChange = (modelId: string) => {
|
||||
// this.onModelChange?.(modelId);
|
||||
// };
|
||||
|
||||
openPreference(e: Event) {
|
||||
const element = e.currentTarget;
|
||||
@@ -93,20 +92,20 @@ export class ChatInputPreference extends SignalWatcher(
|
||||
const searchItems = [];
|
||||
|
||||
// model switch
|
||||
modelItems.push(
|
||||
menu.subMenu({
|
||||
name: 'Model',
|
||||
prefix: AiOutlineIcon(),
|
||||
options: {
|
||||
items: (this.session?.optionalModels ?? []).map(modelId => {
|
||||
return menu.action({
|
||||
name: modelId,
|
||||
select: () => this._onModelChange(modelId),
|
||||
});
|
||||
}),
|
||||
},
|
||||
})
|
||||
);
|
||||
// modelItems.push(
|
||||
// menu.subMenu({
|
||||
// name: 'Model',
|
||||
// prefix: AiOutlineIcon(),
|
||||
// options: {
|
||||
// items: (this.session?.optionalModels ?? []).map(modelId => {
|
||||
// return menu.action({
|
||||
// name: modelId,
|
||||
// select: () => this._onModelChange(modelId),
|
||||
// });
|
||||
// }),
|
||||
// },
|
||||
// })
|
||||
// );
|
||||
|
||||
modelItems.push(
|
||||
menu.toggleSwitch({
|
||||
@@ -152,9 +151,7 @@ export class ChatInputPreference extends SignalWatcher(
|
||||
data-testid="chat-input-preference-trigger"
|
||||
class="chat-input-preference-trigger"
|
||||
>
|
||||
<span class="chat-input-preference-trigger-label">
|
||||
${this.modelId || this.session?.model}
|
||||
</span>
|
||||
<span class="chat-input-preference-trigger-label"> Claude </span>
|
||||
<span class="chat-input-preference-trigger-icon">
|
||||
${ArrowDownSmallIcon()}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user