mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08: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:
+18
-21
@@ -6,7 +6,6 @@ import {
|
|||||||
} from '@blocksuite/affine/components/context-menu';
|
} from '@blocksuite/affine/components/context-menu';
|
||||||
import { SignalWatcher, WithDisposable } from '@blocksuite/affine/global/lit';
|
import { SignalWatcher, WithDisposable } from '@blocksuite/affine/global/lit';
|
||||||
import {
|
import {
|
||||||
AiOutlineIcon,
|
|
||||||
ArrowDownSmallIcon,
|
ArrowDownSmallIcon,
|
||||||
ThinkingIcon,
|
ThinkingIcon,
|
||||||
WebIcon,
|
WebIcon,
|
||||||
@@ -82,9 +81,9 @@ export class ChatInputPreference extends SignalWatcher(
|
|||||||
| undefined;
|
| undefined;
|
||||||
// --------- search props end ---------
|
// --------- search props end ---------
|
||||||
|
|
||||||
private readonly _onModelChange = (modelId: string) => {
|
// private readonly _onModelChange = (modelId: string) => {
|
||||||
this.onModelChange?.(modelId);
|
// this.onModelChange?.(modelId);
|
||||||
};
|
// };
|
||||||
|
|
||||||
openPreference(e: Event) {
|
openPreference(e: Event) {
|
||||||
const element = e.currentTarget;
|
const element = e.currentTarget;
|
||||||
@@ -93,20 +92,20 @@ export class ChatInputPreference extends SignalWatcher(
|
|||||||
const searchItems = [];
|
const searchItems = [];
|
||||||
|
|
||||||
// model switch
|
// model switch
|
||||||
modelItems.push(
|
// modelItems.push(
|
||||||
menu.subMenu({
|
// menu.subMenu({
|
||||||
name: 'Model',
|
// name: 'Model',
|
||||||
prefix: AiOutlineIcon(),
|
// prefix: AiOutlineIcon(),
|
||||||
options: {
|
// options: {
|
||||||
items: (this.session?.optionalModels ?? []).map(modelId => {
|
// items: (this.session?.optionalModels ?? []).map(modelId => {
|
||||||
return menu.action({
|
// return menu.action({
|
||||||
name: modelId,
|
// name: modelId,
|
||||||
select: () => this._onModelChange(modelId),
|
// select: () => this._onModelChange(modelId),
|
||||||
});
|
// });
|
||||||
}),
|
// }),
|
||||||
},
|
// },
|
||||||
})
|
// })
|
||||||
);
|
// );
|
||||||
|
|
||||||
modelItems.push(
|
modelItems.push(
|
||||||
menu.toggleSwitch({
|
menu.toggleSwitch({
|
||||||
@@ -152,9 +151,7 @@ export class ChatInputPreference extends SignalWatcher(
|
|||||||
data-testid="chat-input-preference-trigger"
|
data-testid="chat-input-preference-trigger"
|
||||||
class="chat-input-preference-trigger"
|
class="chat-input-preference-trigger"
|
||||||
>
|
>
|
||||||
<span class="chat-input-preference-trigger-label">
|
<span class="chat-input-preference-trigger-label"> Claude </span>
|
||||||
${this.modelId || this.session?.model}
|
|
||||||
</span>
|
|
||||||
<span class="chat-input-preference-trigger-icon">
|
<span class="chat-input-preference-trigger-icon">
|
||||||
${ArrowDownSmallIcon()}
|
${ArrowDownSmallIcon()}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user