Commit Graph

11 Commits

Author SHA1 Message Date
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
亢奋猫
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
SuYao
32a6666bb3 chore(chat-page): scaffold chat component tree (#14997)
Co-authored-by: jdzhang <625013594@qq.com>
Co-authored-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Signed-off-by: gujiaming <52187003+AtomsH4@users.noreply.github.com>
Signed-off-by: suyao <sy20010504@gmail.com>
Signed-off-by: kangfenmao <kangfenmao@qq.com>
Signed-off-by: jdzhang <625013594@qq.com>
Signed-off-by: jd <59188306+zhangjiadi225@users.noreply.github.com>
2026-06-23 20:31:49 +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
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
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
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
3679a8bd23 docs(design-system): update design token guide (#14995)
### What this PR does

Before this PR:

DESIGN.md described the Cherry Studio design system with outdated token
names, older font guidance, and hard-coded color/value references that
no longer matched the v2 UI token structure.

After this PR:

DESIGN.md is updated to describe the current token-driven design system,
including semantic color roles, typography, radius, shadow, blur,
overlay, border, status, and prompt guidance that points readers back to
the token CSS files as the source of truth.

<!-- (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 following tradeoffs were made:

- Kept this PR documentation-only so reviewers can evaluate the design
guidance separately from implementation changes.
- Referenced token names instead of duplicating every raw value,
reducing the chance that the guide drifts from
`packages/ui/src/styles/tokens/*.css`.

The following alternatives were considered:

- Updating component code together with the guide, but that would make
the PR harder to review and is not necessary for this documentation
update.
- Keeping hard-coded color values throughout the guide, but that
conflicts with the token-first v2 design direction.

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

### Breaking changes

None.

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

N/A

### Special notes for your reviewer

This PR only changes DESIGN.md.

### 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)
- [ ] 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)
- [ ] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] 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
NONE
```

Signed-off-by: akazaakari950718-dev <akazaakari950718@gmail.com>
2026-05-11 16:01:48 +08:00
SuYao
34735feef5 docs: add design system specifications (DESIGN.md) (#14163)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 17:46:34 +08:00