Commit Graph

184 Commits

Author SHA1 Message Date
SuYao
bd87e9a6cb feat(provider-registry): generate catalog from src/creators + src/providers, add TokenHub (#16401)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-07-03 13:01:36 +08:00
jd
2f53df5227 fix(code-block-view): auto-scroll streaming code blocks (#16673)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-07-02 19:53:20 +08:00
Pleasure1234
761f5386f6 feat(provider-registry): add OpenCode Go provider (#16618)
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-07-02 15:43:12 +08:00
亢奋猫
03ab285431 fix(agent-page): lazy load artifact file tree (#16577)
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-07-01 19:16:17 +08:00
beyondkmp
4112ff3a2c fix(switch): use valid svg dimensions for thumb icon (#16592)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: beyondkmp <beyondkmp@gmail.com>
2026-06-30 20:14:42 +08:00
Asurada
00298533a4 feat(websearch): add firecrawl web search provider (#16344)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: ousugo <dkzyxh@gmail.com>
2026-06-30 20:14:17 +08:00
Gu JiaMing
c993719569 fix(page-side-panel): scope portal via usePortalContainer, drop the root marker (#16555)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-30 20:06:57 +08:00
亢奋猫
366ecf63da refactor(provider): remove tokenflux providers (#16518)
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-30 19:52:35 +08:00
jd
090f9a43e9 fix(sortable): require primary pointer activation (#16574)
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-06-29 22:51:56 +08:00
jd
21e0e04abc feat(resource-dialogs): stepped create wizard for assistants and agents (#16496)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-06-29 18:25:15 +08:00
SuYao
af69f8cc43 fix(paintings): use motion react import (#16545)
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-29 13:19:09 +08:00
SuYao
611944599f refactor(deps): replace lodash with es-toolkit/compat and drop it (#16528)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-29 12:28:57 +08:00
亢奋猫
eb2622e9af refactor(ui): remove antd dependency (#16336)
Co-authored-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-26 15:49:22 +08:00
Pleasure1234
ca133e33b1 fix: correct minor bugs across image-preview, provider-config, mini-apps, painting, notes, and selector (#16343)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-06-24 23:02:01 +08:00
Gu JiaMing
5543521730 fix(page-side-panel): scope non-mac app shell portal (#16074)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Pleasurecruise <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-22 21:12:40 +08:00
亢奋猫
7592d31ca4 refactor(ui-markdown): simplify markdown imports (#16228)
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-20 21:46:08 +08:00
fullex
1c6ff30a18 refactor(shared): dissolve config/ and move logic out of types/ into utils/
Dissolve the by-kind @shared/config junk drawer per shared-layer governance: route each member by shape and actual consumer process — cross-process slices into types//utils//ai/, single-process code back into main/renderer (Invariant 1.1). Confirm each item's real consumer process rather than trusting the directional plan (API_SERVER_DEFAULTS is renderer-only, MIN_WINDOW_* is cross-process, providers.ts is renderer-only), and drop dead consts (ZOOM_LEVELS/ZOOM_OPTIONS, bookExts, thirdPartyApplicationExts).

Purge runtime logic from types/ so the bucket holds only declarations: move serializeError + AI-SDK error guards to utils/error.ts, the FileHandle factories/guards to utils/file/handle.ts, isSerializable + SerializableSchema to utils/serializable.ts, and the tab-instance guard/normalizer to utils/tabInstanceMetadata.ts. Tests follow the logic to utils/__tests__; the type-level ipc contract test is retired (its invariants kept as a breadcrumb for the future IpcApi Zod schema). types/ is now logic-free and test-free.

Also: remove the dead @shared mock from the packages/ui code-editor test so packages/ui no longer references production code; fix the data-classify preference generator prompts import and the update-languages output path to the relocated modules.

Update shared-layer-architecture (3.1 type/util test rule, 5/6 config dissolution) and renderer-architecture cross-references.
2026-06-19 20:41:18 -07:00
Gu JiaMing
1b966cab67 feat(ui): add required-field marker and accessible provider validation (#16046)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Pleasurecruise <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-06-18 23:59:21 +08:00
Gu JiaMing
10a5939e60 fix(emoji-avatar): align sidebar background and support emoji sequences (#16077)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: 顾家铭 <gujiaming@gujiamingdeMacBook-Pro.local>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-18 23:58:54 +08:00
亢奋猫
9749358af9 feat(renderer-components): split shared list, tree, icons, markdown & code components (#16026)
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-18 18:01:52 +08:00
Pleasure1234
1714004f83 feat(code-cli): replace discontinued iFlow CLI with Qoder CLI (#16119)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: Pleasurecruise <3196812536@qq.com>
2026-06-18 16:10:13 +08:00
Gu JiaMing
d6f2a3300b style(settings-ui): polish small UI regressions (#16076)
Co-authored-by: Pleasurecruise <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Signed-off-by: pleasure1234 <pleasure1234@users.noreply.github.com>
2026-06-17 16:36:12 +08:00
Gu JiaMing
2035c9e3a1 fix(provider-avatar): correct avatar lifecycle, cropping, and image-storage error surfacing (#16075)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Pleasurecruise <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-17 16:29:40 +08:00
亢奋猫
2e3520678c feat(ui): add shared markdown, tree view, and portal primitives (#16020)
Co-authored-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-17 13:26:53 +08:00
Gu JiaMing
9c09e52ddd feat(provider-list): drag provider groups as a single unit (#15743)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: Pleasure1234 <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-12 18:48:34 +08:00
亢奋猫
f408d448b6 refactor(settings): polish provider, file processing, and MCP settings UI (#15790)
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
2026-06-11 10:18:18 +08:00
SuYao
b8f1feb4f8 feat(command): introduce command system, consolidating shortcut & app-menu handling (#15699)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-05 23:24:34 +08:00
SuYao
5706307451 refactor(ai-service): consolidate AI runtime to main process (#14911)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-05 00:06:51 +08:00
Yiran
e8b43bb3a3 refactor(settings): align provider settings UI with design system (#15515)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
2026-06-02 21:38:00 +08:00
Yiran
2a602f7c7b fix(icons): use currentColor for GitHub Copilot and OpenCode logos (#15525)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
2026-06-02 21:28:07 +08:00
Asurada
22b0aaf2d0 fix(ui): correct provider and model provider logo mappings (#15563)
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-06-02 18:19:43 +08:00
Yiran
61c013bd5b feat(knowledge-base): redesign knowledge workspace (#15518)
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: 槑囿脑袋 <70054568+eeee0717@users.noreply.github.com>
Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
Signed-off-by: eeee0717 <chentao020717Work@outlook.com>
2026-06-02 16:03:37 +08:00
亢奋猫
26508591f8 refactor(paintings): migrate to v2 data layer and UI (#15154)
Co-authored-by: jidan745le <420511176@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-06-02 15:18:53 +08:00
fullex
53a3577389 refactor(renderer): flatten src/renderer/src to src/renderer
Move all renderer source from src/renderer/src/* up one level to
src/renderer/*, removing the redundant nested src directory.

- Update path aliases (@renderer, @types, @logger, @data) and TanStack
  Router paths in electron.vite.config.ts; update tsconfig.{json,web,node}
  path mappings and include globs.
- Fix Vite root-relative script paths in the 8 renderer HTML entries.
- Update cross-process relative imports in main/preload (language,
  apiServer models, preload index) to drop the /src segment.
- Switch renderer test imports of the logger mock to the @test-mocks alias.
- Update hardcoded renderer paths in scripts and their fixtures, lint
  configs (eslint/oxlint/biome), CODEOWNERS, docs, and the data-classify tool.
- Convert deep (../../+) relative imports within the renderer to the
  @renderer alias (69 files, 108 imports); keep single-level relatives.
- Fix doc links broken by the move and correct one pre-existing broken
  link in naming-conventions.md.
2026-05-28 21:40:20 -07:00
Yiran
955a8384d9 feat(settings): redesign settings navigation (#15263)
### What this PR does

Before this PR:

- The settings page sidebar used local inline className strings, not
shared across the 10+ settings sub-pages.
- `ProviderList` rendered its header with bespoke
`ProviderListHeaderBar` + `ProviderListHeaderTitle` components instead
of a shared `PageHeader`.
- The 10+ settings sub-pages each owned their own header layout.
- The standalone settings window was hard-coded to 220px sidebar width
with no "sized to the main window" rule.
- `t('settings.mcp.title')` referenced a key path that didn't match the
actual entry in i18n locales.

After this PR:

- Settings submenu styling consolidated into four shared tokens in
`src/renderer/src/pages/settings/index.tsx`
(`settingsSubmenuListClassName`, `settingsSubmenuItemClassName`,
`settingsSubmenuItemLabelClassName`,
`settingsSubmenuSectionTitleClassName`).
- `ProviderList` header now composes the shared `PageHeader` + search
field with trailing add button; `ProviderListHeaderBar` and
`ProviderListHeaderTitle` deleted.
- All settings sub-pages migrated to the same `PageHeader + Scrollbar +
MenuList` shape (Channels, Common, Data, FileProcessing, Integration,
MCP, ProviderList, Shortcut, Tasks, WebSearch).
- Standalone settings window is now sized to 80% of the main window with
a hard 760×560 floor, centered on the main window
(`SettingsWindowService`); `--settings-width` for the standalone shell
tightened from 220px to 200px.
- Corrected `t('settings.mcp.title')` →
`t('agent.settings.toolsMcp.mcp.tab')`.

Fixes # N/A

### Why we need it and why it was done in this way

The following tradeoffs were made:

- This PR includes shared UI component additions / updates because the
settings redesign needs a reusable `PageHeader`, a `labelClassName` prop
on `MenuItem`, and a refined compact-menu `Popover` template. Keeping
them together with the settings consumers makes the design change easier
to review end to end.
- The shared component changes are intentionally visual / API-additive
(one new component, one new prop, one tightened default border width,
one new compact-menu sizing template) and do not change behavior
contracts for non-settings callers.
- `MenuItem` default visuals (`text-sm`, `py-1.5`, `font-normal`) match
what `DESIGN.md` already documents; the previous defaults
(`text-[13px]`, `py-1.25`, `font-medium`) had been out of sync with the
spec. This PR brings the implementation back in line with the spec
rather than introducing new defaults.

The following alternatives were considered:

- Keeping the settings styling inside each sub-page was rejected because
the same token strings already appeared at multiple call sites;
extracting them to `settings/index.tsx` removes the duplication.
- Splitting the shared UI updates (`PageHeader`,
`MenuItem.labelClassName`, `Popover` hairline / compact width) into a
separate PR is possible, but keeping them together makes the settings
design change easier to review end to end.
- Extracting a `SidebarHeader / SidebarSection / SidebarSectionTitle /
SidebarMenuItem` family into `@cherrystudio/ui` was deferred because
only ~1.5 pages share the exact "grouped icon-prefixed nav" pattern
today (Settings, partly FilesPage). The `DESIGN.md` Sidebar section is
softened from a "hard rule" to a "target rule" so the spec no longer
contradicts the shipping implementation.

Links to places where the discussion took place: N/A

### Breaking changes

None.

`MenuItem` default visuals change slightly (`font-medium` →
`font-normal`, `py-1.25` → `py-1.5`, `text-[13px]` → `text-sm`). The
previous defaults had been out of sync with what `DESIGN.md` already
documents; this PR brings them back in line with the spec, so call sites
that didn't opt out of the default now render closer to the documented
design.

### Special notes for your reviewer

- Target branch is `v2`.
- New shared UI in `@cherrystudio/ui`:
- `PageHeader` is newly added
(`packages/ui/src/components/composites/PageHeader/`) with its own
stories and tests.
- `MenuItem` gains a `labelClassName` prop so callers can style the
label span directly (e.g. `group-data-[active=true]:font-medium` for
bold-on-active). This removes a previous `[font-weight:inherit]`
CSS-inheritance hack; the existing test was rewritten to validate the
new contract.
- `Popover` default border tightened from 1px to 0.5px hairline,
matching the `DESIGN.md` Popover surface rule.
- Compact menu popovers now use `w-fit min-w-32` instead of a hard-coded
`w-40` so width follows content with a 128px floor (aligned with
`ContextMenu`'s existing `min-w-[8rem]`).
- `DESIGN.md` updates: new "Settings Panel Layout" subsection under
Layout Principles; new "Search field with trailing action" entry under
Inputs; Window Chrome gets a "Settings window sizing" rule; Popover and
compact-menu rules updated; Sidebar section softened to a "target rule".
- `ProcessorAvatar` (`FileProcessingSettings/components/`) switched its
`size` prop from `'sm' | 'lg'` to `size: number` plus an optional
`className`. This is a co-located change driven by the settings menu's
need for a 22px avatar (neither old enum value supported it). The old
`'lg'` (36px) had no remaining callers.
- i18n locales: added `settings.mcp.allServers` and
`settings.mcp.shortTitle`; removed unused
`settings.integrations.groups.notes`. All three master locales (en-us,
zh-cn, zh-tw) and nine translate locales are in sync.
- Targeted verification was run before commit:
- `pnpm build:check` (oxlint + eslint + typecheck + i18n check + format
check + full vitest — 9439 tests across 666 files, all passing).
- Follow-ups (intentionally out of scope):
- Extract `SidebarHeader / SidebarSection / SidebarSectionTitle /
SidebarMenuItem` once a third page (Library or Knowledge) adopts the
same pattern.
- `SettingsWindowService` already gracefully degrades when the main
window is missing; an explicit test for that case can be added.

### Checklist

This checklist is not enforcing, but it's a reminder of items that could
be relevant to every PR.
Approvers are expected to review this list.

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [x] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others

### Release note

```release-note
Refreshes the settings page navigation, unifies the ProviderList header with the shared PageHeader, and refines compact popover menus.
```

---------

Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
2026-05-27 16:53:21 +08:00
Yiran
b16815f5ac feat(translate): refresh translate page and shared drawer composition (#15265)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
2026-05-25 17:45:25 +08:00
fullex
4a8c548ece refactor(ui): normalize all packages/ui paths to kebab-case
Migrate 310 paths to kebab-case per docs/references/naming-conventions.md
§4.5, aligning packages/ui with shadcn convention (all primitives,
composites, icons, hooks, stories use kebab-case file/directory names;
exported identifiers stay PascalCase/camelCase).

Generator fixes:
- scripts/svg-utils.ts: drop toCamelCase, preserve kebab basename from
  source SVG filenames
- scripts/generate-icons.ts: fix flat-icon types import path
  (../types not ../../types)
- scripts/codegen.ts: quote catalog keys containing dashes

Path renames:
- 5 primitive camelCase files (copyButton, customTag, etc.)
- ErrorBoundary -> error-boundary
- 24 composite directories (CodeEditor, ImagePreview, etc.) and 35
  internal PascalCase .tsx files (incl. 12 test files); Input directory
  renamed to composite-input to align with CompositeInput export
- 12 + 21 + 12 = 45 icon paths regenerated from kebab source SVGs
- 2 hook files (useDndReorder, useDndState) and 2 composite hooks
  (useDraggableReorder, useImagePreviewTransform)
- 1 utility (reorderVisibleSubset) and its co-located test
- 68 Storybook story files matching their source components

Barrel completeness:
- packages/ui/src/components/index.ts now re-exports CustomTagProps,
  letting the 2 external consumers drop their deep-imports

Docs:
- packages/ui/README.md: add Naming Conventions section linking to
  docs/references/naming-conventions.md
- packages/ui/docs/migration-plan.md: update examples to kebab paths
- docs/references/naming-conventions.md §3.2: note packages/ui hooks
  use kebab-case per §4.5
2026-05-22 04:47:32 -07:00
Yiran
6a3fa17053 feat(mini-apps): refresh mini app page and icons (#15205)
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-05-21 11:35:04 +08:00
Yiran
ff594adc84 feat(icons): light/dark dual-source architecture for provider/model logos (#15087)
Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
2026-05-18 13:44:22 +08:00
Yiran
d1c60e7f3e refactor(ui): refresh shared dialog styling (#15091)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
Signed-off-by: Yiran <269086835+Cherry-Yiran@users.noreply.github.com>
2026-05-18 13:43:25 +08:00
jidan745le
e59c7aa7f7 refactor(provider-settings): migrate to v2 data layer and UI (#14631)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: suyao <sy20010504@gmail.com>
2026-05-14 17:01:33 +08:00
jd
ea1dc026cd refactor(translate): rebuild translate page on @cherrystudio/ui (#14351)
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: jdzhang <625013594@qq.com>
Fixes #14339
2026-05-11 13:57:25 +08:00
SuYao
ebc609a1dd feat: context menu (#12060)
### What this PR does

**Before this PR:**

- Right-click menus across the renderer were built with antd's
`Dropdown` (`trigger={['contextMenu']}`) plus an ad-hoc bespoke menu
(`src/renderer/src/components/layout/TabContextMenu.tsx`) for the
AppShell tab bar. There was no shared design-system primitive; styling,
sub-menu support, and `asChild` ergonomics were inconsistent.
- The selection-aware copy/quote wrapper lived at
`src/renderer/src/components/ContextMenu/index.tsx` under a generic name
that suggested it was the canonical context menu (it wasn't — it was
specifically for text selection).

**After this PR:**

- New Radix-based `ContextMenu` primitive lives at
`packages/ui/src/components/primitives/context-menu.tsx`, with the
supporting `ContextMenuItemContent` helper, a new `--cs-menu-item-hover`
design token, and a primitive-level unit test
(`packages/ui/src/components/primitives/__tests__/context-menu.test.tsx`).
- 16 renderer call sites migrated to the new primitive (chat tabs,
topics, agent sessions, attachments, notes, mini-apps, image viewer, SVG
renderer, inputbar tools, citations, messages, skills settings,
assistant items, agent items, assistant preset cards, YAML front
matter).
- `TabContextMenu.tsx` deleted; the old selection wrapper renamed to
`SelectionContextMenu.tsx` and its behavior tightened (see Breaking
changes).
- Async `onSelect` handlers now wrap their work in `try/catch + logger +
toast` so user-visible operations like LLM auto-rename,
save-to-knowledge, and export to Notion/Yuque/etc no longer fail
silently.

Fixes #

### Why we need it and why it was done in this way

`@cherrystudio/ui` is now the v2 design-system home; every other
primitive (Tooltip, Combobox, Toast, TreeSelect, …) has moved here.
Right-click menus were the largest remaining surface still bound to
antd's `Dropdown`. Picking Radix as the backend is consistent with the
rest of the primitive library; building our own `ContextMenuItemContent`
helper keeps the call-site noise low for the common `icon + label +
shortcut/submenu chevron` shape.

The following tradeoffs were made:

- The click-triggered "more actions" Dropdowns in `AssistantItem` /
`AgentItem` / `AssistantPresetCard` / `YamlFrontMatterNodeView` still
use `antd Dropdown` for now — `@cherrystudio/ui` ships `ContextMenu` and
`SelectDropdown` but no click-driven `DropdownMenu` yet. Tracked as
#14994. Acceptable as a follow-up because the migration boundary is at
the right-click surface for this PR.
- `KnowledgePage` / `KnowledgeUrls` / `SkillsSettings` were
intentionally left untouched per @kangfenmao to avoid conflicting with
the knowledge-base PR (#14734). They'll be migrated once that lands.
- For the menu focus-state contrast I originally bumped
`--cs-background-subtle`, but the token leaks into ~44 unrelated
consumers. Reverted and replaced with a dedicated `--cs-menu-item-hover`
token.

The following alternatives were considered:

- Pinning down a click-driven antd shim around the new `ContextMenu` to
handle both triggers in a single tree — rejected; it would have meant
inverting the migration goal (less antd, not more).
- Putting all menu hover styling under one bumped subtle background —
rejected after review; the dedicated `--cs-menu-item-hover` token keeps
the change surgical.

Links to places where the discussion took place:
https://github.com/CherryHQ/cherry-studio/pull/12060#pullrequestreview-4260670092

### Breaking changes

Renamed `ContextMenu` (the selection-aware copy/quote wrapper) to
`SelectionContextMenu`. User-visible behavior change: right-clicking
inside chat messages, citations, and agent session messages now always
shows the menu with disabled items when no text is selected (was: menu
suppressed entirely). Once a selection exists the actions behave
identically to v1. Logged in
`v2-refactor-temp/docs/breaking-changes/2026-05-11-message-right-click-menu-discoverable-when-no-selection.md`.

### Special notes for your reviewer

- The reviewer correctly flagged a regression class where the f2d8db5f7
fix landed mid-PR (drag handler/style getting clobbered when `{...rest}`
was spread after them). The new primitive-level test guards that pattern
at the boundary (asChild forwarding of `onClick` / `onPointerDown` +
`onSelect` semantics).
- macOS transparent-window `z-50` behavior on the tab right-click menu —
I tested locally via the dev build; Radix portals to body and the menu
rides above the title-bar drag region. Worth a focused manual
verification on review.
- Knowledge-base files (`KnowledgePage.tsx`, `KnowledgeUrls.tsx`,
`SkillsSettings.tsx`) were reset to `origin/v2` baseline per @kangfenmao
— see commit `68cbb648d`.

### Checklist

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [x] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code before requesting review
from others

### Release note

```release-note
NONE
```

---------

Signed-off-by: suyao <sy20010504@gmail.com>
Co-authored-by: MyPrototypeWhat <daoquqiexing@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:21:48 +08:00
jd
3c200793cb feat(library): add v2 resource library page with assistant tag & search APIs (#14442)
<!-- Template from
https://github.com/kubevirt/kubevirt/blob/main/.github/PULL_REQUEST_TEMPLATE.md?-->

### What this PR does

This PR adds the new v2 **Resource Library** page at `/app/library` as a
unified management entry point for **Assistants, Agents, and Skills**.

The page provides a shared navigation and interaction shell, but
resource data is loaded per active resource tab. Assistants, Agents, and
Skills each keep their own adapter/query path and backend ownership
boundary; there is no aggregated cross-resource list endpoint in this
PR.

**Scope by resource**

- **Assistant** — when the Assistant tab is active, the library uses the
Assistant DataApi list/create/duplicate/update/delete paths. Assistant
reads include embedded `tags` and `modelName`, and Assistant list
supports `search` and `tagIds` filtering.
- **Agent** — when the Agent tab is active, the library uses the Agent
DataApi list/create/update/delete paths and the Agent editor for
configuration. Agent list supports the resource-library search/tag
filter shape through the Agent DataApi.
- **Skill** — when the Skill tab is active, the library uses Skill
list/detail/import/uninstall flows. Filesystem-affecting operations stay
on the existing skill IPC service, while tag binding and list filtering
use the v2 tag/skill API paths.

Before this PR:

- Assistant, Agent, and Skill management lived in separate product
surfaces.
- There was no shared v2 Resource Library entry point for browsing these
resource types through one navigation model.
- Resource search and tag filtering were not exposed through a
tab-scoped Resource Library UI.
- Assistant list reads did not embed tag metadata or model display names
for the library cards.

After this PR:

- `/app/library` provides a shared Resource Library shell with
resource-specific tabs.
- Switching tabs changes which resource adapter/query path is active; no
cross-resource aggregate query is introduced.
- Assistant, Agent, and Skill lists can be searched and filtered by tags
within their active tab.
- Assistant reads embed `tags[]` and `modelName`, and Assistant
create/update accepts optional `tagIds` for tag binding.
- Agent configuration can be created and edited from the library editor
flow.
- Skill detail, import/install, uninstall, file preview, and tag binding
are available from the library page.
- The library keeps the current v2 `useDataApi.refetch` contract as a
revalidation/cache helper; this PR does not turn `refetch` into an
imperative data-read API.

<!-- (optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)`
format, will close the issue(s) when PR gets merged)*: -->

Fixes #

### Why we need it and why it was done in this way

The v2 Resource Library is intended to replace fragmented
resource-management entry points with one consistent place to browse and
manage Assistants, Agents, and Skills while keeping each resource type's
data ownership intact.

The implementation keeps the Resource Library as a shared UI surface
while keeping reads and writes resource-scoped. Switching tabs changes
which resource adapter/query path is active, so each resource type keeps
its own backend contract instead of introducing a new aggregated query
layer.

The following tradeoffs were made:

- **Shared shell, resource-scoped data**: the UI frame is shared, but
Assistant, Agent, and Skill keep separate adapters and backend paths.
- **No aggregate Resource Library endpoint**: the page does not
introduce a cross-resource list API. This avoids a new orchestration
layer and keeps pagination/filtering behavior owned by each resource
service.
- **Tag filtering uses OR semantics**: matching any selected tag is
enough for inclusion. AND semantics can be added later as a separate
query shape if needed.
- **Filesystem work stays outside DataApi**: Skill install/uninstall
still use the skill IPC service because those operations touch local
directories, archives, repositories, and symlinks.
- **`refetch` remains a revalidation trigger**: direct cache control or
imperative reads should continue to use SWR/DataApi `mutate` or explicit
requests rather than relying on `refetch` return values.

The following alternatives were considered:

- A single aggregated `/library/resources` style endpoint — rejected
because it would duplicate resource-specific filtering logic and blur
service ownership.
- Client-only filtering across all resource types — rejected because
search/tag filtering should use the resource service's current query
contract where available.
- Moving Skill install/uninstall into DataApi — rejected because
filesystem mutation is outside the SQLite-backed DataApi boundary.

Links to places where the discussion took place: N/A

### Breaking changes

None.

The API/schema changes are additive:

- Assistant responses include embedded `tags` and `modelName`.
- Assistant create/update accepts optional `tagIds`.
- Resource list paths support tab-scoped search/tag filtering where
applicable.

Existing callers that do not use the new fields or query params should
continue to work.

### Special notes for your reviewer

Base branch is `v2`. This PR is still a draft while review feedback is
being addressed.

Suggested review entry points:

- Renderer library shell:
`src/renderer/src/pages/library/LibraryPage.tsx`
- Resource list/grid: `src/renderer/src/pages/library/list/`
- Assistant adapter/editor:
`src/renderer/src/pages/library/adapters/assistantAdapter.ts`,
`src/renderer/src/pages/library/editor/assistant/`
- Agent adapter/editor:
`src/renderer/src/pages/library/adapters/agentAdapter.ts`,
`src/renderer/src/pages/library/editor/agent/`
- Skill adapter/detail/import:
`src/renderer/src/pages/library/adapters/skillAdapter.ts`,
`src/renderer/src/pages/library/detail/skill/`,
`src/renderer/src/pages/library/list/ImportSkillDialog.tsx`
- Backend services: `AssistantService`, `AgentService`, `TagService`,
and skill service integration paths.

Known follow-ups:

1. Continue UI polish on Resource Library spacing and detail/editor
interactions.
2. Continue component-level i18n cleanup for any remaining literals
found during review.
3. Keep model-picker related v2 LLM migration work separate from this PR
unless required by this library flow.

### Checklist

This checklist is not enforcing, but it's a reminder of items that could
be relevant to every PR.
Approvers are expected to review this list.

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [x] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others

### Release note

<!--  Write your release note:
1. Enter your extended release note in the below block. If the PR
requires additional action from users switching to the new release,
include the string "action required".
2. If no release note is required, just write "NONE".
3. Only include user-facing changes (new features, bug fixes visible to
users, UI changes, behavior changes). For CI, maintenance, internal
refactoring, build tooling, or other non-user-facing work, write "NONE".
-->

```release-note
Add a new v2 Resource Library page under /app/library for managing Assistants, Agents, and Skills through resource-specific tabs, with search, tag filtering, editors/details, assistant import/export, and skill import/uninstall flows.
```

---------

Signed-off-by: jdzhang <625013594@qq.com>
Signed-off-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-05-10 20:14:45 +08:00
jd
64d6c84535 refactor(renderer-components): replace legacy antd and styled UI usage (#14940)
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-05-09 23:10:23 +08:00
亢奋猫
0b4b2a3c64 Migrate OpenClaw page to v2 data storage (#14941)
<!-- Template from
https://github.com/kubevirt/kubevirt/blob/main/.github/PULL_REQUEST_TEMPLATE.md?-->
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. Consider creating this PR as draft:
https://github.com/CherryHQ/cherry-studio/blob/main/CONTRIBUTING.md
-->

<!--

🚨 Branch Strategy Change (Effective April 3, 2026) 🚨

The `main` branch is now under CODE FREEZE.

- main branch: Only accepts critical bug fixes via `hotfix/*` branches.
Fix PRs must be minimal in scope and must not include any refactoring
code.
- v2 branch: All new features, refactoring, and optimizations should be
submitted to the `v2` branch.

If you are submitting a bug fix to main, please ensure your PR is from a
`hotfix/*` branch.

-->

### What this PR does

Before this PR:
OpenClaw page state still depended on the legacy Redux slice for gateway
status, selected model, health checks, and port values, and the
LaunchPad OpenClaw entry navigated to a route that returned 404.

After this PR:
OpenClaw user preferences are stored in Preference, runtime gateway
snapshots are stored in Shared Cache, legacy selected model JSON is
migrated to `provider::model`, the page uses `@cherrystudio/ui`/Tailwind
instead of Antd, and LaunchPad opens `/app/openclaw`.

<!-- (optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)`
format, will close the issue(s) when PR gets merged)*: -->

Fixes #

N/A

### Why we need it and why it was done in this way

The following tradeoffs were made:
The Redux slice itself is left untouched; only the OpenClaw page
boundary and v2 migration mapping move data into Preference/Shared
Cache.

The following alternatives were considered:
A generated simple mapping was avoided because the selected model
requires JSON-to-UniqueModelId conversion, and runtime compatibility
reads from old Redux were avoided to keep the v2 migration one-way.

Links to places where the discussion took place: N/A

### Breaking changes

<!-- optional -->

If this PR introduces breaking changes, please describe the changes and
the impact on users.

None.

### Special notes for your reviewer

<!-- optional -->

Validation run locally: `pnpm format`, `pnpm lint`, `pnpm test`, and
`pnpm build:check`.

### Checklist

This checklist is not enforcing, but it's a reminder of items that could
be relevant to every PR.
Approvers are expected to review this list.

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [x] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others

### Release note

<!--  Write your release note:
1. Enter your extended release note in the below block. If the PR
requires additional action from users switching to the new release,
include the string "action required".
2. If no release note is required, just write "NONE".
3. Only include user-facing changes (new features, bug fixes visible to
users, UI changes, behavior changes). For CI, maintenance, internal
refactoring, build tooling, or other non-user-facing work, write "NONE".
-->

```release-note
OpenClaw now uses v2 Preference/Shared Cache storage and the LaunchPad OpenClaw shortcut opens the correct page.
```

---------

Signed-off-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
2026-05-08 22:48:45 +08:00
亢奋猫
dee3bb0928 feat(settings): refactor settings UI and add settings window (#14567)
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: jdzhang <625013594@qq.com>
Co-authored-by: jdzhang <625013594@qq.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-05-08 18:09:26 +08:00
SuYao
7a740aa44c fix(draggable-list): bind scroll node via callback ref (#14632)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 20:59:34 +08:00
jd
21e448ff26 feat(selector-v2): assistant & agent selectors on the EntitySelector composite (#14556)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-04-30 12:11:13 +08:00
jd
2456dbdf96 feat(model-selector-v2): build v2 model selector on new data/UI stack (#14490)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Fixes #14483
2026-04-27 16:33:29 +08:00