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