Skip to content

Commit 4cdc094

Browse files
tjx666Waaade-QAQ
authored andcommitted
🐛 fix(desktop): macos26 small icon (lobehub#9421)
* 🐛 fix(desktop): macos26 icon small * Revert "🐛 fix(desktop): macos26 icon small" This reverts commit 4a4b7b2. * ✨ feat(desktop): support Liquid Glass icons for macOS 26 - Add pre-generated Assets.car files for all build variants - Configure afterPack hook to copy Assets.car during build - Maintain backward compatibility with .icns fallback for older macOS Reference: electron-userland/electron-builder#9254 * docs: optimize comments * fix: update deprecated macos-13 to macos-15-intel * docs: optimize ai rules
1 parent 28b640f commit 4cdc094

File tree

11 files changed

+79
-59
lines changed

11 files changed

+79
-59
lines changed

.cursor/rules/project-introduce.mdc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@ alwaysApply: true
66

77
You are developing an open-source, modern-design AI chat framework: lobehub(previous lobe-chat).
88

9-
support platforms:
9+
Supported platforms:
1010

1111
- web desktop/mobile
1212
- desktop(electron)
13-
- mobile app(react native). coming soon
13+
- mobile app(react native), coming soon
1414

1515
logo emoji: 🤯
1616

1717
## Project Technologies Stack
1818

19-
read [package.json](mdc:package.json) to know all npm packages you can use.
20-
2119
- Next.js 15
2220
- react 19
2321
- TypeScript
@@ -33,6 +31,6 @@ read [package.json](mdc:package.json) to know all npm packages you can use.
3331
- dayjs for time library
3432
- lodash-es for utility library
3533
- TRPC for type safe backend
36-
- PGLite for client DB and PostgreSQL for backend DB
34+
- PGLite for client DB and Neon PostgreSQL for backend DB
3735
- Drizzle ORM
3836
- Vitest for testing

.cursor/rules/project-structure.mdc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ alwaysApply: false
55

66
# LobeChat Project Structure
77

8-
note: some not very important files are not shown for simplicity.
9-
108
## Complete Project Structure
119

12-
this project use common monorepo structure. The workspace packages name use `@lobechat/` namespace.
10+
This project uses common monorepo structure. The workspace packages name use `@lobechat/` namespace.
11+
12+
**note**: some not very important files are not shown for simplicity.
1313

1414
```plaintext
1515
lobe-chat/
@@ -28,10 +28,12 @@ lobe-chat/
2828
│ │ │ ├── schemas/
2929
│ │ │ └── repositories/
3030
│ ├── model-bank/
31+
│ │ └── src/
32+
│ │ └── aiModels/
3133
│ ├── model-runtime/
3234
│ │ └── src/
33-
│ │ ├── openai/
34-
│ │ └── anthropic/
35+
│ │ ├── core/
36+
│ │ └── providers/
3537
│ ├── types/
3638
│ │ └── src/
3739
│ │ ├── message/
@@ -96,14 +98,14 @@ lobe-chat/
9698
- UI Components: `src/components`, `src/features`
9799
- Global providers: `src/layout`
98100
- Zustand stores: `src/store`
99-
- Client Services: `src/services/`
101+
- Client Services: `src/services/` cross-platform services
100102
- clientDB: `src/services/<domain>/client.ts`
101103
- serverDB: `src/services/<domain>/server.ts`
102104
- API Routers:
103105
- `src/app/(backend)/webapi` (REST)
104106
- `src/server/routers/{edge|lambda|async|desktop|tools}` (tRPC)
105107
- Server:
106-
- Services(can access serverDB): `src/server/services`
108+
- Services(can access serverDB): `src/server/services` server-used-only services
107109
- Modules(can't access db): `src/server/modules` (Server only Third-party Service Module)
108110
- Database:
109111
- Schema (Drizzle): `packages/database/src/schemas`
@@ -113,8 +115,8 @@ lobe-chat/
113115

114116
## Data Flow Architecture
115117

116-
- **Browser/PWA**: React UI → Client Service → Direct Model Access → PGLite (Web WASM)
117-
- **Server**: React UI → Client Service → tRPC Lambda → Server Services → PostgreSQL (Remote)
118+
- **Web with ClientDB**: React UI → Client Service → Direct Model Access → PGLite (Web WASM)
119+
- **Web with ServerDB**: React UI → Client Service → tRPC Lambda → Server Services → PostgreSQL (Remote)
118120
- **Desktop**:
119121
- Cloud sync disabled: Electron UI → Client Service → tRPC Lambda → Local Server Services → PGLite (Node WASM)
120122
- Cloud sync enabled: Electron UI → Client Service → tRPC Lambda → Cloud Server Services → PostgreSQL (Remote)

.cursor/rules/typescript.mdc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,11 @@ alwaysApply: false
2929

3030
## Code Structure and Readability
3131

32-
- Refactor repeated logic into reusable functions.
3332
- Prefer object destructuring when accessing and using properties.
3433
- Use consistent, descriptive naming; avoid obscure abbreviations.
3534
- Use semantically meaningful variable, function, and class names.
3635
- Replace magic numbers or strings with well-named constants.
37-
- Keep meaningful code comments; do not remove them when applying edits. Update comments when behavior changes.
38-
- Ensure JSDoc comments accurately reflect the implementation.
39-
- Look for opportunities to simplify or modernize code with the latest JavaScript/TypeScript features where it improves clarity.
4036
- Defer formatting to tooling; ignore purely formatting-only issues and autofixable lint problems.
41-
- Respect project Prettier settings.
4237

4338
## UI and Theming
4439

@@ -50,15 +45,14 @@ alwaysApply: false
5045
## Performance
5146

5247
- Prefer `for…of` loops to index-based `for` loops when feasible.
53-
- Decide whether callbacks should be debounced or throttled based on UX and performance needs.
54-
- Reuse existing npm packages rather than reinventing the wheel (e.g., `lodash-es/omit`).
48+
- Reuse existing utils inside `packages/utils` or installed npm packages rather than reinventing the wheel.
5549
- Query only the required columns from a database rather than selecting entire rows.
5650

5751
## Time and Consistency
5852

5953
- Instead of calling `Date.now()` multiple times, assign it to a constant once and reuse it to ensure consistency and improve readability.
6054

61-
## Some logging rules
55+
## Logging
6256

6357
- Never log user private information like api key, etc
6458
- Don't use `import { log } from 'debug'` to log messages, because it will directly log the message to the console.

.github/workflows/desktop-pr-build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
runs-on: ${{ matrix.os }}
9696
strategy:
9797
matrix:
98-
os: [macos-latest, macos-13, windows-2025, ubuntu-latest]
98+
os: [macos-latest, macos-15-intel, windows-2025, ubuntu-latest]
9999
steps:
100100
- uses: actions/checkout@v5
101101
with:
@@ -129,11 +129,11 @@ jobs:
129129
run: npm run desktop:build
130130
env:
131131
# 设置更新通道,PR构建为nightly,否则为stable
132-
UPDATE_CHANNEL: 'nightly'
132+
UPDATE_CHANNEL: "nightly"
133133
APP_URL: http://localhost:3015
134-
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
134+
DATABASE_URL: "postgresql://postgres@localhost:5432/postgres"
135135
# 默认添加一个加密 SECRET
136-
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
136+
KEY_VAULTS_SECRET: "oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE="
137137
# macOS 签名和公证配置
138138
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
139139
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
@@ -152,10 +152,10 @@ jobs:
152152
run: npm run desktop:build
153153
env:
154154
# 设置更新通道,PR构建为nightly,否则为stable
155-
UPDATE_CHANNEL: 'nightly'
155+
UPDATE_CHANNEL: "nightly"
156156
APP_URL: http://localhost:3015
157-
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
158-
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
157+
DATABASE_URL: "postgresql://postgres@localhost:5432/postgres"
158+
KEY_VAULTS_SECRET: "oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE="
159159
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
160160
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
161161
# 将 TEMP 和 TMP 目录设置到 C 盘
@@ -168,10 +168,10 @@ jobs:
168168
run: npm run desktop:build
169169
env:
170170
# 设置更新通道,PR构建为nightly,否则为stable
171-
UPDATE_CHANNEL: 'nightly'
171+
UPDATE_CHANNEL: "nightly"
172172
APP_URL: http://localhost:3015
173-
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
174-
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
173+
DATABASE_URL: "postgresql://postgres@localhost:5432/postgres"
174+
KEY_VAULTS_SECRET: "oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE="
175175
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
176176
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
177177

.github/workflows/release-desktop-beta.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
runs-on: ${{ matrix.os }}
8383
strategy:
8484
matrix:
85-
os: [macos-latest, macos-13, windows-2025, ubuntu-latest]
85+
os: [macos-latest, macos-15-intel, windows-2025, ubuntu-latest]
8686
steps:
8787
- uses: actions/checkout@v5
8888
with:
@@ -116,9 +116,9 @@ jobs:
116116
run: npm run desktop:build
117117
env:
118118
APP_URL: http://localhost:3015
119-
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
119+
DATABASE_URL: "postgresql://postgres@localhost:5432/postgres"
120120
# 默认添加一个加密 SECRET
121-
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
121+
KEY_VAULTS_SECRET: "oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE="
122122
# macOS 签名和公证配置
123123
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
124124
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
@@ -137,8 +137,8 @@ jobs:
137137
run: npm run desktop:build
138138
env:
139139
APP_URL: http://localhost:3015
140-
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
141-
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
140+
DATABASE_URL: "postgresql://postgres@localhost:5432/postgres"
141+
KEY_VAULTS_SECRET: "oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE="
142142
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
143143
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
144144

@@ -152,8 +152,8 @@ jobs:
152152
run: npm run desktop:build
153153
env:
154154
APP_URL: http://localhost:3015
155-
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
156-
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
155+
DATABASE_URL: "postgresql://postgres@localhost:5432/postgres"
156+
KEY_VAULTS_SECRET: "oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE="
157157
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
158158
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
159159

CLAUDE.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,18 @@ This repository adopts a monorepo structure.
3131

3232
see @.cursor/rules/typescript.mdc
3333

34-
### Modify Code Rules
35-
36-
- **Code Language**:
37-
- For files with existing Chinese comments: Continue using Chinese to maintain consistency
38-
- For new files or files without Chinese comments: MUST use American English.
39-
- eg: new react tsx file and new test file
40-
- Conservative for existing code, modern approaches for new features
41-
4234
### Testing
4335

44-
Testing work follows the Rule-Aware Task Execution system above.
45-
46-
- **Required Rule**: `testing-guide/testing-guide.mdc`
36+
- **Required Rule**: read `@.cursor/rules/testing-guide/testing-guide.mdc` before writing tests
4737
- **Command**:
4838
- web: `bunx vitest run --silent='passed-only' '[file-path-pattern]'`
4939
- packages(eg: database): `cd packages/database && bunx vitest run --silent='passed-only' '[file-path-pattern]'`
5040

5141
**Important**:
5242

53-
- wrapped the file path in single quotes to avoid shell expansion
43+
- wrap the file path in single quotes to avoid shell expansion
5444
- Never run `bun run test` etc to run tests, this will run all tests and cost about 10mins
55-
- If try to fix the same test twice, but still failed, stop and ask for help.
45+
- If trying to fix the same test twice, but still failed, stop and ask for help.
5646

5747
### Typecheck
5848

@@ -61,15 +51,9 @@ Testing work follows the Rule-Aware Task Execution system above.
6151
### i18n
6252

6353
- **Keys**: Add to `src/locales/default/namespace.ts`
64-
- **Dev**: Translate `locales/zh-CN/namespace.json` locale file only for preview
54+
- **Dev**: Translate `locales/zh-CN/namespace.json` and `locales/en-US/namespace.json` locales file only for dev preview
6555
- DON'T run `pnpm i18n`, let CI auto handle it
6656

6757
## Rules Index
6858

69-
Some useful rules of this project. Read them when needed.
70-
71-
**IMPORTANT**: All rule files referenced in this document are located in the `.cursor/rules/` directory. Throughout this document, rule files are referenced by their filename only for brevity.
72-
73-
### 📋 Complete Rule Files
74-
7559
Some useful project rules are listed in @.cursor/rules/rules-index.mdc
4.27 MB
Binary file not shown.
5.68 MB
Binary file not shown.
4.46 MB
Binary file not shown.

apps/desktop/build/Icon.Assets.car

4.08 MB
Binary file not shown.

0 commit comments

Comments
 (0)