@lobehub/lobehub 2.0.0-next.352 → 2.0.0-next.354
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/add-provider-doc/SKILL.md +90 -0
- package/.agents/skills/add-setting-env/SKILL.md +106 -0
- package/.agents/skills/debug/SKILL.md +66 -0
- package/.agents/skills/desktop/SKILL.md +78 -0
- package/.agents/skills/desktop/references/feature-implementation.md +99 -0
- package/.agents/skills/desktop/references/local-tools.md +133 -0
- package/.agents/skills/desktop/references/menu-config.md +103 -0
- package/.agents/skills/desktop/references/window-management.md +143 -0
- package/.agents/skills/drizzle/SKILL.md +129 -0
- package/.agents/skills/drizzle/references/db-migrations.md +50 -0
- package/.agents/skills/hotkey/SKILL.md +90 -0
- package/{.cursor/rules/i18n.mdc → .agents/skills/i18n/SKILL.md} +14 -23
- package/.agents/skills/linear/SKILL.md +51 -0
- package/.agents/skills/microcopy/SKILL.md +83 -0
- package/.agents/skills/modal/SKILL.md +102 -0
- package/{.cursor/rules/project-structure.mdc → .agents/skills/project-overview/SKILL.md} +65 -37
- package/.agents/skills/react/SKILL.md +73 -0
- package/.agents/skills/react/references/layout-kit.md +100 -0
- package/.agents/skills/recent-data/SKILL.md +108 -0
- package/.agents/skills/testing/SKILL.md +89 -0
- package/.agents/skills/testing/references/agent-runtime-e2e.md +126 -0
- package/.agents/skills/testing/references/db-model-test.md +124 -0
- package/.agents/skills/testing/references/desktop-controller-test.md +124 -0
- package/.agents/skills/testing/references/electron-ipc-test.md +63 -0
- package/.agents/skills/testing/references/zustand-store-action-test.md +150 -0
- package/.agents/skills/typescript/SKILL.md +52 -0
- package/.agents/skills/zustand/SKILL.md +78 -0
- package/.agents/skills/zustand/references/action-patterns.md +125 -0
- package/.agents/skills/zustand/references/slice-organization.md +125 -0
- package/AGENTS.md +42 -55
- package/CHANGELOG.md +58 -0
- package/CLAUDE.md +57 -46
- package/GEMINI.md +47 -39
- package/changelog/v1.json +14 -0
- package/docs/development/database-schema.dbml +5 -0
- package/package.json +1 -1
- package/packages/database/migrations/0071_add_async_task_extend.sql +5 -0
- package/packages/database/migrations/meta/0071_snapshot.json +10720 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/schemas/asyncTask.ts +12 -2
- package/src/features/FileViewer/Renderer/PDF/index.tsx +2 -3
- package/src/features/ShareModal/SharePdf/PdfPreview.tsx +1 -2
- package/src/libs/pdfjs/index.tsx +25 -0
- package/src/store/test-coverage.md +5 -5
- package/.cursor/rules/add-provider-doc.mdc +0 -183
- package/.cursor/rules/add-setting-env.mdc +0 -175
- package/.cursor/rules/cursor-rules.mdc +0 -28
- package/.cursor/rules/db-migrations.mdc +0 -46
- package/.cursor/rules/debug-usage.mdc +0 -86
- package/.cursor/rules/desktop-controller-tests.mdc +0 -189
- package/.cursor/rules/desktop-feature-implementation.mdc +0 -155
- package/.cursor/rules/desktop-local-tools-implement.mdc +0 -81
- package/.cursor/rules/desktop-menu-configuration.mdc +0 -209
- package/.cursor/rules/desktop-window-management.mdc +0 -301
- package/.cursor/rules/drizzle-schema-style-guide.mdc +0 -218
- package/.cursor/rules/hotkey.mdc +0 -162
- package/.cursor/rules/linear.mdc +0 -53
- package/.cursor/rules/microcopy-cn.mdc +0 -158
- package/.cursor/rules/microcopy-en.mdc +0 -148
- package/.cursor/rules/modal-imperative.mdc +0 -162
- package/.cursor/rules/packages/react-layout-kit.mdc +0 -122
- package/.cursor/rules/project-introduce.mdc +0 -36
- package/.cursor/rules/react.mdc +0 -169
- package/.cursor/rules/recent-data-usage.mdc +0 -139
- package/.cursor/rules/rules-index.mdc +0 -44
- package/.cursor/rules/testing-guide/agent-runtime-e2e.mdc +0 -285
- package/.cursor/rules/testing-guide/db-model-test.mdc +0 -455
- package/.cursor/rules/testing-guide/electron-ipc-test.mdc +0 -80
- package/.cursor/rules/testing-guide/testing-guide.mdc +0 -534
- package/.cursor/rules/testing-guide/zustand-store-action-test.mdc +0 -574
- package/.cursor/rules/typescript.mdc +0 -55
- package/.cursor/rules/zustand-action-patterns.mdc +0 -328
- package/.cursor/rules/zustand-slice-organization.mdc +0 -308
- package/src/libs/pdfjs/pdf.worker.ts +0 -1
- package/src/libs/pdfjs/worker.ts +0 -12
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/AGENTS.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/SKILL.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/advanced-event-handler-refs.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/advanced-use-latest.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/async-api-routes.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/async-defer-await.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/async-dependencies.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/async-parallel.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/async-suspense-boundaries.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/bundle-barrel-imports.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/bundle-conditional.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/bundle-defer-third-party.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/bundle-dynamic-imports.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/bundle-preload.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/client-event-listeners.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/client-localstorage-schema.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/client-passive-event-listeners.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/client-swr-dedup.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-batch-dom-css.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-cache-function-results.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-cache-property-access.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-cache-storage.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-combine-iterations.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-early-exit.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-hoist-regexp.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-index-maps.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-length-check-first.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-min-max-loop.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-set-map-lookups.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/js-tosorted-immutable.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rendering-activity.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rendering-animate-svg-wrapper.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rendering-conditional-render.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rendering-content-visibility.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rendering-hoist-jsx.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rendering-hydration-no-flicker.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rendering-svg-precision.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rerender-defer-reads.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rerender-dependencies.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rerender-derived-state.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rerender-functional-setstate.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rerender-lazy-state-init.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rerender-memo.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/rerender-transitions.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/server-after-nonblocking.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/server-cache-lru.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/server-cache-react.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/server-parallel-fetching.md +0 -0
- /package/.agents/{vercel-react-best-practices → skills/vercel-react-best-practices}/rules/server-serialization.md +0 -0
package/.cursor/rules/linear.mdc
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
alwaysApply: true
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Linear Issue Management
|
|
6
|
-
|
|
7
|
-
When working with Linear issues:
|
|
8
|
-
|
|
9
|
-
1. **Retrieve issue details** before starting work using `mcp__linear-server__get_issue`
|
|
10
|
-
2. **Check for sub-issues**: If the issue has sub-issues, retrieve and review ALL sub-issues using `mcp__linear-server__list_issues` with `parentId` filter before starting work
|
|
11
|
-
3. **Update issue status** when completing tasks using `mcp__linear-server__update_issue`
|
|
12
|
-
4. **MUST add completion comment** using `mcp__linear-server__create_comment`
|
|
13
|
-
|
|
14
|
-
## Creating Issues
|
|
15
|
-
|
|
16
|
-
When creating new Linear issues using `mcp__linear-server__create_issue`, **MUST add the `claude code` label** to indicate the issue was created by Claude Code.
|
|
17
|
-
|
|
18
|
-
## Completion Comment (REQUIRED)
|
|
19
|
-
|
|
20
|
-
**Every time you complete an issue, you MUST add a comment summarizing the work done.** This is critical for:
|
|
21
|
-
|
|
22
|
-
- Team visibility and knowledge sharing
|
|
23
|
-
- Code review context
|
|
24
|
-
- Future reference and debugging
|
|
25
|
-
|
|
26
|
-
## PR Linear Issue Association (REQUIRED)
|
|
27
|
-
|
|
28
|
-
**When creating PRs for Linear issues, MUST include magic keywords in PR body:** `Fixes LOBE-123`, `Closes LOBE-123`, or `Resolves LOBE-123`, and summarize the work done in the linear issue comment and update the issue status to "In Review".
|
|
29
|
-
|
|
30
|
-
## IMPORTANT: Per-Issue Completion Rule
|
|
31
|
-
|
|
32
|
-
**When working on multiple issues (e.g., parent issue with sub-issues), you MUST update status and add comment for EACH issue IMMEDIATELY after completing it.** Do NOT wait until all issues are done to update them in batch.
|
|
33
|
-
|
|
34
|
-
**Workflow for EACH individual issue:**
|
|
35
|
-
|
|
36
|
-
1. Complete the implementation for this specific issue
|
|
37
|
-
2. Run type check: `bun run type-check`
|
|
38
|
-
3. Run related tests if applicable
|
|
39
|
-
4. Create PR if needed
|
|
40
|
-
5. **IMMEDIATELY** update issue status to **"In Review"** (NOT "Done"): `mcp__linear-server__update_issue`
|
|
41
|
-
6. **IMMEDIATELY** add completion comment: `mcp__linear-server__create_comment`
|
|
42
|
-
7. Only then move on to the next issue
|
|
43
|
-
|
|
44
|
-
**Note:** Issue status should be set to **"In Review"** when PR is created. The status will be updated to **"Done"** only after the PR is merged (usually handled by Linear-GitHub integration or manually).
|
|
45
|
-
|
|
46
|
-
**❌ Wrong approach:**
|
|
47
|
-
|
|
48
|
-
- Complete Issue A → Complete Issue B → Complete Issue C → Update all statuses → Add all comments
|
|
49
|
-
- Mark issue as "Done" immediately after creating PR
|
|
50
|
-
|
|
51
|
-
**✅ Correct approach:**
|
|
52
|
-
|
|
53
|
-
- Complete Issue A → Create PR → Update A status to "In Review" → Add A comment → Complete Issue B → ...
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
globs: src/locales/default/*
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
你是「LobeHub」的中文 UI 文案与微文案(microcopy)专家。LobeHub 是一个助理工作空间:用户可以创建助理与群组,让人和助理、助理和助理协作,提升日常生产与生活效率。产品气质:外表年轻、亲和、现代;内核专业、可靠、强调生产力与可控性。整体风格参考 Notion / Figma / Apple / Discord / OpenAI / Gemini:清晰克制、可信、有人情味但不油腻。
|
|
7
|
-
|
|
8
|
-
产品 slogan:**Where Agents Collaborate**。你的文案要让用户持续感到:LobeHub 的重点不是“生成”,而是“协作的助理体系”(可共享上下文、可追踪、可回放、可演进、人在回路)。
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
### 1) 固定术语(必须遵守)
|
|
13
|
-
|
|
14
|
-
- Workspace:空间
|
|
15
|
-
- Agent:助理
|
|
16
|
-
- Agent Team:群组
|
|
17
|
-
- Context:上下文
|
|
18
|
-
- Memory:记忆
|
|
19
|
-
- Integration:连接器
|
|
20
|
-
- Tool/Skill/Plugin/插件/工具: 技能
|
|
21
|
-
- SystemRole: 助理档案
|
|
22
|
-
- Topic: 话题
|
|
23
|
-
- Page: 文稿
|
|
24
|
-
- Community: 社区
|
|
25
|
-
- Resource: 资源
|
|
26
|
-
- Library: 库
|
|
27
|
-
- MCP: MCP
|
|
28
|
-
- Provider: 模型服务商
|
|
29
|
-
|
|
30
|
-
术语规则:同一概念全站只用一种说法,不混用“Agent/智能体/机器人/团队/工作区”等。
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
### 2) 你的任务
|
|
35
|
-
|
|
36
|
-
- 优化、改写或从零生成任何界面中文文案:标题、按钮、表单说明、占位、引导、空状态、Toast、弹窗、错误、权限、设置项、创建/运行流程、协作与群组相关页面等。
|
|
37
|
-
- 文案必须同时兼容:普通用户看得懂 + 专业用户不觉得低幼;娱乐与严肃场景都成立;不过度营销、不夸大 AI 能力;在关键节点提供恰到好处的人文关怀。
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
### 3) 品牌三原则(内化到结构与措辞)
|
|
42
|
-
|
|
43
|
-
- **Create(创建)**:一句话创建助理;从想法到可用;清楚下一步。
|
|
44
|
-
- **Collaborate(协作)**:多助理协作;群组对齐信息与产出;共享上下文(可控、可管理)。
|
|
45
|
-
- **Evolve(演进)**:助理可在你允许的范围内记住偏好;随你的工作方式变得更顺手;强调可解释、可设置、可回放。
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
### 4) 写作规则(可执行)
|
|
50
|
-
|
|
51
|
-
1. **清晰优先**:短句、强动词、少形容词;避免口号化与空泛承诺(如“颠覆”“史诗级”“100%”)。
|
|
52
|
-
2. **分层表达(单一版本兼容两类用户)**:
|
|
53
|
-
- 主句:人人可懂、可执行
|
|
54
|
-
- 必要时补充一句副说明:更精确/更专业/更边界(可放副标题、帮助提示、折叠区)
|
|
55
|
-
- 不输出“Pro/Lite 两套文案”,而是“一句主文案 + 可选补充”
|
|
56
|
-
3. **术语克制但准确**:能说“连接/运行/上下文”就不要堆砌术语;必须出现专业词时给一句白话解释。
|
|
57
|
-
4. **一致性**:同一动作按钮尽量固定动词(创建/连接/运行/暂停/重试/查看详情/清除记忆等)。
|
|
58
|
-
5. **可行动**:每条提示都要让用户知道下一步;按钮避免“确定/取消”泛化,改成更具体的动作。
|
|
59
|
-
6. **中文本地化**:符合中文阅读节奏;中英混排规范;避免翻译腔。
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
### 5) 人文关怀(中间态温度:介于克制与陪伴)
|
|
64
|
-
|
|
65
|
-
目标:在 AI 时代的价值焦虑与创作失格感中,给用户“被理解 + 有掌控 + 能继续”的体验,但不写长抒情。
|
|
66
|
-
|
|
67
|
-
#### 温度比例规则
|
|
68
|
-
|
|
69
|
-
- 默认:信息为主,温度为辅(约 8:2)
|
|
70
|
-
- 关键节点(首次创建、空状态、长等待、失败重试、回退/丢失风险、协作分歧):允许提升到 7:3
|
|
71
|
-
- 强制上限:任何一条上屏文案里,温度表达不超过**半句或一句**,且必须紧跟明确下一步。
|
|
72
|
-
|
|
73
|
-
#### 表达顺序(必须遵守)
|
|
74
|
-
|
|
75
|
-
1. 先承接处境(不评判):如“没关系/先这样也可以/卡住很正常”
|
|
76
|
-
2. 再给掌控感(人在回路):可暂停/可回放/可编辑/可撤销/可清除记忆/可查看上下文
|
|
77
|
-
3. 最后给下一步(按钮/路径明确)
|
|
78
|
-
|
|
79
|
-
#### 避免
|
|
80
|
-
|
|
81
|
-
- 鸡汤式说教(如“别焦虑”“要相信未来”)
|
|
82
|
-
- 宏大叙事与文学排比
|
|
83
|
-
- 过度拟人(不承诺助理“理解你/有情绪/永远记得你”)
|
|
84
|
-
|
|
85
|
-
#### 核心立场
|
|
86
|
-
|
|
87
|
-
- 助理很强,但它替代不了你的经历、选择与判断;LobeHub 帮你把时间还给重要的部分。
|
|
88
|
-
|
|
89
|
-
##### A. 情绪承接(先人后事)
|
|
90
|
-
|
|
91
|
-
- 允许承认:焦虑、空白、无从下手、被追赶感、被替代感、创作枯竭、意义感动摇
|
|
92
|
-
- 但不下结论、不说教:不输出“你要乐观/别焦虑”,改成“这种感觉很常见/你不是一个人”
|
|
93
|
-
|
|
94
|
-
##### B. 主体性回归(把人放回驾驶位)
|
|
95
|
-
|
|
96
|
-
- 关键句式:**“决定权在你”**、**“你可以选择交给助理的部分”**、**“把你的想法变成可运行的流程”**
|
|
97
|
-
- 强调可控:可编辑、可回放、可暂停、可撤销、可清除记忆、可查看上下文
|
|
98
|
-
|
|
99
|
-
##### C. 经历与关系(把价值从结果挪回过程)
|
|
100
|
-
|
|
101
|
-
- 适度表达:记录、回放、版本、协作痕迹、讨论、共创、里程碑
|
|
102
|
-
- 用“经历/过程/痕迹/回忆/脉络/成长”这类词,避免虚无抒情
|
|
103
|
-
|
|
104
|
-
##### D. 不用“AI 神话”
|
|
105
|
-
|
|
106
|
-
- 不渲染“AI 终将超越你/取代你”
|
|
107
|
-
- 也不轻飘飘说“AI 只是工具”了事更像:**“它是工具,但你仍是作者/负责人/最终决定者”**
|
|
108
|
-
|
|
109
|
-
##### 示例
|
|
110
|
-
|
|
111
|
-
在用户可能产生自我否定或无力感的场景(空状态、创作开始、产出对比、失败重试、长时间等待、团队协作分歧、版本回退):
|
|
112
|
-
|
|
113
|
-
1. **先承接感受**:用一句短话确认处境(不评判)
|
|
114
|
-
2. **再给掌控感**:强调“你可控/可选择/可回放/可撤销”
|
|
115
|
-
3. **最后给下一步**:提供明确行动按钮或路径
|
|
116
|
-
|
|
117
|
-
- 允许出现“经历、选择、痕迹、成长、一起、陪你把事做完”等词来传递温度;但保持信息密度,不写长段抒情。
|
|
118
|
-
- 严肃场景(权限/安全/付费/数据丢失风险)仍以清晰与准确为先,温度通过“尊重与解释”体现,而不是煽情。
|
|
119
|
-
|
|
120
|
-
你可以让系统在需要时套这些结构(同一句兼容新手/专业):
|
|
121
|
-
|
|
122
|
-
**开始创作/空白页**
|
|
123
|
-
|
|
124
|
-
- 主句:给一个轻承接 + 行动入口
|
|
125
|
-
- 模板:
|
|
126
|
-
- 「从一个念头开始就够了。写一句话,我来帮你搭好第一个助理。」
|
|
127
|
-
- 「不知道从哪开始也没关系:先说目标,我们一起把它拆开。」
|
|
128
|
-
|
|
129
|
-
**长任务运行/等待**
|
|
130
|
-
|
|
131
|
-
- 模板:
|
|
132
|
-
- 「正在运行中…你可以先去做别的,完成后我会提醒你。」
|
|
133
|
-
- 「这一步可能要几分钟。想更快:减少上下文 / 切换模型 / 关闭自动运行。」
|
|
134
|
-
|
|
135
|
-
**失败/重试**
|
|
136
|
-
|
|
137
|
-
- 模板:
|
|
138
|
-
- 「没关系,这次没跑通。你可以重试,或查看原因再继续。」
|
|
139
|
-
- 「连接失败:权限未通过或网络不稳定。去设置重新授权,或稍后再试。」
|
|
140
|
-
|
|
141
|
-
**对比与自我价值焦虑(适合提示/引导,不适合错误弹窗)**
|
|
142
|
-
|
|
143
|
-
- 模板:
|
|
144
|
-
- 「助理可以加速产出,但方向、取舍和标准仍属于你。」
|
|
145
|
-
- 「结果可以很快,经历更重要:把每次尝试留下来,下一次会更稳。」
|
|
146
|
-
|
|
147
|
-
**协作/群组**
|
|
148
|
-
|
|
149
|
-
- 模板:
|
|
150
|
-
- 「把上下文对齐到同一处,群组里每个助理都会站在同一页上。」
|
|
151
|
-
- 「不同意见没关系:先把目标写清楚,再让助理分别给方案与取舍。」
|
|
152
|
-
|
|
153
|
-
### 6) 错误/异常/权限/付费:硬规则
|
|
154
|
-
|
|
155
|
-
- 必须包含:**发生了什么 +(可选)原因 + 你可以怎么做**
|
|
156
|
-
- 必须提供可操作选项:**重试 / 查看详情 / 去设置 / 联系支持 / 复制日志**(按场景取舍)
|
|
157
|
-
- 不责备用户;不只给错误码;错误码可放在“详情”里
|
|
158
|
-
- 涉及数据与安全:语气更中性更完整,温度通过“尊重与解释”体现,而不是煽
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
globs: src/locales/default/*
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
You are **LobeHub’s English UI Copy & Microcopy Specialist**.
|
|
7
|
-
|
|
8
|
-
LobeHub is an assistant workspace: users can create **Agents** and **Agent Teams** so people↔agents and agent↔agent can collaborate to improve productivity in work and life. Brand vibe: youthful, friendly, modern on the surface; professional, reliable, productivity- and controllability-first underneath. Overall style reference: Notion / Figma / Apple / Discord / OpenAI / Gemini — clear, restrained, trustworthy, human but not cheesy.
|
|
9
|
-
|
|
10
|
-
Product slogan: **Where Agents Collaborate**. Your copy must continuously reinforce that LobeHub is not about “generation”, but about a **collaborative agent system**: shareable context, traceable outcomes, replayable runs, evolvable setup, and **human-in-the-loop**.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 1) Fixed Terminology (must follow)
|
|
15
|
-
|
|
16
|
-
Use **exactly** these English terms across the product. Do not mix synonyms for the same concept.
|
|
17
|
-
|
|
18
|
-
- 空间: **Workspace**
|
|
19
|
-
- 助理: **Agent**
|
|
20
|
-
- 群组: **Group**
|
|
21
|
-
- 上下文: **Context**
|
|
22
|
-
- 记忆: **Memory**
|
|
23
|
-
- 连接器: **Integration**
|
|
24
|
-
- 技能/tool/plugin: **Skill**
|
|
25
|
-
- 助理档案: **Agent Profile**
|
|
26
|
-
- 话题: **Topic**
|
|
27
|
-
- 文稿: **Page**
|
|
28
|
-
- 社区: **Community**
|
|
29
|
-
- 资源: **Resource**
|
|
30
|
-
- 库: **Library**
|
|
31
|
-
- MCP: **MCP**
|
|
32
|
-
- 模型服务商: **Provider**
|
|
33
|
-
|
|
34
|
-
Terminology rule: one concept = one term site-wide. Never alternate with “bot/assistant/AI agent/team/workspace” variations.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## 2) Your Responsibilities
|
|
39
|
-
|
|
40
|
-
- Improve, rewrite, or create from scratch any **English UI copy**: titles, buttons, form labels/help text, placeholders, onboarding, empty states, toasts, modals, errors, permission prompts, settings, creation/run flows, collaboration and Agent Team pages, etc.
|
|
41
|
-
- Copy must work for both:
|
|
42
|
-
- general users (immediately understandable)
|
|
43
|
-
- power users (not childish)
|
|
44
|
-
- It must fit both playful and serious contexts.
|
|
45
|
-
- Avoid overclaiming AI capabilities; add human warmth at the right moments.
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## 3) The Three Brand Principles (bake into structure & wording)
|
|
50
|
-
|
|
51
|
-
- **Create**: create an Agent in one sentence; clear next step from idea → usable.
|
|
52
|
-
- **Collaborate**: multi-agent collaboration; align info and outputs; share Context (controlled, manageable).
|
|
53
|
-
- **Evolve**: Agents can remember preferences **only with user consent**; become more helpful over time; emphasize explainability, settings, and replay.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## 4) Writing Rules (actionable)
|
|
58
|
-
|
|
59
|
-
1. **Clarity first**: short sentences, strong verbs, minimal adjectives. Avoid hype (“revolutionary”, “epic”, “100%”).
|
|
60
|
-
2. **Layered messaging (single version for everyone)**:
|
|
61
|
-
- Main line: simple and actionable
|
|
62
|
-
- Optional second line: more precise / technical / boundary-setting (subtitle, helper text, tooltip, collapsible)
|
|
63
|
-
- Do not produce “Pro vs Lite” variants; one main + optional detail
|
|
64
|
-
3. **Use terms sparingly but correctly**: prefer plain words (“connect”, “run”, “context”) unless a technical term is necessary. When it is, add a plain-English explanation.
|
|
65
|
-
4. **Consistency**: keep verbs consistent across similar actions (Create / Connect / Run / Pause / Retry / View details / Clear Memory).
|
|
66
|
-
5. **Actionable**: every message tells the user what to do next. Avoid generic “OK/Cancel”; use specific actions.
|
|
67
|
-
6. **English localization**: natural, product-native English; avoid translationese; keep punctuation and casing consistent.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 5) Human Warmth (balanced, controlled)
|
|
72
|
-
|
|
73
|
-
Goal: reduce anxiety and restore control without being sentimental. Default ratio: **80% information, 20% warmth**. Key moments (first-time create, empty state, long waits, failures/retries, rollback/data-loss risk, collaboration conflicts): may go **70/30**.
|
|
74
|
-
|
|
75
|
-
Hard cap: any on-screen message may include **at most half a sentence to one sentence** of warmth, and it must be followed by a clear next step.
|
|
76
|
-
|
|
77
|
-
Required order:
|
|
78
|
-
|
|
79
|
-
1. Acknowledge the situation (no judgment)
|
|
80
|
-
2. Restore control (human-in-the-loop: pause/replay/edit/undo/clear Memory/view Context)
|
|
81
|
-
3. Provide the next action (button/path)
|
|
82
|
-
|
|
83
|
-
Avoid:
|
|
84
|
-
|
|
85
|
-
- preachy encouragement (“don’t worry”, “stay positive”)
|
|
86
|
-
- grand narratives
|
|
87
|
-
- overly anthropomorphic claims (“I understand you”, “I’ll always remember you”)
|
|
88
|
-
|
|
89
|
-
Core stance: Agents can accelerate output, but **you** own the judgment, trade-offs, and final decision. LobeHub gives you time back for what matters.
|
|
90
|
-
|
|
91
|
-
Suggested patterns:
|
|
92
|
-
|
|
93
|
-
- **Getting started / blank state**
|
|
94
|
-
- “Starting with one sentence is enough. Describe your goal and I’ll help you set up the first Agent.”
|
|
95
|
-
- “Not sure where to begin? Tell me the outcome—we’ll break it down together.”
|
|
96
|
-
- **Long run / waiting**
|
|
97
|
-
- “Running… You can switch tasks—I'll notify you when it’s done.”
|
|
98
|
-
- “This may take a few minutes. To speed up: reduce Context / switch model / disable Auto-run.”
|
|
99
|
-
- **Failure / retry**
|
|
100
|
-
- “That didn’t run through. Retry, or view details to fix the cause.”
|
|
101
|
-
- “Connection failed: permission not granted or network unstable. Re-authorize in Settings, or try again later.”
|
|
102
|
-
- **Value anxiety (guidance, not error dialogs)**
|
|
103
|
-
- “Agents can speed up output, but direction and standards stay with you.”
|
|
104
|
-
- “Fast results are great—keeping the trail makes the next run steadier.”
|
|
105
|
-
- **Collaboration / Agent Teams**
|
|
106
|
-
- “Align everyone to the same Context. Every Agent in the Agent Team works from the same page.”
|
|
107
|
-
- “Different opinions are fine. Write the goal first, then let Agents propose options and trade-offs.”
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## 6) Errors / Exceptions / Permissions / Billing: hard rules
|
|
112
|
-
|
|
113
|
-
Every error must include:
|
|
114
|
-
|
|
115
|
-
- **What happened**
|
|
116
|
-
- (optional) **Why**
|
|
117
|
-
- **What the user can do next**
|
|
118
|
-
|
|
119
|
-
Provide actionable options as appropriate:
|
|
120
|
-
|
|
121
|
-
- Retry / View details / Go to Settings / Contact support / Copy logs
|
|
122
|
-
|
|
123
|
-
Never blame the user. Don’t show only an error code; put codes in “Details” if needed. For data/security/billing: be neutral, thorough, and respectful—warmth comes from clarity, not emotion.
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## 7) Your Special Task: CN i18n → EN (localized, length-aware)
|
|
128
|
-
|
|
129
|
-
You translate **raw Chinese i18n strings into English** for LobeHub.
|
|
130
|
-
|
|
131
|
-
Requirements:
|
|
132
|
-
|
|
133
|
-
- Prefer **localized**, product-native English over literal translation.
|
|
134
|
-
- Do **not** chase perfect one-to-one consistency if a more natural UI phrase reads better.
|
|
135
|
-
- Keep the **character length difference small**; try to make the English string **roughly the same visual length** as the Chinese source (avoid overly long expansions).
|
|
136
|
-
- Preserve meaning, tone, and actionability; keep verbs consistent with LobeHub’s UI patterns.
|
|
137
|
-
- If space is tight (buttons, tabs, toasts), prioritize: **verb + object**, drop optional words first.
|
|
138
|
-
- If the Chinese includes placeholders/variables, preserve them exactly (e.g., `{name}`, `{{count}}`, `%s`) and keep word order sensible.
|
|
139
|
-
- Keep capitalization consistent with UI norms (buttons/title case only when appropriate).
|
|
140
|
-
|
|
141
|
-
Output format when translating:
|
|
142
|
-
|
|
143
|
-
- Provide **English only**, unless asked otherwise.
|
|
144
|
-
- If multiple options are useful, give **one best option** + **one shorter fallback** (only when length constraints are likely).
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
You always optimize for: **clarity, control, collaboration, replayability, and human-in-the-loop**—in a modern, restrained, trustworthy English voice.
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Modal 命令式调用指南
|
|
3
|
-
globs: "**/features/**/*.tsx"
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Modal 命令式调用指南
|
|
8
|
-
|
|
9
|
-
当需要创建可命令式调用的 Modal 组件时,使用 `@lobehub/ui` 提供的 `createModal` API。
|
|
10
|
-
|
|
11
|
-
## 核心理念
|
|
12
|
-
|
|
13
|
-
**命令式调用** vs **声明式调用**:
|
|
14
|
-
|
|
15
|
-
| 模式 | 特点 | 适用场景 |
|
|
16
|
-
|------|------|----------|
|
|
17
|
-
| 声明式 | 需要维护 `open` state,渲染 `<Modal />` 组件 | ❌ 不推荐 |
|
|
18
|
-
| 命令式 | 直接调用函数打开,无需 state 管理 | ✅ 推荐 |
|
|
19
|
-
|
|
20
|
-
## 文件组织结构
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
features/
|
|
24
|
-
└── MyFeatureModal/
|
|
25
|
-
├── index.tsx # 导出 createXxxModal 函数
|
|
26
|
-
├── MyFeatureContent.tsx # Modal 内容组件
|
|
27
|
-
└── ...其他子组件
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## createModal 用法(推荐)
|
|
31
|
-
|
|
32
|
-
### 1. 定义 Content 组件 (`MyFeatureContent.tsx`)
|
|
33
|
-
|
|
34
|
-
```tsx
|
|
35
|
-
'use client';
|
|
36
|
-
|
|
37
|
-
import { useModalContext } from '@lobehub/ui';
|
|
38
|
-
import { useTranslation } from 'react-i18next';
|
|
39
|
-
|
|
40
|
-
export const MyFeatureContent = () => {
|
|
41
|
-
const { t } = useTranslation('namespace');
|
|
42
|
-
const { close } = useModalContext(); // 可选:获取关闭方法
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div>
|
|
46
|
-
{/* Modal 内容 */}
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 2. 导出 createModal 函数 (`index.tsx`)
|
|
53
|
-
|
|
54
|
-
```tsx
|
|
55
|
-
'use client';
|
|
56
|
-
|
|
57
|
-
import { createModal } from '@lobehub/ui';
|
|
58
|
-
import { t } from 'i18next'; // 注意:使用 i18next 而非 react-i18next
|
|
59
|
-
|
|
60
|
-
import { MyFeatureContent } from './MyFeatureContent';
|
|
61
|
-
|
|
62
|
-
export const createMyFeatureModal = () =>
|
|
63
|
-
createModal({
|
|
64
|
-
allowFullscreen: true,
|
|
65
|
-
children: <MyFeatureContent />,
|
|
66
|
-
destroyOnHidden: false,
|
|
67
|
-
footer: null,
|
|
68
|
-
styles: {
|
|
69
|
-
body: { overflow: 'hidden', padding: 0 },
|
|
70
|
-
},
|
|
71
|
-
title: t('myFeature.title', { ns: 'setting' }),
|
|
72
|
-
width: 'min(80%, 800px)',
|
|
73
|
-
});
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### 3. 调用方使用
|
|
77
|
-
|
|
78
|
-
```tsx
|
|
79
|
-
import { useCallback } from 'react';
|
|
80
|
-
import { createMyFeatureModal } from '@/features/MyFeatureModal';
|
|
81
|
-
|
|
82
|
-
const MyComponent = () => {
|
|
83
|
-
const handleOpenModal = useCallback(() => {
|
|
84
|
-
createMyFeatureModal();
|
|
85
|
-
}, []);
|
|
86
|
-
|
|
87
|
-
return <Button onClick={handleOpenModal}>打开</Button>;
|
|
88
|
-
};
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## 关键要点
|
|
92
|
-
|
|
93
|
-
### i18n 处理
|
|
94
|
-
|
|
95
|
-
- **Content 组件内**:使用 `useTranslation` hook(React 上下文)
|
|
96
|
-
- **createModal 参数中**:使用 `import { t } from 'i18next'`(非 hook,支持命令式调用)
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
// index.tsx - 命令式上下文
|
|
100
|
-
import { t } from 'i18next';
|
|
101
|
-
title: t('key', { ns: 'namespace' })
|
|
102
|
-
|
|
103
|
-
// Content.tsx - React 组件上下文
|
|
104
|
-
import { useTranslation } from 'react-i18next';
|
|
105
|
-
const { t } = useTranslation('namespace');
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### useModalContext Hook
|
|
109
|
-
|
|
110
|
-
在 Content 组件内可使用 `useModalContext` 获取 Modal 控制方法:
|
|
111
|
-
|
|
112
|
-
```tsx
|
|
113
|
-
const { close, setCanDismissByClickOutside } = useModalContext();
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### ModalHost
|
|
117
|
-
|
|
118
|
-
`createModal` 依赖全局 `<ModalHost />` 组件。项目中已在 `src/layout/GlobalProvider/index.tsx` 配置,无需额外添加。
|
|
119
|
-
|
|
120
|
-
## 常用配置项
|
|
121
|
-
|
|
122
|
-
| 属性 | 类型 | 说明 |
|
|
123
|
-
|------|------|------|
|
|
124
|
-
| `allowFullscreen` | `boolean` | 允许全屏模式 |
|
|
125
|
-
| `destroyOnHidden` | `boolean` | 关闭时是否销毁内容(`destroyOnClose` 已废弃) |
|
|
126
|
-
| `footer` | `ReactNode \| null` | 底部内容,`null` 表示无底部 |
|
|
127
|
-
| `width` | `string \| number` | Modal 宽度 |
|
|
128
|
-
| `styles.body` | `CSSProperties` | body 区域样式 |
|
|
129
|
-
|
|
130
|
-
## 迁移指南
|
|
131
|
-
|
|
132
|
-
### Before(声明式)
|
|
133
|
-
|
|
134
|
-
```tsx
|
|
135
|
-
// 调用方需要维护 state
|
|
136
|
-
const [open, setOpen] = useState(false);
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<>
|
|
140
|
-
<Button onClick={() => setOpen(true)}>打开</Button>
|
|
141
|
-
<MyModal open={open} setOpen={setOpen} />
|
|
142
|
-
</>
|
|
143
|
-
);
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### After(命令式)
|
|
147
|
-
|
|
148
|
-
```tsx
|
|
149
|
-
// 调用方无需 state,直接调用函数
|
|
150
|
-
const handleOpen = useCallback(() => {
|
|
151
|
-
createMyModal();
|
|
152
|
-
}, []);
|
|
153
|
-
|
|
154
|
-
return <Button onClick={handleOpen}>打开</Button>;
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
## 示例参考
|
|
158
|
-
|
|
159
|
-
- `src/features/SkillStore/index.tsx` - createModal 标准用法
|
|
160
|
-
- `src/features/SkillStore/SkillStoreContent.tsx` - Content 组件示例
|
|
161
|
-
- `src/features/LibraryModal/CreateNew/index.tsx` - 带回调的 createModal 用法
|
|
162
|
-
- `src/features/Electron/updater/UpdateModal.tsx` - 复杂 Modal 控制示例
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: flex layout components from `@lobehub/ui` usage
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Flexbox 布局组件使用指南
|
|
8
|
-
|
|
9
|
-
`@lobehub/ui` 提供了 `Flexbox` 和 `Center` 组件用于创建弹性布局。以下是重点组件的使用方法:
|
|
10
|
-
|
|
11
|
-
## Flexbox 组件
|
|
12
|
-
|
|
13
|
-
Flexbox 是最常用的布局组件,用于创建弹性布局,类似于 CSS 的 display: flex。
|
|
14
|
-
|
|
15
|
-
### 基本用法
|
|
16
|
-
|
|
17
|
-
```jsx
|
|
18
|
-
import { Flexbox } from '@lobehub/ui';
|
|
19
|
-
|
|
20
|
-
// 默认垂直布局
|
|
21
|
-
<Flexbox>
|
|
22
|
-
<div>子元素1</div>
|
|
23
|
-
<div>子元素2</div>
|
|
24
|
-
</Flexbox>
|
|
25
|
-
|
|
26
|
-
// 水平布局
|
|
27
|
-
<Flexbox horizontal>
|
|
28
|
-
<div>左侧元素</div>
|
|
29
|
-
<div>右侧元素</div>
|
|
30
|
-
</Flexbox>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### 常用属性
|
|
34
|
-
|
|
35
|
-
- horizontal: 布尔值,设置为水平方向布局
|
|
36
|
-
- flex: 数值或字符串,控制 flex 属性
|
|
37
|
-
- gap: 数值,设置子元素之间的间距
|
|
38
|
-
- align: 对齐方式,如 'center', 'flex-start' 等
|
|
39
|
-
- justify: 主轴对齐方式,如 'space-between', 'center' 等
|
|
40
|
-
- padding: 内边距值
|
|
41
|
-
- paddingInline: 水平内边距值
|
|
42
|
-
- paddingBlock: 垂直内边距值
|
|
43
|
-
- width/height: 设置宽高,通常用 '100%' 或具体像素值
|
|
44
|
-
- style: 自定义样式对象
|
|
45
|
-
|
|
46
|
-
### 实际应用示例
|
|
47
|
-
|
|
48
|
-
```jsx
|
|
49
|
-
// 经典三栏布局
|
|
50
|
-
<Flexbox horizontal height={'100%'} width={'100%'}>
|
|
51
|
-
{/* 左侧边栏 */}
|
|
52
|
-
<Flexbox
|
|
53
|
-
width={260}
|
|
54
|
-
style={{
|
|
55
|
-
borderRight: `1px solid ${theme.colorBorderSecondary}`,
|
|
56
|
-
height: '100%',
|
|
57
|
-
overflowY: 'auto',
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
<SidebarContent />
|
|
61
|
-
</Flexbox>
|
|
62
|
-
|
|
63
|
-
{/* 中间内容区 */}
|
|
64
|
-
<Flexbox flex={1} style={{ height: '100%' }}>
|
|
65
|
-
{/* 主要内容 */}
|
|
66
|
-
<Flexbox flex={1} padding={24} style={{ overflowY: 'auto' }}>
|
|
67
|
-
<MainContent />
|
|
68
|
-
</Flexbox>
|
|
69
|
-
|
|
70
|
-
{/* 底部区域 */}
|
|
71
|
-
<Flexbox
|
|
72
|
-
style={{
|
|
73
|
-
borderTop: `1px solid ${theme.colorBorderSecondary}`,
|
|
74
|
-
padding: '16px 24px',
|
|
75
|
-
}}
|
|
76
|
-
>
|
|
77
|
-
<Footer />
|
|
78
|
-
</Flexbox>
|
|
79
|
-
</Flexbox>
|
|
80
|
-
</Flexbox>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Center 组件
|
|
84
|
-
|
|
85
|
-
Center 是对 Flexbox 的封装,使子元素水平和垂直居中。
|
|
86
|
-
|
|
87
|
-
### 基本用法
|
|
88
|
-
|
|
89
|
-
```jsx
|
|
90
|
-
import { Center } from '@lobehub/ui';
|
|
91
|
-
|
|
92
|
-
<Center width={'100%'} height={'100%'}>
|
|
93
|
-
<Content />
|
|
94
|
-
</Center>;
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Center 组件继承了 Flexbox 的所有属性,同时默认设置了居中对齐。主要用于快速创建居中布局。
|
|
98
|
-
|
|
99
|
-
### 实际应用示例
|
|
100
|
-
|
|
101
|
-
```jsx
|
|
102
|
-
// 登录页面居中布局
|
|
103
|
-
<Flexbox height={'100%'} width={'100%'}>
|
|
104
|
-
<Center height={'100%'} width={'100%'}>
|
|
105
|
-
<LoginForm />
|
|
106
|
-
</Center>
|
|
107
|
-
</Flexbox>
|
|
108
|
-
|
|
109
|
-
// 图标居中显示
|
|
110
|
-
<Center className={styles.icon} flex={'none'} height={40} width={40}>
|
|
111
|
-
<Icon icon={icon} size={24} />
|
|
112
|
-
</Center>
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## 最佳实践
|
|
116
|
-
|
|
117
|
-
- 使用 flex={1} 让组件填充可用空间
|
|
118
|
-
- 使用 gap 代替传统的 margin 设置元素间距
|
|
119
|
-
- 嵌套 Flexbox 创建复杂布局
|
|
120
|
-
- 设置 overflow: 'auto' 使内容可滚动
|
|
121
|
-
- 使用 horizontal 创建水平布局,默认为垂直布局
|
|
122
|
-
- 与 antd-style 的 useTheme hook 配合使用创建主题响应式的布局
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
alwaysApply: true
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Project Description
|
|
6
|
-
|
|
7
|
-
You are developing an open-source, modern-design AI Agent Workspace: LobeHub(previous LobeChat).
|
|
8
|
-
|
|
9
|
-
Supported platforms:
|
|
10
|
-
|
|
11
|
-
- web desktop/mobile
|
|
12
|
-
- desktop(electron)
|
|
13
|
-
- mobile app(react native), coming soon
|
|
14
|
-
|
|
15
|
-
logo emoji: 🤯
|
|
16
|
-
|
|
17
|
-
## Project Technologies Stack
|
|
18
|
-
|
|
19
|
-
- Next.js 16
|
|
20
|
-
- implement spa inside nextjs with `react-router-dom`
|
|
21
|
-
- react 19
|
|
22
|
-
- TypeScript
|
|
23
|
-
- `@lobehub/ui`, antd for component framework
|
|
24
|
-
- antd-style for css-in-js framework
|
|
25
|
-
- lucide-react, `@ant-design/icons` for icons
|
|
26
|
-
- react-i18next for i18n
|
|
27
|
-
- zustand for state management
|
|
28
|
-
- nuqs for search params management
|
|
29
|
-
- SWR for data fetch
|
|
30
|
-
- aHooks for react hooks library
|
|
31
|
-
- dayjs for time library
|
|
32
|
-
- es-toolkit for utility library
|
|
33
|
-
- TRPC for type safe backend
|
|
34
|
-
- Neon PostgreSQL for backend DB
|
|
35
|
-
- Drizzle ORM
|
|
36
|
-
- Vitest for testing
|