fix(core): remove network search button on ask ai input (#13373)

Close [AI-395](https://linear.app/affine-design/issue/AI-395)

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

## Summary by CodeRabbit

* **Refactor**
* Removed the network search feature and its related UI elements from
the AI input panel. The input panel now only includes the input textarea
and send button.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Wu Yue
2025-07-31 14:43:32 +08:00
committed by GitHub
parent 8d889fc3c7
commit dfce0116b6

View File

@@ -3,7 +3,7 @@ import { SignalWatcher, WithDisposable } from '@blocksuite/affine/global/lit';
import { ColorScheme } from '@blocksuite/affine/model';
import { unsafeCSSVarV2 } from '@blocksuite/affine/shared/theme';
import { stopPropagation } from '@blocksuite/affine/shared/utils';
import { PublishIcon, SendIcon } from '@blocksuite/icons/lit';
import { SendIcon } from '@blocksuite/icons/lit';
import {
darkCssVariablesV2,
lightCssVariablesV2,
@@ -11,8 +11,6 @@ import {
import { css, html, LitElement, nothing, unsafeCSS } from 'lit';
import { property, query, state } from 'lit/decorators.js';
import type { AINetworkSearchConfig } from '../../type';
export class AIPanelInput extends SignalWatcher(WithDisposable(LitElement)) {
static override styles = css`
:host {
@@ -217,14 +215,6 @@ export class AIPanelInput extends SignalWatcher(WithDisposable(LitElement)) {
this.remove();
};
private readonly _toggleNetworkSearch = (e: MouseEvent) => {
e.preventDefault();
e.stopPropagation();
const enable = this.networkSearchConfig.enabled.value;
this.networkSearchConfig.setEnabled(!enable);
};
override render() {
return html`<div class="root">
<div class="star">${AIStarIcon}</div>
@@ -242,21 +232,6 @@ export class AIPanelInput extends SignalWatcher(WithDisposable(LitElement)) {
@paste=${stopPropagation}
@keyup=${stopPropagation}
></textarea>
${this.networkSearchConfig.visible.value
? html`
<div
class="network"
data-active=${!!this.networkSearchConfig.enabled.value}
@click=${this._toggleNetworkSearch}
@pointerdown=${stopPropagation}
>
${PublishIcon()}
<affine-tooltip .offsetY=${12}>
Toggle Network Search
</affine-tooltip>
</div>
`
: nothing}
<div
class="arrow"
data-testid="ai-panel-input-send"
@@ -284,9 +259,6 @@ export class AIPanelInput extends SignalWatcher(WithDisposable(LitElement)) {
@state()
private accessor _hasContent = false;
@property({ attribute: false })
accessor networkSearchConfig!: AINetworkSearchConfig;
@property({ attribute: false })
accessor onFinish: ((input: string) => void) | undefined = undefined;