Commit Graph

14 Commits

Author SHA1 Message Date
亢奋猫
366ecf63da refactor(provider): remove tokenflux providers (#16518)
Signed-off-by: kangfenmao <kangfenmao@qq.com>
2026-06-30 19:52:35 +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
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
亢奋猫
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
亢奋猫
c88f6aa787 refactor: stabilize ui package boundaries and theme contracts (#14328)
Co-authored-by: MyPrototypeWhat <daoquqiexing@gmail.com>
Fixes #14331
2026-04-20 16:12:02 +08:00
fullex
71a36794a6 fix: add void operator to all floating promises to satisfy no-floating-promises lint rule
Signed-off-by: fullex <0xfullex@gmail.com>
2026-03-24 07:56:37 -07:00
SuYao
43f2a6bc54 refactor(ui): overhaul icon system and migrate Avatar to shadcn/radix (#12858)
### What this PR does

Before this PR:
- Provider/model icons were scattered image imports (PNG/WebP) with no
unified API
- Avatar primitive was based on HeroUI with hardcoded `shadow-lg` and
`border-[0.5px]`
- Full-bleed and padded avatar variants used different rendering
approaches
- Multiple files duplicated IIFE patterns for rendering CompoundIcon vs
string logos
- No type-safe icon catalogs

After this PR:
- **Compound Icon API**: Each icon exposes `.Color`, `.Mono`, and
`.Avatar` sub-components via a unified `CompoundIcon` interface
- **Auto-generated catalogs**: `PROVIDER_ICON_CATALOG` and
`MODEL_ICON_CATALOG` with `resolveProviderIcon` / `resolveModelIcon`
helpers
- **SVG pipeline**: Codegen processes SVGs → generates Color/Mono/Avatar
components
- **Avatar migrated to shadcn/radix**: Replaced HeroUI Avatar with
`Avatar` + `AvatarFallback` pattern, removed hardcoded shadow/border
- **EmojiAvatar moved**: From `primitives/Avatar/` to
`composites/EmojiAvatar/`
- **LogoAvatar component**: Reusable component replacing repeated IIFE
patterns across 5+ files
- **getMCPProviderLogo helper**: Centralized MCP provider icon mapping
- 80+ monochrome icon components, stroke attribute support, deprecated
logos cleanup

<img width="714" height="820" alt="image"
src="https://github.com/user-attachments/assets/a3f14348-5781-494a-8c3b-1f40391e2ec0"
/>

<img width="1008" height="593" alt="image"
src="https://github.com/user-attachments/assets/8ba7fa42-fa33-4e49-ba76-647ba1438e0c"
/>

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

The v2 refactoring requires moving away from HeroUI toward shadcn/radix
primitives, and needs a scalable, type-safe icon system to replace
scattered image imports. The compound icon pattern (`Icon.Color`,
`Icon.Mono`, `Icon.Avatar`) provides a consistent API while enabling
tree-shaking. The Avatar primitive now uses radix-based `Avatar` +
`AvatarFallback`, aligning with the project's shadcn migration.

The following tradeoffs were made:
- Each icon is a separate TSX file for tree-shaking and lazy loading
support
- Avatar components use `AvatarFallback` to render icons — no image
loading overhead

The following alternatives were considered:
- Runtime SVG color manipulation — rejected for better performance and
consistency
- Keeping HeroUI Avatar — rejected as it conflicts with v2 shadcn
migration goals

### Breaking changes

- Avatar primitive API changed: `HeroUI Avatar` → shadcn `Avatar` +
`AvatarFallback` + `AvatarImage`
- `EmojiAvatar` moved from `primitives/Avatar` to
`composites/EmojiAvatar`
- `shadow-lg` and `border-[0.5px]` removed from generated avatars — now
opt-in via `className`

### Special notes for your reviewer

- ~214 files changed, but the bulk are auto-generated avatar/icon
components under `packages/ui/src/components/icons/`
- Key files to review:
- `packages/ui/src/components/primitives/avatar.tsx` — new shadcn Avatar
primitive
- `packages/ui/scripts/codegen.ts` — avatar generation using
AvatarFallback
- `src/renderer/src/components/Icons/LogoAvatar.tsx` — reusable logo
renderer
- Renderer files using the new Avatar API (Sidebar, UserPopup,
ModelAvatar, etc.)

### Checklist

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: Write code that humans can understand and Keep it simple
- [x] Refactor: You have left the code cleaner than you found it (Boy
Scout Rule)
- [ ] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: N/A - internal component changes

### Release note

```release-note
NONE
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: icarus <eurfelux@gmail.com>
2026-03-16 17:13:25 +08:00
MyPrototypeWhat
ad90d22be3 chore: update TypeScript configuration and improve icon generation script
- Adjusted tsconfig.web.json to maintain formatting consistency.
- Enhanced tsconfig.json in the ui package by adding strict compiler options for better code quality.
- Modified the generate-icons script to remove an unused parameter, streamlining the function call.
2025-12-17 12:49:58 +08:00
MyPrototypeWhat
4d7989c220 feat: add new SVG icons and update package.json
- Added multiple new SVG icons to the logos directory.
- Removed the deprecated dmxapiLogo component.
- Updated package.json to reflect the new icons.
2025-12-16 15:53:27 +08:00
MyPrototypeWhat
9d75b0972e Refactor icon management and update dependencies
- Removed the ICON_IMPLEMENTATION_GUIDE.md file and several unused SVG icons from the `icons/` directory.
- Added new SVG icons to enhance the icon library, including various brand logos.
- Updated package.json to reflect the new version of the `tsx` dependency.
- Introduced a script for generating icons and improved the structure of the icons module for better organization and accessibility.
- Updated the stories for icons to showcase the new additions and ensure proper documentation.
2025-11-14 17:55:44 +08:00
MyPrototypeWhat
8cc6b08831 chore(ui): update package.json and migration status files
- Reformatted keywords and files array in package.json for better readability.
- Updated migration status to reflect the migration of additional components, increasing the total migrated count to 46 and reducing pending migrations to 190.
- Added new components to the migration status table, including ErrorBoundary and ProviderAvatar, while removing deprecated components like ErrorTag, SuccessTag, and WarnTag.
2025-09-16 13:32:25 +08:00
one
8981d0a09d refactor(CodeEditor): decouple CodeEditor and global settings (#10163)
* refactor(CodeEditor): decouple CodeEditor and global settings

* refactor: improve language extension fallbacks

* refactor: make a copy of CodeEditor in the ui package

* refactor: update ui CodeEditor and language list

* refactor: use CodeEditor from the ui package

* feat: add a story for CodeEditor
2025-09-16 10:11:36 +08:00