@lobehub/lobehub 2.0.0-next.277 → 2.0.0-next.278
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/.cursor/rules/db-migrations.mdc +1 -1
- package/.cursor/rules/debug-usage.mdc +7 -5
- package/.cursor/rules/desktop-controller-tests.mdc +2 -1
- package/.cursor/rules/desktop-feature-implementation.mdc +9 -5
- package/.cursor/rules/desktop-local-tools-implement.mdc +67 -66
- package/.cursor/rules/desktop-menu-configuration.mdc +21 -9
- package/.cursor/rules/desktop-window-management.mdc +17 -2
- package/.cursor/rules/drizzle-schema-style-guide.mdc +6 -6
- package/.cursor/rules/hotkey.mdc +1 -0
- package/.cursor/rules/i18n.mdc +1 -0
- package/.cursor/rules/project-structure.mdc +16 -3
- package/.cursor/rules/react.mdc +17 -5
- package/.cursor/rules/recent-data-usage.mdc +2 -1
- package/.cursor/rules/testing-guide/testing-guide.mdc +262 -238
- package/.cursor/rules/testing-guide/zustand-store-action-test.mdc +1 -1
- package/.cursor/rules/zustand-action-patterns.mdc +1 -1
- package/.cursor/rules/zustand-slice-organization.mdc +4 -4
- package/CHANGELOG.md +25 -0
- package/CLAUDE.md +1 -1
- package/GEMINI.md +1 -1
- package/changelog/v1.json +5 -0
- package/docs/development/database-schema.dbml +16 -0
- package/locales/en-US/chat.json +24 -0
- package/locales/zh-CN/chat.json +24 -0
- package/package.json +1 -1
- package/packages/business/const/src/index.ts +3 -0
- package/packages/database/migrations/0069_add_topic_shares_table.sql +22 -0
- package/packages/database/migrations/meta/0069_snapshot.json +9704 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/models/__tests__/topicShare.test.ts +318 -0
- package/packages/database/src/models/topicShare.ts +177 -0
- package/packages/database/src/schemas/topic.ts +44 -2
- package/packages/types/src/conversation.ts +5 -0
- package/packages/types/src/topic/topic.ts +46 -0
- package/src/app/[variants]/(main)/agent/features/Conversation/Header/ShareButton/index.tsx +24 -9
- package/src/app/[variants]/(main)/group/features/Conversation/Header/ShareButton/index.tsx +26 -9
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/AspectRatioSelect/index.tsx +1 -2
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageNum.tsx +54 -173
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ResolutionSelect.tsx +22 -67
- package/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx +18 -0
- package/src/app/[variants]/router/desktopRouter.config.tsx +18 -0
- package/src/app/[variants]/share/t/[id]/SharedMessageList.tsx +54 -0
- package/src/app/[variants]/share/t/[id]/_layout/index.tsx +170 -0
- package/src/app/[variants]/share/t/[id]/features/Portal/index.tsx +66 -0
- package/src/app/[variants]/share/t/[id]/index.tsx +112 -0
- package/src/app/robots.tsx +1 -1
- package/src/business/client/BusinessMobileRoutes.tsx +1 -1
- package/src/features/Conversation/ChatList/index.tsx +12 -5
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Render/index.tsx +8 -4
- package/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx +15 -10
- package/src/features/Conversation/Messages/AssistantGroup/Tools.tsx +3 -1
- package/src/features/Conversation/Messages/AssistantGroup/components/ContentBlock.tsx +3 -2
- package/src/features/Conversation/Messages/AssistantGroup/components/GroupItem.tsx +2 -2
- package/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx +25 -26
- package/src/features/Conversation/Messages/Supervisor/components/Group.tsx +4 -2
- package/src/features/Conversation/Messages/Tool/Tool/index.tsx +16 -12
- package/src/features/Conversation/Messages/Tool/index.tsx +20 -11
- package/src/features/Conversation/Messages/index.tsx +1 -1
- package/src/features/Conversation/store/slices/data/action.ts +2 -1
- package/src/features/SharePopover/index.tsx +215 -0
- package/src/features/SharePopover/style.ts +10 -0
- package/src/libs/next/proxy/define-config.ts +4 -1
- package/src/locales/default/chat.ts +26 -0
- package/src/proxy.ts +1 -0
- package/src/server/routers/lambda/__tests__/message.test.ts +152 -0
- package/src/server/routers/lambda/__tests__/share.test.ts +227 -0
- package/src/server/routers/lambda/__tests__/topic.test.ts +174 -0
- package/src/server/routers/lambda/index.ts +2 -0
- package/src/server/routers/lambda/message.ts +37 -4
- package/src/server/routers/lambda/share.ts +55 -0
- package/src/server/routers/lambda/topic.ts +45 -0
- package/src/services/message/index.ts +1 -0
- package/src/services/topic/index.ts +16 -0
package/.cursor/rules/react.mdc
CHANGED
|
@@ -107,7 +107,7 @@ This project uses a **hybrid routing architecture**: Next.js App Router for stat
|
|
|
107
107
|
| Router | oauth, reset-password, etc.) | src/app/[variants]/(auth)/ |
|
|
108
108
|
+------------------+--------------------------------+--------------------------------+
|
|
109
109
|
| React Router | Main SPA features | BrowserRouter + Routes |
|
|
110
|
-
| DOM | (chat,
|
|
110
|
+
| DOM | (chat, community, settings) | desktopRouter.config.tsx |
|
|
111
111
|
| | | mobileRouter.config.tsx |
|
|
112
112
|
+------------------+--------------------------------+--------------------------------+
|
|
113
113
|
```
|
|
@@ -122,16 +122,16 @@ This project uses a **hybrid routing architecture**: Next.js App Router for stat
|
|
|
122
122
|
### Router Utilities
|
|
123
123
|
|
|
124
124
|
```tsx
|
|
125
|
-
import {
|
|
125
|
+
import { ErrorBoundary, RouteConfig, dynamicElement, redirectElement } from '@/utils/router';
|
|
126
126
|
|
|
127
127
|
// Lazy load a page component
|
|
128
|
-
element: dynamicElement(() => import('./chat'), 'Desktop > Chat')
|
|
128
|
+
element: dynamicElement(() => import('./chat'), 'Desktop > Chat');
|
|
129
129
|
|
|
130
130
|
// Create a redirect
|
|
131
|
-
element: redirectElement('/settings/profile')
|
|
131
|
+
element: redirectElement('/settings/profile');
|
|
132
132
|
|
|
133
133
|
// Error boundary for route
|
|
134
|
-
errorElement: <ErrorBoundary resetPath="/chat"
|
|
134
|
+
errorElement: <ErrorBoundary resetPath="/chat" />;
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
### Adding New Routes
|
|
@@ -142,6 +142,18 @@ errorElement: <ErrorBoundary resetPath="/chat" />
|
|
|
142
142
|
|
|
143
143
|
### Navigation
|
|
144
144
|
|
|
145
|
+
**Important**: For SPA pages (React Router DOM routes), use `Link` from `react-router-dom`, NOT from `next/link`.
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
// ❌ Wrong - next/link in SPA pages
|
|
149
|
+
import Link from 'next/link';
|
|
150
|
+
<Link href="/">Home</Link>
|
|
151
|
+
|
|
152
|
+
// ✅ Correct - react-router-dom Link in SPA pages
|
|
153
|
+
import { Link } from 'react-router-dom';
|
|
154
|
+
<Link to="/">Home</Link>
|
|
155
|
+
```
|
|
156
|
+
|
|
145
157
|
```tsx
|
|
146
158
|
// In components - use react-router-dom hooks
|
|
147
159
|
import { useNavigate, useParams } from 'react-router-dom';
|
|
@@ -42,7 +42,7 @@ const Component = () => {
|
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
44
|
<div>
|
|
45
|
-
{recentTopics.map(topic => (
|
|
45
|
+
{recentTopics.map((topic) => (
|
|
46
46
|
<div key={topic.id}>{topic.title}</div>
|
|
47
47
|
))}
|
|
48
48
|
</div>
|
|
@@ -81,6 +81,7 @@ const isInit = useSessionStore(recentSelectors.isRecentTopicsInit);
|
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
**RecentTopic 类型:**
|
|
84
|
+
|
|
84
85
|
```typescript
|
|
85
86
|
interface RecentTopic {
|
|
86
87
|
agent: {
|