refactor: remove remaining dead code

This commit is contained in:
chengyongru
2026-08-23 19:08:00 +08:00
committed by chengyongru
parent 3852956a71
commit 961b1fdd7d
46 changed files with 85 additions and 250 deletions
+3 -3
View File
@@ -137,7 +137,7 @@ export function CapabilityMentionToken({
return <SessionMentionToken mention={segment.mention} label={segment.text} variant={variant} />;
}
export function SessionMentionToken({
function SessionMentionToken({
mention,
label,
variant,
@@ -172,7 +172,7 @@ export function SessionMentionToken({
);
}
export function CliAppMentionToken({
function CliAppMentionToken({
app,
label,
variant,
@@ -229,7 +229,7 @@ export function CliAppMentionToken({
);
}
export function McpPresetMentionToken({
function McpPresetMentionToken({
preset,
label,
variant,
+2 -2
View File
@@ -151,7 +151,7 @@ export function splitFilePath(path: string): { directory: string; name: string }
};
}
export function fileKindForPath(path: string): FileReferenceKind {
function fileKindForPath(path: string): FileReferenceKind {
const normalized = path.toLowerCase();
const name = normalized.split(/[\\/]/).pop() ?? normalized;
const ext = name.includes(".") ? name.split(".").pop() ?? "" : "";
@@ -193,7 +193,7 @@ export function fileKindForPath(path: string): FileReferenceKind {
}
}
export function FileReferenceIcon({ kind }: { kind: FileReferenceKind }) {
function FileReferenceIcon({ kind }: { kind: FileReferenceKind }) {
if (kind === "python") {
return (
<svg
+2 -2
View File
@@ -967,7 +967,7 @@ interface ReasoningBubbleProps {
hasBodyBelow: boolean;
}
export function ReasoningBubble({
function ReasoningBubble({
text,
streaming,
hasBodyBelow,
@@ -993,7 +993,7 @@ interface TraceGroupProps {
* collapsed because tool traces are supporting evidence, not the answer.
* A single click expands the exact calls when the user wants details.
*/
export function TraceGroup({ message }: TraceGroupProps) {
function TraceGroup({ message }: TraceGroupProps) {
const { t } = useTranslation();
const lines = message.traces ?? [message.content];
const count = lines.length;
@@ -174,7 +174,7 @@ export function ChannelLogo({
);
}
export function channelDisplayName(feature: NanobotFeatureInfo): string {
function channelDisplayName(feature: NanobotFeatureInfo): string {
return channelUiPresentation(feature.name, feature.webui)?.displayName ?? feature.display_name;
}
@@ -112,7 +112,7 @@ export function ChannelSetupLinks({
);
}
export function ChannelOfficialLink({
function ChannelOfficialLink({
feature,
setup,
}: {
@@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input";
import type { ChannelConfigField } from "@/components/settings/channels/catalog";
import { cn } from "@/lib/utils";
export function channelFieldValue(field: ChannelConfigField, values: Record<string, string>): string {
function channelFieldValue(field: ChannelConfigField, values: Record<string, string>): string {
return values[field.key] ?? field.defaultValue ?? field.options?.[0]?.value ?? "";
}
@@ -27,7 +27,7 @@ export type ChannelSetupPresentation = {
presets?: ChannelProviderPreset[];
};
export type ChannelCatalogSetupPresentation = {
type ChannelCatalogSetupPresentation = {
mode?: "webui" | "credentials" | "connect";
command?: string;
docsUrl?: string;
@@ -38,15 +38,15 @@ export type ChannelCatalogSetupPresentation = {
presets?: ChannelProviderPresetDefinition[];
};
export type ChannelFieldPresentation = {
type ChannelFieldPresentation = {
key: string;
};
export type ChannelSetupActionDefinition = Omit<ChannelSetupAction, "label">;
type ChannelSetupActionDefinition = Omit<ChannelSetupAction, "label">;
export type ChannelProviderPresetDefinition = Omit<ChannelProviderPreset, "label">;
export type ChannelSetupAction = {
type ChannelSetupAction = {
id: string;
label: string;
url?: string;
@@ -72,7 +72,7 @@ export type ChannelConfigField = {
options?: ChannelConfigOption[];
};
export type ChannelConfigOption = {
type ChannelConfigOption = {
value: string;
label: string;
};
+1 -1
View File
@@ -14,7 +14,7 @@ export type SettingsSectionKey =
| "runtime"
| "advanced";
export type PendingRestartSection = "runtime" | "browser" | "image";
type PendingRestartSection = "runtime" | "browser" | "image";
export type PendingRestartSections = Record<PendingRestartSection, boolean>;
export type RestartAwarePayload = {
@@ -51,7 +51,7 @@ import type { CliAppInfo, McpPresetInfo, ToolProgressEvent, UIFileEdit, UIMessag
const ACTIVITY_SCROLL_NEAR_BOTTOM_PX = 24;
export { isAgentActivityMember, isReasoningOnlyAssistant };
export { isAgentActivityMember };
interface ActivityCounts {
reasoningSteps: number;
@@ -155,7 +155,7 @@ function FileEditRow({
);
}
export function hasVisibleDiffStats(edit: Pick<FileEditSummary, "added" | "deleted">): boolean {
function hasVisibleDiffStats(edit: Pick<FileEditSummary, "added" | "deleted">): boolean {
return edit.added > 0 || edit.deleted > 0;
}
@@ -3,7 +3,7 @@ import { compactActivityPath, redactActivityText } from "./activity-text";
export type GenericToolStatus = "running" | "done" | "error";
export type ToolFamily = "content-search" | "file-search" | "list" | "read" | "memory" | "generic";
export interface ToolField {
interface ToolField {
key:
| "query"
| "pattern"
@@ -7,7 +7,7 @@ import { displayWebHost, formatCompactWebUrl, parseSafeActivityHttpUrl } from ".
export type WebSearchStatus = "running" | "done" | "error";
export type WebSearchTarget = "web" | "x";
export interface WebSearchSource {
interface WebSearchSource {
title: string;
href: string;
host: string;
@@ -26,13 +26,13 @@ export function userPromptAnchors(messages: UIMessage[]): PromptAnchor[] {
});
}
export function promptLabel(content: string, index: number): string {
function promptLabel(content: string, index: number): string {
const text = content.replace(/\s+/g, " ").trim();
if (!text) return `Prompt ${index + 1}`;
return truncatePreview(text, 80);
}
export function promptPreview(content: string, index: number): string {
function promptPreview(content: string, index: number): string {
const text = compactPreview(content);
if (!text) return `Prompt ${index + 1}`;
return truncatePreview(text, 320);
+1 -1
View File
@@ -33,7 +33,7 @@ const buttonVariants = cva(
},
);
export interface ButtonProps
interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
+1 -1
View File
@@ -3,7 +3,7 @@ import * as React from "react";
import { formControlFocusClassName } from "@/components/ui/form-control";
import { cn } from "@/lib/utils";
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
+1 -1
View File
@@ -3,7 +3,7 @@ import * as React from "react";
import { formControlFocusClassName } from "@/components/ui/form-control";
import { cn } from "@/lib/utils";
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
({ className, ...props }, ref) => {
@@ -12,7 +12,7 @@ export type {
export const MAX_WORKBENCH_PANES = 4;
export const WORKBENCH_LAYOUTS = [
const WORKBENCH_LAYOUTS = [
"columns",
"rows",
"grid",