Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

♻️ refactor(ui): migrate antd Spin, Progress, Badge, Result, Pagination, Tooltip, Popover, Empty and Upload to base-ui (#19606)

Innei0ec5751c598d
diff --git a/.agents/skills/design-prototype/SKILL.md b/.agents/skills/design-prototype/SKILL.md
index bd86ed84e7f..880e6413bd1 100644
--- a/.agents/skills/design-prototype/SKILL.md
+++ b/.agents/skills/design-prototype/SKILL.md
@@ -120,8 +120,8 @@ _demonstrates_:
ideally behind a state-toggle strip like the template's. A happy-path-only
prototype under-specifies the design and silently blesses missing states.
- Reuse the app's **surface contracts**: side panels are `DraggablePanel`
- (collapse + drag-resize come free), loading is skeleton/`NeuralNetworkLoading`
- (never antd `Spin`), modals via `createModal`-style flows.
+ (collapse + drag-resize come free), loading follows the ux skill's feedback §4.1
+ scenario table (skeleton / base-ui `Spin`, `variant="network"` only for AI work), modals via `createModal`-style flows.
- Don't paint affordances you don't wire (`cursor: zoom-in` with no zoom, keycap
chips with no keys) — in an _interactive_ prototype a dead affordance is a spec bug.
- Walk the ux Quick review against the prototype before delivering; annotate
diff --git a/.agents/skills/design-prototype/references/template.html b/.agents/skills/design-prototype/references/template.html
index 8f3a4f34663..1f508dfdb80 100644
--- a/.agents/skills/design-prototype/references/template.html
+++ b/.agents/skills/design-prototype/references/template.html
@@ -80,7 +80,7 @@
{state === 'data' && <Text>Replace me with the real surface.</Text>}
{state === 'empty' && <Empty description="Nothing here yet" />}
{state === 'loading' && (
- <Text type="secondary">skeleton / NeuralNetworkLoading here…</Text>
+ <Text type="secondary">skeleton / Spin here…</Text>
)}
{state === 'error' && (
<Flexbox align="center" gap={8}>
diff --git a/.agents/skills/react/SKILL.md b/.agents/skills/react/SKILL.md
index fee7334d8ef..33e379db215 100644
--- a/.agents/skills/react/SKILL.md
+++ b/.agents/skills/react/SKILL.md
@@ -82,7 +82,7 @@ Use `Flexbox` and `Center` from `@lobehub/ui`. See `references/layout-kit.md` fo
## Related Skills
-- **`ux`**: loading visuals and user-facing interaction design. Do not use antd `Spin` / `<Spin />`.
+- **`ux`**: loading visuals (scenario → loader table in `references/feedback.md` §4.1) and user-facing interaction design.
- **`modal`**: imperative base-ui modal patterns.
- **`spa-routes`**: SPA navigation, route ownership, router configuration, and `.desktop` variants.
- **`compose-atoms`**: split a heavy domain feature into mountable capability atoms; each host imports only what it mounts.
diff --git a/.agents/skills/ux-audit/references/pattern-catalog.md b/.agents/skills/ux-audit/references/pattern-catalog.md
index 5fb2758833e..3abaccd017d 100644
--- a/.agents/skills/ux-audit/references/pattern-catalog.md
+++ b/.agents/skills/ux-audit/references/pattern-catalog.md
@@ -1,6 +1,6 @@
# Pattern Catalog — the _Designing Interfaces_ benchmark
-The pattern language from Jenifer Tidwell's **_Designing Interfaces_** (with a few
+The pattern language from Jenifer Tidwell's _**Designing Interfaces**_ (with a few
common web/app additions), grouped by family. Use it in **step 2** of the audit: walk
each family and tag which patterns the surface implements — and, just as important, which
expected ones are **absent**.
@@ -70,8 +70,8 @@ no way to see new items; a list with no empty state) is a finding.
## Feedback & system response
-- **Loading Indicator / Spinner / Skeleton** — in-flight feedback (LobeHub: skeleton /
- `NeuralNetworkLoading`, never antd `Spin`).
+- **Loading Indicator / Spinner / Skeleton** — in-flight feedback (LobeHub: pick by the ux
+ skill's feedback §4.1 scenario table — skeleton / base-ui `Spin`, never antd `Spin`).
- **Progress Indicator** — bounded progress for known-length work.
- **Update Indicator** — "N new" signal for background changes.
- **Failure + Retry** — a terminal error state with a way to recover (ux §4.2).
diff --git a/.agents/skills/ux/SKILL.md b/.agents/skills/ux/SKILL.md
index e7a34157d98..71002574164 100644
--- a/.agents/skills/ux/SKILL.md
+++ b/.agents/skills/ux/SKILL.md
@@ -144,7 +144,7 @@ Use this scan to identify applicable checks, then read the linked module for its
**Feedback — loading & system response** ([feedback.md](references/feedback.md))
-- [ ] Use project loaders rather than antd `Spin`.
+- [ ] Loading form matches the scenario table in [feedback §4.1](references/feedback.md).
- [ ] Match skeleton structure to measured rendered layouts, including platform and route variants.
- [ ] Loading and load-more failures have visible recovery paths; failed items persist rather than auto-dismiss.
- [ ] Dependent-fetch gates release on settled data, absence, or error; error/not-found branches remain reachable.
diff --git a/.agents/skills/ux/references/feedback.md b/.agents/skills/ux/references/feedback.md
index 8c713ed3c45..2fa1c92d6fa 100644
--- a/.agents/skills/ux/references/feedback.md
+++ b/.agents/skills/ux/references/feedback.md
@@ -8,18 +8,37 @@ tagged with the design value(s) it serves.
## 4.1 Loading visuals・Natural
-**Never use antd `Spin`** — it doesn't match the product's loading visual. Use a project
-loader:
-
-| Need | Component |
-| --------------------------- | ----------------------------------------------------------------------------- |
-| Default loading (in-flight) | `NeuralNetworkLoading` from `@/components/NeuralNetworkLoading` (`size` prop) |
-| Inline dots | `DotsLoading` / `BubblesLoading` from `@/components` |
-| Branded full-page | `Loading` from `@/components/Loading/BrandTextLoading` |
-| List / card placeholder | a skeleton (e.g. `SkeletonList`) |
-
-When in doubt, reach for `NeuralNetworkLoading` — the default in-flight indicator (e.g.
-modal "in progress" states). Minimise layout shift (CLS): the strongest loading state
+This section is the single source for **which loading form fits which scenario**; other
+skills link here instead of restating it. Pick by scenario, top to bottom — the first row
+that matches wins:
+
+| Scenario | Form |
+| ----------------------------------------------------------- | -------------------------------------------------------------------------- |
+| App boot / full-screen blocking wait | `BrandTextLoading` from `@/components/Loading/BrandTextLoading` |
+| Route / page first paint (layout known) | route skeleton from `@/components/Skeleton/*` mirroring the page structure |
+| Known-shape content (list, card, detail) | in-place `Skeleton` / `ListSkeleton` — keep the chrome, swap only the text |
+| Unknown-shape content region (file preview, QR, modal body) | `Spin size="large"` centred |
+| Inline / button / background refresh (revalidate, saving) | `Spin size="small"`, or `Button`'s `loading` prop for the button itself |
+| AI thinking, generating or running a tool | `Spin variant="network"` |
+| Waiting for a streamed reply's first token | `BubblesLoading` from `@/components/BubblesLoading` |
+| Long job with a known progress value | `Progress` + persisted elapsed readout (see below) |
+
+`Spin` and `Progress` come from `@lobehub/ui/base-ui`; never antd `Spin` / `Progress`.
+Sizes: `small` for 14–20 px contexts (inline, rows, buttons), `middle` for 24–32 px (card
+body, panel), `large` for 36–48 px (centred region). A pixel number is fine when the loader
+must replace an icon of an exact size.
+
+**`variant="network"` means "the AI is working", nothing else.** A settings save or a list
+fetch uses the default variant; using `network` for plain I/O dilutes the one signal that
+tells the user the agent is busy.
+
+**Running-status glyphs are not loaders.** `RingLoading` (a row's running status),
+`StopLoading` (a running action that can be stopped) and `DotsLoading` (a topic row still
+generating) mark an item's _state_ inside a list; keep them there and don't use them as
+region loaders. `CircleLoading` and `ContentLoading` are legacy wrappers — new code uses
+`Spin` directly.
+
+Minimise layout shift (CLS): the strongest loading state
changes as little of the final layout as possible. When a surface already knows its shape
(card, row, list item), keep the layout elements — container, border, radius, padding,
icon — and replace only the text/data with a skeleton sized like the text it stands in
@@ -51,7 +70,8 @@ doesn't leak a stale start onto a later one that reuses the slot.
**Checklist**
-- [ ] No antd `Spin`; use `NeuralNetworkLoading` / project loaders. _(Natural)_
+- [ ] Loading form picked from the §4.1 scenario table; base-ui `Spin`, never antd `Spin`. _(Natural)_
+- [ ] `Spin variant="network"` only while the AI is thinking / generating / running a tool. _(Certainty)_
- [ ] Skeleton reuses the loaded component's chrome — content swap, not relayout. _(Certainty・Natural)_
- [ ] Skeleton lines match the real text's **height and typical width proportion** (long title line over a shorter subtitle, not equal full-width bars). _(Certainty)_
- [ ] Known-shape surface not downgraded to a bare block / spinner. _(Natural)_
@@ -233,7 +253,7 @@ flag in `finally`, and on `catch` surface the error + a retry; a failed write mu
permanently disable the only way forward.
> ✅ A panel whose data request errors or exceeds its timeout shows "加载失败" with a
-> **Reload** button that refetches. ❌ A `NeuralNetworkLoading` that spins indefinitely when
+> **Reload** button that refetches. ❌ A `Spin` that spins indefinitely when
> the request hangs. ❌ `isInit` set only in the success handler, so a failed fetch leaves
> the skeleton up forever. ❌ The onboarding language step `await setSettings(...)` — the write
> that gates `commonStepsCompleted` — with no try/catch/finally, so a failed write leaves
diff --git a/.agents/skills/ux/references/read.md b/.agents/skills/ux/references/read.md
index 76379379e49..e0f8d83d6e6 100644
--- a/.agents/skills/ux/references/read.md
+++ b/.agents/skills/ux/references/read.md
@@ -16,8 +16,8 @@ clear next action (CTA + value props); distinguish "no data yet" (onboarding CTA
"no match for filters" (clear-filters affordance) — they are different screens. When a
surface keeps its toolbar/header mounted with no data (so a create / `+` affordance
stays reachable), the **body** below must still render an empty placeholder —
-persistent chrome is no excuse for dead space. Loading uses a skeleton /
-`NeuralNetworkLoading`, never a flash of blank or a layout shift; error surfaces the
+persistent chrome is no excuse for dead space. Loading follows the
+[feedback §4.1](./feedback.md) scenario table, never a flash of blank or a layout shift; error surfaces the
reason and a retry/back path.
The single most common way this breaks: the fetch reads only `{ data, isLoading }`, never
@@ -109,7 +109,7 @@ Distinguish `error` (transient → reason + retry, keep the URL) from a resolved
- [ ] A list merged from a fetched set + a **static/frontend set** (`[...fetched, ...placeholders]`, a catalog padded with "coming soon" rows) branches `error` **before** merging — a failed fetch there keeps `length > 0` via the static entries, so neither the empty guard nor an error-unread call site catches it (a plausible partial catalog); `fallbackData: []` makes it automatic. _(Certainty・Meaningful)_
- [ ] A detail page reads `error` before falling to `NotFound` — a failed fetch shows a reload state, not a "doesn't exist" 404 (deleted vs failed-to-load are different screens). _(Certainty・Meaningful)_
- [ ] Always-rendered chrome still renders a body empty placeholder. _(Meaningful)_
-- [ ] Loading designed (skeleton / NeuralNetworkLoading), no layout shift — a detail page's "record not loaded yet" is a skeleton, never a bare `return null` / blank. _(Natural)_
+- [ ] Loading designed per feedback §4.1 (skeleton / `Spin`), no layout shift — a detail page's "record not loaded yet" is a skeleton, never a bare `return null` / blank. _(Natural)_
- [ ] Error designed with reason + retry/back path. _(Meaningful)_
## 1.2 Lists at scale・Certainty・Natural
diff --git a/DESIGN.md b/DESIGN.md
index 2c33ee8841a..594da04bf35 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -139,7 +139,7 @@ The shadow tokens are shared across light and dark. Only the surface and border
Motion clarifies change; it is never decoration. Honor `prefers-reduced-motion` by dropping nonessential animation.
-When motion helps — revealing, moving, or connecting elements — keep it short and physical: roughly 100–200ms for state changes and popovers, up to \~300ms for overlays and modals. Avoid long, looping, or attention-grabbing animation. For AI/loading moments, prefer the system's purpose-built loaders (skeletons, `NeuralNetworkLoading`) over ad-hoc spinners.
+When motion helps — revealing, moving, or connecting elements — keep it short and physical: roughly 100–200ms for state changes and popovers, up to \~300ms for overlays and modals. Avoid long, looping, or attention-grabbing animation. For AI/loading moments, pick the loader from the `ux` skill's scenario table (skeletons, base-ui `Spin`, `variant="network"` for AI work) over ad-hoc spinners.
## Shapes
diff --git a/package.json b/package.json
index b83eb68d6bd..93c39149b55 100644
--- a/package.json
+++ b/package.json
@@ -321,7 +321,7 @@
"@lobehub/icons": "^5.18.0",
"@lobehub/market-sdk": "0.41.0",
"@lobehub/tts": "^5.1.2",
- "@lobehub/ui": "^5.47.0",
+ "@lobehub/ui": "^5.50.0",
"@modelcontextprotocol/sdk": "^1.30.0",
"@neondatabase/serverless": "^1.1.0",
"@next/third-parties": "^16.3.0",
diff --git a/packages/builtin-tool-agent-documents/src/client/Streaming/CreateDocument/index.tsx b/packages/builtin-tool-agent-documents/src/client/Streaming/CreateDocument/index.tsx
index 40909176708..fea9fcab9d5 100644
--- a/packages/builtin-tool-agent-documents/src/client/Streaming/CreateDocument/index.tsx
+++ b/packages/builtin-tool-agent-documents/src/client/Streaming/CreateDocument/index.tsx
@@ -2,12 +2,12 @@
import type { BuiltinStreamingProps } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { FileTextIcon } from 'lucide-react';
import { memo } from 'react';
import BubblesLoading from '@/components/BubblesLoading';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import StreamingMarkdown from '@/components/StreamingMarkdown';
import type { CreateDocumentArgs } from '../../../types';
@@ -54,7 +54,7 @@ export const CreateDocumentStreaming = memo<BuiltinStreamingProps<CreateDocument
<Flexbox flex={1}>
<div className={styles.title}>{title}</div>
</Flexbox>
- <NeuralNetworkLoading size={20} />
+ <Spin size="middle" variant="network" />
</Flexbox>
{!content ? (
<Flexbox paddingBlock={16} paddingInline={12}>
diff --git a/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx b/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx
index 5a27c048ca4..28e9f4cc95a 100644
--- a/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx
+++ b/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx
@@ -2,8 +2,15 @@
import { DEFAULT_AVATAR } from '@lobechat/const';
import type { BuiltinInterventionProps } from '@lobechat/types';
-import { Accordion, AccordionItem, Flexbox, Icon, stopPropagation, Tooltip } from '@lobehub/ui';
-import { Avatar } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon, stopPropagation, Tooltip } from '@lobehub/ui';
+import {
+ AccordionHeader,
+ AccordionItem,
+ AccordionPanel,
+ AccordionRoot,
+ AccordionTrigger,
+ Avatar,
+} from '@lobehub/ui/base-ui';
import { Input, InputNumber } from 'antd';
import { createStaticStyles, useTheme } from 'antd-style';
import isEqual from 'fast-deep-equal';
@@ -107,65 +114,68 @@ const TaskEditor = memo<TaskEditorProps>(({ task, index, onChange, onDelete }) =
}, [index, onDelete]);
return (
- <AccordionItem
- defaultExpand
- itemKey={String(index)}
- paddingBlock={4}
- paddingInline={2}
- title={
- <Flexbox horizontal align={'center'} gap={8}>
- <div className={styles.assignee}>
- <Avatar
- avatar={agent?.avatar || DEFAULT_AVATAR}
- background={agent?.backgroundColor || theme.colorBgContainer}
- shape={'circle'}
- size={20}
- />
- <span>{agent?.title}</span>
- </div>
- </Flexbox>
- }
- >
- <Flexbox gap={12} style={{ marginTop: 8 }}>
- <Flexbox horizontal gap={12}>
- <Input
- placeholder={t('agentGroupManagement.executeTasks.intervention.titlePlaceholder')}
- size={'small'}
- value={task.title}
- variant={'filled'}
- onChange={handleTitleChange}
- />
- <Flexbox horizontal align={'center'} gap={8} onClick={stopPropagation}>
- <Tooltip title={t('agentGroupManagement.executeTask.intervention.timeout')}>
- <Clock size={14} />
- </Tooltip>
- <InputNumber
- className={styles.timeoutInput}
- max={120}
- min={1}
- size={'small'}
- suffix={t('agentGroupManagement.executeTask.intervention.timeoutUnit')}
- value={Math.round((task.timeout || DEFAULT_TIMEOUT) / 60_000)}
+ <AccordionRoot defaultValue={['task']} variant={'borderless'}>
+ <AccordionItem value={'task'}>
+ <AccordionHeader style={{ paddingBlock: 4, paddingInline: 2 }}>
+ <AccordionTrigger>
+ <Flexbox horizontal align={'center'} gap={8}>
+ <div className={styles.assignee}>
+ <Avatar
+ avatar={agent?.avatar || DEFAULT_AVATAR}
+ background={agent?.backgroundColor || theme.colorBgContainer}
+ shape={'circle'}
+ size={20}
+ />
+ <span>{agent?.title}</span>
+ </div>
+ </Flexbox>
+ </AccordionTrigger>
+ </AccordionHeader>
+ <AccordionPanel>
+ <Flexbox gap={12} style={{ marginTop: 8 }}>
+ <Flexbox horizontal gap={12}>
+ <Input
+ placeholder={t('agentGroupManagement.executeTasks.intervention.titlePlaceholder')}
+ size={'small'}
+ value={task.title}
+ variant={'filled'}
+ onChange={handleTitleChange}
+ />
+ <Flexbox horizontal align={'center'} gap={8} onClick={stopPropagation}>
+ <Tooltip title={t('agentGroupManagement.executeTask.intervention.timeout')}>
+ <Clock size={14} />
+ </Tooltip>
+ <InputNumber
+ className={styles.timeoutInput}
+ max={120}
+ min={1}
+ size={'small'}
+ suffix={t('agentGroupManagement.executeTask.intervention.timeoutUnit')}
+ value={Math.round((task.timeout || DEFAULT_TIMEOUT) / 60_000)}
+ variant={'filled'}
+ onChange={handleTimeoutChange}
+ />
+ <Icon
+ className={styles.deleteButton}
+ icon={Trash2}
+ size={{ size: 16 }}
+ onClick={handleDelete}
+ />
+ </Flexbox>
+ </Flexbox>
+ <Input.TextArea
+ autoSize={{ maxRows: 20, minRows: 8 }}
+ value={task.instruction}
variant={'filled'}
- onChange={handleTimeoutChange}
- />
- <Icon
- className={styles.deleteButton}
- icon={Trash2}
- size={{ size: 16 }}
- onClick={handleDelete}
+ placeholder={t(
+ 'agentGroupManagement.executeTasks.intervention.instructionPlaceholder',
+ )}
+ onChange={handleInstructionChange}
/>
</Flexbox>
- </Flexbox>
- <Input.TextArea
- autoSize={{ maxRows: 20, minRows: 8 }}
- placeholder={t('agentGroupManagement.executeTasks.intervention.instructionPlaceholder')}
- value={task.instruction}
- variant={'filled'}
- onChange={handleInstructionChange}
- />
- </Flexbox>
- </AccordionItem>
+ </AccordionPanel>
+ </AccordionItem>
+ </AccordionRoot>
);
});
@@ -217,7 +227,7 @@ const ExecuteTasksIntervention = memo<BuiltinInterventionProps<ExecuteTasksParam
}, [registerBeforeApprove, hasChanges, tasks, args, onArgsChange]);
return (
- <Accordion className={styles.container} gap={0} variant={'borderless'}>
+ <Flexbox className={styles.container} gap={0}>
{tasks.map((task, index) => (
<TaskEditor
index={index}
@@ -227,7 +237,7 @@ const ExecuteTasksIntervention = memo<BuiltinInterventionProps<ExecuteTasksParam
onDelete={handleTaskDelete}
/>
))}
- </Accordion>
+ </Flexbox>
);
},
isEqual,
diff --git a/packages/builtin-tool-group-management/src/client/Render/ExecuteTasks/index.tsx b/packages/builtin-tool-group-management/src/client/Render/ExecuteTasks/index.tsx
index 887f53c26c9..d0eb6c31712 100644
--- a/packages/builtin-tool-group-management/src/client/Render/ExecuteTasks/index.tsx
+++ b/packages/builtin-tool-group-management/src/client/Render/ExecuteTasks/index.tsx
@@ -2,8 +2,8 @@
import { DEFAULT_AVATAR } from '@lobechat/const';
import type { AgentGroupMember, BuiltinRenderProps } from '@lobechat/types';
-import { Accordion, AccordionItem, Block, Flexbox, Markdown } from '@lobehub/ui';
-import { Avatar, Text } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Markdown } from '@lobehub/ui';
+import { Accordion, Avatar, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, useTheme } from 'antd-style';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -88,41 +88,39 @@ const ExecuteTasksRender = memo<BuiltinRenderProps<ExecuteTasksParams, unknown,
return (
<Flexbox className={styles.container} gap={12}>
{!!tasksWithAgents.length && (
- <Accordion defaultExpandedKeys={[]} gap={0} variant={'borderless'}>
- {tasksWithAgents.map((task, index) => (
- <AccordionItem
- itemKey={task.agentId || String(index)}
- key={task.agentId || index}
- paddingBlock={8}
- paddingInline={4}
- action={
- <div className={styles.assignee}>
- <Avatar
- avatar={task.agent?.avatar || DEFAULT_AVATAR}
- background={task.agent?.backgroundColor || theme.colorBgContainer}
- shape={'circle'}
- size={20}
- />
- <span>{task.agent?.title}</span>
- </div>
- }
- title={
- <Flexbox horizontal align={'center'} gap={8} style={{ minWidth: 0 }}>
- <span className={styles.index}>{index + 1}.</span>
- <Text className={styles.taskTitle} weight={500}>
- {task.title || 'Task'}
- </Text>
- </Flexbox>
- }
- >
- {task.instruction && (
- <Block padding={12} style={{ marginTop: 8 }} variant={'filled'}>
- <Text className={styles.instruction}>{task.instruction}</Text>
- </Block>
- )}
- </AccordionItem>
- ))}
- </Accordion>
+ <Accordion
+ defaultValue={[]}
+ gap={0}
+ variant={'borderless'}
+ items={tasksWithAgents.map((task, index) => ({
+ action: (
+ <div className={styles.assignee}>
+ <Avatar
+ avatar={task.agent?.avatar || DEFAULT_AVATAR}
+ background={task.agent?.backgroundColor || theme.colorBgContainer}
+ shape={'circle'}
+ size={20}
+ />
+ <span>{task.agent?.title}</span>
+ </div>
+ ),
+ alwaysShowAction: true,
+ children: task.instruction && (
+ <Block padding={12} style={{ marginTop: 8 }} variant={'filled'}>
+ <Text className={styles.instruction}>{task.instruction}</Text>
+ </Block>
+ ),
+ key: task.agentId || String(index),
+ title: (
+ <Flexbox horizontal align={'center'} gap={8} style={{ minWidth: 0 }}>
+ <span className={styles.index}>{index + 1}.</span>
+ <Text className={styles.taskTitle} weight={500}>
+ {task.title || 'Task'}
+ </Text>
+ </Flexbox>
+ ),
+ }))}
+ />
)}
{resultContent && (
diff --git a/packages/builtin-tool-memory/src/client/Render/SearchUserMemory/index.tsx b/packages/builtin-tool-memory/src/client/Render/SearchUserMemory/index.tsx
index 02b754efe15..70a286451b4 100644
--- a/packages/builtin-tool-memory/src/client/Render/SearchUserMemory/index.tsx
+++ b/packages/builtin-tool-memory/src/client/Render/SearchUserMemory/index.tsx
@@ -1,10 +1,10 @@
'use client';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Accordion, AccordionItem, Flexbox } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Accordion, Tag, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
-import { memo } from 'react';
+import { memo, type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import type { SearchMemoryParams, SearchUserMemoryState } from '../../../types';
@@ -119,156 +119,143 @@ const SearchUserMemoryRender = memo<BuiltinRenderProps<SearchMemoryParams, Searc
...(preferences.length > 0 ? ['preferences'] : []),
];
+ const items = [
+ activities.length > 0 && {
+ children: (
+ <Flexbox>
+ {activities.map((item) => (
+ <MemoryItem
+ content={item.narrative}
+ key={item.id}
+ subContent={item.feedback}
+ tags={item.tags}
+ title={item.notes || item.type}
+ />
+ ))}
+ </Flexbox>
+ ),
+ key: 'activities',
+ title: (
+ <Text className={styles.sectionHeader}>
+ <span>Activities</span>
+ <Text as={'span'} type={'secondary'}>
+ {' '}
+ ({activities.length})
+ </Text>
+ </Text>
+ ),
+ },
+ contexts.length > 0 && {
+ children: (
+ <Flexbox>
+ {contexts.map((item) => (
+ <MemoryItem
+ content={item.description}
+ key={item.id}
+ subContent={item.currentStatus}
+ tags={item.tags}
+ title={item.title}
+ />
+ ))}
+ </Flexbox>
+ ),
+ key: 'contexts',
+ title: (
+ <Text className={styles.sectionHeader}>
+ <span>{t('builtins.lobe-user-memory.render.contexts')}</span>
+ <Text as={'span'} type={'secondary'}>
+ {' '}
+ ({contexts.length})
+ </Text>
+ </Text>
+ ),
+ },
+ experiences.length > 0 && {
+ children: (
+ <Flexbox>
+ {experiences.map((item) => (
+ <MemoryItem
+ content={item.situation}
+ key={item.id}
+ subContent={item.keyLearning}
+ tags={item.tags}
+ title={item.action}
+ />
+ ))}
+ </Flexbox>
+ ),
+ key: 'experiences',
+ title: (
+ <Text className={styles.sectionHeader}>
+ <span>{t('builtins.lobe-user-memory.render.experiences')}</span>
+ <Text as={'span'} type={'secondary'}>
+ {' '}
+ ({experiences.length})
+ </Text>
+ </Text>
+ ),
+ },
+ identities.length > 0 && {
+ children: (
+ <Flexbox>
+ {identities.map((item) => (
+ <MemoryItem
+ content={item.description}
+ key={item.id}
+ subContent={item.role}
+ tags={item.tags}
+ title={item.relationship || item.type}
+ />
+ ))}
+ </Flexbox>
+ ),
+ key: 'identities',
+ title: (
+ <Text className={styles.sectionHeader}>
+ <span>Identities</span>
+ <Text as={'span'} type={'secondary'}>
+ {' '}
+ ({identities.length})
+ </Text>
+ </Text>
+ ),
+ },
+ preferences.length > 0 && {
+ children: (
+ <Flexbox>
+ {preferences.map((item) => (
+ <MemoryItem
+ content={item.conclusionDirectives}
+ key={item.id}
+ subContent={item.suggestions}
+ tags={item.tags}
+ />
+ ))}
+ </Flexbox>
+ ),
+ key: 'preferences',
+ title: (
+ <Text className={styles.sectionHeader}>
+ <span>{t('builtins.lobe-user-memory.render.preferences')}</span>
+ <Text as={'span'} type={'secondary'}>
+ {' '}
+ ({preferences.length})
+ </Text>
+ </Text>
+ ),
+ },
+ ].filter(Boolean) as { children: ReactNode; key: string; title: ReactNode }[];
+
return (
<Flexbox className={styles.container}>
- <Accordion defaultExpandedKeys={defaultActiveKeys} gap={0}>
- {activities.length > 0 && (
- <AccordionItem
- itemKey="activities"
- paddingBlock={8}
- paddingInline={12}
- title={
- <Text className={styles.sectionHeader}>
- <span>Activities</span>
- <Text as={'span'} type={'secondary'}>
- {' '}
- ({activities.length})
- </Text>
- </Text>
- }
- >
- <Flexbox>
- {activities.map((item) => (
- <MemoryItem
- content={item.narrative}
- key={item.id}
- subContent={item.feedback}
- tags={item.tags}
- title={item.notes || item.type}
- />
- ))}
- </Flexbox>
- </AccordionItem>
- )}
-
- {/* Contexts */}
- {contexts.length > 0 && (
- <AccordionItem
- itemKey="contexts"
- paddingBlock={8}
- paddingInline={12}
- title={
- <Text className={styles.sectionHeader}>
- <span>{t('builtins.lobe-user-memory.render.contexts')}</span>
- <Text as={'span'} type={'secondary'}>
- {' '}
- ({contexts.length})
- </Text>
- </Text>
- }
- >
- <Flexbox>
- {contexts.map((item) => (
- <MemoryItem
- content={item.description}
- key={item.id}
- subContent={item.currentStatus}
- tags={item.tags}
- title={item.title}
- />
- ))}
- </Flexbox>
- </AccordionItem>
- )}
-
- {/* Experiences */}
- {experiences.length > 0 && (
- <AccordionItem
- itemKey="experiences"
- paddingBlock={8}
- paddingInline={12}
- title={
- <Text className={styles.sectionHeader}>
- <span>{t('builtins.lobe-user-memory.render.experiences')}</span>
- <Text as={'span'} type={'secondary'}>
- {' '}
- ({experiences.length})
- </Text>
- </Text>
- }
- >
- <Flexbox>
- {experiences.map((item) => (
- <MemoryItem
- content={item.situation}
- key={item.id}
- subContent={item.keyLearning}
- tags={item.tags}
- title={item.action}
- />
- ))}
- </Flexbox>
- </AccordionItem>
- )}
-
- {/* Preferences */}
- {identities.length > 0 && (
- <AccordionItem
- itemKey="identities"
- paddingBlock={8}
- paddingInline={12}
- title={
- <Text className={styles.sectionHeader}>
- <span>Identities</span>
- <Text as={'span'} type={'secondary'}>
- {' '}
- ({identities.length})
- </Text>
- </Text>
- }
- >
- <Flexbox>
- {identities.map((item) => (
- <MemoryItem
- content={item.description}
- key={item.id}
- subContent={item.role}
- tags={item.tags}
- title={item.relationship || item.type}
- />
- ))}
- </Flexbox>
- </AccordionItem>
- )}
-
- {preferences.length > 0 && (
- <AccordionItem
- itemKey="preferences"
- paddingBlock={8}
- paddingInline={12}
- title={
- <Text className={styles.sectionHeader}>
- <span>{t('builtins.lobe-user-memory.render.preferences')}</span>
- <Text as={'span'} type={'secondary'}>
- {' '}
- ({preferences.length})
- </Text>
- </Text>
- }
- >
- <Flexbox>
- {preferences.map((item) => (
- <MemoryItem
- content={item.conclusionDirectives}
- key={item.id}
- subContent={item.suggestions}
- tags={item.tags}
- />
- ))}
- </Flexbox>
- </AccordionItem>
- )}
- </Accordion>
+ <Accordion
+ defaultValue={defaultActiveKeys}
+ gap={0}
+ items={items}
+ styles={{
+ trigger: { paddingInline: 12 },
+ }}
+ />
</Flexbox>
);
},
diff --git a/packages/builtin-tool-memory/src/client/components/ActivityMemoryCard.tsx b/packages/builtin-tool-memory/src/client/components/ActivityMemoryCard.tsx
index 3b422369457..6fd8fe2f9b1 100644
--- a/packages/builtin-tool-memory/src/client/components/ActivityMemoryCard.tsx
+++ b/packages/builtin-tool-memory/src/client/components/ActivityMemoryCard.tsx
@@ -1,11 +1,10 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
+import { Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import BubblesLoading from '@/components/BubblesLoading';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import StreamingMarkdown from '@/components/StreamingMarkdown';
import type { AddActivityMemoryParams } from '../../types';
@@ -63,7 +62,7 @@ export const ActivityMemoryCard = memo<ActivityMemoryCardProps>(({ data, loading
</Flexbox>
{activityType && <Tag>{activityType}</Tag>}
{status && <Tag color={STATUS_COLORS[status] || 'default'}>{status.replace('_', ' ')}</Tag>}
- {loading && <NeuralNetworkLoading size={20} />}
+ {loading && <Spin size="middle" variant="network" />}
</Flexbox>
{hasActivityContent ? (
diff --git a/packages/builtin-tool-memory/src/client/components/ContextMemoryCard.tsx b/packages/builtin-tool-memory/src/client/components/ContextMemoryCard.tsx
index 934265b9571..89f13b043d6 100644
--- a/packages/builtin-tool-memory/src/client/components/ContextMemoryCard.tsx
+++ b/packages/builtin-tool-memory/src/client/components/ContextMemoryCard.tsx
@@ -1,13 +1,11 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Progress, Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { memo } from 'react';
import BubblesLoading from '@/components/BubblesLoading';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import StreamingMarkdown from '@/components/StreamingMarkdown';
import type { AddContextMemoryParams } from '../../types';
@@ -73,7 +71,7 @@ export const ContextMemoryCard = memo<ContextMemoryCardProps>(({ data, loading }
</Flexbox>
{contextType && <Tag>{contextType}</Tag>}
{status && <Tag color={STATUS_COLORS[status] || 'default'}>{status.replace('_', ' ')}</Tag>}
- {loading && <NeuralNetworkLoading size={20} />}
+ {loading && <Spin size="middle" variant="network" />}
</Flexbox>
{hasContextContent ? (
@@ -101,11 +99,13 @@ export const ContextMemoryCard = memo<ContextMemoryCardProps>(({ data, loading }
{item.title}
</Text>
<Progress
- percent={item.percent}
+ percent={item.percent ?? 0}
+ segments={5}
showInfo={false}
- size={[2, 12]}
- steps={5}
+ size={12}
strokeColor={item.strokeColor}
+ style={{ flex: 'none', width: 18 }}
+ variant="segments"
/>
<Text fontSize={12} type={'secondary'}>
{item.percent}%
diff --git a/packages/builtin-tool-memory/src/client/components/ExperienceMemoryCard.tsx b/packages/builtin-tool-memory/src/client/components/ExperienceMemoryCard.tsx
index f6b2c9f4061..e0a476ea73d 100644
--- a/packages/builtin-tool-memory/src/client/components/ExperienceMemoryCard.tsx
+++ b/packages/builtin-tool-memory/src/client/components/ExperienceMemoryCard.tsx
@@ -1,13 +1,12 @@
'use client';
-import { Accordion, AccordionItem, Flexbox } from '@lobehub/ui';
-import { Avatar, Tag, Text } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Accordion, Avatar, Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { Steps } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { memo } from 'react';
import BubblesLoading from '@/components/BubblesLoading';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import StreamingMarkdown from '@/components/StreamingMarkdown';
import { highlightTextStyles } from '@/styles';
@@ -114,7 +113,7 @@ export const ExperienceMemoryCard = memo<ExperienceMemoryCardProps>(({ data, loa
<Flexbox flex={1}>
<div className={styles.title}>{title || 'Experience Memory'}</div>
</Flexbox>
- {loading && <NeuralNetworkLoading size={20} />}
+ {loading && <Spin size="middle" variant="network" />}
</Flexbox>
{/* When has STAR content: collapse summary */}
@@ -122,77 +121,84 @@ export const ExperienceMemoryCard = memo<ExperienceMemoryCardProps>(({ data, loa
<>
{/* Collapsed Summary */}
{(summary || safeTags.length > 0) && (
- <Accordion gap={0}>
- <AccordionItem
- itemKey="summary"
- paddingBlock={8}
- paddingInline={8}
- styles={{
- base: { marginBlock: 4, marginInline: 4 },
- }}
- title={
- <Text fontSize={12} type={'secondary'} weight={500}>
- Summary
- </Text>
- }
- >
- <Flexbox gap={8} paddingBlock={'8px 12px'} paddingInline={8}>
- {summary && <div className={styles.summary}>{summary}</div>}
- {details && <div className={styles.detail}>{details}</div>}
- {safeTags.length > 0 && (
- <Flexbox horizontal className={styles.tags} gap={8} wrap={'wrap'}>
- {safeTags.map((tag, index) => (
- <Tag key={index}>{tag}</Tag>
- ))}
+ <Accordion
+ defaultValue={['summary']}
+ gap={0}
+ items={[
+ {
+ children: (
+ <Flexbox gap={8} paddingBlock={'8px 12px'} paddingInline={8}>
+ {summary && <div className={styles.summary}>{summary}</div>}
+ {details && <div className={styles.detail}>{details}</div>}
+ {safeTags.length > 0 && (
+ <Flexbox horizontal className={styles.tags} gap={8} wrap={'wrap'}>
+ {safeTags.map((tag, index) => (
+ <Tag key={index}>{tag}</Tag>
+ ))}
+ </Flexbox>
+ )}
</Flexbox>
- )}
- </Flexbox>
- </AccordionItem>
- </Accordion>
+ ),
+ key: 'summary',
+ title: (
+ <Text fontSize={12} type={'secondary'} weight={500}>
+ Summary
+ </Text>
+ ),
+ },
+ ]}
+ styles={{
+ item: { marginBlock: 4, marginInline: 4 },
+ }}
+ />
)}
{/* STAR Steps */}
- <Accordion className={styles.section} defaultExpandedKeys={['star']} gap={0}>
- <AccordionItem
- itemKey="star"
- paddingBlock={8}
- paddingInline={8}
- title={
- <Text fontSize={12} type={'secondary'} weight={500}>
- STAR
- </Text>
- }
- >
- <Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
- <Steps
- className={styles.stepsContainer}
- current={null as any}
- direction="vertical"
- size="small"
- items={starItems.map((item) => ({
- description: <div className={styles.stepContent}>{item.content}</div>,
- icon: (
- <Avatar
- shadow
- avatar={item.avatar}
- shape={'square'}
- size={20}
- style={{
- border: `1px solid ${cssVar.colorBorderSecondary}`,
- fontSize: 11,
- }}
- />
- ),
- title: (
- <Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
- {item.title}
- </Text>
- ),
- }))}
- />
- </Flexbox>
- </AccordionItem>
- </Accordion>
+ <Accordion
+ className={styles.section}
+ defaultValue={['star']}
+ gap={0}
+ items={[
+ {
+ children: (
+ <Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
+ <Steps
+ className={styles.stepsContainer}
+ current={null as any}
+ direction="vertical"
+ size="small"
+ items={starItems.map((item) => ({
+ description: <div className={styles.stepContent}>{item.content}</div>,
+ icon: (
+ <Avatar
+ shadow
+ avatar={item.avatar}
+ shape={'square'}
+ size={20}
+ style={{
+ border: `1px solid ${cssVar.colorBorderSecondary}`,
+ fontSize: 11,
+ }}
+ />
+ ),
+ title: (
+ <Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
+ {item.title}
+ </Text>
+ ),
+ }))}
+ />
+ </Flexbox>
+ ),
+ key: 'star',
+ title: (
+ <Text fontSize={12} type={'secondary'} weight={500}>
+ STAR
+ </Text>
+ ),
+ },
+ ]}
+ />
{/* Key Learning */}
{keyLearning && (
diff --git a/packages/builtin-tool-memory/src/client/components/IdentityMemoryCard.tsx b/packages/builtin-tool-memory/src/client/components/IdentityMemoryCard.tsx
index 44d4afc9942..7fe05c4d980 100644
--- a/packages/builtin-tool-memory/src/client/components/IdentityMemoryCard.tsx
+++ b/packages/builtin-tool-memory/src/client/components/IdentityMemoryCard.tsx
@@ -1,13 +1,11 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Progress, Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import BubblesLoading from '@/components/BubblesLoading';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import StreamingMarkdown from '@/components/StreamingMarkdown';
import type { IdentityMemoryViewModel } from './identityMemoryViewModel';
@@ -66,7 +64,7 @@ export const IdentityMemoryCard = memo<IdentityMemoryCardProps>(
</Flexbox>
{identityType && <Tag>{identityType}</Tag>}
{relationship && <Tag color={'info'}>{relationship}</Tag>}
- {loading && <NeuralNetworkLoading size={20} />}
+ {loading && <Spin size="middle" variant="network" />}
</Flexbox>
{hasIdentityContent ? (
@@ -109,7 +107,14 @@ export const IdentityMemoryCard = memo<IdentityMemoryCardProps>(
<Text fontSize={12} type={'secondary'} weight={500}>
Confidence
</Text>
- <Progress percent={confidence} showInfo={false} size={[2, 12]} steps={5} />
+ <Progress
+ percent={confidence}
+ segments={5}
+ showInfo={false}
+ size={12}
+ style={{ flex: 'none', width: 18 }}
+ variant="segments"
+ />
<Text fontSize={12} type={'secondary'}>
{confidence}%
</Text>
diff --git a/packages/builtin-tool-memory/src/client/components/MemoryCardParts.tsx b/packages/builtin-tool-memory/src/client/components/MemoryCardParts.tsx
index e4eb2428467..59da7a5b27f 100644
--- a/packages/builtin-tool-memory/src/client/components/MemoryCardParts.tsx
+++ b/packages/builtin-tool-memory/src/client/components/MemoryCardParts.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Accordion, AccordionItem, Flexbox, Tooltip } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
+import { Flexbox, Tooltip } from '@lobehub/ui';
+import { Accordion, Tag, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import type { ReactNode } from 'react';
import { memo } from 'react';
@@ -149,33 +149,36 @@ export const SummaryAccordion = memo<SummaryAccordionProps>(({ details, summary,
if (!summary && tags.length === 0) return null;
return (
- <Accordion gap={0}>
- <AccordionItem
- itemKey="summary"
- paddingBlock={8}
- paddingInline={8}
- styles={{
- base: { marginBlock: 4, marginInline: 4 },
- }}
- title={
- <Text fontSize={12} type={'secondary'} weight={500}>
- Summary
- </Text>
- }
- >
- <Flexbox gap={8} paddingBlock={'8px 12px'} paddingInline={8}>
- {summary && <div className={memoryCardStyles.summary}>{summary}</div>}
- {details && <div className={memoryCardStyles.detail}>{details}</div>}
- {tags.length > 0 && (
- <Flexbox horizontal className={memoryCardStyles.tags} gap={8} wrap={'wrap'}>
- {tags.map((tag, index) => (
- <Tag key={index}>{tag}</Tag>
- ))}
+ <Accordion
+ defaultValue={['summary']}
+ gap={0}
+ items={[
+ {
+ children: (
+ <Flexbox gap={8} paddingBlock={'8px 12px'} paddingInline={8}>
+ {summary && <div className={memoryCardStyles.summary}>{summary}</div>}
+ {details && <div className={memoryCardStyles.detail}>{details}</div>}
+ {tags.length > 0 && (
+ <Flexbox horizontal className={memoryCardStyles.tags} gap={8} wrap={'wrap'}>
+ {tags.map((tag, index) => (
+ <Tag key={index}>{tag}</Tag>
+ ))}
+ </Flexbox>
+ )}
</Flexbox>
- )}
- </Flexbox>
- </AccordionItem>
- </Accordion>
+ ),
+ key: 'summary',
+ title: (
+ <Text fontSize={12} type={'secondary'} weight={500}>
+ Summary
+ </Text>
+ ),
+ },
+ ]}
+ styles={{
+ item: { marginBlock: 4, marginInline: 4 },
+ }}
+ />
);
});
diff --git a/packages/builtin-tool-memory/src/client/components/PreferenceMemoryCard.tsx b/packages/builtin-tool-memory/src/client/components/PreferenceMemoryCard.tsx
index 662bff36126..4701ca70803 100644
--- a/packages/builtin-tool-memory/src/client/components/PreferenceMemoryCard.tsx
+++ b/packages/builtin-tool-memory/src/client/components/PreferenceMemoryCard.tsx
@@ -1,13 +1,12 @@
'use client';
-import { Accordion, AccordionItem, Flexbox } from '@lobehub/ui';
-import { Avatar, Tag, Text } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Accordion, Avatar, Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { Steps } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { memo } from 'react';
import BubblesLoading from '@/components/BubblesLoading';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import StreamingMarkdown from '@/components/StreamingMarkdown';
import { highlightTextStyles } from '@/styles';
@@ -152,7 +151,7 @@ export const PreferenceMemoryCard = memo<PreferenceMemoryCardProps>(({ data, loa
<div className={styles.title}>{title || 'Preference Memory'}</div>
</Flexbox>
{type && <Tag>{type}</Tag>}
- {loading && <NeuralNetworkLoading size={20} />}
+ {loading && <Spin size="middle" variant="network" />}
</Flexbox>
{/* When has context content: collapse summary */}
@@ -160,123 +159,134 @@ export const PreferenceMemoryCard = memo<PreferenceMemoryCardProps>(({ data, loa
<>
{/* Collapsed Summary */}
{(summary || safeTags.length > 0) && (
- <Accordion gap={0}>
- <AccordionItem
- itemKey="summary"
- paddingBlock={8}
- paddingInline={8}
- styles={{
- base: { marginBlock: 4, marginInline: 4 },
- }}
- title={
- <Text fontSize={12} type={'secondary'} weight={500}>
- Summary
- </Text>
- }
- >
- <Flexbox gap={8} paddingBlock={'8px 12px'} paddingInline={8}>
- {summary && <div className={styles.summary}>{summary}</div>}
- {details && <div className={styles.detail}>{details}</div>}
- {safeTags.length > 0 && (
- <Flexbox horizontal className={styles.tags} gap={8} wrap={'wrap'}>
- {safeTags.map((tag, index) => (
- <Tag key={index}>{tag}</Tag>
- ))}
+ <Accordion
+ defaultValue={['summary']}
+ gap={0}
+ items={[
+ {
+ children: (
+ <Flexbox gap={8} paddingBlock={'8px 12px'} paddingInline={8}>
+ {summary && <div className={styles.summary}>{summary}</div>}
+ {details && <div className={styles.detail}>{details}</div>}
+ {safeTags.length > 0 && (
+ <Flexbox horizontal className={styles.tags} gap={8} wrap={'wrap'}>
+ {safeTags.map((tag, index) => (
+ <Tag key={index}>{tag}</Tag>
+ ))}
+ </Flexbox>
+ )}
</Flexbox>
- )}
- </Flexbox>
- </AccordionItem>
- </Accordion>
+ ),
+ key: 'summary',
+ title: (
+ <Text fontSize={12} type={'secondary'} weight={500}>
+ Summary
+ </Text>
+ ),
+ },
+ ]}
+ styles={{
+ item: { marginBlock: 4, marginInline: 4 },
+ }}
+ />
)}
{/* Origin Context Steps */}
{hasContextContent && (
- <Accordion className={styles.section} defaultExpandedKeys={['context']} gap={0}>
- <AccordionItem
- itemKey="context"
- paddingBlock={8}
- paddingInline={8}
- title={
- <Text fontSize={12} type={'secondary'} weight={500}>
- Origin Context
- </Text>
- }
- >
- <Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
- <Steps
- className={styles.stepsContainer}
- current={null as any}
- direction="vertical"
- size="small"
- items={contextItems.map((item) => ({
- description: <div className={styles.stepContent}>{item.content}</div>,
- icon: (
- <Avatar
- shadow
- avatar={item.avatar}
- shape={'square'}
- size={20}
- style={{
- border: `1px solid ${cssVar.colorBorderSecondary}`,
- fontSize: 11,
- }}
- />
- ),
- title: (
- <Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
- {item.title}
- </Text>
- ),
- }))}
- />
- </Flexbox>
- </AccordionItem>
- </Accordion>
+ <Accordion
+ className={styles.section}
+ defaultValue={['context']}
+ gap={0}
+ items={[
+ {
+ children: (
+ <Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
+ <Steps
+ className={styles.stepsContainer}
+ current={null as any}
+ direction="vertical"
+ size="small"
+ items={contextItems.map((item) => ({
+ description: <div className={styles.stepContent}>{item.content}</div>,
+ icon: (
+ <Avatar
+ shadow
+ avatar={item.avatar}
+ shape={'square'}
+ size={20}
+ style={{
+ border: `1px solid ${cssVar.colorBorderSecondary}`,
+ fontSize: 11,
+ }}
+ />
+ ),
+ title: (
+ <Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
+ {item.title}
+ </Text>
+ ),
+ }))}
+ />
+ </Flexbox>
+ ),
+ key: 'context',
+ title: (
+ <Text fontSize={12} type={'secondary'} weight={500}>
+ Origin Context
+ </Text>
+ ),
+ },
+ ]}
+ />
)}
{/* App Context */}
{hasAppContext && (
- <Accordion className={styles.section} gap={0}>
- <AccordionItem
- itemKey="appContext"
- paddingBlock={8}
- paddingInline={8}
- title={
- <Text fontSize={12} type={'secondary'} weight={500}>
- App Context
- </Text>
- }
- >
- <Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
- <Steps
- className={styles.stepsContainer}
- current={null as any}
- direction="vertical"
- size="small"
- items={appContextItems.map((item) => ({
- description: <div className={styles.stepContent}>{item.content}</div>,
- icon: (
- <Avatar
- shadow
- avatar={item.avatar}
- shape={'square'}
- size={20}
- style={{
- border: `1px solid ${cssVar.colorBorderSecondary}`,
- fontSize: 11,
- }}
- />
- ),
- title: (
- <Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
- {item.title}
- </Text>
- ),
- }))}
- />
- </Flexbox>
- </AccordionItem>
- </Accordion>
+ <Accordion
+ className={styles.section}
+ defaultValue={['appContext']}
+ gap={0}
+ items={[
+ {
+ children: (
+ <Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
+ <Steps
+ className={styles.stepsContainer}
+ current={null as any}
+ direction="vertical"
+ size="small"
+ items={appContextItems.map((item) => ({
+ description: <div className={styles.stepContent}>{item.content}</div>,
+ icon: (
+ <Avatar
+ shadow
+ avatar={item.avatar}
+ shape={'square'}
+ size={20}
+ style={{
+ border: `1px solid ${cssVar.colorBorderSecondary}`,
+ fontSize: 11,
+ }}
+ />
+ ),
+ title: (
+ <Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
+ {item.title}
+ </Text>
+ ),
+ }))}
+ />
+ </Flexbox>
+ ),
+ key: 'appContext',
+ title: (
+ <Text fontSize={12} type={'secondary'} weight={500}>
+ App Context
+ </Text>
+ ),
+ },
+ ]}
+ />
)}
{/* Conclusion Directive */}
diff --git a/packages/builtin-tool-skills/src/client/Inspector/ExecScript/index.tsx b/packages/builtin-tool-skills/src/client/Inspector/ExecScript/index.tsx
index 0d1afb99220..05aee0ee2f9 100644
--- a/packages/builtin-tool-skills/src/client/Inspector/ExecScript/index.tsx
+++ b/packages/builtin-tool-skills/src/client/Inspector/ExecScript/index.tsx
@@ -1,9 +1,9 @@
'use client';
import { type BuiltinInspectorProps } from '@lobechat/types';
-import { Icon } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
-import { Check, LoaderCircle, X } from 'lucide-react';
+import { Check, X } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -60,7 +60,7 @@ export const ExecScriptInspector = memo<BuiltinInspectorProps<ExecScriptParams,
</span>
{description && <span className={highlightTextStyles.primary}>{description}</span>}
{isLoading ? null : isStillRunning ? (
- <Icon spin className={styles.statusIcon} icon={LoaderCircle} size={14} />
+ <Spin className={styles.statusIcon} size="small" />
) : pluginState?.success !== undefined ? (
isSuccess ? (
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
diff --git a/packages/builtin-tool-user-interaction/src/client/Intervention/AskUserQuestion/index.tsx b/packages/builtin-tool-user-interaction/src/client/Intervention/AskUserQuestion/index.tsx
index a60791bf797..46f480fef5d 100644
--- a/packages/builtin-tool-user-interaction/src/client/Intervention/AskUserQuestion/index.tsx
+++ b/packages/builtin-tool-user-interaction/src/client/Intervention/AskUserQuestion/index.tsx
@@ -9,11 +9,10 @@ import {
} from '@lobechat/shared-tool-ui/ask-user';
import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
-import { Alert, Button, Text } from '@lobehub/ui/base-ui';
+import { Alert, Button, Spin, Text } from '@lobehub/ui/base-ui';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useConversationStore } from '@/features/Conversation/store';
import { dataSelectors } from '@/features/Conversation/store/slices/data/selectors';
import { useChatStore } from '@/store/chat';
@@ -81,7 +80,7 @@ const AskUserQuestionIntervention = memo<BuiltinInterventionProps<AskUserQuestio
if (submissionPhase === 'submitting' || submissionPhase === 'checking') {
return (
<Flexbox horizontal align="center" gap={8} padding={8} role="status">
- <NeuralNetworkLoading size={16} />
+ <Spin size="small" variant="network" />
<Text type="secondary">
{t(
submissionPhase === 'submitting'
diff --git a/packages/builtin-tool-video-generation/src/client/components/GenerationProgress.tsx b/packages/builtin-tool-video-generation/src/client/components/GenerationProgress.tsx
index cee80545f53..ac33599d436 100644
--- a/packages/builtin-tool-video-generation/src/client/components/GenerationProgress.tsx
+++ b/packages/builtin-tool-video-generation/src/client/components/GenerationProgress.tsx
@@ -1,13 +1,11 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Progress, Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { MAX_ESTIMATED_PROGRESS, useEstimatedProgress } from '@/hooks/useEstimatedProgress';
import { formatDuration } from '../utils/formatDuration';
@@ -39,7 +37,7 @@ export const GenerationProgress = memo<GenerationProgressProps>(
return (
<Flexbox align={'center'} gap={8}>
{progress === null ? (
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
) : (
<Progress percent={progress} size={56} type={'circle'} />
)}
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/index.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/index.tsx
index f40bce0c9b3..f5d5abd6546 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/index.tsx
@@ -1,4 +1,5 @@
-import { Button, Center, Flexbox } from '@lobehub/ui';
+import { Center, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx b/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx
index 7a556d733b3..dea05d4bab6 100644
--- a/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx
@@ -1,7 +1,6 @@
import type { SearchQuery } from '@lobechat/types';
-// eslint-disable-next-line no-restricted-imports -- Base Select does not support multiple selection yet.
-import { Block, Flexbox, SearchBar as Search, Select, Tooltip } from '@lobehub/ui';
-import { CheckboxGroup, Segmented, Text } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, SearchBar as Search, Tooltip } from '@lobehub/ui';
+import { CheckboxGroup, Segmented, Select, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import type { ReactNode } from 'react';
import { memo, useState } from 'react';
diff --git a/src/components/AsyncBoundary/index.tsx b/src/components/AsyncBoundary/index.tsx
index 41fe95bab72..9b01c11687b 100644
--- a/src/components/AsyncBoundary/index.tsx
+++ b/src/components/AsyncBoundary/index.tsx
@@ -1,10 +1,9 @@
'use client';
import { Center, Flexbox } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { memo, type ReactNode } from 'react';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
-
import AsyncError, { type AsyncErrorVariant } from '../AsyncError';
/**
@@ -83,7 +82,7 @@ const AsyncBoundary = memo<AsyncBoundaryProps>(
return (
loading ?? (
<Center flex={1} padding={48} width={'100%'}>
- <NeuralNetworkLoading size={24} />
+ <Spin size="middle" />
</Center>
)
);
diff --git a/src/components/AsyncError/index.tsx b/src/components/AsyncError/index.tsx
index 091ef717c5f..fb451035226 100644
--- a/src/components/AsyncError/index.tsx
+++ b/src/components/AsyncError/index.tsx
@@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next';
import { normalizeAsyncError } from '@/libs/swr/normalizeError';
/**
- * The error counterpart to the loading family (`NeuralNetworkLoading`,
+ * The error counterpart to the loading family (`Spin`,
* `SkeletonLoading`, …). One reusable component, several `variant`s so different
* surfaces express failure differently without each re-implementing the
* icon + reason + retry plumbing. Pick the variant by where the failure lives;
diff --git a/src/components/AvatarUpload/index.tsx b/src/components/AvatarUpload/index.tsx
index 7da54935642..4673fc20d3a 100644
--- a/src/components/AvatarUpload/index.tsx
+++ b/src/components/AvatarUpload/index.tsx
@@ -1,10 +1,9 @@
'use client';
import { Icon } from '@lobehub/ui';
-import { Avatar } from '@lobehub/ui/base-ui';
-import { Spin, Upload } from 'antd';
+import { Avatar, Spin, Upload } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2, PencilIcon, X } from 'lucide-react';
+import { PencilIcon, X } from 'lucide-react';
import { memo, useMemo } from 'react';
import { imageToBase64 } from '@/utils/imageToBase64';
@@ -111,8 +110,8 @@ const AvatarUpload = memo<AvatarUploadProps>(
);
return (
- <Upload beforeUpload={handleUpload} itemRender={() => void 0} maxCount={1}>
- <Spin indicator={<Icon spin icon={Loader2} />} spinning={!!loading}>
+ <Upload maxCount={1} onFiles={([file]) => handleUpload(file)}>
+ <Spin size="small" spinning={!!loading}>
<div className={styles.wrapper}>
<Avatar avatar={value} shape={shape} size={size} title={title} />
<div className={`${styles.overlay} avatar-edit-overlay`}>
diff --git a/src/components/Editor/AutoSaveHint.tsx b/src/components/Editor/AutoSaveHint.tsx
index 61fe26e5459..3604f69b89f 100644
--- a/src/components/Editor/AutoSaveHint.tsx
+++ b/src/components/Editor/AutoSaveHint.tsx
@@ -1,9 +1,9 @@
'use client';
import { Icon } from '@lobehub/ui';
-import { Tag } from '@lobehub/ui/base-ui';
+import { Spin, Tag } from '@lobehub/ui/base-ui';
import dayjs from 'dayjs';
-import { CloudIcon, Loader2Icon, TriangleAlertIcon } from 'lucide-react';
+import { CloudIcon, TriangleAlertIcon } from 'lucide-react';
import { type CSSProperties } from 'react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -30,7 +30,7 @@ const AutoSaveHint = memo<AutoSaveHintProps>(({ style, saveStatus, lastUpdatedTi
if (saveStatus === 'saving')
return (
- <Tag icon={<Icon spin icon={Loader2Icon} />} style={style}>
+ <Tag icon={<Spin size="small" />} style={style}>
{t('autoSave.saving')}
</Tag>
);
diff --git a/src/components/FeedbackModal/FeedbackContent.tsx b/src/components/FeedbackModal/FeedbackContent.tsx
index 28fb8db2a7e..7609ba43380 100644
--- a/src/components/FeedbackModal/FeedbackContent.tsx
+++ b/src/components/FeedbackModal/FeedbackContent.tsx
@@ -2,8 +2,8 @@
import { BRANDING_EMAIL } from '@lobechat/business-const';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Button, toast, useModalContext } from '@lobehub/ui/base-ui';
-import { Form, Input, Upload } from 'antd';
+import { Button, toast, Upload, useModalContext } from '@lobehub/ui/base-ui';
+import { Form, Input } from 'antd';
import { ImagePlus, Send } from 'lucide-react';
import { memo, useCallback, useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';
@@ -165,14 +165,7 @@ const FeedbackContent = memo<FeedbackContentProps>(({ initialValues }) => {
</Button>
</Flexbox>
) : (
- <Upload
- accept="image/*"
- showUploadList={false}
- beforeUpload={(file) => {
- handleScreenshotUpload(file);
- return false;
- }}
- >
+ <Upload accept="image/*" onFiles={([file]) => handleScreenshotUpload(file)}>
<Button icon={<Icon icon={ImagePlus} />} loading={uploadingScreenshot}>
{uploadingScreenshot
? t('feedback.fields.screenshot.uploading')
diff --git a/src/components/FileParsingStatus/index.tsx b/src/components/FileParsingStatus/index.tsx
index e15ac8cd0aa..72d47426d7a 100644
--- a/src/components/FileParsingStatus/index.tsx
+++ b/src/components/FileParsingStatus/index.tsx
@@ -1,8 +1,7 @@
import { Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { Button, Tag } from '@lobehub/ui/base-ui';
-import { Badge } from 'antd';
+import { Badge, Button, Spin, Tag } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
-import { BoltIcon, Loader2Icon, RotateCwIcon } from 'lucide-react';
+import { BoltIcon, RotateCwIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -109,9 +108,7 @@ const FileParsingStatus = memo<FileParsingStatusProps>(
className={cx('chunk-tag', className)}
style={{ cursor: 'pointer' }}
variant={'filled'}
- icon={
- preparingEmbedding ? <Icon spin icon={Loader2Icon} /> : <Icon icon={BoltIcon} />
- }
+ icon={preparingEmbedding ? <Spin size="small" /> : <Icon icon={BoltIcon} />}
onClick={() => {
onClick?.(AsyncTaskStatus.Success);
}}
diff --git a/src/components/InlineRename/index.tsx b/src/components/InlineRename/index.tsx
index 0406184b42a..a7648e7d638 100644
--- a/src/components/InlineRename/index.tsx
+++ b/src/components/InlineRename/index.tsx
@@ -2,7 +2,8 @@
import { type InputProps } from '@lobehub/ui';
import { Input, Popover, stopPropagation } from '@lobehub/ui';
-import { type InputRef, type PopoverProps } from 'antd';
+import { type PopoverPlacement } from '@lobehub/ui/base-ui';
+import { type InputRef } from 'antd';
import { type KeyboardEvent } from 'react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
@@ -38,7 +39,7 @@ export interface InlineRenameProps {
/**
* Popover placement
*/
- placement?: PopoverProps['placement'];
+ placement?: PopoverPlacement;
/**
* Current title
*/
diff --git a/src/components/Loading/CircleLoading/index.tsx b/src/components/Loading/CircleLoading/index.tsx
index 53f3284e8ab..95c061aa9ae 100644
--- a/src/components/Loading/CircleLoading/index.tsx
+++ b/src/components/Loading/CircleLoading/index.tsx
@@ -1,8 +1,7 @@
'use client';
-import { Center, Flexbox, Icon } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { LoaderCircle } from 'lucide-react';
+import { Center, Flexbox } from '@lobehub/ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { useTranslation } from 'react-i18next';
const CircleLoading = () => {
@@ -11,7 +10,7 @@ const CircleLoading = () => {
<Center height={'100%'} width={'100%'}>
<Flexbox align={'center'} gap={8}>
<div>
- <Icon spin icon={LoaderCircle} size={'large'} />
+ <Spin size="large" />
</div>
<Text style={{ letterSpacing: '0.1em' }} type={'secondary'}>
{t('loading')}
diff --git a/src/components/Loading/UpdateLoading/index.tsx b/src/components/Loading/UpdateLoading/index.tsx
deleted file mode 100644
index 7044e0bc7ff..00000000000
--- a/src/components/Loading/UpdateLoading/index.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { type IconSize } from '@lobehub/ui';
-import { Icon } from '@lobehub/ui';
-import { Loader2 } from 'lucide-react';
-import { type CSSProperties } from 'react';
-import { memo } from 'react';
-
-interface UpdateLoadingProps {
- size?: IconSize;
- style?: CSSProperties;
-}
-
-const UpdateLoading = memo<UpdateLoadingProps>(({ size, style }) => {
- return (
- <div style={style}>
- <Icon spin icon={Loader2} size={size} />
- </div>
- );
-});
-
-export default UpdateLoading;
diff --git a/src/components/NeuralNetworkLoading/index.tsx b/src/components/NeuralNetworkLoading/index.tsx
deleted file mode 100644
index 849c8d3caa9..00000000000
--- a/src/components/NeuralNetworkLoading/index.tsx
+++ /dev/null
@@ -1,182 +0,0 @@
-'use client';
-
-import { createStaticStyles, keyframes } from 'antd-style';
-import { type CSSProperties } from 'react';
-import { memo } from 'react';
-
-const pulseAnim = keyframes`
- 0%, 100% {
- opacity: 0.3;
- }
- 50% {
- opacity: 1;
- }
-`;
-
-const flowAnim = keyframes`
- 0% {
- transform: translateX(0);
- opacity: 0.5;
- }
- 50% {
- opacity: 1;
- }
- 100% {
- transform: translateX(var(--flow-distance));
- opacity: 0.5;
- }
-`;
-
-const rotateAnim = keyframes`
- 100% {
- transform: rotate(360deg);
- }
-`;
-
-const scaleAnim = keyframes`
- 0%, 100% {
- transform: scale(0.8);
- opacity: 0.5;
- }
- 50% {
- transform: scale(1);
- opacity: 1;
- }
-`;
-
-const styles = createStaticStyles(({ css, cssVar }) => ({
- center: css`
- fill: ${cssVar.colorTextSecondary};
- animation: ${scaleAnim} 2s infinite;
- `,
-
- connection: css`
- opacity: 0.3;
- stroke: ${cssVar.colorTextSecondary};
- stroke-width: 0.5;
- `,
-
- container: css`
- display: flex;
- align-items: center;
- justify-content: center;
- `,
-
- node: css`
- fill: ${cssVar.colorTextSecondary};
- animation: ${pulseAnim} 2s infinite;
- `,
-
- particle: css`
- fill: ${cssVar.colorTextSecondary};
- animation: ${flowAnim} 2s infinite;
- `,
-
- ring: css`
- transform-origin: center;
-
- fill: none;
- stroke: ${cssVar.colorFill};
- stroke-dasharray: 0 8;
- stroke-width: 1;
-
- animation: ${rotateAnim} 20s infinite linear;
- `,
-
- svg: css`
- width: 100%;
- height: 100%;
- `,
-}));
-
-interface NeuralNetworkLoadingProps {
- size?: number;
-}
-
-const NeuralNetworkLoading = memo<NeuralNetworkLoadingProps>(({ size = 16 }) => {
- const nodeCount = 3;
- const layerCount = 3;
-
- // Generate nodes for each layer
- const nodes = [];
- for (let layerIndex = 0; layerIndex < layerCount; layerIndex++) {
- for (let nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) {
- const x = 25 + layerIndex * 25;
- const y = 25 + nodeIndex * 25;
- const delay = (layerIndex * nodeCount + nodeIndex) * 0.2;
- nodes.push(
- <circle
- className={styles.node}
- cx={x}
- cy={y}
- key={`node-${layerIndex}-${nodeIndex}`}
- r="3"
- style={{ animationDelay: `${delay}s` }}
- />,
- );
- }
- }
-
- // Generate connections between layers
- const connections = [];
- for (let layerIndex = 0; layerIndex < layerCount - 1; layerIndex++) {
- for (let nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) {
- const x1 = 25 + layerIndex * 25;
- const y1 = 25 + nodeIndex * 25;
- for (let targetIndex = 0; targetIndex < nodeCount; targetIndex++) {
- const x2 = 25 + (layerIndex + 1) * 25;
- const y2 = 25 + targetIndex * 25;
- connections.push(
- <line
- className={styles.connection}
- key={`connection-${layerIndex}-${nodeIndex}-${targetIndex}`}
- x1={x1}
- x2={x2}
- y1={y1}
- y2={y2}
- />,
- );
- }
- }
- }
-
- // Generate particles
- const particles = [0, 1, 2].map((index) => (
- <circle
- className={styles.particle}
- cx={25}
- cy={50}
- key={`particle-${index}`}
- r="1.5"
- style={
- {
- '--flow-distance': '50px',
- 'animationDelay': `${index * 0.6}s`,
- } as CSSProperties
- }
- />
- ));
-
- return (
- <div className={styles.container} style={{ height: size, width: size }}>
- <svg className={styles.svg} viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
- {/* Connections */}
- {connections}
-
- {/* Nodes */}
- {nodes}
-
- {/* Particles */}
- {particles}
-
- {/* Central processing unit */}
- <rect className={styles.center} height="6" width="6" x="47" y="47" />
-
- {/* Rotating outer ring */}
- <circle className={styles.ring} cx="50" cy="50" r="40" />
- </svg>
- </div>
- );
-});
-
-export default NeuralNetworkLoading;
diff --git a/src/components/RatingOverview/index.tsx b/src/components/RatingOverview/index.tsx
index 31d7ee67b2b..2457f3656ac 100644
--- a/src/components/RatingOverview/index.tsx
+++ b/src/components/RatingOverview/index.tsx
@@ -1,8 +1,7 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Progress, Text } from '@lobehub/ui/base-ui';
import { cssVar, useResponsive } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -55,7 +54,6 @@ const RatingOverview = memo<RatingOverviewProps>(
showInfo={false}
size={'small'}
strokeColor={cssVar.colorWarning}
- strokeWidth={8}
style={{ flex: 1, marginBottom: 0 }}
/>
</Flexbox>
diff --git a/src/components/StatisticCard/index.test.tsx b/src/components/StatisticCard/index.test.tsx
index 4c0c2239c01..144fb5a7b4a 100644
--- a/src/components/StatisticCard/index.test.tsx
+++ b/src/components/StatisticCard/index.test.tsx
@@ -61,7 +61,7 @@ describe('StatisticCard', () => {
});
it('replaces extra with a small spinner while loading', () => {
- const { container } = render(
+ render(
<StatisticCard
loading
extra={<button type="button">More</button>}
@@ -71,7 +71,7 @@ describe('StatisticCard', () => {
);
expect(screen.queryByText('More')).toBeNull();
- expect(container.querySelector('.ant-spin')).not.toBeNull();
+ expect(screen.getByRole('status')).toBeInTheDocument();
});
it('applies valueStyle to the statistic content', () => {
diff --git a/src/components/StatisticCard/index.tsx b/src/components/StatisticCard/index.tsx
index 6037d35acaa..70c38b17c9e 100644
--- a/src/components/StatisticCard/index.tsx
+++ b/src/components/StatisticCard/index.tsx
@@ -1,7 +1,7 @@
import { type BlockProps } from '@lobehub/ui';
import { Block, Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Spin, Statistic } from 'antd';
+import { Spin, Text } from '@lobehub/ui/base-ui';
+import { Statistic } from 'antd';
import { createStaticStyles, responsive } from 'antd-style';
import { type CSSProperties, type ReactNode } from 'react';
import { memo } from 'react';
@@ -108,7 +108,7 @@ const StatisticCard = memo<StatisticCardProps>(
title
)}
</div>
- {loading ? <Spin percent={'auto'} size={'small'} /> : extra}
+ {loading ? <Spin size={'small'} /> : extra}
</div>
{statistic && (
<Flexbox gap={16} style={statistic.style}>
diff --git a/src/components/TipGuide/index.tsx b/src/components/TipGuide/index.tsx
index d36e16fc948..ceb54030270 100644
--- a/src/components/TipGuide/index.tsx
+++ b/src/components/TipGuide/index.tsx
@@ -1,6 +1,5 @@
import { Flexbox, Popover } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui/base-ui';
-import { type TooltipProps } from 'antd';
+import { ActionIcon, type PopoverPlacement } from '@lobehub/ui/base-ui';
import { ConfigProvider } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { XIcon } from 'lucide-react';
@@ -68,7 +67,7 @@ export interface TipGuideProps {
/**
* Tooltip placement, defaults to bottom
*/
- placement?: TooltipProps['placement'];
+ placement?: PopoverPlacement;
/**
* style
*/
diff --git a/src/features/Acceptance/Viewer/AcceptanceScope.tsx b/src/features/Acceptance/Viewer/AcceptanceScope.tsx
index 62c26e3aaee..b134938e2f3 100644
--- a/src/features/Acceptance/Viewer/AcceptanceScope.tsx
+++ b/src/features/Acceptance/Viewer/AcceptanceScope.tsx
@@ -1,11 +1,10 @@
'use client';
import { Center, Empty } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Button, Spin } from '@lobehub/ui/base-ui';
import { createContext, type ReactNode, use } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { isTrpcErrorCode } from '@/utils/trpcError';
import { useAcceptanceBundle } from './useAcceptanceBundle';
@@ -52,7 +51,7 @@ export const AcceptanceBundleGate = ({
if (isLoading && !data) {
return (
<Center height={height}>
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
</Center>
);
}
diff --git a/src/features/Acceptance/Viewer/Evidence/attachments.tsx b/src/features/Acceptance/Viewer/Evidence/attachments.tsx
index 24076bf288c..94cdd8459b2 100644
--- a/src/features/Acceptance/Viewer/Evidence/attachments.tsx
+++ b/src/features/Acceptance/Viewer/Evidence/attachments.tsx
@@ -2,10 +2,9 @@
import type { AcceptanceAttachment } from '@lobechat/types';
import { Flexbox, Icon, Image } from '@lobehub/ui';
-import { Button, toast } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { Button, Spin, toast, Upload } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx, useResponsive } from 'antd-style';
-import { ImagePlus, Loader2, X } from 'lucide-react';
+import { ImagePlus, X } from 'lucide-react';
import { type ClipboardEvent, memo, useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -17,11 +16,6 @@ const MAX_ATTACHMENT_SIZE = 10 * 1024 * 1024;
const styles = createStaticStyles(({ css }) => ({
flushUpload: css`
display: contents;
-
- .ant-upload,
- .ant-upload-select {
- display: contents;
- }
`,
remove: css`
cursor: pointer;
@@ -228,7 +222,7 @@ export const AttachmentStrip = memo<AttachmentStripProps>(
))}
{uploading && (
<div className={cx(styles.thumb, styles.thumbLoading)}>
- <Icon spin icon={Loader2} size={16} />
+ <Spin size="small" />
</div>
)}
</Flexbox>
@@ -254,12 +248,7 @@ export const AttachmentUploadButton = memo<AttachmentUploadButtonProps>(({ disab
accept={'image/*'}
className={styles.flushUpload}
disabled={disabled}
- showUploadList={false}
- beforeUpload={(file, fileList) => {
- // beforeUpload fires per file — fire the batch once, on the first item.
- if (file === fileList[0]) onFiles(fileList as unknown as File[]);
- return false;
- }}
+ onFiles={onFiles}
>
<Button
disabled={disabled}
diff --git a/src/features/Acceptance/Viewer/ReadOnly/Discussion.tsx b/src/features/Acceptance/Viewer/ReadOnly/Discussion.tsx
index 3828eb182fd..d6942d4cf10 100644
--- a/src/features/Acceptance/Viewer/ReadOnly/Discussion.tsx
+++ b/src/features/Acceptance/Viewer/ReadOnly/Discussion.tsx
@@ -1,10 +1,9 @@
import type { AcceptanceCommentItem } from '@lobechat/types';
import { Empty, Flexbox } from '@lobehub/ui';
-import { Avatar, Button, Text } from '@lobehub/ui/base-ui';
+import { Avatar, Button, Spin, Text } from '@lobehub/ui/base-ui';
import { BadgeCheck, GitCommitHorizontal } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useActivityTime } from '@/hooks/useActivityTime';
import { useAcceptanceScope } from '../AcceptanceScope';
@@ -64,7 +63,7 @@ const ReadDiscussion = () => {
const { data: bundle } = useAcceptanceBundle(acceptanceId);
const { data, error, isLoading, mutate } = useAcceptanceCommentList(acceptanceId);
- if (!data && isLoading) return <NeuralNetworkLoading size={32} />;
+ if (!data && isLoading) return <Spin size="middle" />;
if (!data && error)
return (
<Empty description={t('acceptance.comments.loadFailed')}>
diff --git a/src/features/AgentGoals/CreateGoalModal/CreateGoalContent.tsx b/src/features/AgentGoals/CreateGoalModal/CreateGoalContent.tsx
index 3838a1b398c..f58757e2d46 100644
--- a/src/features/AgentGoals/CreateGoalModal/CreateGoalContent.tsx
+++ b/src/features/AgentGoals/CreateGoalModal/CreateGoalContent.tsx
@@ -5,7 +5,7 @@ import type { CreateGoalParams, GoalCriterionDraft } from '@lobechat/builtin-too
import { DEFAULT_GOAL_MAX_ROUNDS } from '@lobechat/const/verify';
import { useEditor } from '@lobehub/editor/react';
import { Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, Button, Text, toast, useModalContext } from '@lobehub/ui/base-ui';
+import { ActionIcon, Button, Spin, Text, toast, useModalContext } from '@lobehub/ui/base-ui';
import { InputNumber } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import {
@@ -22,7 +22,6 @@ import { type KeyboardEvent, memo, useCallback, useEffect, useRef, useState } fr
import { useTranslation } from 'react-i18next';
import GeneratingBorder from '@/components/GeneratingBorder';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import {
CriterionList,
CriterionRequiredChip,
@@ -472,7 +471,7 @@ const CreateGoalContent = memo<CreateGoalContentProps>((props) => {
justify={'space-between'}
>
<Flexbox horizontal align={'center'} gap={8}>
- <NeuralNetworkLoading size={18} />
+ <Spin size="small" variant="network" />
<div
aria-label={t('createGoal.generating')}
className={styles.generatingTextViewport}
diff --git a/src/features/AgentProfileArtwork/index.tsx b/src/features/AgentProfileArtwork/index.tsx
index ab42a4ac00b..ec9c0ea9c55 100644
--- a/src/features/AgentProfileArtwork/index.tsx
+++ b/src/features/AgentProfileArtwork/index.tsx
@@ -12,6 +12,7 @@ import {
Button,
type DropdownItem,
DropdownMenu,
+ Spin,
Text,
toast,
} from '@lobehub/ui/base-ui';
@@ -21,7 +22,6 @@ import { memo, useCallback, useId, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import EmojiPicker from '@/components/EmojiPicker';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import {
openAgentArtworkStudio,
styleReferencesForArtworkStyle,
@@ -387,7 +387,7 @@ export const AgentProfileArtwork = memo<AgentProfileArtworkProps>(
{generating === 'background' ? (
<Center className={styles.generationFeedback}>
<Flexbox align={'center'} gap={10}>
- <NeuralNetworkLoading size={32} />
+ <Spin size="large" variant="network" />
<Flexbox align={'center'} gap={4}>
<Text className={styles.generationTitle}>
{t('settingAgent.artwork.background.generating')}
@@ -543,7 +543,7 @@ export const AgentProfileArtwork = memo<AgentProfileArtworkProps>(
/>
{generating === 'avatar' ? (
<Center className={styles.avatarGenerating}>
- <NeuralNetworkLoading size={28} />
+ <Spin size="middle" variant="network" />
</Center>
) : null}
{/* Hover-revealed corner badge as the direct studio entry. */}
diff --git a/src/features/AgentSelectionEmpty.tsx b/src/features/AgentSelectionEmpty.tsx
index f1a6075b830..39f4a4814c0 100644
--- a/src/features/AgentSelectionEmpty.tsx
+++ b/src/features/AgentSelectionEmpty.tsx
@@ -4,7 +4,7 @@ import { Users } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-interface AgentSelectionEmptyProps extends Omit<EmptyProps, 'icon'> {
+interface AgentSelectionEmptyProps extends Omit<EmptyProps, 'icon' | 'variant'> {
search?: boolean;
variant?: 'noAvailable' | 'noSelected' | 'empty';
}
diff --git a/src/features/AgentSidebar/Topic/index.tsx b/src/features/AgentSidebar/Topic/index.tsx
index 8355652b23a..1450f78cd63 100644
--- a/src/features/AgentSidebar/Topic/index.tsx
+++ b/src/features/AgentSidebar/Topic/index.tsx
@@ -7,13 +7,13 @@ import {
AccordionPanel,
accordionStyles,
AccordionTrigger,
+ Spin,
Text,
} from '@lobehub/ui/base-ui';
import { cx } from 'antd-style';
import React, { memo, Suspense, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import { useFetchChatTopics } from '@/hooks/useFetchChatTopics';
import { useChatStore } from '@/store/chat';
@@ -59,7 +59,7 @@ const Topic = memo<TopicProps>(({ expanded, itemKey }) => {
{topicCount}
</Text>
)}
- {isRevalidating && <NeuralNetworkLoading size={14} />}
+ {isRevalidating && <Spin size="small" />}
</Flexbox>
</AccordionTrigger>
<div
diff --git a/src/features/AgentSidebar/Topic/useDropdownMenu.tsx b/src/features/AgentSidebar/Topic/useDropdownMenu.tsx
index 8878516f68e..64ac858c559 100644
--- a/src/features/AgentSidebar/Topic/useDropdownMenu.tsx
+++ b/src/features/AgentSidebar/Topic/useDropdownMenu.tsx
@@ -1,8 +1,8 @@
import { isDesktop } from '@lobechat/const';
import { type MenuProps } from '@lobehub/ui';
import { Icon } from '@lobehub/ui';
-import { confirmModal, toast } from '@lobehub/ui/base-ui';
-import { App, Upload } from 'antd';
+import { confirmModal, toast, Upload } from '@lobehub/ui/base-ui';
+import { App } from 'antd';
import { css, cx } from 'antd-style';
import { Archive, HardDriveDownload, Hash, Import, LucideCheck, Trash } from 'lucide-react';
import { useCallback } from 'react';
@@ -114,7 +114,6 @@ export const useTopicActionsDropdownMenu = (
title: t('importError'),
});
}
- return false; // Prevent default upload behavior
},
[importTopic, modal, onUploadClose, t],
);
@@ -155,9 +154,8 @@ export const useTopicActionsDropdownMenu = (
label: (
<Upload
accept=".json"
- beforeUpload={handleImport}
disabled={!canCreateTopic}
- showUploadList={false}
+ onFiles={([file]) => handleImport(file)}
>
<div className={cx(hotArea)}>{t('actions.import')}</div>
</Upload>
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx
index db4b88298bc..20e2282eee3 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx
@@ -64,8 +64,6 @@ vi.mock('antd', async (importOriginal) => ({
App: { useApp: () => ({ message: { error: vi.fn() } }) },
}));
-vi.mock('@/components/NeuralNetworkLoading', () => ({ default: () => <div>loading</div> }));
-
vi.mock('@/features/Acceptance', async () => ({
// The real row/list primitives: the assertions cover the shared grammar.
...(await vi.importActual('@/features/Acceptance/CriterionList')),
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx
index da9f5ec1eda..904a5b3d4be 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx
@@ -1,7 +1,7 @@
'use client';
import { Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, Button, Collapsible, Text } from '@lobehub/ui/base-ui';
+import { ActionIcon, Button, Collapsible, Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
ChevronRight,
@@ -14,7 +14,6 @@ import {
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import {
type AcceptanceCheck,
checkDisplayTitle,
@@ -183,7 +182,7 @@ const TaskAcceptance = memo<TaskAcceptanceProps>(({ variant = 'default' }) => {
// acceptance section here would advertise a contract that never runs.
if (automationMode) return null;
- if (subjectLoading) return <NeuralNetworkLoading size={28} />;
+ if (subjectLoading) return <Spin size="middle" />;
// Before the first Acceptance round exists, the configured criteria ARE the
// delivery acceptance. Keep them in this single slot; once a round exists,
// replace the definitions with their live/result projection below.
@@ -284,7 +283,7 @@ const TaskAcceptance = memo<TaskAcceptanceProps>(({ variant = 'default' }) => {
{header}
<Collapsible open={sectionExpanded}>
<Flexbox className={styles.body} gap={14}>
- {bundleLoading && <NeuralNetworkLoading size={28} />}
+ {bundleLoading && <Spin size="middle" />}
{bundleError && <AcceptanceError onRetry={() => void mutateBundle()} />}
{bundle && (
<>
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
index 168a988e396..5530fa49258 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
@@ -9,6 +9,7 @@ import {
type DropdownItem,
DropdownMenu,
Select,
+ Spin,
Tag,
Text,
toast,
@@ -29,7 +30,6 @@ import {
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import {
CriterionList,
CriterionRequiredChip,
@@ -574,7 +574,7 @@ const TaskVerifyConfig = memo(() => {
return (
<Block className={styles.section} variant={'outlined'}>
<Flexbox horizontal align={'center'} gap={12}>
- <NeuralNetworkLoading size={20} />
+ <Spin size="middle" variant="network" />
<Text className={styles.subtitle}>{t('verifyConfig.generating')}</Text>
</Flexbox>
</Block>
diff --git a/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx b/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx
index 25648f42d32..43ae62a026e 100644
--- a/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx
+++ b/src/features/AgentTasks/AgentTaskList/AgentTasksPage.tsx
@@ -1,6 +1,12 @@
import { Flexbox } from '@lobehub/ui';
-import { ActionIcon, TabsIndicator, TabsList, TabsRoot, TabsTab } from '@lobehub/ui/base-ui';
-import { Pagination } from 'antd';
+import {
+ ActionIcon,
+ Pagination,
+ TabsIndicator,
+ TabsList,
+ TabsRoot,
+ TabsTab,
+} from '@lobehub/ui/base-ui';
import { Plus } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/features/TaskPriorityTag.tsx b/src/features/AgentTasks/features/TaskPriorityTag.tsx
index f66ef488e71..537a79b0cd2 100644
--- a/src/features/AgentTasks/features/TaskPriorityTag.tsx
+++ b/src/features/AgentTasks/features/TaskPriorityTag.tsx
@@ -1,7 +1,7 @@
import type { IconType } from '@lobehub/icons';
-import { type DropdownItem, DropdownMenu, Icon, type MenuInfo, Tooltip } from '@lobehub/ui';
+import { type DropdownItem, DropdownMenu, type MenuInfo, Tooltip } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2Icon } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -154,7 +154,7 @@ const TaskPriorityTag = memo<TaskPriorityTagProps>(
const triggerNode = children ? (
children
) : loading ? (
- <Icon spin color={cssVar.colorTextDescription} icon={Loader2Icon} size={size} />
+ <Spin size={size} style={{ color: cssVar.colorTextDescription }} />
) : (
<Tooltip title={t(`taskDetail.${meta.labelKey}` as never, { defaultValue: meta.label })}>
<span
diff --git a/src/features/AgentTasks/features/TaskStatusTag.tsx b/src/features/AgentTasks/features/TaskStatusTag.tsx
index eb24b57ca5a..9ddd76fb5a3 100644
--- a/src/features/AgentTasks/features/TaskStatusTag.tsx
+++ b/src/features/AgentTasks/features/TaskStatusTag.tsx
@@ -1,7 +1,7 @@
import type { TaskStatus } from '@lobechat/types';
import { type DropdownItem, DropdownMenu, Icon, type MenuInfo, Tooltip } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2Icon } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -117,7 +117,7 @@ const TaskStatusTag = memo<TaskStatusTagProps>(
const triggerNode =
children ||
(loading ? (
- <Icon spin color={cssVar.colorTextDescription} icon={Loader2Icon} size={size} />
+ <Spin size={size} style={{ color: cssVar.colorTextDescription }} />
) : (
<Tooltip title={t(`taskDetail.${meta.labelKey}`, { defaultValue: meta.label })}>
<span className={styles.trigger} onClick={(e) => e.stopPropagation()}>
diff --git a/src/features/AgentTasks/features/TaskSubtaskProgressTag.tsx b/src/features/AgentTasks/features/TaskSubtaskProgressTag.tsx
index caa2e5d01e5..cb4cce8ad55 100644
--- a/src/features/AgentTasks/features/TaskSubtaskProgressTag.tsx
+++ b/src/features/AgentTasks/features/TaskSubtaskProgressTag.tsx
@@ -1,8 +1,7 @@
import type { TaskDetailSubtask, TaskSubtaskProgress } from '@lobechat/types';
import { Block, Flexbox } from '@lobehub/ui';
import type { DropdownMenuProps } from '@lobehub/ui/base-ui';
-import { DropdownMenu, Text, toast } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { DropdownMenu, Progress, Text, toast } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import type { MouseEvent } from 'react';
import { memo, useCallback, useMemo, useState } from 'react';
diff --git a/src/features/AgentTasks/features/TaskVisibilityTag.tsx b/src/features/AgentTasks/features/TaskVisibilityTag.tsx
index 12db15c0de6..fcc547b5e45 100644
--- a/src/features/AgentTasks/features/TaskVisibilityTag.tsx
+++ b/src/features/AgentTasks/features/TaskVisibilityTag.tsx
@@ -1,6 +1,7 @@
import { type DropdownItem, DropdownMenu, Icon, type MenuInfo, Tooltip } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2Icon, LockIcon, UsersIcon } from 'lucide-react';
+import { LockIcon, UsersIcon } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -128,7 +129,7 @@ const TaskVisibilityTag = memo<TaskVisibilityTagProps>(
const triggerNode = children ? (
children
) : loading ? (
- <Icon spin color={cssVar.colorTextDescription} icon={Loader2Icon} size={size} />
+ <Spin size={size} style={{ color: cssVar.colorTextDescription }} />
) : (
<Tooltip title={label}>
<span className={styles.trigger} onClick={(e) => e.stopPropagation()}>
diff --git a/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx b/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx
index b2b4e5927e8..a86bdc9da69 100644
--- a/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx
+++ b/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx
@@ -3,13 +3,12 @@
import { AGENT_CHAT_URL, DEFAULT_INBOX_AVATAR } from '@lobechat/const';
import { agentDisplayName } from '@lobechat/types';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Button, Text, toast, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, Spin, Text, toast, useModalContext } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { CircleCheck } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import AgentItem from '@/features/PageEditor/Copilot/AgentSelector/AgentItem';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
@@ -186,7 +185,7 @@ const MoveTopicsContent = memo<MoveTopicsContentProps>(({ onMoved, sourceAgentId
if (step === 'moving') {
return (
<Flexbox align={'center'} gap={16} justify={'center'} padding={48}>
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
<Text type={'secondary'}>{t('management.moveModal.moving')}</Text>
</Flexbox>
);
diff --git a/src/features/AgentTransferMigration/MigrationBanner.tsx b/src/features/AgentTransferMigration/MigrationBanner.tsx
index f2a27530baa..88559ac9d11 100644
--- a/src/features/AgentTransferMigration/MigrationBanner.tsx
+++ b/src/features/AgentTransferMigration/MigrationBanner.tsx
@@ -1,9 +1,8 @@
'use client';
-import { Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Flexbox, Tooltip } from '@lobehub/ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2 } from 'lucide-react';
import { memo, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
@@ -74,7 +73,7 @@ export const TopicMigrationPlaceholder = memo<MigrationBannerProps>(
return (
<Flexbox align={'center'} flex={1} gap={12} justify={'center'} padding={24}>
- <Icon spin color={cssVar.colorTextDescription} icon={Loader2} size={20} />
+ <Spin size="middle" style={{ color: cssVar.colorTextDescription }} />
<Text type={'secondary'} weight={500}>
{t(
data?.type === 'copy'
@@ -129,7 +128,7 @@ export const AgentMigrationBadge = memo<MigrationTarget>(({ agentId, groupId })
return (
<Tooltip title={t('transferMigration.agentBanner.desc')}>
<Flexbox horizontal align={'center'} className={chipStyles.chip} gap={6}>
- <Icon spin color={cssVar.colorWarning} icon={Loader2} size={12} />
+ <Spin size={12} style={{ color: cssVar.colorWarning }} />
<span>
{t(
data.type === 'copy'
diff --git a/src/features/AgentTransferMigration/TopicMigrationIndicator.tsx b/src/features/AgentTransferMigration/TopicMigrationIndicator.tsx
index 475f74ff19b..fce8a8d117a 100644
--- a/src/features/AgentTransferMigration/TopicMigrationIndicator.tsx
+++ b/src/features/AgentTransferMigration/TopicMigrationIndicator.tsx
@@ -1,8 +1,7 @@
'use client';
-import { Icon } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2 } from 'lucide-react';
import { memo } from 'react';
import { useTopicMigrationPending } from './MigrationBanner';
@@ -23,7 +22,7 @@ const TopicMigrationIndicator = memo<TopicMigrationIndicatorProps>(
if (!topicPending) return null;
- return <Icon spin color={cssVar.colorTextQuaternary} icon={Loader2} size={12} />;
+ return <Spin size={12} style={{ color: cssVar.colorTextQuaternary }} />;
},
);
diff --git a/src/features/ArtworkStudio/Content.tsx b/src/features/ArtworkStudio/Content.tsx
index 5cc10555646..1fbdc497669 100644
--- a/src/features/ArtworkStudio/Content.tsx
+++ b/src/features/ArtworkStudio/Content.tsx
@@ -14,6 +14,7 @@ import {
Alert,
Avatar,
Button,
+ Spin,
Text,
useModalContext,
} from '@lobehub/ui/base-ui';
@@ -31,7 +32,6 @@ import {
import { memo, type MouseEvent, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { avatarRemountKey, openFilePicker } from '@/features/AgentProfileArtwork/utils';
import { CHIEF_AGENT_ARTWORKS, DEFAULT_CHIEF_AGENT_ARTWORK } from '@/features/ChiefAgent/artwork';
import { HOME_PORTRAIT_VISIBLE_RATIO } from '@/features/Home/portraitFraming';
@@ -502,7 +502,7 @@ const ArtworkStudioContent = memo<ArtworkStudioContentProps>(
const renderGenerationOverlay = (composition: AgentArtworkComposition) =>
isGenerating(composition) ? (
<Center className={styles.generationOverlay} gap={8}>
- <NeuralNetworkLoading size={28} />
+ <Spin size="middle" variant="network" />
<Text className={styles.generationOverlayTitle}>{generatingTitle}</Text>
<Button size={'small'} type={'fill'} onClick={onCancel}>
{t('artworkStudio.cancel')}
diff --git a/src/features/AttachmentInput/AttachmentMenu.tsx b/src/features/AttachmentInput/AttachmentMenu.tsx
index dbe41466987..8ad9132be8f 100644
--- a/src/features/AttachmentInput/AttachmentMenu.tsx
+++ b/src/features/AttachmentInput/AttachmentMenu.tsx
@@ -1,8 +1,7 @@
'use client';
import { Icon } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { ActionIcon, Upload } from '@lobehub/ui/base-ui';
import { css, cx } from 'antd-style';
import { ChevronRight, FileUp, LibraryBig, PlusIcon, TypeIcon } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
@@ -48,13 +47,9 @@ const AttachmentMenu = memo<AttachmentMenuProps>(
label: (
<Upload
multiple
- showUploadList={false}
- beforeUpload={(file, fileList) => {
- if (file === fileList.at(-1)) {
- setOpen(false);
- void onFiles(fileList);
- }
- return false;
+ onFiles={(files) => {
+ setOpen(false);
+ void onFiles(files);
}}
>
<div className={cx(hotArea)}>
diff --git a/src/features/AttachmentInput/AttachmentUploadButton.tsx b/src/features/AttachmentInput/AttachmentUploadButton.tsx
index 94c4b4418a6..54043612332 100644
--- a/src/features/AttachmentInput/AttachmentUploadButton.tsx
+++ b/src/features/AttachmentInput/AttachmentUploadButton.tsx
@@ -1,5 +1,4 @@
-import { ActionIcon } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { ActionIcon, Upload } from '@lobehub/ui/base-ui';
import { Paperclip } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -12,30 +11,12 @@ interface AttachmentUploadButtonProps {
title?: string;
}
-/**
- * Standalone "attach file" button — Antd Upload wrapped in a paperclip icon.
- * Calls `onFiles` for each batch of files the user picks. The host decides
- * what to do with them (typically pass to `useAttachmentUpload.addFiles`).
- */
const AttachmentUploadButton = memo<AttachmentUploadButtonProps>(
({ accept, disabled, onFiles, size = 20, title }) => {
const { t } = useTranslation('chat');
return (
- <Upload
- multiple
- accept={accept}
- disabled={disabled}
- showUploadList={false}
- beforeUpload={(file, fileList) => {
- // beforeUpload fires once per file but receives the whole batch.
- // Forward all files on the LAST call to give onFiles one shot.
- if (file === fileList.at(-1)) {
- void onFiles(fileList);
- }
- return false;
- }}
- >
+ <Upload multiple accept={accept} disabled={disabled} onFiles={(files) => void onFiles(files)}>
<ActionIcon
disabled={disabled}
icon={Paperclip}
diff --git a/src/features/Auth/MarketAuthCallback/index.tsx b/src/features/Auth/MarketAuthCallback/index.tsx
index c5326a6864b..733a6f4e35b 100644
--- a/src/features/Auth/MarketAuthCallback/index.tsx
+++ b/src/features/Auth/MarketAuthCallback/index.tsx
@@ -1,8 +1,7 @@
'use client';
import { FluentEmoji } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Button, Result, Text } from '@lobehub/ui/base-ui';
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthAuthorizeError/index.tsx b/src/features/Auth/OAuthAuthorizeError/index.tsx
index c557296f394..ecd591f6ee6 100644
--- a/src/features/Auth/OAuthAuthorizeError/index.tsx
+++ b/src/features/Auth/OAuthAuthorizeError/index.tsx
@@ -1,8 +1,7 @@
'use client';
import { Block, Flexbox, FluentEmoji } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Button, Result, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthCallback/Error.tsx b/src/features/Auth/OAuthCallback/Error.tsx
index efefaab6ad5..db186a83aa6 100644
--- a/src/features/Auth/OAuthCallback/Error.tsx
+++ b/src/features/Auth/OAuthCallback/Error.tsx
@@ -2,8 +2,7 @@
// Highlighter is intentionally avoided: it pulls every shiki grammar (~10 MB) into the auth bundle
import { Block, Flexbox, FluentEmoji } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Button, Result, Text } from '@lobehub/ui/base-ui';
import { useTranslation } from 'react-i18next';
import { useSearchParams } from 'react-router';
diff --git a/src/features/Auth/OAuthCallback/Social.tsx b/src/features/Auth/OAuthCallback/Social.tsx
index e8cdd025863..6901fcff5a2 100644
--- a/src/features/Auth/OAuthCallback/Social.tsx
+++ b/src/features/Auth/OAuthCallback/Social.tsx
@@ -1,8 +1,7 @@
'use client';
import { FluentEmoji } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Result, Text } from '@lobehub/ui/base-ui';
import React, { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSearchParams } from 'react-router';
diff --git a/src/features/Auth/OAuthCallback/Success.tsx b/src/features/Auth/OAuthCallback/Success.tsx
index c8d32569d51..a80f3a35de0 100644
--- a/src/features/Auth/OAuthCallback/Success.tsx
+++ b/src/features/Auth/OAuthCallback/Success.tsx
@@ -1,8 +1,7 @@
'use client';
import { FluentEmoji } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Result, Text } from '@lobehub/ui/base-ui';
import React, { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSearchParams } from 'react-router';
diff --git a/src/features/Auth/OAuthConsent/ClientError.tsx b/src/features/Auth/OAuthConsent/ClientError.tsx
index 32df34dbf61..2e04829ff81 100644
--- a/src/features/Auth/OAuthConsent/ClientError.tsx
+++ b/src/features/Auth/OAuthConsent/ClientError.tsx
@@ -1,8 +1,7 @@
'use client';
import { FluentEmoji } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Result, Text } from '@lobehub/ui/base-ui';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthConsent/Consent/BuiltinConsent.tsx b/src/features/Auth/OAuthConsent/Consent/BuiltinConsent.tsx
index 0f545b60f29..984f2d83d51 100644
--- a/src/features/Auth/OAuthConsent/Consent/BuiltinConsent.tsx
+++ b/src/features/Auth/OAuthConsent/Consent/BuiltinConsent.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Result, Text } from '@lobehub/ui/base-ui';
import { memo, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthDevice/DeviceSuccess.tsx b/src/features/Auth/OAuthDevice/DeviceSuccess.tsx
index fb6bcb5fadd..12515507ca6 100644
--- a/src/features/Auth/OAuthDevice/DeviceSuccess.tsx
+++ b/src/features/Auth/OAuthDevice/DeviceSuccess.tsx
@@ -1,8 +1,7 @@
'use client';
import { FluentEmoji } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Result, Text } from '@lobehub/ui/base-ui';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/SignIn/SignInEmailStep.tsx b/src/features/Auth/SignIn/SignInEmailStep.tsx
index 6684e59822e..c770ed7ad65 100644
--- a/src/features/Auth/SignIn/SignInEmailStep.tsx
+++ b/src/features/Auth/SignIn/SignInEmailStep.tsx
@@ -1,8 +1,8 @@
import { BRANDING_NAME } from '@lobechat/business-const';
import { Flexbox, Icon, Input } from '@lobehub/ui';
-import { Alert, Button, Text } from '@lobehub/ui/base-ui';
+import { Alert, Badge, Button, Text } from '@lobehub/ui/base-ui';
import { type FormInstance, type InputRef } from 'antd';
-import { Badge, Divider, Form } from 'antd';
+import { Divider, Form } from 'antd';
import { createStaticStyles } from 'antd-style';
import { Mail } from 'lucide-react';
import { type CSSProperties, useEffect, useRef } from 'react';
@@ -137,7 +137,7 @@ export const SignInEmailStep = ({
color="var(--ant-color-info)"
count={t('betterAuth.signin.lastUsed')}
key={provider}
- styles={{ root: { display: 'block', width: '100%' } }}
+ style={{ display: 'block', width: '100%' }}
>
{button}
</Badge>
diff --git a/src/features/ChatInput/ActionBar/Params/Controls.tsx b/src/features/ChatInput/ActionBar/Params/Controls.tsx
index a1e04049689..e1d57043743 100644
--- a/src/features/ChatInput/ActionBar/Params/Controls.tsx
+++ b/src/features/ChatInput/ActionBar/Params/Controls.tsx
@@ -5,7 +5,7 @@ import {
} from '@lobechat/const';
import { resolveEffectiveReasoningChatConfig } from '@lobechat/model-runtime/utils/modelExtendParams';
import { Flexbox, Icon, TextArea } from '@lobehub/ui';
-import { Select, SliderWithInput, Switch } from '@lobehub/ui/base-ui';
+import { Select, SliderWithInput, Spin, Switch } from '@lobehub/ui/base-ui';
import { Form as AntdForm } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { debounce } from 'es-toolkit/compat';
@@ -18,7 +18,6 @@ import { useTranslation } from 'react-i18next';
import type { PartialDeep } from 'type-fest';
import InfoTooltip from '@/components/InfoTooltip';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import ModelSelect from '@/features/ModelSelect';
import ControlsForm from '@/features/ModelSwitchPanel/components/ControlsForm';
import { usePermission } from '@/hooks/usePermission';
@@ -845,7 +844,7 @@ const Controls = ({ variant = 'popover' }: ControlsProps) => {
<span className={styles.headerTitle}>{panelTitle}</span>
{updating && (
<div className={styles.headerLoading}>
- <NeuralNetworkLoading size={18} />
+ <Spin size="small" />
</div>
)}
</div>
diff --git a/src/features/ChatInput/ActionBar/Plus/index.tsx b/src/features/ChatInput/ActionBar/Plus/index.tsx
index 36e2217f773..f568cbebd0a 100644
--- a/src/features/ChatInput/ActionBar/Plus/index.tsx
+++ b/src/features/ChatInput/ActionBar/Plus/index.tsx
@@ -3,9 +3,8 @@
import { validateVideoFileSize } from '@lobechat/utils/client';
import type { IconProps } from '@lobehub/ui';
import { Icon, Popover } from '@lobehub/ui';
-import { toast } from '@lobehub/ui/base-ui';
+import { toast, Upload } from '@lobehub/ui/base-ui';
import { GlobeOffIcon, SkillsIcon } from '@lobehub/ui/icons';
-import { Upload } from 'antd';
import { css, cssVar, cx } from 'antd-style';
import {
Brain,
@@ -464,8 +463,7 @@ const usePlusMenuItems = ({ close }: { close: () => void }): ActionDropdownMenuI
label: (
<Upload
multiple
- showUploadList={false}
- beforeUpload={async (file) => {
+ beforeUpload={(file) => {
if (file.type.startsWith('image') && !canUploadImage) return false;
if (file.type.startsWith('video') && !canUploadVideo) return false;
if (file.type.startsWith('audio') && !canUploadAudio) return false;
@@ -479,10 +477,12 @@ const usePlusMenuItems = ({ close }: { close: () => void }): ActionDropdownMenuI
);
return false;
}
+ return true;
+ }}
+ onFiles={async (files) => {
close();
editor?.focus();
- await upload([file], agentId);
- return false;
+ await upload(files, agentId);
}}
>
<div className={cx(hotArea)}>{t('upload.action.fileOrImageUpload')}</div>
diff --git a/src/features/ChatInput/ActionBar/Tools/ComposioServerItem.tsx b/src/features/ChatInput/ActionBar/Tools/ComposioServerItem.tsx
index 104b86c78c5..0c6e03442b0 100644
--- a/src/features/ChatInput/ActionBar/Tools/ComposioServerItem.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/ComposioServerItem.tsx
@@ -1,6 +1,6 @@
import { Flexbox, Icon, stopPropagation } from '@lobehub/ui';
-import { Checkbox } from '@lobehub/ui/base-ui';
-import { Loader2, SquareArrowOutUpRight } from 'lucide-react';
+import { Checkbox, Spin } from '@lobehub/ui/base-ui';
+import { SquareArrowOutUpRight } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -279,7 +279,7 @@ const ComposioServerItem = memo<ComposioServerItemProps>(
if (isConnecting) {
return (
<Flexbox horizontal align="center" gap={4} onClick={stopPropagation}>
- <Icon spin icon={Loader2} />
+ <Spin size="small" />
</Flexbox>
);
}
@@ -309,7 +309,7 @@ const ComposioServerItem = memo<ComposioServerItemProps>(
case ComposioServerStatus.ACTIVE: {
// Toggling state
if (isToggling) {
- return <Icon spin icon={Loader2} />;
+ return <Spin size="small" />;
}
return (
<Checkbox
@@ -329,7 +329,7 @@ const ComposioServerItem = memo<ComposioServerItemProps>(
if (isWaitingAuth) {
return (
<Flexbox horizontal align="center" gap={4} onClick={stopPropagation}>
- <Icon spin icon={Loader2} />
+ <Spin size="small" />
</Flexbox>
);
}
diff --git a/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx b/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx
index 9fc778c4050..d77a19b4f6f 100644
--- a/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx
@@ -1,6 +1,6 @@
import { Flexbox, Icon, stopPropagation } from '@lobehub/ui';
-import { Checkbox } from '@lobehub/ui/base-ui';
-import { Loader2, SquareArrowOutUpRight } from 'lucide-react';
+import { Checkbox, Spin } from '@lobehub/ui/base-ui';
+import { SquareArrowOutUpRight } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -246,7 +246,7 @@ const LobehubSkillServerItem = memo<LobehubSkillServerItemProps>(
if (isConnecting) {
return (
<Flexbox horizontal align="center" gap={4} onClick={stopPropagation}>
- <Icon spin icon={Loader2} />
+ <Spin size="small" />
</Flexbox>
);
}
@@ -273,7 +273,7 @@ const LobehubSkillServerItem = memo<LobehubSkillServerItemProps>(
switch (server.status) {
case LobehubSkillStatus.CONNECTED: {
if (isToggling) {
- return <Icon spin icon={Loader2} />;
+ return <Spin size="small" />;
}
return (
<Checkbox
@@ -291,7 +291,7 @@ const LobehubSkillServerItem = memo<LobehubSkillServerItemProps>(
if (isWaitingAuth) {
return (
<Flexbox horizontal align="center" gap={4} onClick={stopPropagation}>
- <Icon spin icon={Loader2} />
+ <Spin size="small" />
</Flexbox>
);
}
diff --git a/src/features/ChatInput/ActionBar/Upload/index.tsx b/src/features/ChatInput/ActionBar/Upload/index.tsx
index 1c91491c6f5..6e3f85ddddf 100644
--- a/src/features/ChatInput/ActionBar/Upload/index.tsx
+++ b/src/features/ChatInput/ActionBar/Upload/index.tsx
@@ -1,7 +1,6 @@
import { validateVideoFileSize } from '@lobechat/utils/client';
import { Icon, Tooltip } from '@lobehub/ui';
-import { toast } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { toast, Upload } from '@lobehub/ui/base-ui';
import { css, cx } from 'antd-style';
import { FileUp, FolderUp, ImageUp, Paperclip } from 'lucide-react';
import { memo, Suspense, useState } from 'react';
@@ -90,13 +89,10 @@ const FileUpload = memo(() => {
<Upload
multiple
accept={'image/*'}
- showUploadList={false}
- beforeUpload={async (file) => {
+ onFiles={async (files) => {
setDropdownOpen(false);
editor?.focus();
- await upload([file], agentId);
-
- return false;
+ await upload(files, agentId);
}}
>
<div className={cx(hotArea)}>{t('upload.action.imageUpload')}</div>
@@ -114,8 +110,7 @@ const FileUpload = memo(() => {
label: (
<Upload
multiple
- showUploadList={false}
- beforeUpload={async (file) => {
+ beforeUpload={(file) => {
if (
(file.type.startsWith('image') && !canUploadImage) ||
(file.type.startsWith('video') && !canUploadVideo) ||
@@ -123,7 +118,6 @@ const FileUpload = memo(() => {
)
return false;
- // Validate video file size
const validation = validateVideoFileSize(file);
if (!validation.isValid) {
toast.error(
@@ -135,11 +129,12 @@ const FileUpload = memo(() => {
return false;
}
+ return true;
+ }}
+ onFiles={async (files) => {
setDropdownOpen(false);
editor?.focus();
- await upload([file], agentId);
-
- return false;
+ await upload(files, agentId);
}}
>
<div className={cx(hotArea)}>{t('upload.action.fileUpload')}</div>
@@ -154,8 +149,7 @@ const FileUpload = memo(() => {
<Upload
directory
multiple={true}
- showUploadList={false}
- beforeUpload={async (file) => {
+ beforeUpload={(file) => {
if (
(file.type.startsWith('image') && !canUploadImage) ||
(file.type.startsWith('video') && !canUploadVideo) ||
@@ -163,7 +157,6 @@ const FileUpload = memo(() => {
)
return false;
- // Validate video file size
const validation = validateVideoFileSize(file);
if (!validation.isValid) {
toast.error(
@@ -175,11 +168,12 @@ const FileUpload = memo(() => {
return false;
}
+ return true;
+ }}
+ onFiles={async (files) => {
setDropdownOpen(false);
editor?.focus();
- await upload([file], agentId);
-
- return false;
+ await upload(files, agentId);
}}
>
<div className={cx(hotArea)}>{t('upload.action.folderUpload')}</div>
diff --git a/src/features/ChatInput/ActionBar/components/ActionPopover.tsx b/src/features/ChatInput/ActionBar/components/ActionPopover.tsx
index 6ae02a6414d..2d7b6c10b01 100644
--- a/src/features/ChatInput/ActionBar/components/ActionPopover.tsx
+++ b/src/features/ChatInput/ActionBar/components/ActionPopover.tsx
@@ -2,12 +2,12 @@
import { type PopoverProps } from '@lobehub/ui';
import { Flexbox, Popover } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { type ReactNode } from 'react';
import { memo, Suspense } from 'react';
import DebugNode from '@/components/DebugNode';
-import UpdateLoading from '@/components/Loading/UpdateLoading';
import { useIsMobile } from '@/hooks/useIsMobile';
const prefixCls = 'ant';
@@ -74,7 +74,7 @@ const ActionPopover = memo<ActionPopoverProps>(
<Flexbox horizontal gap={8} justify={'space-between'} style={{ marginBottom: 16 }}>
{title}
{extra}
- {loading && <UpdateLoading style={{ color: cssVar.colorTextSecondary }} />}
+ {loading && <Spin size="small" style={{ color: cssVar.colorTextSecondary }} />}
</Flexbox>
)}
{content}
diff --git a/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx b/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx
index 8fbb8fb553e..e733db2b257 100644
--- a/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx
+++ b/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx
@@ -1,6 +1,5 @@
-import { Center, Flexbox, Icon } from '@lobehub/ui';
-import { Checkbox } from '@lobehub/ui/base-ui';
-import { Loader2 } from 'lucide-react';
+import { Center, Flexbox } from '@lobehub/ui';
+import { Checkbox, Spin } from '@lobehub/ui/base-ui';
import { type CSSProperties, type ReactNode } from 'react';
import { memo, useState } from 'react';
@@ -95,7 +94,7 @@ const CheckboxItem = memo<CheckboxItemProps>(
</span>
{loading ? (
<Center width={18}>
- <Icon spin icon={Loader2} />
+ <Spin size="small" />
</Center>
) : (
<Checkbox
diff --git a/src/features/ChatInput/ControlBar/WorktreeSwitcher.tsx b/src/features/ChatInput/ControlBar/WorktreeSwitcher.tsx
index d9eda7259f4..9126cbf44a9 100644
--- a/src/features/ChatInput/ControlBar/WorktreeSwitcher.tsx
+++ b/src/features/ChatInput/ControlBar/WorktreeSwitcher.tsx
@@ -8,6 +8,7 @@ import {
DropdownMenuPositioner,
DropdownMenuRoot,
DropdownMenuTrigger,
+ Spin,
toast,
} from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
@@ -16,7 +17,6 @@ import {
FolderPlusIcon,
GitBranchIcon,
GitForkIcon,
- LoaderCircleIcon,
RefreshCwIcon,
SearchIcon,
Trash2Icon,
@@ -745,7 +745,7 @@ const WorktreeSwitcher = memo<WorktreeSwitcherProps>(
</div>
<div className={styles.actionCell}>
{removing ? (
- <Icon spin icon={LoaderCircleIcon} size={13} />
+ <Spin size={13} />
) : worktree.current ? (
<Icon className={styles.check} icon={CheckIcon} size={14} />
) : (
diff --git a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx
index 2d4ea22195b..3e5ee349170 100644
--- a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx
+++ b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx
@@ -1,6 +1,5 @@
import { Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { ActionIcon, Tag } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { ActionIcon, Progress, Tag } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { CircleAlertIcon, CircleCheckIcon, Loader2Icon, RotateCwIcon } from 'lucide-react';
import { memo } from 'react';
@@ -149,11 +148,10 @@ const ContextItem = memo<FileItemProps>((props) => {
role={'progressbar'}
>
<Progress
- percent={progress}
+ percent={progress ?? 0}
showInfo={false}
size={12}
status={'normal'}
- strokeWidth={12}
type={'circle'}
/>
</span>
diff --git a/src/features/ChatInput/Dictation/index.tsx b/src/features/ChatInput/Dictation/index.tsx
index 736cfcd2303..d9a9fa8aa4f 100644
--- a/src/features/ChatInput/Dictation/index.tsx
+++ b/src/features/ChatInput/Dictation/index.tsx
@@ -1,8 +1,9 @@
'use client';
-import { Icon, Tooltip } from '@lobehub/ui';
+import { Tooltip } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
-import { LoaderCircle, Mic, RotateCcw, X } from 'lucide-react';
+import { Mic, RotateCcw, X } from 'lucide-react';
import type { MouseEvent } from 'react';
import { memo, useCallback, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
@@ -84,19 +85,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
clip: rect(0, 0, 0, 0);
`,
- spin: css`
- animation: dictation-spin 1s linear infinite;
-
- @keyframes dictation-spin {
- to {
- transform: rotate(360deg);
- }
- }
-
- @media (prefers-reduced-motion: reduce) {
- animation: none;
- }
- `,
status: css`
overflow: hidden;
@@ -322,7 +310,7 @@ const Dictation = memo(() => {
onKeyDown={(event) => handleKeyboardActivation(event, start)}
/>
) : status !== 'error' ? (
- <Icon aria-hidden className={styles.spin} icon={LoaderCircle} size={18} />
+ <Spin aria-hidden size="small" />
) : null}
</div>
<ChatInputAction
diff --git a/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx b/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx
index 24190684891..31faee233c8 100644
--- a/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx
+++ b/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx
@@ -1,9 +1,8 @@
import { CheckCircleFilled } from '@ant-design/icons';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Progress, Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { CircleAlertIcon, Loader2Icon } from 'lucide-react';
+import { CircleAlertIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -25,7 +24,7 @@ const UploadStatus = memo<UploadStateProps>(({ error, status, size, uploadState
case 'pending': {
return (
<Flexbox horizontal align={'center'} gap={4}>
- <Icon spin icon={Loader2Icon} size={12} />
+ <Spin size={12} />
<Text style={{ fontSize: 12 }} type={'secondary'}>
{t('upload.preview.status.pending')}
</Text>
@@ -36,7 +35,7 @@ const UploadStatus = memo<UploadStateProps>(({ error, status, size, uploadState
case 'uploading': {
return (
<Flexbox horizontal align={'center'} gap={4}>
- <Progress percent={uploadState?.progress} size={14} type="circle" />
+ <Progress percent={uploadState?.progress ?? 0} size={14} type="circle" />
<Text style={{ fontSize: 12 }} type={'secondary'}>
{formatSize(size * ((uploadState?.progress || 0) / 100), 0)}
</Text>
@@ -47,7 +46,7 @@ const UploadStatus = memo<UploadStateProps>(({ error, status, size, uploadState
case 'processing': {
return (
<Flexbox horizontal align={'center'} gap={4}>
- <Progress percent={uploadState?.progress} size={14} type="circle" />
+ <Progress percent={uploadState?.progress ?? 0} size={14} type="circle" />
<Text style={{ fontSize: 12 }} type={'secondary'}>
{formatSize(size)}
</Text>
diff --git a/src/features/CommunityWorkspaceSettings/index.tsx b/src/features/CommunityWorkspaceSettings/index.tsx
index 7b872fdf080..96f1dd49ce9 100644
--- a/src/features/CommunityWorkspaceSettings/index.tsx
+++ b/src/features/CommunityWorkspaceSettings/index.tsx
@@ -2,9 +2,9 @@
import { OFFICIAL_URL } from '@lobechat/const';
import { Block, Center, Flexbox, Icon, Input, TextArea, Tooltip } from '@lobehub/ui';
-import { Avatar, Button, Tabs, Tag, Text, toast } from '@lobehub/ui/base-ui';
-import type { TableColumnsType, UploadProps } from 'antd';
-import { Input as AntInput, Table, Upload } from 'antd';
+import { Avatar, Button, Tabs, Tag, Text, toast, Upload } from '@lobehub/ui/base-ui';
+import type { TableColumnsType } from 'antd';
+import { Input as AntInput, Table } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import {
ArrowLeft,
@@ -432,13 +432,10 @@ const CommunityWorkspaceSettings = memo(() => {
[t, uploadWithProgress],
);
- const handleBannerUpload: UploadProps['customRequest'] = useCallback(
- async (options: Parameters<NonNullable<UploadProps['customRequest']>>[0]) => {
- const file = options.file as File;
-
+ const handleBannerUpload = useCallback(
+ async (file: File) => {
if (file.size > MAX_FILE_SIZE) {
toast.error(t('user.workspaceProfile.errors.fileTooLarge'));
- options.onError?.(new Error('File too large'));
return;
}
@@ -447,18 +444,15 @@ const CommunityWorkspaceSettings = memo(() => {
const result = await uploadWithProgress({ file });
if (!result?.url) {
toast.error(t('user.workspaceProfile.errors.uploadFailed'));
- options.onError?.(new Error('Upload failed'));
return;
}
const url = result.url.startsWith('/')
? `${window.location.origin}${result.url}`
: result.url;
setBannerUrl(url);
- options.onSuccess?.(result);
} catch (error) {
console.error('[CommunityWorkspaceSettings] Banner upload failed:', error);
toast.error(t('user.workspaceProfile.errors.uploadFailed'));
- options.onError?.(error as Error);
} finally {
setBannerUploading(false);
}
@@ -638,11 +632,10 @@ const CommunityWorkspaceSettings = memo(() => {
<Flexbox gap={8} width="100%">
<Upload
accept="image/*"
- customRequest={handleBannerUpload}
disabled={!canEdit}
maxCount={1}
- showUploadList={false}
style={{ display: 'block', width: '100%' }}
+ onFiles={([file]) => handleBannerUpload(file)}
>
<div
style={{
diff --git a/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx b/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx
index 2e7041dd535..24cca55cb3e 100644
--- a/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx
+++ b/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx
@@ -1,4 +1,4 @@
-import { Tooltip } from 'antd';
+import { Tooltip } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { BanIcon, CheckIcon, HandIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/Icon.tsx b/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/Icon.tsx
index 222997366bd..4daae756f40 100644
--- a/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/Icon.tsx
+++ b/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/Icon.tsx
@@ -1,7 +1,8 @@
import { SiReact } from '@icons-pack/react-simple-icons';
import { Icon } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { CodeXml, GlobeIcon, ImageIcon, Loader2, OrigamiIcon } from 'lucide-react';
+import { CodeXml, GlobeIcon, ImageIcon, OrigamiIcon } from 'lucide-react';
import { memo } from 'react';
interface ArtifactProps {
@@ -10,8 +11,7 @@ interface ArtifactProps {
const SIZE = 28;
const ArtifactIcon = memo<ArtifactProps>(({ type }) => {
- if (!type)
- return <Icon spin icon={Loader2} size={SIZE} style={{ color: cssVar.colorTextSecondary }} />;
+ if (!type) return <Spin size={SIZE} style={{ color: cssVar.colorTextSecondary }} />;
switch (type) {
case 'application/lobe.artifacts.code': {
diff --git a/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx b/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx
index 00903054da3..dc349657aa0 100644
--- a/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx
+++ b/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx
@@ -1,6 +1,6 @@
-import { Center, Flexbox, Icon } from '@lobehub/ui';
+import { Center, Flexbox } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
-import { Loader2 } from 'lucide-react';
import { memo, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
@@ -116,7 +116,7 @@ const Render = memo<ArtifactProps>(({ identifier, title, type, language, childre
<Flexbox horizontal gap={2}>
{!isArtifactTagClosed && (
<div>
- <Icon spin icon={Loader2} />
+ <Spin size="small" />
</div>
)}
{str?.length}
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx
index f7c0826f613..5130ef3095d 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx
@@ -1,5 +1,6 @@
import { type ToolIntervention } from '@lobechat/types';
import { Block, Icon, Tooltip } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import {
AlertTriangle,
@@ -14,8 +15,6 @@ import {
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
-
import { hasToolResultBody } from '../toolResultBody';
interface StatusIndicatorProps {
@@ -79,7 +78,7 @@ const StatusIndicator = memo<StatusIndicatorProps>(
} else if (hasResult || isToolComplete) {
icon = <Icon color={cssVar.colorSuccess} icon={successIcon ?? Check} />;
} else {
- icon = <NeuralNetworkLoading size={16} />;
+ icon = <Spin size="small" variant="network" />;
}
return (
diff --git a/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.test.tsx b/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.test.tsx
index c526d6bb7a1..1ac601e8476 100644
--- a/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.test.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.test.tsx
@@ -88,10 +88,6 @@ vi.mock('react-i18next', () => ({
}),
}));
-vi.mock('@/components/NeuralNetworkLoading', () => ({
- default: () => <div>loading</div>,
-}));
-
vi.mock('@/hooks/useAutoScroll', () => ({
useAutoScroll: () => ({
handleScroll: vi.fn(),
diff --git a/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsx b/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsx
index 19c4f5c7080..7dd6e85b4d2 100644
--- a/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/components/WorkflowCollapse.tsx
@@ -1,6 +1,6 @@
import { type ChatToolPayloadWithResult } from '@lobechat/types';
import { Block, Flexbox, Icon } from '@lobehub/ui';
-import { Accordion, ActionIcon, Text } from '@lobehub/ui/base-ui';
+import { Accordion, ActionIcon, Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Check, HandIcon, Maximize2, Minimize2, X } from 'lucide-react';
import { AnimatePresence } from 'motion/react';
@@ -8,7 +8,6 @@ import * as motion from 'motion/react-m';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useAutoScroll } from '@/hooks/useAutoScroll';
import { useChatStore } from '@/store/chat';
import { operationSelectors } from '@/store/chat/slices/operation/selectors';
@@ -414,7 +413,7 @@ const WorkflowCollapse = memo<WorkflowCollapseProps>(
pendingInterventionPresent ? (
<Icon color={cssVar.colorInfo} icon={HandIcon} />
) : (
- <NeuralNetworkLoading size={16} />
+ <Spin size="small" variant="network" />
),
);
}
diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/TaskTitle.tsx b/src/features/Conversation/Messages/GroupTasks/TaskItem/TaskTitle.tsx
index 91f9dd79e72..14ff5f217b0 100644
--- a/src/features/Conversation/Messages/GroupTasks/TaskItem/TaskTitle.tsx
+++ b/src/features/Conversation/Messages/GroupTasks/TaskItem/TaskTitle.tsx
@@ -2,13 +2,12 @@
import { ThreadStatus } from '@lobechat/types';
import { Block, Flexbox, Icon } from '@lobehub/ui';
-import { Avatar, Text } from '@lobehub/ui/base-ui';
+import { Avatar, Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Footprints, ListChecksIcon, Wrench, XIcon } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { DEFAULT_AVATAR } from '@/const/meta';
import { formatDuration, formatElapsedTime, isProcessingStatus } from '../../Tasks/shared';
@@ -51,7 +50,7 @@ const TaskStatusIndicator = memo<{ status?: ThreadStatus }>(({ status }) => {
} else if (isError) {
icon = <Icon color={cssVar.colorError} icon={XIcon} />;
} else if (isProcessing || isInitializing) {
- icon = <NeuralNetworkLoading size={16} />;
+ icon = <Spin size="small" variant="network" />;
} else {
return null;
}
diff --git a/src/features/Conversation/Messages/Task/ClientTaskDetail/InitializingState.tsx b/src/features/Conversation/Messages/Task/ClientTaskDetail/InitializingState.tsx
index 88b28524664..72619fa9933 100644
--- a/src/features/Conversation/Messages/Task/ClientTaskDetail/InitializingState.tsx
+++ b/src/features/Conversation/Messages/Task/ClientTaskDetail/InitializingState.tsx
@@ -1,12 +1,11 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, keyframes } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { shinyTextStyles } from '@/styles';
const shimmer = keyframes`
@@ -57,7 +56,7 @@ const InitializingState = memo(() => {
return (
<Flexbox className={styles.container} gap={12}>
<Flexbox horizontal align="center" gap={8}>
- <NeuralNetworkLoading size={14} />
+ <Spin size="small" variant="network" />
<Text className={shinyTextStyles.shinyText} weight={500}>
{t('task.status.initializing')}
</Text>
diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/TaskTitle.tsx b/src/features/Conversation/Messages/Tasks/TaskItem/TaskTitle.tsx
index d3932d59188..7bf7e76afac 100644
--- a/src/features/Conversation/Messages/Tasks/TaskItem/TaskTitle.tsx
+++ b/src/features/Conversation/Messages/Tasks/TaskItem/TaskTitle.tsx
@@ -1,13 +1,12 @@
'use client';
import { Block, Flexbox, Icon } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Footprints, ListChecksIcon, Wrench, XIcon } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { ThreadStatus } from '@/types/index';
import { formatDuration, formatElapsedTime, isProcessingStatus } from '../shared';
@@ -45,7 +44,7 @@ const TaskStatusIndicator = memo<{ status?: ThreadStatus }>(({ status }) => {
} else if (isError) {
icon = <Icon color={cssVar.colorError} icon={XIcon} />;
} else if (isProcessing || isInitializing) {
- icon = <NeuralNetworkLoading size={16} />;
+ icon = <Spin size="small" variant="network" />;
} else {
return null;
}
diff --git a/src/features/Conversation/Messages/Tasks/shared/InitializingState.tsx b/src/features/Conversation/Messages/Tasks/shared/InitializingState.tsx
index 0412f52899e..652a79549b9 100644
--- a/src/features/Conversation/Messages/Tasks/shared/InitializingState.tsx
+++ b/src/features/Conversation/Messages/Tasks/shared/InitializingState.tsx
@@ -1,12 +1,11 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, keyframes } from 'antd-style';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { shinyTextStyles } from '@/styles';
import { formatElapsedTime } from './utils';
@@ -71,7 +70,7 @@ const InitializingState = memo(() => {
return (
<Flexbox className={styles.container} gap={12}>
<Flexbox horizontal align="center" gap={8}>
- <NeuralNetworkLoading size={14} />
+ <Spin size="small" variant="network" />
<Text className={shinyTextStyles.shinyText} weight={500}>
{t('task.status.initializing')}
</Text>
diff --git a/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx b/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx
index 40a849ac140..f2687b8d534 100644
--- a/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx
+++ b/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx
@@ -2,13 +2,12 @@
import { type TaskDetail } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, keyframes } from 'antd-style';
import { Footprints, Timer, Wrench } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useChatStore } from '@/store/chat';
import { MAX_PROGRESS, PROGRESS_INCREMENT, PROGRESS_INTERVAL } from './constants';
@@ -207,7 +206,7 @@ const ProcessingState = memo<ProcessingStateProps>(
{currentActivity && (
<div className={styles.activityRow}>
<Flexbox horizontal align={'center'} gap={4}>
- <NeuralNetworkLoading size={14} />
+ <Spin size="small" variant="network" />
<Text as={'span'} fontSize={12} type={'secondary'}>
{renderActivityText()}
</Text>
@@ -290,7 +289,7 @@ const ProcessingState = memo<ProcessingStateProps>(
{/* Current Activity */}
{currentActivity && (
<Flexbox horizontal align="center" gap={8}>
- <NeuralNetworkLoading size={14} />
+ <Spin size="small" variant="network" />
<Text
ellipsis
as={'span'}
diff --git a/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx b/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx
index 780d324ae3e..1aba24d74db 100644
--- a/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx
+++ b/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx
@@ -2,13 +2,12 @@
import { type AssistantContentBlock, type UIChatMessage } from '@lobechat/types';
import { Block, Flexbox, Icon, Markdown } from '@lobehub/ui';
-import { Accordion, Text } from '@lobehub/ui/base-ui';
+import { Accordion, Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { ScrollText, Workflow } from 'lucide-react';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useAutoScroll } from '@/hooks/useAutoScroll';
import { useUserStore } from '@/store/user';
import { userGeneralSettingsSelectors } from '@/store/user/selectors';
@@ -175,7 +174,7 @@ const ProcessingView = memo<{
variant="outlined"
width={24}
>
- <NeuralNetworkLoading size={16} />
+ <Spin size="small" variant="network" />
</Block>
<Flexbox horizontal align="center" gap={4}>
<Text as="span" type="secondary" weight={500}>
diff --git a/src/features/Conversation/Messages/components/ContentLoading.tsx b/src/features/Conversation/Messages/components/ContentLoading.tsx
index 25470f8a297..95abe2b96f2 100644
--- a/src/features/Conversation/Messages/components/ContentLoading.tsx
+++ b/src/features/Conversation/Messages/components/ContentLoading.tsx
@@ -1,10 +1,10 @@
import { HETEROGENEOUS_TYPE_LABELS } from '@lobechat/heterogeneous-agents';
import { Flexbox } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import BubblesLoading from '@/components/BubblesLoading';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useChatStore } from '@/store/chat';
import { operationSelectors } from '@/store/chat/selectors';
import { type OperationType, type StreamRetryMetadata } from '@/store/chat/slices/operation/types';
@@ -149,7 +149,7 @@ const ContentLoading = memo<ContentLoadingProps>(({ id, startTime: startTimeOver
if (operationType === 'contextCompression') {
return (
<Flexbox horizontal align={'center'} gap={8}>
- <NeuralNetworkLoading size={16} />
+ <Spin size="small" variant="network" />
<span className={shinyTextStyles.shinyText}>{t('operation.contextCompression')}</span>
</Flexbox>
);
diff --git a/src/features/Conversation/WorkingSidebar/Files/__tests__/index.test.tsx b/src/features/Conversation/WorkingSidebar/Files/__tests__/index.test.tsx
index b2df672395f..3f7001df9f8 100644
--- a/src/features/Conversation/WorkingSidebar/Files/__tests__/index.test.tsx
+++ b/src/features/Conversation/WorkingSidebar/Files/__tests__/index.test.tsx
@@ -249,10 +249,6 @@ vi.mock('antd-style', async (importOriginal) => {
};
});
-vi.mock('@/components/NeuralNetworkLoading', () => ({
- default: () => <div />,
-}));
-
// ─── helpers ──────────────────────────────────────────────────────────────────
const setReveal = (path: string, nonce: number) => {
diff --git a/src/features/Conversation/WorkingSidebar/Files/index.tsx b/src/features/Conversation/WorkingSidebar/Files/index.tsx
index ebf930b967e..9d453548a52 100644
--- a/src/features/Conversation/WorkingSidebar/Files/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/Files/index.tsx
@@ -2,7 +2,7 @@
import type { ProjectFileIndexEntry } from '@lobechat/electron-client-ipc';
import { Center, copyToClipboard, Empty, Flexbox, Icon, stopPropagation } from '@lobehub/ui';
-import { ActionIcon, Button, DropdownMenu, Input, toast } from '@lobehub/ui/base-ui';
+import { ActionIcon, Button, DropdownMenu, Input, Spin, toast } from '@lobehub/ui/base-ui';
import type { GitStatusEntry } from '@pierre/trees';
import { createStaticStyles } from 'antd-style';
import {
@@ -20,7 +20,6 @@ import type { DragEvent } from 'react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { startWorkspaceFileDrag } from '@/features/ChatInput/InputEditor/workspaceFileDragData';
import type { ExplorerTreeNode } from '@/features/ExplorerTree';
import {
@@ -568,7 +567,7 @@ const Files = memo<FilesProps>(({ deviceId, workingDirectory }) => {
if (!data && isLoading) {
return (
<Center flex={1}>
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
</Center>
);
}
@@ -630,7 +629,7 @@ const Files = memo<FilesProps>(({ deviceId, workingDirectory }) => {
</div>
{isEmpty && isFiltering && isSearching ? (
<Center flex={1}>
- <NeuralNetworkLoading size={32} />
+ <Spin size="large" />
</Center>
) : isEmpty ? (
<Center flex={1} gap={8} paddingBlock={24}>
diff --git a/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx b/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx
index f678d848de3..7300145888c 100644
--- a/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx
+++ b/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx
@@ -29,10 +29,6 @@ vi.mock('@lobehub/ui/base-ui', async (importOriginal) => ({
toast: { error: messageError, success: messageSuccess },
}));
-vi.mock('@/components/NeuralNetworkLoading', () => ({
- default: () => <div data-testid="neural-network-loading" />,
-}));
-
vi.mock('@/components/AsyncError', () => ({
default: ({ onRetry }: { onRetry?: () => void }) => (
<button data-testid="async-error" onClick={onRetry}>
@@ -682,6 +678,6 @@ describe('AgentDocumentsGroup', () => {
});
render(<AgentDocumentsGroup />);
- expect(screen.getByTestId('neural-network-loading')).toBeInTheDocument();
+ expect(screen.getByRole('status')).toBeInTheDocument();
});
});
diff --git a/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.tsx b/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.tsx
index 65424597cee..23c4b884251 100644
--- a/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.tsx
+++ b/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.tsx
@@ -5,7 +5,7 @@ import {
EMPTY_ARRAY,
} from '@lobechat/const';
import { Center, Empty, Flexbox } from '@lobehub/ui';
-import { ActionIcon, confirmModal, Text, toast } from '@lobehub/ui/base-ui';
+import { ActionIcon, confirmModal, Spin, Text, toast } from '@lobehub/ui/base-ui';
import { SkillsIcon } from '@lobehub/ui/icons';
import { createStaticStyles, cx } from 'antd-style';
import dayjs from 'dayjs';
@@ -19,7 +19,6 @@ import { useParams } from 'react-router';
import AsyncError from '@/components/AsyncError';
import { withErrorBoundary } from '@/components/ErrorBoundary';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { buildAgentDocumentPath } from '@/features/AgentDocumentPage/navigation';
import { DocumentExplorerTree } from '@/features/AgentDocumentsExplorer';
import { startSkillDrag } from '@/features/ChatInput/InputEditor/ActionTag/skillDragData';
@@ -519,7 +518,7 @@ const AgentDocumentsGroup = memo<AgentDocumentsGroupProps>(
if (isLoading) {
return (
<Center flex={1} paddingBlock={24}>
- <NeuralNetworkLoading size={32} />
+ <Spin size="large" />
</Center>
);
}
@@ -581,7 +580,7 @@ const AgentDocumentsGroup = memo<AgentDocumentsGroupProps>(
if (showProjectSkills && isProjectSkillsLoading) {
return (
<Center flex={1} paddingBlock={24}>
- <NeuralNetworkLoading size={32} />
+ <Spin size="large" />
</Center>
);
}
diff --git a/src/features/Conversation/WorkingSidebar/Review/index.tsx b/src/features/Conversation/WorkingSidebar/Review/index.tsx
index 44f184f5dcd..da00c54260c 100644
--- a/src/features/Conversation/WorkingSidebar/Review/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/Review/index.tsx
@@ -2,7 +2,7 @@
import type { GitWorkingTreePatch } from '@lobechat/electron-client-ipc';
import { Center, type DropdownItem, DropdownMenu, Empty, Flexbox } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui/base-ui';
+import { ActionIcon, Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import {
ArrowLeftIcon,
@@ -24,7 +24,6 @@ import path from 'path-browserify-esm';
import { Fragment, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useLocalStorageState } from '@/hooks/useLocalStorageState';
import { useFetchGitBranch } from '@/store/device';
@@ -393,7 +392,7 @@ const Review = memo<ReviewProps>(
if (!data && isLoading) {
return (
<Center flex={1}>
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
</Center>
);
}
diff --git a/src/features/Conversation/WorkingSidebar/WorksSection/VersionList.tsx b/src/features/Conversation/WorkingSidebar/WorksSection/VersionList.tsx
index 9618845609b..7527d8e57e6 100644
--- a/src/features/Conversation/WorkingSidebar/WorksSection/VersionList.tsx
+++ b/src/features/Conversation/WorkingSidebar/WorksSection/VersionList.tsx
@@ -1,11 +1,10 @@
import type { WorkVersionItem } from '@lobechat/types';
import { Center, Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { formatTaskItemDate } from '@/features/AgentTasks/features/formatTaskItemDate';
import { useClientDataSWR } from '@/libs/swr';
import { workKeys } from '@/libs/swr/keys';
@@ -57,7 +56,7 @@ const VersionList = memo<{ workId: string }>(({ workId }) => {
if (isLoading) {
return (
<Center height={56}>
- <NeuralNetworkLoading size={18} />
+ <Spin size="small" />
</Center>
);
}
diff --git a/src/features/Conversation/WorkingSidebar/WorksSection/index.tsx b/src/features/Conversation/WorkingSidebar/WorksSection/index.tsx
index 1ae781ec530..7f72f381865 100644
--- a/src/features/Conversation/WorkingSidebar/WorksSection/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/WorksSection/index.tsx
@@ -1,13 +1,12 @@
import type { WorkListItem } from '@lobechat/types';
import { Center, Empty, Flexbox } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui/base-ui';
+import { ActionIcon, Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { ClipboardListIcon, HistoryIcon, ListIcon } from 'lucide-react';
import { memo, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { getAllWorkSummaries } from '@/features/Conversation/store/slices/data/workSummaries';
import WorkSummaryCard from '@/features/Work/WorkSummaryCard';
import { useLocalStorageState } from '@/hooks/useLocalStorageState';
@@ -160,7 +159,7 @@ const WorksSection = memo<WorksSectionProps>(({ active = true }) => {
if (isLoading) {
return (
<Center flex={1}>
- <NeuralNetworkLoading size={24} />
+ <Spin size="middle" />
</Center>
);
}
diff --git a/src/features/Conversation/components/Reaction/ReactionPicker.tsx b/src/features/Conversation/components/Reaction/ReactionPicker.tsx
index 859a5815f8a..3d05e11a841 100644
--- a/src/features/Conversation/components/Reaction/ReactionPicker.tsx
+++ b/src/features/Conversation/components/Reaction/ReactionPicker.tsx
@@ -3,8 +3,7 @@
import data from '@emoji-mart/data';
import Picker from '@emoji-mart/react';
import { Flexbox, Tooltip } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui/base-ui';
-import { Popover } from 'antd';
+import { ActionIcon, Popover } from '@lobehub/ui/base-ui';
import { createStaticStyles, useTheme } from 'antd-style';
import { PlusIcon, SmilePlus } from 'lucide-react';
import { type FC, memo, type ReactNode, useState } from 'react';
@@ -122,8 +121,8 @@ const ReactionPicker: FC<ReactionPickerProps> = memo(({ messageId, trigger }) =>
arrow={false}
content={content}
open={open}
- overlayInnerStyle={{ padding: 0 }}
placement="top"
+ styles={{ content: { padding: 0 } }}
trigger="click"
onOpenChange={handleOpenChange}
>
diff --git a/src/features/Conversation/components/Thinking/StatusIndicator.tsx b/src/features/Conversation/components/Thinking/StatusIndicator.tsx
index 7dafd7661bc..acda4bf22d4 100644
--- a/src/features/Conversation/components/Thinking/StatusIndicator.tsx
+++ b/src/features/Conversation/components/Thinking/StatusIndicator.tsx
@@ -1,6 +1,7 @@
import { Block, Icon } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { AtomIcon, Loader2Icon } from 'lucide-react';
+import { AtomIcon } from 'lucide-react';
import { memo } from 'react';
interface StatusIndicatorProps {
@@ -12,7 +13,7 @@ const StatusIndicator = memo<StatusIndicatorProps>(({ thinking, showDetail }) =>
let icon;
if (thinking) {
- icon = <Icon spin color={cssVar.colorTextDescription} icon={Loader2Icon} />;
+ icon = <Spin size="small" style={{ color: cssVar.colorTextDescription }} />;
} else {
icon = (
<Icon color={showDetail ? cssVar.purple : cssVar.colorTextDescription} icon={AtomIcon} />
diff --git a/src/features/DataImporter/Error.tsx b/src/features/DataImporter/Error.tsx
index 5189b56131d..c509b9b9e42 100644
--- a/src/features/DataImporter/Error.tsx
+++ b/src/features/DataImporter/Error.tsx
@@ -1,6 +1,5 @@
import { Flexbox, Highlighter, Icon } from '@lobehub/ui';
-import { Alert, Button } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Alert, Button, Result } from '@lobehub/ui/base-ui';
import { ShieldAlert } from 'lucide-react';
import React, { memo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
diff --git a/src/features/DataImporter/FileUploading.tsx b/src/features/DataImporter/FileUploading.tsx
index 9c6efe2988d..0f8a3656f2d 100644
--- a/src/features/DataImporter/FileUploading.tsx
+++ b/src/features/DataImporter/FileUploading.tsx
@@ -1,5 +1,5 @@
import { Flexbox } from '@lobehub/ui';
-import { Progress } from 'antd';
+import { Progress } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -23,12 +23,7 @@ export const FileUploading = memo<FileUploadingProps>(({ progress = 0, speed = 0
<Flexbox align={'center'} gap={8} width={'100%'}>
{t('importModal.uploading.desc')}
<Flexbox flex={1} gap={8} width={'100%'}>
- <Progress
- showInfo
- percent={progress}
- strokeColor={cssVar.colorSuccess}
- trailColor={cssVar.colorSuccessBg}
- />
+ <Progress showInfo percent={progress} strokeColor={cssVar.colorSuccess} />
<Flexbox
horizontal
distribution={'space-between'}
diff --git a/src/features/DataImporter/SuccessResult.tsx b/src/features/DataImporter/SuccessResult.tsx
index 11cbc3b673e..057a5224630 100644
--- a/src/features/DataImporter/SuccessResult.tsx
+++ b/src/features/DataImporter/SuccessResult.tsx
@@ -1,8 +1,8 @@
'use client';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
-import { Result, Table } from 'antd';
+import { Button, Result } from '@lobehub/ui/base-ui';
+import { Table } from 'antd';
import { createStaticStyles } from 'antd-style';
import { CheckCircle } from 'lucide-react';
import React, { memo } from 'react';
diff --git a/src/features/DataImporter/index.tsx b/src/features/DataImporter/index.tsx
index 408031ad20a..34c14e11b3f 100644
--- a/src/features/DataImporter/index.tsx
+++ b/src/features/DataImporter/index.tsx
@@ -3,8 +3,7 @@
import { type ErrorShape, type ImportFileUploadState } from '@lobechat/types';
import { ImportStage } from '@lobechat/types';
import { Center } from '@lobehub/ui';
-import { Button, toast } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { Button, toast, Upload } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { ImportIcon } from 'lucide-react';
import { type ReactNode } from 'react';
@@ -75,21 +74,19 @@ const DataImporter = memo<DataImporterProps>(({ children, onFinishImport }) => {
// Keeps the import modal in place on a bad file so the retry stays one click
// away; the reason itself is transient and belongs to the toast.
- const handleBeforeUpload = useCallback(
+ const handleFile = useCallback(
async (file: File) => {
const result = await parseConfigFile(file);
if (!result.success) {
setHasConfigError(true);
toast.error({ description: result.error, title: t('importModal.error.invalidConfig') });
- return false;
+ return;
}
setHasConfigError(false);
setImportPgData(result.data);
setShowImportModal(true);
-
- return false;
},
[t],
);
@@ -194,10 +191,9 @@ const DataImporter = memo<DataImporterProps>(({ children, onFinishImport }) => {
<Center gap={24} padding={40}>
<Upload
accept={'application/json'}
- beforeUpload={handleBeforeUpload}
className={cx(styles.wrapper)}
maxCount={1}
- showUploadList={false}
+ onFiles={([file]) => handleFile(file)}
>
<Button>{t('importModal.error.selectAnotherFile')}</Button>
</Upload>
@@ -208,10 +204,9 @@ const DataImporter = memo<DataImporterProps>(({ children, onFinishImport }) => {
</DataStyleModal>
<Upload
accept={'application/json'}
- beforeUpload={handleBeforeUpload}
className={cx(styles.wrapper)}
maxCount={1}
- showUploadList={false}
+ onFiles={([file]) => handleFile(file)}
>
{/* a very hackable solution: add a pseudo before to have a large hot zone */}
<div className={cx(styles.children)}>{children}</div>
diff --git a/src/features/DesktopOnboarding/steps/DataModeStep.tsx b/src/features/DesktopOnboarding/steps/DataModeStep.tsx
index 8301cb44cb6..e887eae725d 100644
--- a/src/features/DesktopOnboarding/steps/DataModeStep.tsx
+++ b/src/features/DesktopOnboarding/steps/DataModeStep.tsx
@@ -70,7 +70,7 @@ const DataModeStep = memo<DataModeStepProps>(({ onBack, onNext }) => {
<Empty
description={t('screen4.share.description')}
icon={HeartHandshake}
- padding={0}
+ style={{ padding: 0 }}
title={t('screen4.share.title')}
type={'page'}
descriptionProps={{
diff --git a/src/features/DesktopOnboarding/steps/KeepAwakeStep.tsx b/src/features/DesktopOnboarding/steps/KeepAwakeStep.tsx
index 875d033d143..ca7b395e3e1 100644
--- a/src/features/DesktopOnboarding/steps/KeepAwakeStep.tsx
+++ b/src/features/DesktopOnboarding/steps/KeepAwakeStep.tsx
@@ -59,7 +59,7 @@ const KeepAwakeStep = memo<KeepAwakeStepProps>(({ onBack, onNext }) => {
<Empty
description={t('keepAwake.on.description')}
icon={MonitorCheck}
- padding={0}
+ style={{ padding: 0 }}
type={'page'}
descriptionProps={{
fontSize: 14,
diff --git a/src/features/EditLock/EditingIndicator.tsx b/src/features/EditLock/EditingIndicator.tsx
index 77279dd2522..302748e8b63 100644
--- a/src/features/EditLock/EditingIndicator.tsx
+++ b/src/features/EditLock/EditingIndicator.tsx
@@ -1,9 +1,9 @@
'use client';
import { Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2Icon, PencilIcon } from 'lucide-react';
+import { PencilIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -34,7 +34,7 @@ const EditingIndicator = memo<EditingIndicatorProps>(({ holderId, pending }) =>
const checkingLabel = t('pageEditor.editMode.checking');
return (
<Flexbox horizontal align={'center'} gap={4} style={{ color: cssVar.colorTextTertiary }}>
- <Icon spin icon={Loader2Icon} size={14} />
+ <Spin size="small" />
<Text ellipsis style={{ color: 'inherit', fontSize: 12, maxWidth: 200 }}>
{checkingLabel}
</Text>
diff --git a/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx b/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx
index f2ee985519b..b373b50b7fd 100644
--- a/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx
+++ b/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx
@@ -1,7 +1,7 @@
-import { Flexbox, Highlighter, Icon } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
+import { Flexbox, Highlighter } from '@lobehub/ui';
+import { Button, Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
-import { Ban, Loader2, RotateCcw } from 'lucide-react';
+import { Ban, RotateCcw } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import GuideActions from '../GuideActions';
@@ -34,7 +34,7 @@ const OverloadedState = ({
return (
<GuideShell
compact
- icon={<Icon spin icon={Loader2} size={18} />}
+ icon={<Spin size="small" />}
title={t('cliOverloadedGuide.autoRetry.title', { name: config.title })}
variant={variant}
actions={
diff --git a/src/features/FileViewer/Renderer/Code/index.tsx b/src/features/FileViewer/Renderer/Code/index.tsx
index d502a9d6fcd..ec116fc7c73 100644
--- a/src/features/FileViewer/Renderer/Code/index.tsx
+++ b/src/features/FileViewer/Renderer/Code/index.tsx
@@ -1,11 +1,11 @@
'use client';
import { Center, Flexbox, Highlighter } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { getLanguageFromFilename } from '@/utils/fileLanguage';
import { useTextFileLoader } from '../../hooks/useTextFileLoader';
@@ -45,7 +45,7 @@ const CodeViewer = memo<CodeViewerProps>(({ url, fileName }) => {
</Highlighter>
) : (
<Center height={'100%'}>
- <NeuralNetworkLoading size={36} />
+ <Spin size="large" />
</Center>
)}
</Flexbox>
diff --git a/src/features/FileViewer/Renderer/HTML/index.tsx b/src/features/FileViewer/Renderer/HTML/index.tsx
index f77854320b0..685beb44dd2 100644
--- a/src/features/FileViewer/Renderer/HTML/index.tsx
+++ b/src/features/FileViewer/Renderer/HTML/index.tsx
@@ -1,12 +1,12 @@
'use client';
import { Center, Flexbox } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import AsyncError from '@/components/AsyncError';
import { InlineHtmlPreview } from '@/components/HtmlPreview';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useTextFileLoader } from '../../hooks/useTextFileLoader';
import NotSupport from '../../NotSupport';
@@ -41,7 +41,7 @@ const HTMLViewer = memo<HTMLViewerProps>(({ url }) => {
<InlineHtmlPreview content={fileData} />
) : (
<Center height={'100%'}>
- <NeuralNetworkLoading size={36} />
+ <Spin size="large" />
</Center>
)}
</Flexbox>
diff --git a/src/features/FileViewer/Renderer/Image/index.tsx b/src/features/FileViewer/Renderer/Image/index.tsx
index 1d161dfec12..99a3bd1d439 100644
--- a/src/features/FileViewer/Renderer/Image/index.tsx
+++ b/src/features/FileViewer/Renderer/Image/index.tsx
@@ -1,10 +1,9 @@
'use client';
import { Center } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { memo, useState } from 'react';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
-
interface ImageViewerProps {
fileId: string;
url: string | null;
@@ -17,8 +16,8 @@ const ImageViewer = memo<ImageViewerProps>(({ url }) => {
return (
<Center height={'100%'} width={'100%'}>
- {!isLoaded && <NeuralNetworkLoading size={36} />}
- { }
+ {!isLoaded && <Spin size="large" />}
+ {}
<img
alt="Image preview"
src={url}
diff --git a/src/features/FileViewer/Renderer/MSDoc/index.tsx b/src/features/FileViewer/Renderer/MSDoc/index.tsx
index 121cbbd8a15..a618340305b 100644
--- a/src/features/FileViewer/Renderer/MSDoc/index.tsx
+++ b/src/features/FileViewer/Renderer/MSDoc/index.tsx
@@ -1,10 +1,10 @@
'use client';
import { Center, Flexbox } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { lazy, memo, Suspense } from 'react';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useBlobFileLoader } from '../../hooks/useBlobFileLoader';
import NotSupport from '../../NotSupport';
@@ -51,7 +51,7 @@ const MSDocViewer = memo<MSDocViewerProps>(({ fileName, fileType, url }) => {
if (loading)
return (
<Center height={'100%'} width={'100%'}>
- <NeuralNetworkLoading size={36} />
+ <Spin size="large" />
</Center>
);
@@ -72,7 +72,7 @@ const MSDocViewer = memo<MSDocViewerProps>(({ fileName, fileType, url }) => {
<Suspense
fallback={
<Center height={'100%'} width={'100%'}>
- <NeuralNetworkLoading size={36} />
+ <Spin size="large" />
</Center>
}
>
diff --git a/src/features/FileViewer/Renderer/Markdown/index.tsx b/src/features/FileViewer/Renderer/Markdown/index.tsx
index 6c510a5478c..0022d19a36d 100644
--- a/src/features/FileViewer/Renderer/Markdown/index.tsx
+++ b/src/features/FileViewer/Renderer/Markdown/index.tsx
@@ -1,14 +1,13 @@
'use client';
import { Center, Flexbox, Highlighter, Icon, Markdown } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
+import { Spin, Tabs } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { CodeIcon, EyeIcon } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useTextFileLoader } from '../../hooks/useTextFileLoader';
import NotSupport from '../../NotSupport';
@@ -73,7 +72,7 @@ const MarkdownViewer = memo<MarkdownViewerProps>(({ url }) => {
if (loading || fileData === null)
return (
<Center height={'100%'} width={'100%'}>
- <NeuralNetworkLoading size={36} />
+ <Spin size="large" />
</Center>
);
diff --git a/src/features/FileViewer/Renderer/PDF/index.tsx b/src/features/FileViewer/Renderer/PDF/index.tsx
index 0b10c440197..b8ea5d8b11f 100644
--- a/src/features/FileViewer/Renderer/PDF/index.tsx
+++ b/src/features/FileViewer/Renderer/PDF/index.tsx
@@ -4,9 +4,9 @@ import 'react-pdf/dist/Page/AnnotationLayer.css';
import 'react-pdf/dist/Page/TextLayer.css';
import { Flexbox } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { Fragment, memo, useCallback, useState } from 'react';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { Document, Page, pdfjs } from '@/libs/pdfjs';
import { lambdaQuery } from '@/libs/trpc/client';
@@ -66,7 +66,7 @@ const PDFViewer = memo<PDFViewerProps>(({ url, fileId }) => {
<Document
className={styles.document}
file={url}
- loading={<NeuralNetworkLoading size={36} />}
+ loading={<Spin size="large" />}
options={options}
onLoadSuccess={onDocumentLoadSuccess}
>
diff --git a/src/features/FileViewer/index.tsx b/src/features/FileViewer/index.tsx
index 4fd252a91c8..e4fa74e44dd 100644
--- a/src/features/FileViewer/index.tsx
+++ b/src/features/FileViewer/index.tsx
@@ -2,12 +2,12 @@
import { MARKDOWN_MIME_TYPES } from '@lobechat/const';
import { Center } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import type { CSSProperties, JSXElementConstructor } from 'react';
import { memo, useCallback, useEffect, useState } from 'react';
import AsyncError from '@/components/AsyncError';
import { isHtmlFile } from '@/components/HtmlPreview';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { type FileListItem } from '@/types/files';
import { isPdfFile } from './fileType';
@@ -163,7 +163,7 @@ const FileViewer = memo<FileViewerProps>(({ id, style, fileType, url, name }) =>
return (
<Center height={'100%'} width={'100%'}>
- <NeuralNetworkLoading size={36} />
+ <Spin size="large" />
</Center>
);
}
diff --git a/src/features/HeteroSessionImport/Content.tsx b/src/features/HeteroSessionImport/Content.tsx
index 3be45efd16b..1a709d6c007 100644
--- a/src/features/HeteroSessionImport/Content.tsx
+++ b/src/features/HeteroSessionImport/Content.tsx
@@ -6,9 +6,8 @@ import type {
HeteroSessionDirPref,
HeteroSessionImportStatus,
} from '@lobechat/types';
-import { Flexbox, Icon, NeuralNetworkLoading, ScrollShadow, SearchBar } from '@lobehub/ui';
-import { Button, Checkbox, Text, useModalContext } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Flexbox, Icon, ScrollShadow, SearchBar } from '@lobehub/ui';
+import { Button, Checkbox, Progress, Spin, Text, useModalContext } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { Check, FolderSearch, TriangleAlert, X } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
@@ -241,7 +240,7 @@ const Content = memo<ContentProps>(({ agentId }) => {
if (phase === 'scanning')
return (
<Flexbox align="center" gap={16} justify="center" style={{ height: CONTENT_HEIGHT }}>
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
<Text type="secondary">{t('heteroImport.scanning')}</Text>
</Flexbox>
);
diff --git a/src/features/HeteroSessionImport/SessionList.tsx b/src/features/HeteroSessionImport/SessionList.tsx
index c056301b4d1..889094cc00a 100644
--- a/src/features/HeteroSessionImport/SessionList.tsx
+++ b/src/features/HeteroSessionImport/SessionList.tsx
@@ -1,7 +1,7 @@
import type { HeteroSessionDigest } from '@lobechat/types';
import { ClaudeCode, Codex } from '@lobehub/icons';
-import { Flexbox, Icon, NeuralNetworkLoading, Tooltip } from '@lobehub/ui';
-import { Button, Checkbox, Tag, Text } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon, Tooltip } from '@lobehub/ui';
+import { Button, Checkbox, Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import dayjs from 'dayjs';
import { Check, RotateCcw, X } from 'lucide-react';
@@ -67,7 +67,7 @@ const ImportState = memo<{ onRetry: () => void; showRetry: boolean; state?: Impo
if (state === 'running')
return (
<Flexbox horizontal align="center" gap={6}>
- <NeuralNetworkLoading size={14} />
+ <Spin size="small" />
<Text fontSize={12} type="secondary">
{t('heteroImport.state.running')}
</Text>
diff --git a/src/features/Home/Recents/index.tsx b/src/features/Home/Recents/index.tsx
index f7d9be3bd53..c1360128401 100644
--- a/src/features/Home/Recents/index.tsx
+++ b/src/features/Home/Recents/index.tsx
@@ -7,6 +7,7 @@ import {
accordionStyles,
AccordionTrigger,
ActionIcon,
+ Spin,
Text,
} from '@lobehub/ui/base-ui';
import { cx } from 'antd-style';
@@ -23,7 +24,6 @@ import { memo, Suspense, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { openCustomizeSidebarModal } from '@/features/HomeSidebar/Body/CustomizeSidebarModal';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import { useCacheScope } from '@/libs/swr/useCacheScope';
@@ -140,7 +140,7 @@ const Recents = memo<RecentsProps>(({ itemKey }) => {
<Text ellipsis fontSize={12} type={'secondary'} weight={500}>
{t('recents')}
</Text>
- {syncStatus?.isValidating && query && <NeuralNetworkLoading size={14} />}
+ {syncStatus?.isValidating && query && <Spin size="small" />}
</Flexbox>
</AccordionTrigger>
<div
diff --git a/src/features/HomeSidebar/Body/Agent/CreateAgentButton.tsx b/src/features/HomeSidebar/Body/Agent/CreateAgentButton.tsx
index 621865fc192..ce48a8c8cc5 100644
--- a/src/features/HomeSidebar/Body/Agent/CreateAgentButton.tsx
+++ b/src/features/HomeSidebar/Body/Agent/CreateAgentButton.tsx
@@ -1,13 +1,12 @@
'use client';
import { Block, Center, Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { ActionIcon, DropdownMenu, Text } from '@lobehub/ui/base-ui';
+import { ActionIcon, DropdownMenu, Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { ChevronDownIcon, PlusIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { usePermission } from '@/hooks/usePermission';
import { SessionDefaultGroup } from '@/types/session';
@@ -123,11 +122,7 @@ const CreateAgentButton = memo<CreateAgentButtonProps>(({ groupId, className, vi
onClick={handleClick}
>
<Center flex={'none'} height={28} width={28}>
- {isMutatingAgent ? (
- <NeuralNetworkLoading size={14} />
- ) : (
- <Icon icon={PlusIcon} size={'small'} />
- )}
+ {isMutatingAgent ? <Spin size="small" /> : <Icon icon={PlusIcon} size={'small'} />}
</Center>
<Text style={{ flex: 1 }} type={'secondary'}>
{t('addAgent')}
diff --git a/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/index.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/index.tsx
index 2f4489944ca..8bed4b60411 100644
--- a/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/index.tsx
+++ b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/index.tsx
@@ -1,9 +1,9 @@
import { GROUP_CHAT_URL } from '@lobechat/const';
import { type SidebarAgentItem } from '@lobechat/types';
-import { Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, Tag } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { ActionIcon, Spin, Tag } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2, PinIcon } from 'lucide-react';
+import { PinIcon } from 'lucide-react';
import { type CSSProperties, type DragEvent } from 'react';
import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -84,7 +84,7 @@ const GroupItem = memo<GroupItemProps>(({ item, style, className, onNavigate })
// Memoize avatar icon (show loader when updating)
const avatarIcon = useMemo(() => {
if (isUpdating) {
- return <Icon spin color={cssVar.colorTextDescription} icon={Loader2} size={18} />;
+ return <Spin size="small" style={{ color: cssVar.colorTextDescription }} />;
}
// If avatar is a string, it's a custom group avatar
diff --git a/src/features/HomeSidebar/Body/Agent/List/AgentItem/index.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentItem/index.tsx
index 5c5b5303971..42cc7faad3c 100644
--- a/src/features/HomeSidebar/Body/Agent/List/AgentItem/index.tsx
+++ b/src/features/HomeSidebar/Body/Agent/List/AgentItem/index.tsx
@@ -1,9 +1,8 @@
import type { SidebarAgentItem } from '@lobechat/types';
import { agentDisplayName, agentSecondaryDisplayName } from '@lobechat/types';
-import { Icon } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui/base-ui';
+import { ActionIcon, Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2, PinIcon } from 'lucide-react';
+import { PinIcon } from 'lucide-react';
import { type CSSProperties, type DragEvent } from 'react';
import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -147,7 +146,7 @@ const AgentItem = memo<AgentItemProps>(({ item, style, className, onNavigate, se
// Memoize avatar icon (show loader when updating, running spinner or unread badge at bottom-right)
const avatarIcon = useMemo(() => {
if (isUpdating) {
- return <Icon spin color={cssVar.colorTextDescription} icon={Loader2} size={18} />;
+ return <Spin size="small" style={{ color: cssVar.colorTextDescription }} />;
}
const avatarNode = (
@@ -163,7 +162,7 @@ const AgentItem = memo<AgentItemProps>(({ item, style, className, onNavigate, se
<span className={styles.wrapper}>
{avatarNode}
<span className={styles.runningBadge}>
- <Icon spin icon={Loader2} size={9} />
+ <Spin size={9} />
</span>
</span>
);
diff --git a/src/features/HomeSidebar/Body/Agent/List/Group/Item.tsx b/src/features/HomeSidebar/Body/Agent/List/Group/Item.tsx
index ae9500889b1..86bbdf273bc 100644
--- a/src/features/HomeSidebar/Body/Agent/List/Group/Item.tsx
+++ b/src/features/HomeSidebar/Body/Agent/List/Group/Item.tsx
@@ -6,10 +6,11 @@ import {
AccordionPanel,
accordionStyles,
AccordionTrigger,
+ Spin,
Text,
} from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
-import { HashIcon, Loader2 } from 'lucide-react';
+import { HashIcon } from 'lucide-react';
import React, { memo, useCallback, useMemo, useState } from 'react';
import { useHomeStore } from '@/store/home';
@@ -51,7 +52,7 @@ const GroupItem = memo<SidebarGroup>(({ items, id, name, visibility }) => {
const groupIcon = useMemo(() => {
if (isUpdating) {
- return <Icon spin icon={Loader2} style={{ opacity: 0.5 }} />;
+ return <Spin size="small" style={{ opacity: 0.5 }} />;
}
return <Icon icon={HashIcon} style={{ opacity: 0.5 }} />;
}, [isUpdating]);
diff --git a/src/features/HomeSidebar/Body/Agent/List/InboxItem.tsx b/src/features/HomeSidebar/Body/Agent/List/InboxItem.tsx
index af42eef277d..75c4baf0513 100644
--- a/src/features/HomeSidebar/Body/Agent/List/InboxItem.tsx
+++ b/src/features/HomeSidebar/Body/Agent/List/InboxItem.tsx
@@ -2,10 +2,8 @@
import { DEFAULT_INBOX_AVATAR } from '@lobechat/const';
import { agentDisplayName } from '@lobechat/types';
-import { Icon } from '@lobehub/ui';
-import { Avatar } from '@lobehub/ui/base-ui';
+import { Avatar, Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
-import { Loader2 } from 'lucide-react';
import { type CSSProperties } from 'react';
import { memo } from 'react';
@@ -83,7 +81,7 @@ const InboxItem = memo<InboxItemProps>(({ className, style }) => {
<span className={styles.wrapper}>
{avatarNode}
<span className={styles.runningBadge}>
- <Icon spin icon={Loader2} size={9} />
+ <Spin size={9} />
</span>
</span>
) : (
diff --git a/src/features/HomeSidebar/Body/Agent/index.tsx b/src/features/HomeSidebar/Body/Agent/index.tsx
index 14cd09eeab7..4f548b00c32 100644
--- a/src/features/HomeSidebar/Body/Agent/index.tsx
+++ b/src/features/HomeSidebar/Body/Agent/index.tsx
@@ -8,6 +8,7 @@ import {
accordionStyles,
AccordionTrigger,
ActionIcon,
+ Spin,
Text,
} from '@lobehub/ui/base-ui';
import { cx } from 'antd-style';
@@ -16,7 +17,6 @@ import React, { memo, type MouseEvent, Suspense, useCallback, useMemo } from 're
import { useTranslation } from 'react-i18next';
import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import { useFetchAgentLabels } from '@/hooks/useFetchAgentLabels';
@@ -77,18 +77,18 @@ const Agent = memo<AgentProps>(({ itemKey }) => {
<Text ellipsis fontSize={12} type={'secondary'} weight={500}>
{t(titleKey)}
</Text>
- {isRevalidating && <NeuralNetworkLoading size={14} />}
+ {isRevalidating && <Spin size="small" />}
</Flexbox>
</AccordionTrigger>
<Flexbox
horizontal
align="center"
+ gap={2}
className={cx(
'accordion-action',
accordionStyles.action,
accordionStyles.actionBorderless,
)}
- gap={2}
>
{/* The flat view-all page adapts per mode: workspace gets the
workspace/private segments + per-user pin + author column;
diff --git a/src/features/HomeSidebar/Body/Private/index.tsx b/src/features/HomeSidebar/Body/Private/index.tsx
index 7c1f5bc2e79..3c618b56a62 100644
--- a/src/features/HomeSidebar/Body/Private/index.tsx
+++ b/src/features/HomeSidebar/Body/Private/index.tsx
@@ -8,6 +8,7 @@ import {
accordionStyles,
AccordionTrigger,
ActionIcon,
+ Spin,
Text,
} from '@lobehub/ui/base-ui';
import { cx } from 'antd-style';
@@ -15,7 +16,6 @@ import { ArrowRight } from 'lucide-react';
import React, { memo, type MouseEvent, Suspense, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import { useFetchAgentList } from '@/hooks/useFetchAgentList';
@@ -105,18 +105,18 @@ const Private = memo<PrivateProps>(({ itemKey }) => {
<Text ellipsis fontSize={12} type={'secondary'} weight={500}>
{t('navPanel.privateAgents', { defaultValue: 'Private' })}
</Text>
- {isRevalidating && <NeuralNetworkLoading size={14} />}
+ {isRevalidating && <Spin size="small" />}
</Flexbox>
</AccordionTrigger>
<Flexbox
horizontal
align="center"
+ gap={2}
className={cx(
'accordion-action',
accordionStyles.action,
accordionStyles.actionBorderless,
)}
- gap={2}
>
<ActionIcon
icon={ArrowRight}
diff --git a/src/features/HomeSidebar/Header/components/InboxButton.tsx b/src/features/HomeSidebar/Header/components/InboxButton.tsx
index debebed25a3..0df608ef31b 100644
--- a/src/features/HomeSidebar/Header/components/InboxButton.tsx
+++ b/src/features/HomeSidebar/Header/components/InboxButton.tsx
@@ -1,7 +1,6 @@
'use client';
-import { ActionIcon } from '@lobehub/ui/base-ui';
-import { Badge } from 'antd';
+import { ActionIcon, Badge } from '@lobehub/ui/base-ui';
import { BellIcon } from 'lucide-react';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/MCP/MCPInstallProgress/index.tsx b/src/features/MCP/MCPInstallProgress/index.tsx
index 6eff27d5258..1d196e02015 100644
--- a/src/features/MCP/MCPInstallProgress/index.tsx
+++ b/src/features/MCP/MCPInstallProgress/index.tsx
@@ -1,6 +1,5 @@
import { Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Progress, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
import * as m from 'motion/react-m';
@@ -47,7 +46,7 @@ const MCPInstallProgress = memo<{ identifier: string }>(({ identifier }) => {
showInfo={false}
size="small"
status="active"
- strokeColor={{ '0%': cssVar.blue, '100%': cssVar.geekblue }}
+ strokeColor={cssVar.geekblue}
/>
{stepText && (
<Text fontSize={11} style={{ marginTop: 4 }} type={'secondary'}>
diff --git a/src/features/MCPPluginDetail/Score/TotalScore.tsx b/src/features/MCPPluginDetail/Score/TotalScore.tsx
index 9aa3bad8500..28212f948b1 100644
--- a/src/features/MCPPluginDetail/Score/TotalScore.tsx
+++ b/src/features/MCPPluginDetail/Score/TotalScore.tsx
@@ -1,5 +1,5 @@
import { Block, Center, Flexbox, Popover } from '@lobehub/ui';
-import { Progress } from 'antd';
+import { Progress } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -263,14 +263,8 @@ const TotalScore = memo<TotalScoreProps>(({ scoreResult, scoreItems = [], isVali
<Progress
percent={Math.round(percentage)}
showInfo={false}
- size={{
- height: 8,
- }}
- strokeColor={{
- '0%': SEGMENT_COLORS.F_COLOR,
- '60%': SEGMENT_COLORS.B_COLOR,
- '80%': SEGMENT_COLORS.A_COLOR,
- }}
+ size={8}
+ strokeColor={SEGMENT_COLORS.A_COLOR}
/>
</Popover>
diff --git a/src/features/Messenger/IntegrationDetail/Wechat.test.tsx b/src/features/Messenger/IntegrationDetail/Wechat.test.tsx
index 891f2e4ab19..1a802c53e43 100644
--- a/src/features/Messenger/IntegrationDetail/Wechat.test.tsx
+++ b/src/features/Messenger/IntegrationDetail/Wechat.test.tsx
@@ -98,7 +98,6 @@ vi.mock('react-i18next', () => ({
vi.mock('swr', () => ({ default: useSWRMock }));
vi.mock('@/components/AsyncError', () => ({ default: () => null }));
-vi.mock('@/components/NeuralNetworkLoading', () => ({ default: () => <span>Loading</span> }));
vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({
useWorkspaceAwareNavigate: () => vi.fn(),
}));
diff --git a/src/features/Messenger/IntegrationDetail/Wechat.tsx b/src/features/Messenger/IntegrationDetail/Wechat.tsx
index aaab252d7f2..c322d72b3f2 100644
--- a/src/features/Messenger/IntegrationDetail/Wechat.tsx
+++ b/src/features/Messenger/IntegrationDetail/Wechat.tsx
@@ -2,7 +2,7 @@
import { InfoCircleOutlined } from '@ant-design/icons';
import { Block, Flexbox, Icon } from '@lobehub/ui';
-import { Alert, Button, Text, toast } from '@lobehub/ui/base-ui';
+import { Alert, Button, Spin, Text, toast } from '@lobehub/ui/base-ui';
import { QRCode } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ExternalLinkIcon, QrCodeIcon, RefreshCwIcon, XIcon } from 'lucide-react';
@@ -10,7 +10,6 @@ import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import { usePermission } from '@/hooks/usePermission';
import { messengerService } from '@/services/messenger';
@@ -179,7 +178,7 @@ const WechatQrSetup = memo<WechatQrSetupProps>(({ autoStart, disabled, onCancel,
{t('messenger.wechat.connectCta')}
</Button>
)}
- {state.stage === 'loading' && <NeuralNetworkLoading size={48} />}
+ {state.stage === 'loading' && <Spin size="large" />}
{state.stage === 'ready' && (
<QRCode
aria-label={t('messenger.wechat.setupTitle')}
diff --git a/src/features/NavPanel/components/NavItem.tsx b/src/features/NavPanel/components/NavItem.tsx
index c084c565d21..ba686083303 100644
--- a/src/features/NavPanel/components/NavItem.tsx
+++ b/src/features/NavPanel/components/NavItem.tsx
@@ -2,12 +2,11 @@
import { type BlockProps, type GenericItemType, type IconProps } from '@lobehub/ui';
import { Block, Center, ContextMenuTrigger, Flexbox, Icon } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { type FocusEvent, type PointerEvent, type ReactNode } from 'react';
import { memo } from 'react';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { isModifierClick } from '@/utils/navigation';
import { type LazyActions, useLazyActions } from './useLazyActions';
@@ -197,7 +196,7 @@ const NavItem = memo<NavItemProps>(
width={28}
>
{loading ? (
- <NeuralNetworkLoading size={iconSize} />
+ <Spin size={iconSize} />
) : (
<Icon color={iconColor} icon={icon} size={iconSize} />
)}
diff --git a/src/features/OllamaModelDownloader/index.tsx b/src/features/OllamaModelDownloader/index.tsx
index 90080258e66..aed22495304 100644
--- a/src/features/OllamaModelDownloader/index.tsx
+++ b/src/features/OllamaModelDownloader/index.tsx
@@ -1,7 +1,6 @@
import { Ollama } from '@lobehub/icons';
import { Center, Flexbox, Input } from '@lobehub/ui';
-import { Alert, Button } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Alert, Button, Progress } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { type ReactNode } from 'react';
import { memo, useCallback, useMemo, useState } from 'react';
@@ -81,12 +80,7 @@ const OllamaModelDownloader = memo<OllamaModelDownloaderProps>(
</FormAction>
{isDownloading && (
<Flexbox flex={1} gap={8} style={{ maxWidth: 300 }} width={'100%'}>
- <Progress
- showInfo
- percent={percent}
- strokeColor={cssVar.colorSuccess}
- trailColor={cssVar.colorSuccessBg}
- />
+ <Progress showInfo percent={percent} strokeColor={cssVar.colorSuccess} />
<Flexbox
horizontal
distribution={'space-between'}
diff --git a/src/features/Onboarding/components/ComposioServerList/components/ServerStatusControl.tsx b/src/features/Onboarding/components/ComposioServerList/components/ServerStatusControl.tsx
index feb08800bee..611c93c3486 100644
--- a/src/features/Onboarding/components/ComposioServerList/components/ServerStatusControl.tsx
+++ b/src/features/Onboarding/components/ComposioServerList/components/ServerStatusControl.tsx
@@ -1,6 +1,7 @@
import { Icon } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { CheckIcon, CircleX, Loader2 } from 'lucide-react';
+import { CheckIcon, CircleX } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -19,7 +20,7 @@ const ServerStatusControl = memo<ServerStatusControlProps>(
// Loading states
if (isConnecting || isWaitingAuth) {
- return <Icon spin color={cssVar.colorTextDescription} icon={Loader2} />;
+ return <Spin size="small" style={{ color: cssVar.colorTextDescription }} />;
}
// No server yet - show nothing (click to connect)
diff --git a/src/features/PageEditor/EditingIndicator.tsx b/src/features/PageEditor/EditingIndicator.tsx
index 4960518ddc8..7de6162d370 100644
--- a/src/features/PageEditor/EditingIndicator.tsx
+++ b/src/features/PageEditor/EditingIndicator.tsx
@@ -1,9 +1,9 @@
'use client';
import { Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2Icon, PencilIcon } from 'lucide-react';
+import { PencilIcon } from 'lucide-react';
import { type CSSProperties, memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -51,7 +51,7 @@ const EditingIndicator = memo(() => {
return (
<Flexbox horizontal align={'center'} gap={4} style={{ color: cssVar.colorTextTertiary }}>
- <Icon spin icon={Loader2Icon} size={14} />
+ <Spin size="small" />
<Text ellipsis style={labelStyle}>
{t('pageEditor.editMode.checking')}
</Text>
diff --git a/src/features/PageEditor/History/HistoryListItem.tsx b/src/features/PageEditor/History/HistoryListItem.tsx
index ebccc3f6768..c51db088fe2 100644
--- a/src/features/PageEditor/History/HistoryListItem.tsx
+++ b/src/features/PageEditor/History/HistoryListItem.tsx
@@ -1,8 +1,7 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { ActionIcon, Tag } from '@lobehub/ui/base-ui';
-import { Tooltip } from 'antd';
+import { ActionIcon, Tag, Tooltip } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import dayjs from 'dayjs';
import { ArrowLeftRightIcon, RotateCcwIcon } from 'lucide-react';
diff --git a/src/features/PageExplorer/PageExplorerPlaceholder.tsx b/src/features/PageExplorer/PageExplorerPlaceholder.tsx
index 42e7e29d42c..b5bbaa9df93 100644
--- a/src/features/PageExplorer/PageExplorerPlaceholder.tsx
+++ b/src/features/PageExplorer/PageExplorerPlaceholder.tsx
@@ -1,8 +1,7 @@
import { CUSTOM_DOCUMENT_FILE_TYPE } from '@lobechat/const';
import { Notion } from '@lobehub/icons';
import { Center, FileTypeIcon, Flexbox, Icon } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { Text, Upload } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { ArrowUpIcon, PlusIcon } from 'lucide-react';
import React, { memo, useState } from 'react';
@@ -169,7 +168,7 @@ const PageExplorerPlaceholder = memo<PageExplorerPlaceholderProps>(
};
const handleUploadFile = async (file: File) => {
- if (!canCreate) return false;
+ if (!canCreate) return;
try {
setIsUploading(true);
@@ -247,8 +246,6 @@ const PageExplorerPlaceholder = memo<PageExplorerPlaceholderProps>(
} finally {
setIsUploading(false);
}
-
- return false; // Prevent default upload behavior
};
return (
@@ -282,10 +279,9 @@ const PageExplorerPlaceholder = memo<PageExplorerPlaceholderProps>(
{/* Upload Files (PDF, DOCX, Markdown) */}
<Upload
accept=".md,.markdown,.pdf,.docx"
- beforeUpload={handleUploadFile}
disabled={!canCreate || isUploading}
multiple={false}
- showUploadList={false}
+ onFiles={([file]) => handleUploadFile(file)}
>
<Flexbox
className={styles.card}
diff --git a/src/features/Pages/PageLayout/Body/index.tsx b/src/features/Pages/PageLayout/Body/index.tsx
index a9fad946648..8e8d2346771 100644
--- a/src/features/Pages/PageLayout/Body/index.tsx
+++ b/src/features/Pages/PageLayout/Body/index.tsx
@@ -8,6 +8,7 @@ import {
AccordionRoot,
accordionStyles,
AccordionTrigger,
+ Spin,
Text,
} from '@lobehub/ui/base-ui';
import { cx } from 'antd-style';
@@ -17,7 +18,6 @@ import { useTranslation } from 'react-i18next';
import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
import AsyncBoundary from '@/components/AsyncBoundary';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import PageEmpty from '@/features/PageEmpty';
import { usePermission } from '@/hooks/usePermission';
@@ -128,7 +128,7 @@ const Body = memo(() => {
{section.title}
{section.count > 0 && ` ${section.count}`}
</Text>
- {isValidating && <NeuralNetworkLoading size={14} />}
+ {isValidating && <Spin size="small" />}
</Flexbox>
</AccordionTrigger>
<Flexbox
diff --git a/src/features/PluginTag/PluginStatus.tsx b/src/features/PluginTag/PluginStatus.tsx
index 0da194617cf..a0ada7ff641 100644
--- a/src/features/PluginTag/PluginStatus.tsx
+++ b/src/features/PluginTag/PluginStatus.tsx
@@ -1,6 +1,5 @@
import { Flexbox } from '@lobehub/ui';
-import { ActionIcon, Button, Tag, Text } from '@lobehub/ui/base-ui';
-import { Badge } from 'antd';
+import { ActionIcon, Badge, Button, Tag, Text } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
import { LucideRotateCw, LucideTrash2, RotateCwIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/features/Portal/AcceptanceCheck/Body.tsx b/src/features/Portal/AcceptanceCheck/Body.tsx
index fee631b1b37..faef4ed2bd4 100644
--- a/src/features/Portal/AcceptanceCheck/Body.tsx
+++ b/src/features/Portal/AcceptanceCheck/Body.tsx
@@ -2,12 +2,11 @@
import type { VerifyAgentPlanConfig } from '@lobechat/types';
import { Center, Empty, Flexbox, Icon } from '@lobehub/ui';
-import { Button, Tag, Text, toast } from '@lobehub/ui/base-ui';
+import { Button, Spin, Tag, Text, toast } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import {
checkHeadMeta,
type CheckReviewInput,
@@ -75,7 +74,7 @@ const Body = memo(() => {
if (isLoading) {
return (
<Center height={'100%'}>
- <NeuralNetworkLoading size={40} />
+ <Spin size="large" />
</Center>
);
}
diff --git a/src/features/Portal/Notebook/Body.tsx b/src/features/Portal/Notebook/Body.tsx
index f75c8bd523f..fe808c2b4ec 100644
--- a/src/features/Portal/Notebook/Body.tsx
+++ b/src/features/Portal/Notebook/Body.tsx
@@ -1,7 +1,7 @@
'use client';
import { Center, Empty, Flexbox } from '@lobehub/ui';
-import { Spin } from 'antd';
+import { Spin } from '@lobehub/ui/base-ui';
import { BookOpenIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Projects/Conversation/index.tsx b/src/features/Projects/Conversation/index.tsx
index 8501047f5ef..373eead347d 100644
--- a/src/features/Projects/Conversation/index.tsx
+++ b/src/features/Projects/Conversation/index.tsx
@@ -1,13 +1,12 @@
'use client';
import { Center, Flexbox } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { memo, useCallback, useLayoutEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import NavHeader from '@/features/NavHeader';
import { useInitAgentConfig } from '@/hooks/useInitAgentConfig';
import ChatConversation from '@/routes/(main)/agent/features/Conversation';
@@ -62,7 +61,7 @@ const ProjectConversation = memo(() => {
if (detailSWR.isLoading || !coordinatorAgentId) {
return (
<Center height="100%" width="100%">
- <NeuralNetworkLoading />
+ <Spin size="small" />
</Center>
);
}
diff --git a/src/features/Projects/Workspace/ProjectDashboard.tsx b/src/features/Projects/Workspace/ProjectDashboard.tsx
index a1f10f68e5e..70774bb2920 100644
--- a/src/features/Projects/Workspace/ProjectDashboard.tsx
+++ b/src/features/Projects/Workspace/ProjectDashboard.tsx
@@ -2,8 +2,7 @@
import type { TaskStatus, WorkSummaryItem } from '@lobechat/types';
import { Block, Center, Empty, Flexbox, Icon } from '@lobehub/ui';
-import { Button, Tag, Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Button, Progress, Tag, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
BadgeCheckIcon,
diff --git a/src/features/Projects/Workspace/index.tsx b/src/features/Projects/Workspace/index.tsx
index 9557d653de1..f52d69b6bb6 100644
--- a/src/features/Projects/Workspace/index.tsx
+++ b/src/features/Projects/Workspace/index.tsx
@@ -1,7 +1,7 @@
'use client';
import { Center, Flexbox, TextArea } from '@lobehub/ui';
-import { Button, Tag, Text } from '@lobehub/ui/base-ui';
+import { Button, Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { SendHorizontalIcon, SparklesIcon } from 'lucide-react';
import { memo, useState } from 'react';
@@ -9,7 +9,6 @@ import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { getProjectConversationStartPath } from '@/features/Projects/Layout/navigation';
import ProjectDisabled from '@/features/Projects/ProjectDisabled';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
@@ -100,7 +99,7 @@ const ProjectWorkspace = memo(() => {
if (isLoading || !detail)
return (
<Center height={'100%'}>
- <NeuralNetworkLoading />
+ <Spin size="small" />
</Center>
);
diff --git a/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx
index cf97e93dfd6..a8ebc0dfa02 100644
--- a/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx
+++ b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx
@@ -1,6 +1,5 @@
-import { Icon } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2Icon } from 'lucide-react';
import { type CSSProperties } from 'react';
import React, { memo, useCallback, useMemo } from 'react';
@@ -87,7 +86,7 @@ const KnowledgeBaseItem = memo<KnowledgeBaseItemProps>(
// active-library header and its switcher.
const icon = useMemo(() => {
if (isLoading) {
- return <Icon spin color={cssVar.colorTextDescription} icon={Loader2Icon} size={18} />;
+ return <Spin size="small" style={{ color: cssVar.colorTextDescription }} />;
}
return (
diff --git a/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsx b/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsx
index 83e64c21e5f..fbe8e31aaa3 100644
--- a/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsx
+++ b/src/features/ResourceManager/components/Explorer/EmptyPlaceholder.tsx
@@ -1,6 +1,5 @@
import { Center, FileTypeIcon, Flexbox, Icon } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { Button, Text, Upload } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { ArrowUpIcon, PlusIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
@@ -133,14 +132,7 @@ const EmptyPlaceholder = () => {
/>
</Flexbox>
)}
- <Upload
- multiple={true}
- showUploadList={false}
- beforeUpload={async (file) => {
- await uploadTopLevel([file]);
- return false;
- }}
- >
+ <Upload multiple={true} onFiles={(files) => void uploadTopLevel(files)}>
<Flexbox className={styles.card} padding={16}>
<span className={styles.actionTitle}>{t('FileManager.emptyStatus.actions.file')}</span>
<div className={styles.glow} style={{ background: cssVar.gold }} />
@@ -155,14 +147,11 @@ const EmptyPlaceholder = () => {
<Upload
directory
multiple={true}
- showUploadList={false}
- beforeUpload={async (file) => {
+ onFiles={(files) => {
// Directory upload keeps its own path — the whole tree inherits
// its root's visibility, so we skip the mode-driven default and
// let the server infer from the parent chain.
- await pushDockFileList([file], libraryId, currentFolderId ?? undefined);
-
- return false;
+ void pushDockFileList(files, libraryId, currentFolderId ?? undefined);
}}
>
<Flexbox className={styles.card} padding={16}>
diff --git a/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx b/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx
index c81452c628e..1e3ee5052c1 100644
--- a/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx
+++ b/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx
@@ -1,7 +1,7 @@
'use client';
import { Center, Flexbox } from '@lobehub/ui';
-import { Checkbox } from '@lobehub/ui/base-ui';
+import { Checkbox, Spin } from '@lobehub/ui/base-ui';
import { VirtuosoMasonry } from '@virtuoso.dev/masonry';
import { cssVar } from 'antd-style';
import { SearchIcon } from 'lucide-react';
@@ -11,7 +11,6 @@ import { Virtuoso } from 'react-virtuoso';
import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useResourceManagerStore } from '@/features/ResourceManager/store';
import {
getResourceQueryVisibility,
@@ -160,7 +159,7 @@ const SearchResultsOverlay = memo(() => {
>
{isLoading ? (
<Center height="100%">
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
</Center>
) : error && (!data || data.length === 0) ? (
// A failed search fetch used to fall through to the "no results" state, telling
diff --git a/src/features/ResourceManager/components/Header/AddButton.tsx b/src/features/ResourceManager/components/Header/AddButton.tsx
index 58a1b9a8061..6c1c35c2106 100644
--- a/src/features/ResourceManager/components/Header/AddButton.tsx
+++ b/src/features/ResourceManager/components/Header/AddButton.tsx
@@ -8,8 +8,7 @@ import {
import { Notion } from '@lobehub/icons';
import { type DropdownItem } from '@lobehub/ui';
import { DropdownMenu, Icon, Tooltip } from '@lobehub/ui';
-import { Button, toast } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { Button, toast, Upload } from '@lobehub/ui/base-ui';
import { FilePenLine, FileUp, FolderIcon, FolderUp, Link, Plus } from 'lucide-react';
import { type ChangeEvent } from 'react';
import { useCallback, useId, useMemo, useState } from 'react';
@@ -262,12 +261,10 @@ const AddButton = ({ iconOnly, rootLevel }: AddButtonProps = {}) => {
<Upload
accept={getAcceptedFileTypes(category)}
multiple={true}
- showUploadList={false}
- beforeUpload={async (file) => {
+ onFiles={async (files) => {
setMenuOpen(false);
- await uploadTopLevel([file]);
+ await uploadTopLevel(files);
revealRoot();
- return false;
}}
>
<div>{t('header.actions.uploadFile')}</div>
diff --git a/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx b/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx
index f81c3d55067..6c0a2d571b2 100644
--- a/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx
+++ b/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx
@@ -7,8 +7,7 @@ import {
} from '@lobechat/const';
import { Notion } from '@lobehub/icons';
import { type DropdownItem, DropdownMenu, Icon, stopPropagation } from '@lobehub/ui';
-import { ActionIcon, toast } from '@lobehub/ui/base-ui';
-import { Upload } from 'antd';
+import { ActionIcon, toast, Upload } from '@lobehub/ui/base-ui';
import { FilePenLine, FileUp, FolderIcon, FolderUp, Link, Plus } from 'lucide-react';
import { type ChangeEvent } from 'react';
import { memo, useCallback, useId, useMemo, useState } from 'react';
@@ -168,12 +167,10 @@ const FolderAddButton = memo<FolderAddButtonProps>(({ folderId }) => {
label: (
<Upload
multiple
- showUploadList={false}
- beforeUpload={async (file) => {
+ onFiles={async (files) => {
setMenuOpen(false);
- await pushDockFileList([file], libraryId, folderId);
+ await pushDockFileList(files, libraryId, folderId);
revealChildren();
- return false;
}}
>
<div>{t('header.actions.uploadFile')}</div>
diff --git a/src/features/ResourcePermission/Collaborators/AddCollaboratorsContent.tsx b/src/features/ResourcePermission/Collaborators/AddCollaboratorsContent.tsx
index ccd9c18c8eb..75ddc3c0e6f 100644
--- a/src/features/ResourcePermission/Collaborators/AddCollaboratorsContent.tsx
+++ b/src/features/ResourcePermission/Collaborators/AddCollaboratorsContent.tsx
@@ -264,7 +264,7 @@ const AddCollaboratorsContent = memo<AddCollaboratorsContentProps>(
) : filtered.length === 0 ? (
<Empty
icon={isSearchMiss ? SearchXIcon : UsersIcon}
- paddingBlock={48}
+ style={{ paddingBlock: 48 }}
description={t(
isSearchMiss
? 'permission.collaborators.addModal.noMatch'
diff --git a/src/features/SelfLearning/CreateDomainPage.tsx b/src/features/SelfLearning/CreateDomainPage.tsx
index 1eb479b8eaf..90c316125c9 100644
--- a/src/features/SelfLearning/CreateDomainPage.tsx
+++ b/src/features/SelfLearning/CreateDomainPage.tsx
@@ -1,7 +1,7 @@
'use client';
import { Flexbox, Icon, Input, TextArea } from '@lobehub/ui';
-import { ActionIcon, Button, Popover, Text, toast } from '@lobehub/ui/base-ui';
+import { ActionIcon, Button, Popover, Spin, Text, toast } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import {
@@ -19,7 +19,6 @@ import { Link, useParams } from 'react-router';
import urlJoin from 'url-join';
import GeneratingBorder from '@/components/GeneratingBorder';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import AgentBreadcrumb from '@/features/AgentBreadcrumb';
import { useResolvedAgentRouteId } from '@/features/AgentRoute/useResolvedAgentRouteId';
import NavHeader from '@/features/NavHeader';
@@ -460,7 +459,7 @@ const CreateDomainPage = memo(() => {
justify={'space-between'}
>
<Flexbox horizontal align={'center'} gap={8}>
- <NeuralNetworkLoading size={18} />
+ <Spin size="small" variant="network" />
<div
aria-label={t('create.generating')}
className={styles.generatingTextViewport}
diff --git a/src/features/Settings/advanced/index.tsx b/src/features/Settings/advanced/index.tsx
index cdafa8b4a5b..02cb9d3d864 100644
--- a/src/features/Settings/advanced/index.tsx
+++ b/src/features/Settings/advanced/index.tsx
@@ -2,11 +2,10 @@
import { isDesktop } from '@lobechat/const';
import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui';
-import { Form, Icon } from '@lobehub/ui';
-import { Select, Skeleton, Switch } from '@lobehub/ui/base-ui';
+import { Form } from '@lobehub/ui';
+import { Select, Skeleton, Spin, Switch } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import isEqual from 'fast-deep-equal';
-import { Loader2Icon } from 'lucide-react';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -121,7 +120,7 @@ const Page = memo(() => {
]
: []),
],
- extra: loading && <Icon spin icon={Loader2Icon} size={16} style={{ opacity: 0.5 }} />,
+ extra: loading && <Spin size="small" style={{ opacity: 0.5 }} />,
title: t('tab.advanced.toolsAndDiagnostics.title'),
};
diff --git a/src/features/Settings/creds/features/CreateCredModal/FileCredForm.tsx b/src/features/Settings/creds/features/CreateCredModal/FileCredForm.tsx
index 6af00411350..f8a613f4ebd 100644
--- a/src/features/Settings/creds/features/CreateCredModal/FileCredForm.tsx
+++ b/src/features/Settings/creds/features/CreateCredModal/FileCredForm.tsx
@@ -1,9 +1,8 @@
'use client';
-import { InboxOutlined } from '@ant-design/icons';
-import { Button, toast } from '@lobehub/ui/base-ui';
+import { Button, toast, Upload } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
-import { Form, Input, Upload } from 'antd';
+import { Form, Input } from 'antd';
import { createStaticStyles } from 'antd-style';
import { type FC, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -33,7 +32,7 @@ interface FormValues {
}
const FileCredForm: FC<FileCredFormProps> = ({ credsApi, disabled, onBack, onSuccess }) => {
- const { t } = useTranslation('setting');
+ const { t } = useTranslation(['setting', 'common']);
const [form] = Form.useForm<FormValues>();
const [fileHashId, setFileHashId] = useState<string | null>(null);
const [fileName, setFileName] = useState<string>('');
@@ -61,7 +60,7 @@ const FileCredForm: FC<FileCredFormProps> = ({ credsApi, disabled, onBack, onSuc
});
const handleUpload = async (file: File) => {
- if (disabled) return false;
+ if (disabled) return;
setIsUploading(true);
@@ -91,8 +90,6 @@ const FileCredForm: FC<FileCredFormProps> = ({ credsApi, disabled, onBack, onSuc
} finally {
setIsUploading(false);
}
-
- return false; // Prevent default upload
};
const handleSubmit = (values: FormValues) => {
@@ -108,27 +105,29 @@ const FileCredForm: FC<FileCredFormProps> = ({ credsApi, disabled, onBack, onSuc
return (
<Form<FormValues> form={form} layout="vertical" onFinish={handleSubmit}>
<Form.Item required label={t('creds.form.file')}>
- <Upload.Dragger
- beforeUpload={handleUpload}
+ <Upload
+ dragger
+ description={t('creds.form.uploadDesc')}
disabled={isUploading || disabled}
maxCount={1}
- showUploadList={fileName ? { showRemoveIcon: true } : false}
- onRemove={() => {
- setFileHashId(null);
- setFileName('');
- }}
- >
- <p className="ant-upload-drag-icon">
- <InboxOutlined />
- </p>
- <p className="ant-upload-text">
- {isUploading ? t('creds.file.uploading') : t('creds.form.uploadHint')}
- </p>
- <p className="ant-upload-hint">{t('creds.form.uploadDesc')}</p>
- </Upload.Dragger>
+ title={isUploading ? t('creds.file.uploading') : t('creds.form.uploadHint')}
+ onFiles={([file]) => handleUpload(file)}
+ />
{fileName && (
- <div style={{ marginTop: 8 }}>
- {t('creds.form.selectedFile')}: {fileName}
+ <div style={{ alignItems: 'center', display: 'flex', gap: 8, marginTop: 8 }}>
+ <span>
+ {t('creds.form.selectedFile')}: {fileName}
+ </span>
+ <Button
+ size="small"
+ type="text"
+ onClick={() => {
+ setFileHashId(null);
+ setFileName('');
+ }}
+ >
+ {t('delete', { ns: 'common' })}
+ </Button>
</div>
)}
</Form.Item>
diff --git a/src/features/Settings/creds/features/CreateCredModal/OAuthCredForm.tsx b/src/features/Settings/creds/features/CreateCredModal/OAuthCredForm.tsx
index 49f3586a82f..3b1cecddff6 100644
--- a/src/features/Settings/creds/features/CreateCredModal/OAuthCredForm.tsx
+++ b/src/features/Settings/creds/features/CreateCredModal/OAuthCredForm.tsx
@@ -1,9 +1,9 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
-import { Avatar, Button, Select } from '@lobehub/ui/base-ui';
+import { Empty, Flexbox } from '@lobehub/ui';
+import { Avatar, Button, Select, Spin } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
-import { Empty, Form, Input, Spin } from 'antd';
+import { Form, Input } from 'antd';
import { createStaticStyles } from 'antd-style';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Settings/creds/features/CredsList.tsx b/src/features/Settings/creds/features/CredsList.tsx
index 58602d79d8b..2424f95b589 100644
--- a/src/features/Settings/creds/features/CredsList.tsx
+++ b/src/features/Settings/creds/features/CredsList.tsx
@@ -1,11 +1,10 @@
'use client';
import { type UserCredSummary } from '@lobechat/types';
-import { Flexbox } from '@lobehub/ui';
+import { Empty, Flexbox } from '@lobehub/ui';
import { Button } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
import { TRPCClientError } from '@trpc/client';
-import { Empty } from 'antd';
import { createStaticStyles } from 'antd-style';
import { LogIn } from 'lucide-react';
import { type FC } from 'react';
diff --git a/src/features/Settings/creds/features/EditCredModal/EditKVForm.tsx b/src/features/Settings/creds/features/EditCredModal/EditKVForm.tsx
index 9c5f4e6ae4a..3a1464294d4 100644
--- a/src/features/Settings/creds/features/EditCredModal/EditKVForm.tsx
+++ b/src/features/Settings/creds/features/EditCredModal/EditKVForm.tsx
@@ -2,9 +2,9 @@
import { type UserCredSummary } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Button, Spin } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
-import { Form, Input, Spin } from 'antd';
+import { Form, Input } from 'antd';
import { createStaticStyles } from 'antd-style';
import { Minus, Plus } from 'lucide-react';
import { type FC, useEffect, useState } from 'react';
diff --git a/src/features/Settings/hotkey/features/Desktop.tsx b/src/features/Settings/hotkey/features/Desktop.tsx
index 8ae76957835..5f899ab0b96 100644
--- a/src/features/Settings/hotkey/features/Desktop.tsx
+++ b/src/features/Settings/hotkey/features/Desktop.tsx
@@ -1,10 +1,9 @@
'use client';
import { type FormGroupItemType } from '@lobehub/ui';
-import { Form, HotkeyInput, Icon } from '@lobehub/ui';
-import { Skeleton, toast } from '@lobehub/ui/base-ui';
+import { Form, HotkeyInput } from '@lobehub/ui';
+import { Skeleton, Spin, toast } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
-import { Loader2Icon } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -71,7 +70,7 @@ const HotkeySetting = memo(() => {
const desktop: FormGroupItemType = {
children: DESKTOP_HOTKEYS_REGISTRATION.map((item) => mapHotkeyItem(item)),
- extra: loading && <Icon spin icon={Loader2Icon} size={16} style={{ opacity: 0.5 }} />,
+ extra: loading && <Spin size="small" style={{ opacity: 0.5 }} />,
title: (
<SettingsSearchAnchor id={'hotkey-desktop'}>{t('hotkey.group.desktop')}</SettingsSearchAnchor>
),
diff --git a/src/features/Settings/image/features/Image.tsx b/src/features/Settings/image/features/Image.tsx
index bf6ee8e90b8..92b3ce759a0 100644
--- a/src/features/Settings/image/features/Image.tsx
+++ b/src/features/Settings/image/features/Image.tsx
@@ -2,9 +2,8 @@
import { type UserImageConfig } from '@lobechat/types';
import { type FormGroupItemType } from '@lobehub/ui';
-import { Form, Icon } from '@lobehub/ui';
-import { Skeleton } from '@lobehub/ui/base-ui';
-import { Loader2Icon } from 'lucide-react';
+import { Form } from '@lobehub/ui';
+import { Skeleton, Spin } from '@lobehub/ui/base-ui';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -47,9 +46,7 @@ const ImageSettings = memo(() => {
tooltip: reason,
},
],
- extra: isUpdating ? (
- <Icon spin icon={Loader2Icon} size={16} style={{ opacity: 0.6 }} />
- ) : undefined,
+ extra: isUpdating ? <Spin size="small" style={{ opacity: 0.6 }} /> : undefined,
title: (
<SettingsSearchAnchor id={'service-model-image'}>
{t('settingImage.defaultCount.title')}
diff --git a/src/features/Settings/profile/features/AvatarRow.tsx b/src/features/Settings/profile/features/AvatarRow.tsx
index a2a426a3ff1..e2d07425d2d 100644
--- a/src/features/Settings/profile/features/AvatarRow.tsx
+++ b/src/features/Settings/profile/features/AvatarRow.tsx
@@ -1,7 +1,7 @@
'use client';
import { Icon } from '@lobehub/ui';
-import { Upload } from 'antd';
+import { Upload } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Loader2Icon, PencilIcon } from 'lucide-react';
import { useCallback, useMemo, useState } from 'react';
@@ -85,7 +85,7 @@ const AvatarRow = () => {
const canUpload = isLogin;
const avatarContent = canUpload ? (
- <Upload beforeUpload={handleUploadAvatar} itemRender={() => void 0} maxCount={1}>
+ <Upload maxCount={1} onFiles={([file]) => handleUploadAvatar(file)}>
<div className={styles.wrapper}>
<UserAvatar size={40} />
<div
diff --git a/src/features/Settings/profile/features/FullNameRow.tsx b/src/features/Settings/profile/features/FullNameRow.tsx
index e28ed6262c4..307480da41a 100644
--- a/src/features/Settings/profile/features/FullNameRow.tsx
+++ b/src/features/Settings/profile/features/FullNameRow.tsx
@@ -1,8 +1,8 @@
'use client';
-import { Flexbox, Icon, Input } from '@lobehub/ui';
+import { Flexbox, Input } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
-import { Loader2Icon } from 'lucide-react';
import { useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -37,7 +37,7 @@ const FullNameRow = () => {
return (
<ProfileRow anchor={'profile-full-name'} label={t('profile.fullName')}>
<Flexbox horizontal align="center" gap={8}>
- {saving && <Icon spin icon={Loader2Icon} size={16} style={{ opacity: 0.5 }} />}
+ {saving && <Spin size="small" style={{ opacity: 0.5 }} />}
<Input
defaultValue={fullName || ''}
disabled={saving}
diff --git a/src/features/Settings/profile/features/UsernameRow.tsx b/src/features/Settings/profile/features/UsernameRow.tsx
index 620eb167859..9b35333f379 100644
--- a/src/features/Settings/profile/features/UsernameRow.tsx
+++ b/src/features/Settings/profile/features/UsernameRow.tsx
@@ -1,9 +1,8 @@
'use client';
-import { Flexbox, Icon, Input } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
+import { Flexbox, Input } from '@lobehub/ui';
+import { Button, Spin, Text } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
-import { Loader2Icon } from 'lucide-react';
import { type ChangeEvent } from 'react';
import { useCallback, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -93,7 +92,7 @@ const UsernameRow = () => {
return (
<ProfileRow anchor={'profile-username'} label={t('profile.username')}>
<Flexbox horizontal align="center" gap={8}>
- {saving && <Icon spin icon={Loader2Icon} size={16} style={{ opacity: 0.5 }} />}
+ {saving && <Spin size="small" style={{ opacity: 0.5 }} />}
{error && (
<Text style={{ fontSize: 12, whiteSpace: 'nowrap' }} type="danger">
{error}
diff --git a/src/features/Settings/provider/ProviderMenu/Item.tsx b/src/features/Settings/provider/ProviderMenu/Item.tsx
index f0be41e216a..b1141d7916b 100644
--- a/src/features/Settings/provider/ProviderMenu/Item.tsx
+++ b/src/features/Settings/provider/ProviderMenu/Item.tsx
@@ -1,7 +1,6 @@
import { BRANDING_PROVIDER } from '@lobechat/business-const';
import { Center } from '@lobehub/ui';
-import { Avatar } from '@lobehub/ui/base-ui';
-import { Badge } from 'antd';
+import { Avatar, Badge } from '@lobehub/ui/base-ui';
import { memo, useMemo } from 'react';
import { useLocation } from 'react-router';
diff --git a/src/features/Settings/provider/features/ProviderConfig/Checker.tsx b/src/features/Settings/provider/features/ProviderConfig/Checker.tsx
index 9b19d95c5e3..8cb9da2fda9 100644
--- a/src/features/Settings/provider/features/ProviderConfig/Checker.tsx
+++ b/src/features/Settings/provider/features/ProviderConfig/Checker.tsx
@@ -4,10 +4,9 @@ import { CheckCircleFilled } from '@ant-design/icons';
import { type ChatMessageError } from '@lobechat/types';
import { RequestTrigger, TraceNameMap } from '@lobechat/types';
import { isRecord, pickTrimmedString } from '@lobechat/utils/object';
-import { Flexbox, Highlighter, Icon } from '@lobehub/ui';
-import { Alert, Button, Select } from '@lobehub/ui/base-ui';
+import { Flexbox, Highlighter } from '@lobehub/ui';
+import { Alert, Button, Select, Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
-import { Loader2Icon } from 'lucide-react';
import { type ReactNode } from 'react';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -187,7 +186,7 @@ const Checker = memo<ConnectionCheckerProps>(
listItemHeight={36}
options={sortedModels.map((id) => ({ label: id, value: id }))}
popupClassName={cx(styles.popup)}
- suffixIcon={isProviderConfigUpdating && <Icon spin icon={Loader2Icon} />}
+ suffixIcon={isProviderConfigUpdating && <Spin size="small" />}
value={checkModel}
optionRender={({ value }) => {
return (
diff --git a/src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx b/src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx
index 85d23967ee7..0b76027af94 100644
--- a/src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx
+++ b/src/features/Settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx
@@ -3,10 +3,10 @@
import { CheckCircleFilled } from '@ant-design/icons';
import { MAX_WIDTH } from '@lobechat/const';
import { CopyButton, Flexbox, Icon } from '@lobehub/ui';
-import { Avatar, Button, confirmModal, Modal } from '@lobehub/ui/base-ui';
+import { Avatar, Button, confirmModal, Modal, Spin } from '@lobehub/ui/base-ui';
import { Typography } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2Icon, LogOutIcon, UnplugIcon } from 'lucide-react';
+import { LogOutIcon, UnplugIcon } from 'lucide-react';
import { type ReactNode } from 'react';
import { memo, useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -234,7 +234,7 @@ const OAuthDeviceFlowAuth = memo<OAuthDeviceFlowAuthProps>(
if (state === 'requesting' || !deviceCodeInfo)
return (
<div className={styles.content}>
- <Icon spin icon={Loader2Icon} size={24} />
+ <Spin size="middle" />
<Text type="secondary">{t('providerModels.config.oauth.connecting')}</Text>
</div>
);
@@ -278,7 +278,7 @@ const OAuthDeviceFlowAuth = memo<OAuthDeviceFlowAuthProps>(
</Flexbox>
<div className={styles.pollingHint}>
- <Icon spin icon={Loader2Icon} />
+ <Spin size="small" />
<span>{t('providerModels.config.oauth.polling')}</span>
</div>
</div>
diff --git a/src/features/Settings/provider/features/ProviderConfig/index.tsx b/src/features/Settings/provider/features/ProviderConfig/index.tsx
index 393425398e5..0ee64365d2f 100644
--- a/src/features/Settings/provider/features/ProviderConfig/index.tsx
+++ b/src/features/Settings/provider/features/ProviderConfig/index.tsx
@@ -4,11 +4,11 @@ import { BRANDING_PROVIDER } from '@lobechat/business-const';
import { AES_GCM_URL, BASE_PROVIDER_DOC_URL, FORM_STYLE } from '@lobechat/const';
import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui';
import { Center, Flexbox, Form, Icon, stopPropagation, Tooltip } from '@lobehub/ui';
-import { Avatar, Skeleton, Switch } from '@lobehub/ui/base-ui';
+import { Avatar, Skeleton, Spin, Switch } from '@lobehub/ui/base-ui';
import { useDebounceFn } from 'ahooks';
import { Form as AntdForm } from 'antd';
import { createStaticStyles, cssVar, cx, responsive } from 'antd-style';
-import { InfoIcon, Loader2Icon, LockIcon } from 'lucide-react';
+import { InfoIcon, LockIcon } from 'lucide-react';
import { AiProviderBaseURLSchema } from 'model-bank/aiProvider';
import { type ReactNode } from 'react';
import { memo, useCallback, useLayoutEffect, useRef } from 'react';
@@ -287,7 +287,7 @@ const ProviderConfig = memo<ProviderConfigProps>(
placeholder={t('providerModels.config.apiKey.placeholder', { name })}
suffix={
configUpdating && (
- <Icon spin icon={Loader2Icon} style={{ color: cssVar.colorTextTertiary }} />
+ <Spin size="small" style={{ color: cssVar.colorTextTertiary }} />
)
}
/>
@@ -350,9 +350,7 @@ const ProviderConfig = memo<ProviderConfigProps>(
t('providerModels.config.baseURL.placeholder')
}
suffix={
- configUpdating && (
- <Icon spin icon={Loader2Icon} style={{ color: cssVar.colorTextTertiary }} />
- )
+ configUpdating && <Spin size="small" style={{ color: cssVar.colorTextTertiary }} />
}
/>
),
diff --git a/src/features/Settings/skill/features/ComposioSkillItem.tsx b/src/features/Settings/skill/features/ComposioSkillItem.tsx
index b6ac24aa31c..b849e830fe8 100644
--- a/src/features/Settings/skill/features/ComposioSkillItem.tsx
+++ b/src/features/Settings/skill/features/ComposioSkillItem.tsx
@@ -6,7 +6,6 @@ import { Avatar, Button, Button as LobeButton, confirmModal } from '@lobehub/ui/
import { cssVar } from 'antd-style';
import {
CircleCheck,
- Loader2,
MoreHorizontalIcon,
RotateCcw,
SquareArrowOutUpRight,
@@ -247,7 +246,7 @@ const ComposioSkillItem = memo<ComposioSkillItemProps>(
const renderAction = () => {
if (isConnecting || isWaitingAuth) {
return (
- <Button disabled icon={<Icon spin icon={Loader2} />} type="default">
+ <Button disabled loading type="default">
{t('tools.composio.connect', { defaultValue: 'Connect' })}
</Button>
);
@@ -338,7 +337,7 @@ const ComposioSkillItem = memo<ComposioSkillItemProps>(
// users can tell what is connected instead of hitting a blank detail panel.
const renderNavExtra = () => {
if (isConnecting || isWaitingAuth) {
- return <Button disabled icon={<Icon spin icon={Loader2} />} size="small" type="text" />;
+ return <Button disabled loading size="small" type="text" />;
}
if (isConnected) {
return (
diff --git a/src/features/Settings/skill/features/LobehubSkillItem.tsx b/src/features/Settings/skill/features/LobehubSkillItem.tsx
index 21bf1f5a86c..3c0706ddd36 100644
--- a/src/features/Settings/skill/features/LobehubSkillItem.tsx
+++ b/src/features/Settings/skill/features/LobehubSkillItem.tsx
@@ -4,13 +4,7 @@ import { type LobehubSkillProviderType } from '@lobechat/const';
import { Center, DropdownMenu, Flexbox, Icon, Tooltip } from '@lobehub/ui';
import { Avatar, Button, Button as LobeButton, confirmModal } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import {
- CircleCheck,
- Loader2,
- MoreHorizontalIcon,
- SquareArrowOutUpRight,
- Unplug,
-} from 'lucide-react';
+import { CircleCheck, MoreHorizontalIcon, SquareArrowOutUpRight, Unplug } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -239,7 +233,7 @@ const LobehubSkillItem = memo<LobehubSkillItemProps>(
const renderAction = () => {
if (isConnecting || isWaitingAuth) {
return (
- <Button disabled icon={<Icon spin icon={Loader2} />} type="default">
+ <Button disabled loading type="default">
{t('tools.lobehubSkill.connect')}
</Button>
);
@@ -288,7 +282,7 @@ const LobehubSkillItem = memo<LobehubSkillItemProps>(
// and aren't left staring at a blank detail panel wondering if it's a bug.
const renderNavExtra = () => {
if (isConnecting || isWaitingAuth) {
- return <Button disabled icon={<Icon spin icon={Loader2} />} size="small" type="text" />;
+ return <Button disabled loading size="small" type="text" />;
}
if (isConnected) {
return (
diff --git a/src/features/Settings/stats/features/components/TimeLabel.tsx b/src/features/Settings/stats/features/components/TimeLabel.tsx
index a47027394bd..a267e4548b1 100644
--- a/src/features/Settings/stats/features/components/TimeLabel.tsx
+++ b/src/features/Settings/stats/features/components/TimeLabel.tsx
@@ -1,7 +1,7 @@
import { Flexbox, Icon } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { type LucideIcon } from 'lucide-react';
-import { Loader2 } from 'lucide-react';
import { memo } from 'react';
const TimeLabel = memo<{
@@ -22,7 +22,7 @@ const TimeLabel = memo<{
>
<Icon icon={icon} />
{title ? `${title}: ` : null}
- {date ? <span style={{ fontWeight: 'bold' }}>{date}</span> : <Icon spin icon={Loader2} />}
+ {date ? <span style={{ fontWeight: 'bold' }}>{date}</span> : <Spin size="small" />}
</Flexbox>
);
});
diff --git a/src/features/Settings/system-tools/features/ToolDetectorSection.tsx b/src/features/Settings/system-tools/features/ToolDetectorSection.tsx
index d4f30392e5d..0f368891808 100644
--- a/src/features/Settings/system-tools/features/ToolDetectorSection.tsx
+++ b/src/features/Settings/system-tools/features/ToolDetectorSection.tsx
@@ -3,8 +3,8 @@
import { type BinaryStatus } from '@lobechat/electron-client-ipc';
import { type FormGroupItemType } from '@lobehub/ui';
import { CopyButton, Flexbox, Form, Icon, Tooltip } from '@lobehub/ui';
-import { Button, Tag, Text } from '@lobehub/ui/base-ui';
-import { CheckCircle2, Loader2Icon, RefreshCw, XCircle } from 'lucide-react';
+import { Button, Spin, Tag, Text } from '@lobehub/ui/base-ui';
+import { CheckCircle2, RefreshCw, XCircle } from 'lucide-react';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -81,7 +81,7 @@ const ToolStatusDisplay = memo<ToolStatusDisplayProps>(({ status, isDetecting })
if (isDetecting) {
return (
<Flexbox horizontal align="center" gap={8}>
- <Icon spin icon={Loader2Icon} size={16} style={{ opacity: 0.5 }} />
+ <Spin size="small" style={{ opacity: 0.5 }} />
<Text type="secondary">{t('settingSystemTools.detecting')}</Text>
</Flexbox>
);
diff --git a/src/features/SettingsSearch/SearchResults.tsx b/src/features/SettingsSearch/SearchResults.tsx
index 1fe0f854cb5..3a744189a0f 100644
--- a/src/features/SettingsSearch/SearchResults.tsx
+++ b/src/features/SettingsSearch/SearchResults.tsx
@@ -1,9 +1,8 @@
'use client';
-import { Flexbox, Icon } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2Icon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -58,7 +57,7 @@ const SearchResults = memo<SearchResultsProps>(({ isIndexing, query, results })
{isIndexing ? (
// A zero-result answer is not authoritative while the pinyin dict is
// still loading — show a spinner instead of a false empty state.
- <Icon spin color={cssVar.colorTextSecondary} icon={Loader2Icon} />
+ <Spin size="small" style={{ color: cssVar.colorTextSecondary }} />
) : (
<Text fontSize={12} type={'secondary'}>
{t('settingsSearch.empty', { keyword })}
diff --git a/src/features/ShareModal/SharePdf/PdfPreview.tsx b/src/features/ShareModal/SharePdf/PdfPreview.tsx
index 98945c6b0a8..e094c24c88f 100644
--- a/src/features/ShareModal/SharePdf/PdfPreview.tsx
+++ b/src/features/ShareModal/SharePdf/PdfPreview.tsx
@@ -2,8 +2,8 @@
import { LoadingOutlined } from '@ant-design/icons';
import { Flexbox } from '@lobehub/ui';
-import { Button, createModal } from '@lobehub/ui/base-ui';
-import { Input, Spin } from 'antd';
+import { Button, createModal, Spin } from '@lobehub/ui/base-ui';
+import { Input } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { ChevronLeft, ChevronRight, Expand, FileText } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/features/SkillStore/SkillDetail/Header.tsx b/src/features/SkillStore/SkillDetail/Header.tsx
index 2d058d6dba8..f89dd5b345c 100644
--- a/src/features/SkillStore/SkillDetail/Header.tsx
+++ b/src/features/SkillStore/SkillDetail/Header.tsx
@@ -3,7 +3,7 @@
import { Flexbox, Icon, Tooltip, useModalContext } from '@lobehub/ui';
import { Avatar, Button, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2, Plus, SquareArrowOutUpRight } from 'lucide-react';
+import { Plus, SquareArrowOutUpRight } from 'lucide-react';
import { memo, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
@@ -118,7 +118,7 @@ const Header = memo<HeaderProps>(({ type }) => {
if (isConnecting) {
return (
- <Button disabled icon={<Icon spin icon={Loader2} />} type="default">
+ <Button disabled loading type="default">
{t('tools.composio.connect', { defaultValue: 'Connect' })}
</Button>
);
diff --git a/src/features/SkillStore/SkillDetail/VirtuosoLoading.tsx b/src/features/SkillStore/SkillDetail/VirtuosoLoading.tsx
index 41d6cebf7dc..a2f98401d52 100644
--- a/src/features/SkillStore/SkillDetail/VirtuosoLoading.tsx
+++ b/src/features/SkillStore/SkillDetail/VirtuosoLoading.tsx
@@ -1,11 +1,11 @@
-import { Center, Icon } from '@lobehub/ui';
+import { Center } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2Icon } from 'lucide-react';
const VirtuosoLoading = () => {
return (
<Center padding={16}>
- <Icon spin color={cssVar.colorTextDescription} icon={Loader2Icon} />
+ <Spin size="small" style={{ color: cssVar.colorTextDescription }} />
</Center>
);
};
diff --git a/src/features/SkillStore/SkillList/UploadSkillModal.tsx b/src/features/SkillStore/SkillList/UploadSkillModal.tsx
index 52676a40682..c32889e4f78 100644
--- a/src/features/SkillStore/SkillList/UploadSkillModal.tsx
+++ b/src/features/SkillStore/SkillList/UploadSkillModal.tsx
@@ -6,10 +6,12 @@ import {
Alert,
createModal,
type ModalInstance,
+ Spin,
toast,
+ Upload,
useModalContext,
} from '@lobehub/ui/base-ui';
-import { Spin, Typography, Upload } from 'antd';
+import { Typography } from 'antd';
import { sha256 } from 'js-sha256';
import { ArrowLeftRight, InboxIcon, Sparkles, Upload as UploadIcon } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
@@ -91,15 +93,11 @@ const UploadSkillContent = memo(() => {
{error && <Alert showIcon title={t('agentSkillModal.importError', { error })} type="error" />}
- <Upload.Dragger
+ <Upload
+ dragger
accept=".zip,.skill"
disabled={loading || !canCreate}
- showUploadList={false}
- beforeUpload={(file) => {
- if (!canCreate) return false;
- handleUploadFile(file);
- return false;
- }}
+ onFiles={([file]) => void handleUploadFile(file)}
>
<Flexbox align="center" gap={8} padding={24}>
{loading ? (
@@ -122,7 +120,7 @@ const UploadSkillContent = memo(() => {
</>
)}
</Flexbox>
- </Upload.Dragger>
+ </Upload>
<Flexbox gap={8}>
<Typography.Text strong>{t('agentSkillModal.upload.requirements')}</Typography.Text>
diff --git a/src/features/SkillStore/SkillList/VirtuosoLoading.tsx b/src/features/SkillStore/SkillList/VirtuosoLoading.tsx
index 41d6cebf7dc..a2f98401d52 100644
--- a/src/features/SkillStore/SkillList/VirtuosoLoading.tsx
+++ b/src/features/SkillStore/SkillList/VirtuosoLoading.tsx
@@ -1,11 +1,11 @@
-import { Center, Icon } from '@lobehub/ui';
+import { Center } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
-import { Loader2Icon } from 'lucide-react';
const VirtuosoLoading = () => {
return (
<Center padding={16}>
- <Icon spin color={cssVar.colorTextDescription} icon={Loader2Icon} />
+ <Spin size="small" style={{ color: cssVar.colorTextDescription }} />
</Center>
);
};
diff --git a/src/features/SkillsList/SkillSection.tsx b/src/features/SkillsList/SkillSection.tsx
index 8f3bbbb7d81..bfc3c0c2294 100644
--- a/src/features/SkillsList/SkillSection.tsx
+++ b/src/features/SkillsList/SkillSection.tsx
@@ -1,10 +1,9 @@
import { Center, Flexbox } from '@lobehub/ui';
-import { Accordion, Text } from '@lobehub/ui/base-ui';
+import { Accordion, Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo, type ReactNode, useState } from 'react';
import AsyncError from '@/components/AsyncError';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
export interface SkillSectionHeader {
/** Wrap the section in a collapsible Accordion. Defaults to true. */
@@ -93,7 +92,7 @@ const Body = memo<BodyProps>(({ children, emptyText, error, isEmpty, isLoading,
if (isLoading) {
return (
<Center paddingBlock={12}>
- <NeuralNetworkLoading size={24} />
+ <Spin size="middle" />
</Center>
);
}
diff --git a/src/features/TaskDock/index.tsx b/src/features/TaskDock/index.tsx
index 19818b17b41..aa43484809b 100644
--- a/src/features/TaskDock/index.tsx
+++ b/src/features/TaskDock/index.tsx
@@ -1,11 +1,10 @@
import { Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, Text } from '@lobehub/ui/base-ui';
+import { ActionIcon, Spin, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
CheckIcon,
ChevronDownIcon,
CircleSlashIcon,
- LoaderCircleIcon,
TriangleAlertIcon,
XIcon,
} from 'lucide-react';
@@ -165,7 +164,7 @@ const TaskDock = memo(() => {
return <Icon color={cssVar.colorTextDescription} icon={CircleSlashIcon} size={16} />;
}
default: {
- return <Icon spin icon={LoaderCircleIcon} size={16} />;
+ return <Spin size="small" />;
}
}
}, [status]);
diff --git a/src/features/TopicComment/TopicCommentButton.tsx b/src/features/TopicComment/TopicCommentButton.tsx
index ad785d9be82..e620f2359a3 100644
--- a/src/features/TopicComment/TopicCommentButton.tsx
+++ b/src/features/TopicComment/TopicCommentButton.tsx
@@ -1,5 +1,4 @@
-import { ActionIcon } from '@lobehub/ui/base-ui';
-import { Badge } from 'antd';
+import { ActionIcon, Badge } from '@lobehub/ui/base-ui';
import { MessageCircle } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/User/DataStatistics.tsx b/src/features/User/DataStatistics.tsx
index d1ef7087563..8e459e8495a 100644
--- a/src/features/User/DataStatistics.tsx
+++ b/src/features/User/DataStatistics.tsx
@@ -2,13 +2,12 @@
import { type FlexboxProps } from '@lobehub/ui';
import { Flexbox, Tooltip } from '@lobehub/ui';
-import { Badge } from 'antd';
+import { Badge, Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { isUndefined } from 'es-toolkit/compat';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { useClientDataSWR } from '@/libs/swr';
import { statsKeys } from '@/libs/swr/keys';
import { agentService } from '@/services/agent';
@@ -68,7 +67,7 @@ const DataStatistics = memo<Omit<FlexboxProps, 'children'>>(({ style, ...rest })
const { t } = useTranslation('common');
- const loading = <NeuralNetworkLoading size={20} />;
+ const loading = <Spin size="middle" />;
const items = [
{
diff --git a/src/features/WorkingDirectory/RemoteDirectoryBrowser.tsx b/src/features/WorkingDirectory/RemoteDirectoryBrowser.tsx
index 2fd8dc1e705..75a78e23070 100644
--- a/src/features/WorkingDirectory/RemoteDirectoryBrowser.tsx
+++ b/src/features/WorkingDirectory/RemoteDirectoryBrowser.tsx
@@ -1,13 +1,12 @@
'use client';
import { Flexbox, Input } from '@lobehub/ui';
-import { ActionIcon, Button, Text } from '@lobehub/ui/base-ui';
+import { ActionIcon, Button, Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { ArrowUpIcon, HouseIcon } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import NavItem from '@/features/NavPanel/components/NavItem';
import { useFetchDeviceDirectory } from '@/store/device/directoryHooks';
@@ -96,7 +95,7 @@ export const RemoteDirectoryBrowser = ({
>
{isLoading ? (
<Flexbox align={'center'} flex={1} gap={8} justify={'center'}>
- <NeuralNetworkLoading />
+ <Spin size="small" />
<Text type={'secondary'}>{t('workingDirectory.foldersLoading')}</Text>
</Flexbox>
) : (
diff --git a/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx b/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx
index 2bd627e55f6..1a2e964dda5 100644
--- a/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx
+++ b/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx
@@ -1,9 +1,8 @@
'use client';
import { Center, Flexbox, Icon, Input, TextArea, Tooltip } from '@lobehub/ui';
-import { confirmModal, Text, toast } from '@lobehub/ui/base-ui';
-import { type UploadProps } from 'antd';
-import { Form, Upload } from 'antd';
+import { confirmModal, Text, toast, Upload } from '@lobehub/ui/base-ui';
+import { Form } from 'antd';
import { cssVar } from 'antd-style';
import { CircleHelp, Globe, ImagePlus, Trash2 } from 'lucide-react';
import { memo, useCallback, useEffect, useState } from 'react';
@@ -192,13 +191,10 @@ const ProfileSetupModal = memo<ProfileSetupModalProps>(
}, []);
// Handle banner upload
- const handleBannerUpload: UploadProps['customRequest'] = useCallback(
- async (options: Parameters<NonNullable<UploadProps['customRequest']>>[0]) => {
- const file = options.file as File;
-
+ const handleBannerUpload = useCallback(
+ async (file: File) => {
if (file.size > MAX_FILE_SIZE) {
toast.error(t('profileSetup.errors.fileTooLarge'));
- options.onError?.(new Error('File too large'));
return;
}
@@ -207,12 +203,10 @@ const ProfileSetupModal = memo<ProfileSetupModalProps>(
const result = await uploadWithProgress({ file });
if (result?.url) {
setBannerUrl(result.url);
- options.onSuccess?.(result);
}
} catch (error) {
console.error('[ProfileSetupModal] Banner upload failed:', error);
toast.error(t('profileSetup.errors.uploadFailed'));
- options.onError?.(error as Error);
} finally {
setBannerUploading(false);
}
@@ -492,10 +486,9 @@ const ProfileSetupModal = memo<ProfileSetupModalProps>(
<Flexbox gap={8} width="100%">
<Upload
accept="image/*"
- customRequest={handleBannerUpload}
maxCount={1}
- showUploadList={false}
style={{ display: 'block', width: '100%' }}
+ onFiles={([file]) => handleBannerUpload(file)}
>
<div
style={{
diff --git a/src/layout/AuthProvider/MarketAuth/SocialConnectButton.tsx b/src/layout/AuthProvider/MarketAuth/SocialConnectButton.tsx
index fd90fd02754..a3727865f40 100644
--- a/src/layout/AuthProvider/MarketAuth/SocialConnectButton.tsx
+++ b/src/layout/AuthProvider/MarketAuth/SocialConnectButton.tsx
@@ -2,8 +2,7 @@
import { SiGithub, SiX } from '@icons-pack/react-simple-icons';
import { Flexbox, Tooltip } from '@lobehub/ui';
-import { ActionIcon, Button, Text } from '@lobehub/ui/base-ui';
-import { Spin } from 'antd';
+import { ActionIcon, Button, Spin, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { ArrowRight, Link2Off, Loader2 } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/(create)/features/GenerationInput/UploadCard.tsx b/src/routes/(main)/(create)/features/GenerationInput/UploadCard.tsx
index 446c00c1256..ff67bb34db4 100644
--- a/src/routes/(main)/(create)/features/GenerationInput/UploadCard.tsx
+++ b/src/routes/(main)/(create)/features/GenerationInput/UploadCard.tsx
@@ -1,8 +1,7 @@
'use client';
import { Block } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui/base-ui';
-import { Spin } from 'antd';
+import { ActionIcon, Spin } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Plus, X } from 'lucide-react';
import type { ChangeEvent, CSSProperties } from 'react';
@@ -120,11 +119,9 @@ export const uploadCardStyles = createStaticStyles(({ css }) => ({
background: ${cssVar.colorBgMask};
- /* antd resets the Spin's own color to colorText (near-black in the light
- theme) and the percent ring's stroke is \`currentcolor\`, so it smears into
- the dark mask. The mask is a dark scrim in both themes — override the Spin
- color to white for contrast. */
- .ant-spin {
+ /* The mask is a dark scrim in both themes, so the spinner needs a fixed
+ white rather than a theme-following token. */
+ svg {
color: ${cssVar.colorWhite};
}
`,
@@ -274,7 +271,7 @@ const UploadCard = memo<UploadCardProps>(
/>
{uploading && (
<div className={uploadCardStyles.uploadOverlay}>
- <Spin percent={'auto'} size="small" />
+ <Spin size="small" />
</div>
)}
</div>
diff --git a/src/routes/(main)/(create)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx b/src/routes/(main)/(create)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx
index 178dbe1309b..d749ba629e1 100644
--- a/src/routes/(main)/(create)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx
+++ b/src/routes/(main)/(create)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx
@@ -1,9 +1,9 @@
'use client';
import { Block, Center } from '@lobehub/ui';
+import { Spin } from '@lobehub/ui/base-ui';
import React, { memo } from 'react';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { AsyncTaskStatus } from '@/types/asyncTask';
import { ActionButtons } from './ActionButtons';
@@ -32,7 +32,7 @@ export const LoadingState = memo<LoadingStateProps>(
>
<div className={`${styles.placeholderContainer} ${styles.placeholderContainerLoading}`} />
<Center gap={8} style={{ zIndex: 2 }}>
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" variant="network" />
<ElapsedTime generationId={generation.id} isActive={isGenerating} />
</Center>
<ActionButtons onDelete={onDelete} />
diff --git a/src/routes/(main)/(create)/video/features/GenerationFeed/VideoLoadingItem.tsx b/src/routes/(main)/(create)/video/features/GenerationFeed/VideoLoadingItem.tsx
index 403df100b0d..6614666e4f3 100644
--- a/src/routes/(main)/(create)/video/features/GenerationFeed/VideoLoadingItem.tsx
+++ b/src/routes/(main)/(create)/video/features/GenerationFeed/VideoLoadingItem.tsx
@@ -2,7 +2,7 @@
import { LoadingOutlined } from '@ant-design/icons';
import { Block, Center } from '@lobehub/ui';
-import { Progress, Spin } from 'antd';
+import { Progress, Spin } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { MAX_ESTIMATED_PROGRESS, useEstimatedProgress } from '@/hooks/useEstimatedProgress';
diff --git a/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsx
index 135c28a4758..689574c28c7 100644
--- a/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsx
+++ b/src/routes/(main)/[workspaceSlug]/settings/credential/features/PersonalCredsSection/index.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
-import { Empty } from 'antd';
+import { Empty, Flexbox } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsx
index 13459eb09d7..6a903cf7aa6 100644
--- a/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsx
+++ b/src/routes/(main)/[workspaceSlug]/settings/credential/index.tsx
@@ -1,8 +1,7 @@
'use client';
-import { Block, Flexbox, Icon, Tooltip } from '@lobehub/ui';
+import { Block, Empty, Flexbox, Icon, Tooltip } from '@lobehub/ui';
import { Button, Tabs, Text } from '@lobehub/ui/base-ui';
-import { Empty } from 'antd';
import { createStaticStyles } from 'antd-style';
import { Plus, UserRoundIcon, UsersIcon } from 'lucide-react';
import { useMemo, useState } from 'react';
diff --git a/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx b/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx
index 036aec0eba3..573ab5769aa 100644
--- a/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx
+++ b/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx
@@ -2,14 +2,13 @@
import { InfoCircleOutlined } from '@ant-design/icons';
import { Flexbox } from '@lobehub/ui';
-import { Alert, Button, type ButtonProps, Text } from '@lobehub/ui/base-ui';
+import { Alert, Button, type ButtonProps, Spin, Text } from '@lobehub/ui/base-ui';
import { QRCode } from 'antd';
import { createStaticStyles } from 'antd-style';
import { QrCode, RefreshCw } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { agentBotProviderService } from '@/services/agentBotProvider';
const QR_CODE_SIZE = 220;
@@ -164,7 +163,7 @@ const QrCodeAuth = memo<QrCodeAuthProps>(
{t('channel.wechatGenerateQrCode')}
</Button>
)}
- {state.stage === 'loading' && <NeuralNetworkLoading size={48} />}
+ {state.stage === 'loading' && <Spin size="large" />}
{state.stage === 'ready' && <QRCode size={QR_CODE_SIZE} value={state.imageUrl} />}
{state.stage === 'error' && (
<Flexbox className={styles.error} gap={12}>
diff --git a/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx b/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx
index 6caacfcddeb..34b1fa2b7ac 100644
--- a/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx
+++ b/src/routes/(main)/agent/profile/features/ProfileEditor/CloudHeterogeneousConfig.tsx
@@ -3,8 +3,8 @@
import { type HeterogeneousProviderConfig, type UserCredSummary } from '@lobechat/types';
import { Github } from '@lobehub/icons';
import { Flexbox } from '@lobehub/ui';
-import { Avatar, Button, Select, Tag } from '@lobehub/ui/base-ui';
-import { Input, Spin, Typography } from 'antd';
+import { Avatar, Button, Select, Spin, Tag } from '@lobehub/ui/base-ui';
+import { Input, Typography } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { CheckCircle2, KeyRound, X } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsx b/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsx
index a8b2deb1d7b..c45227601a9 100644
--- a/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsx
+++ b/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsx
@@ -13,9 +13,9 @@ import type {
HeterogeneousProviderConfig,
} from '@lobechat/types';
import { CopyButton, Flexbox, Icon, Input, Tooltip, TooltipGroup } from '@lobehub/ui';
-import { ActionIcon, Button, Segmented, Select, Tag, Text } from '@lobehub/ui/base-ui';
+import { ActionIcon, Button, Segmented, Select, Spin, Tag, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { Loader2Icon, PencilLine, RefreshCw, XCircle } from 'lucide-react';
+import { PencilLine, RefreshCw, XCircle } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -567,7 +567,7 @@ const HeterogeneousAgentStatusCard = memo<HeterogeneousAgentStatusCardProps>(
if (detecting) {
return (
<Flexbox horizontal align="center" gap={8}>
- <Icon spin icon={Loader2Icon} size={16} style={{ opacity: 0.6 }} />
+ <Spin size="small" style={{ opacity: 0.6 }} />
<Text className={styles.metaText}>
{t('heterogeneousStatus.detecting', { name: displayName })}
</Text>
diff --git a/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx b/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx
index 6eddaaea221..9c9c1a64c08 100644
--- a/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx
+++ b/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx
@@ -2,8 +2,7 @@
import { ExclamationCircleOutlined, FolderOpenOutlined } from '@ant-design/icons';
import { FluentEmoji } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Button, Result, Text } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx b/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx
index 230e7efb8b8..a03d7f1229b 100644
--- a/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx
+++ b/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx
@@ -2,8 +2,7 @@
import { ExclamationCircleOutlined, FolderOpenOutlined } from '@ant-design/icons';
import { FluentEmoji } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
-import { Result } from 'antd';
+import { Button, Result, Text } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/user/features/UserAgentList.tsx b/src/routes/(main)/community/(detail)/user/features/UserAgentList.tsx
index 8e6b8cbcac1..94fad2293fa 100644
--- a/src/routes/(main)/community/(detail)/user/features/UserAgentList.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/UserAgentList.tsx
@@ -1,8 +1,7 @@
'use client';
import { Flexbox, Grid, SearchBar } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Pagination } from 'antd';
+import { Pagination, Tag, Text } from '@lobehub/ui/base-ui';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/user/features/UserGroupList.tsx b/src/routes/(main)/community/(detail)/user/features/UserGroupList.tsx
index af909fb8127..f245c09b562 100644
--- a/src/routes/(main)/community/(detail)/user/features/UserGroupList.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/UserGroupList.tsx
@@ -1,8 +1,7 @@
'use client';
import { Flexbox, Grid, SearchBar } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Pagination } from 'antd';
+import { Pagination, Tag, Text } from '@lobehub/ui/base-ui';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/user/features/UserPluginList.tsx b/src/routes/(main)/community/(detail)/user/features/UserPluginList.tsx
index 94997959a64..9b5a6e1bc4e 100644
--- a/src/routes/(main)/community/(detail)/user/features/UserPluginList.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/UserPluginList.tsx
@@ -1,8 +1,8 @@
'use client';
import { Flexbox, Grid } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Input, Pagination } from 'antd';
+import { Pagination, Tag, Text } from '@lobehub/ui/base-ui';
+import { Input } from 'antd';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/user/features/UserSkillList.tsx b/src/routes/(main)/community/(detail)/user/features/UserSkillList.tsx
index 2d67404d979..3daf0eab9ce 100644
--- a/src/routes/(main)/community/(detail)/user/features/UserSkillList.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/UserSkillList.tsx
@@ -1,8 +1,8 @@
'use client';
import { Flexbox, Grid } from '@lobehub/ui';
-import { Button, Tag, Text } from '@lobehub/ui/base-ui';
-import { Input, Pagination } from 'antd';
+import { Button, Pagination, Tag, Text } from '@lobehub/ui/base-ui';
+import { Input } from 'antd';
import { Plus } from 'lucide-react';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceAgentList.tsx b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceAgentList.tsx
index 805b9e07adc..ee4c273da0d 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceAgentList.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceAgentList.tsx
@@ -1,8 +1,8 @@
'use client';
import { Flexbox, Grid } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Input, Pagination } from 'antd';
+import { Pagination, Tag, Text } from '@lobehub/ui/base-ui';
+import { Input } from 'antd';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceGroupList.tsx b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceGroupList.tsx
index ccb61280745..deb29e59820 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceGroupList.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceGroupList.tsx
@@ -1,8 +1,8 @@
'use client';
import { Flexbox, Grid } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Input, Pagination } from 'antd';
+import { Pagination, Tag, Text } from '@lobehub/ui/base-ui';
+import { Input } from 'antd';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/workspace/features/WorkspacePluginList.tsx b/src/routes/(main)/community/(detail)/workspace/features/WorkspacePluginList.tsx
index 635afab1c08..eabb3e25393 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/WorkspacePluginList.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/WorkspacePluginList.tsx
@@ -1,8 +1,8 @@
'use client';
import { Flexbox, Grid } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Input, Pagination } from 'antd';
+import { Pagination, Tag, Text } from '@lobehub/ui/base-ui';
+import { Input } from 'antd';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx
index 1054983731f..cf74904dd6e 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx
@@ -2,11 +2,10 @@
import { OFFICIAL_URL } from '@lobechat/const';
import { Center, Flexbox, Icon, Input, TextArea, Tooltip } from '@lobehub/ui';
-import { Accordion, Button, Text, toast, useModalContext } from '@lobehub/ui/base-ui';
-import type { UploadProps } from 'antd';
-import { Form, Input as AntInput, Upload } from 'antd';
+import { Accordion, Button, Spin, Text, toast, Upload, useModalContext } from '@lobehub/ui/base-ui';
+import { Form, Input as AntInput } from 'antd';
import { cssVar } from 'antd-style';
-import { CircleHelp, Globe, ImagePlus, Loader2, Trash2 } from 'lucide-react';
+import { CircleHelp, Globe, ImagePlus, Trash2 } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -109,7 +108,7 @@ export const Content = memo<ContentProps>(({ user, onSuccess }) => {
}[namespaceAvailability];
return (
<Flexbox horizontal align="center" gap={6} style={{ color, fontSize: 12 }}>
- {namespaceAvailability === 'checking' && <Icon spin icon={Loader2} size={13} />}
+ {namespaceAvailability === 'checking' && <Spin size={13} />}
{t(`user.workspaceProfile.fields.namespace.${namespaceAvailability}` as any)}
</Flexbox>
);
@@ -142,13 +141,10 @@ export const Content = memo<ContentProps>(({ user, onSuccess }) => {
[t, uploadWithProgress],
);
- const handleBannerUpload: UploadProps['customRequest'] = useCallback(
- async (options: Parameters<NonNullable<UploadProps['customRequest']>>[0]) => {
- const file = options.file as File;
-
+ const handleBannerUpload = useCallback(
+ async (file: File) => {
if (file.size > MAX_FILE_SIZE) {
toast.error(t('user.workspaceProfile.errors.fileTooLarge'));
- options.onError?.(new Error('File too large'));
return;
}
@@ -157,18 +153,15 @@ export const Content = memo<ContentProps>(({ user, onSuccess }) => {
const result = await uploadWithProgress({ file });
if (!result?.url) {
toast.error(t('user.workspaceProfile.errors.uploadFailed'));
- options.onError?.(new Error('Upload failed'));
return;
}
const url = result.url.startsWith('/')
? `${window.location.origin}${result.url}`
: result.url;
setBannerUrl(url);
- options.onSuccess?.(result);
} catch (error) {
console.error('[WorkspaceProfileModal] Banner upload failed:', error);
toast.error(t('user.workspaceProfile.errors.uploadFailed'));
- options.onError?.(error as Error);
} finally {
setBannerUploading(false);
}
@@ -256,10 +249,9 @@ export const Content = memo<ContentProps>(({ user, onSuccess }) => {
<Flexbox gap={8} width="100%">
<Upload
accept="image/*"
- customRequest={handleBannerUpload}
maxCount={1}
- showUploadList={false}
style={{ display: 'block', width: '100%' }}
+ onFiles={([file]) => handleBannerUpload(file)}
>
<div
style={{
diff --git a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceSkillList.tsx b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceSkillList.tsx
index ebf6c5e1586..2d277d11a58 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceSkillList.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceSkillList.tsx
@@ -1,8 +1,8 @@
'use client';
import { Flexbox, Grid } from '@lobehub/ui';
-import { Tag, Text } from '@lobehub/ui/base-ui';
-import { Input, Pagination } from 'antd';
+import { Pagination, Tag, Text } from '@lobehub/ui/base-ui';
+import { Input } from 'antd';
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(list)/features/Pagination.tsx b/src/routes/(main)/community/(list)/features/Pagination.tsx
index 88e7939d5e2..e9cd95e8b80 100644
--- a/src/routes/(main)/community/(list)/features/Pagination.tsx
+++ b/src/routes/(main)/community/(list)/features/Pagination.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Pagination as Page } from 'antd';
-import { createStaticStyles, useResponsive } from 'antd-style';
+import { Pagination as Page } from '@lobehub/ui/base-ui';
+import { useResponsive } from 'antd-style';
import { memo } from 'react';
import { useLocation } from 'react-router';
@@ -12,24 +12,6 @@ import { type DiscoverTab } from '@/types/discover';
const SCROLL_CONTAINER_ID = 'lobe-mobile-scroll-container';
-const prefixCls = 'ant';
-
-const styles = createStaticStyles(({ css, cssVar }) => {
- return {
- page: css`
- .${prefixCls}-pagination-item-active {
- border-color: ${cssVar.colorFillSecondary};
- background: ${cssVar.colorFillSecondary};
-
- &:hover {
- border-color: ${cssVar.colorFill};
- background: ${cssVar.colorFill};
- }
- }
- `,
- };
-});
-
interface PaginationProps {
currentPage: number;
pageSize: number;
@@ -56,7 +38,6 @@ const Pagination = memo<PaginationProps>(({ tab, currentPage, total, pageSize })
return (
<Page
- className={styles.page}
current={page ? Number(page) : currentPage}
data-testid="pagination"
pageSize={pageSize}
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx
index 7c41a050696..b270fe644f5 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx
@@ -1,12 +1,11 @@
import { DropdownMenu, Flexbox } from '@lobehub/ui';
-import { ActionIcon, Button, confirmModal, Tag, toast } from '@lobehub/ui/base-ui';
+import { ActionIcon, Button, confirmModal, Spin, Tag, toast } from '@lobehub/ui/base-ui';
import { Card } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { ArrowRight, ChevronRight, Database, Ellipsis, Pencil, Play, Trash2 } from 'lucide-react';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import WorkspaceLink from '@/features/Workspace/WorkspaceLink';
import { agentEvalService } from '@/services/agentEval';
@@ -264,7 +263,7 @@ const DatasetCard = memo<DatasetCardProps>(
<div className={styles.expandedSection}>
{loading ? (
<Flexbox align="center" justify="center" style={{ padding: '48px 24px' }}>
- <NeuralNetworkLoading size={48} />
+ <Spin size="large" />
</Flexbox>
) : total === 0 ? (
<TestCaseEmptyState onAddCase={onAddCase} onImport={onImport} />
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
index fabc661be38..a250ce97e04 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
@@ -1,6 +1,6 @@
import { DropdownMenu, Flexbox, Input } from '@lobehub/ui';
-import { ActionIcon, Button, Text } from '@lobehub/ui/base-ui';
-import { Pagination, Table } from 'antd';
+import { ActionIcon, Button, Pagination, Text } from '@lobehub/ui/base-ui';
+import { Table } from 'antd';
import { type ColumnsType } from 'antd/es/table';
import { createStaticStyles, cssVar } from 'antd-style';
import { Ellipsis, ExternalLink, FileUp, Pencil, Plus, Search, Trash2 } from 'lucide-react';
@@ -425,7 +425,6 @@ const TestCaseTable = memo<TestCaseTableProps>(
style={{ paddingBlock: 12, paddingInline: 16 }}
>
<Pagination
- simple
current={pagination.current}
pageSize={pagination.pageSize}
size="small"
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx
index bab0691b27d..05128622436 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Checkbox, Tag } from '@lobehub/ui/base-ui';
-import { Badge, Table, Tooltip, Typography } from 'antd';
+import { Badge, Checkbox, Tag, Tooltip } from '@lobehub/ui/base-ui';
+import { Table, Typography } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { createStaticStyles, cssVar } from 'antd-style';
import { type FC, memo, useCallback, useEffect, useMemo, useState } from 'react';
@@ -100,11 +100,13 @@ const BatchResumeContent: FC<BatchResumeContentProps> = ({
key: 'select',
render: (_: any, record: ResumableCase) => (
<Tooltip title={record.canResume ? undefined : record.reason}>
- <Checkbox
- checked={selectedIds.includes(record.testCaseId)}
- disabled={!record.canResume}
- onChange={(checked) => handleToggleRow(record.testCaseId, checked)}
- />
+ <span style={{ display: 'inline-flex' }}>
+ <Checkbox
+ checked={selectedIds.includes(record.testCaseId)}
+ disabled={!record.canResume}
+ onChange={(checked) => handleToggleRow(record.testCaseId, checked)}
+ />
+ </span>
</Tooltip>
),
title: (
@@ -141,7 +143,9 @@ const BatchResumeContent: FC<BatchResumeContentProps> = ({
key: 'status',
render: (_: any, record: ResumableCase) => (
<Tooltip title={record.canResume ? undefined : record.reason}>
- <StatusLabel status={record.resumeStatus} />
+ <span style={{ display: 'inline-flex' }}>
+ <StatusLabel status={record.resumeStatus} />
+ </span>
</Tooltip>
),
title: t('table.columns.status'),
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx
index ed3e4c6c53e..904a896364a 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx
@@ -3,8 +3,8 @@
import type { EvalThreadResult } from '@lobechat/types';
import { formatCost, formatShortenNumber } from '@lobechat/utils';
import { Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, Select, Tag } from '@lobehub/ui/base-ui';
-import { Badge, Input, Table, Tooltip } from 'antd';
+import { ActionIcon, Badge, Select, Tag, Tooltip } from '@lobehub/ui/base-ui';
+import { Input, Table } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { createStaticStyles, cssVar } from 'antd-style';
import { Footprints, Play, RotateCcw } from 'lucide-react';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/Charts/ScatterPlot.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/Charts/ScatterPlot.tsx
index 0f7ced43631..560b3d7c534 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/Charts/ScatterPlot.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/Charts/ScatterPlot.tsx
@@ -2,8 +2,8 @@
import { formatCost, formatShortenNumber } from '@lobechat/utils';
import { Flexbox } from '@lobehub/ui';
-import { Tag } from '@lobehub/ui/base-ui';
-import { Divider, Tooltip } from 'antd';
+import { Tag, Tooltip } from '@lobehub/ui/base-ui';
+import { Divider } from 'antd';
import { createStaticStyles, cssVar, useTheme } from 'antd-style';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/index.tsx
index 5c629ab60fb..c5a0a195964 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/index.tsx
@@ -1,8 +1,7 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { Button, confirmModal, Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Button, confirmModal, Progress, Text } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Play, RotateCcw } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/routes/(main)/eval/features/DatasetImportModal/UploadStep.tsx b/src/routes/(main)/eval/features/DatasetImportModal/UploadStep.tsx
index c3bd5730084..d219cbfd3d2 100644
--- a/src/routes/(main)/eval/features/DatasetImportModal/UploadStep.tsx
+++ b/src/routes/(main)/eval/features/DatasetImportModal/UploadStep.tsx
@@ -2,8 +2,7 @@
import { type FileUploadState } from '@lobechat/types';
import { Center, Flexbox, Icon } from '@lobehub/ui';
-import { Tag } from '@lobehub/ui/base-ui';
-import { Progress, Upload } from 'antd';
+import { Progress, Tag, Upload } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { CloudUpload, ImportIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
@@ -12,8 +11,6 @@ import { useTranslation } from 'react-i18next';
import { type DatasetPreset } from '../../config/datasetPresets';
import { ROLE_COLORS } from './const';
-const { Dragger } = Upload;
-
const styles = createStaticStyles(({ css, cssVar }) => ({
// Preset summary panel — a single tonal card describing the chosen format.
container: css`
@@ -27,13 +24,11 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
`,
// Bold dropzone — the single primary action of this step.
dragger: css`
- .ant-upload-drag {
- border-radius: ${cssVar.borderRadiusLG};
- transition: border-color 0.15s ease;
+ border-radius: ${cssVar.borderRadiusLG};
+ transition: border-color 0.15s ease;
- @media (prefers-reduced-motion: reduce) {
- transition: none;
- }
+ @media (prefers-reduced-motion: reduce) {
+ transition: none;
}
`,
draggerContent: css`
@@ -191,16 +186,13 @@ const UploadStep = memo<UploadStepProps>(({ onFileSelect, loading, preset, uploa
</Flexbox>
)}
- <Dragger
+ <Upload
+ dragger
accept=".csv,.xlsx,.xls,.json,.jsonl"
className={styles.dragger}
disabled={loading}
maxCount={1}
- showUploadList={false}
- beforeUpload={(file) => {
- onFileSelect(file);
- return false;
- }}
+ onFiles={([file]) => onFileSelect(file)}
>
{loading ? (
<Center className={styles.draggerContent} gap={16}>
@@ -223,7 +215,7 @@ const UploadStep = memo<UploadStepProps>(({ onFileSelect, loading, preset, uploa
<p className={styles.hintText}>{t('dataset.import.upload.hint')}</p>
</Center>
)}
- </Dragger>
+ </Upload>
</Flexbox>
);
});
diff --git a/src/routes/(main)/group/_layout/Sidebar/Topic/index.tsx b/src/routes/(main)/group/_layout/Sidebar/Topic/index.tsx
index 2076a5c4cd5..9134157b37f 100644
--- a/src/routes/(main)/group/_layout/Sidebar/Topic/index.tsx
+++ b/src/routes/(main)/group/_layout/Sidebar/Topic/index.tsx
@@ -7,13 +7,13 @@ import {
AccordionPanel,
accordionStyles,
AccordionTrigger,
+ Spin,
Text,
} from '@lobehub/ui/base-ui';
import { cx } from 'antd-style';
import React, { memo, Suspense } from 'react';
import { useTranslation } from 'react-i18next';
-import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import { useFetchChatTopics } from '@/hooks/useFetchChatTopics';
import { useChatStore } from '@/store/chat';
@@ -43,7 +43,7 @@ const Topic = memo<TopicProps>(({ itemKey }) => {
<Text ellipsis fontSize={12} type={'secondary'} weight={500}>
{`${t('title')} ${topicCount > 0 ? topicCount : ''}`}
</Text>
- {isRevalidating && <NeuralNetworkLoading size={14} />}
+ {isRevalidating && <Spin size="small" />}
</Flexbox>
</AccordionTrigger>
<div
diff --git a/src/routes/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx b/src/routes/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx
index 5e960fbff8b..043c6bfd3e0 100644
--- a/src/routes/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx
+++ b/src/routes/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx
@@ -1,7 +1,7 @@
import { type MenuProps } from '@lobehub/ui';
import { Icon } from '@lobehub/ui';
-import { confirmModal, toast } from '@lobehub/ui/base-ui';
-import { App, Upload } from 'antd';
+import { confirmModal, toast, Upload } from '@lobehub/ui/base-ui';
+import { App } from 'antd';
import { css, cx } from 'antd-style';
import { Archive, Hash, Import, LucideCheck, Trash } from 'lucide-react';
import { useCallback, useMemo } from 'react';
@@ -120,7 +120,6 @@ export const useTopicActionsDropdownMenu = (
title: t('importError'),
});
}
- return false; // Prevent default upload behavior
},
[importTopic, modal, onUploadClose, t],
);
@@ -159,9 +158,8 @@ export const useTopicActionsDropdownMenu = (
label: (
<Upload
accept=".json"
- beforeUpload={handleImport}
disabled={!canCreateTopic}
- showUploadList={false}
+ onFiles={([file]) => handleImport(file)}
>
<div className={cx(hotArea)}>{t('actions.import')}</div>
</Upload>
diff --git a/src/routes/(main)/memory/contexts/features/ContextRightPanel.tsx b/src/routes/(main)/memory/contexts/features/ContextRightPanel.tsx
index a20f42ad765..7f3bdc400e9 100644
--- a/src/routes/(main)/memory/contexts/features/ContextRightPanel.tsx
+++ b/src/routes/(main)/memory/contexts/features/ContextRightPanel.tsx
@@ -1,8 +1,7 @@
'use client';
import { Center, Flexbox, Tooltip } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { Badge } from 'antd';
+import { Badge, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -52,13 +51,7 @@ const ContextRightPanel = memo(() => {
{context.title}
<Tooltip title={context.currentStatus}>
<Center flex={'none'} height={20} style={{ display: 'inline-flex' }} width={20}>
- <Badge
- status="processing"
- style={{ marginLeft: 8 }}
- styles={{
- indicator: { alignSelf: 'center', marginBottom: 4 },
- }}
- />
+ <Badge status="processing" style={{ marginLeft: 8 }} />
</Center>
</Tooltip>
</Text>
diff --git a/src/routes/(main)/memory/features/MemoryAnalysis/Status.tsx b/src/routes/(main)/memory/features/MemoryAnalysis/Status.tsx
index 8b4b21bdca5..dc781ecd0f2 100644
--- a/src/routes/(main)/memory/features/MemoryAnalysis/Status.tsx
+++ b/src/routes/(main)/memory/features/MemoryAnalysis/Status.tsx
@@ -2,8 +2,7 @@
import { AsyncTaskStatus } from '@lobechat/types';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Alert, Text } from '@lobehub/ui/base-ui';
-import { Progress } from 'antd';
+import { Alert, Progress, Text } from '@lobehub/ui/base-ui';
import { Loader2Icon, TriangleAlertIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -58,10 +57,15 @@ export const MemoryAnalysisStatus = memo<StatusProps>(({ task }) => {
<Flexbox horizontal align="center" gap={12} wrap="wrap">
<Progress
percent={percent ?? 30}
- showInfo={Boolean(percent)}
+ showInfo={false}
status={isError ? 'exception' : 'active'}
style={{ flex: 1, minWidth: 220 }}
/>
+ {percent !== undefined && !isError && (
+ <Text fontSize={13} type="secondary">
+ {percent}%
+ </Text>
+ )}
<Text fontSize={13} type={isError ? 'danger' : 'secondary'}>
{isError ? (errorText ?? t('analysis.status.errorTitle')) : progressText}
</Text>
diff --git a/src/routes/(main)/memory/features/ProgressIcon.tsx b/src/routes/(main)/memory/features/ProgressIcon.tsx
index e840c3de863..0aab87d19ea 100644
--- a/src/routes/(main)/memory/features/ProgressIcon.tsx
+++ b/src/routes/(main)/memory/features/ProgressIcon.tsx
@@ -1,7 +1,6 @@
import { Flexbox, Tooltip } from '@lobehub/ui';
-import { Text } from '@lobehub/ui/base-ui';
-import { type ProgressProps } from 'antd';
-import { Progress } from 'antd';
+import type { ProgressProps } from '@lobehub/ui/base-ui';
+import { Progress, Text } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { memo } from 'react';
@@ -16,9 +15,11 @@ const ProgressIcon = memo<ProgressIconProps>(({ showInfo, format, percent, ...re
<Progress
format={format}
percent={percent}
+ segments={5}
showInfo={false}
- size={[2, 12]}
- steps={5}
+ size={12}
+ style={{ flex: 'none', width: 18 }}
+ variant="segments"
{...rest}
/>
);