@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.
Files changed (73) hide show
  1. package/.cursor/rules/db-migrations.mdc +1 -1
  2. package/.cursor/rules/debug-usage.mdc +7 -5
  3. package/.cursor/rules/desktop-controller-tests.mdc +2 -1
  4. package/.cursor/rules/desktop-feature-implementation.mdc +9 -5
  5. package/.cursor/rules/desktop-local-tools-implement.mdc +67 -66
  6. package/.cursor/rules/desktop-menu-configuration.mdc +21 -9
  7. package/.cursor/rules/desktop-window-management.mdc +17 -2
  8. package/.cursor/rules/drizzle-schema-style-guide.mdc +6 -6
  9. package/.cursor/rules/hotkey.mdc +1 -0
  10. package/.cursor/rules/i18n.mdc +1 -0
  11. package/.cursor/rules/project-structure.mdc +16 -3
  12. package/.cursor/rules/react.mdc +17 -5
  13. package/.cursor/rules/recent-data-usage.mdc +2 -1
  14. package/.cursor/rules/testing-guide/testing-guide.mdc +262 -238
  15. package/.cursor/rules/testing-guide/zustand-store-action-test.mdc +1 -1
  16. package/.cursor/rules/zustand-action-patterns.mdc +1 -1
  17. package/.cursor/rules/zustand-slice-organization.mdc +4 -4
  18. package/CHANGELOG.md +25 -0
  19. package/CLAUDE.md +1 -1
  20. package/GEMINI.md +1 -1
  21. package/changelog/v1.json +5 -0
  22. package/docs/development/database-schema.dbml +16 -0
  23. package/locales/en-US/chat.json +24 -0
  24. package/locales/zh-CN/chat.json +24 -0
  25. package/package.json +1 -1
  26. package/packages/business/const/src/index.ts +3 -0
  27. package/packages/database/migrations/0069_add_topic_shares_table.sql +22 -0
  28. package/packages/database/migrations/meta/0069_snapshot.json +9704 -0
  29. package/packages/database/migrations/meta/_journal.json +7 -0
  30. package/packages/database/src/models/__tests__/topicShare.test.ts +318 -0
  31. package/packages/database/src/models/topicShare.ts +177 -0
  32. package/packages/database/src/schemas/topic.ts +44 -2
  33. package/packages/types/src/conversation.ts +5 -0
  34. package/packages/types/src/topic/topic.ts +46 -0
  35. package/src/app/[variants]/(main)/agent/features/Conversation/Header/ShareButton/index.tsx +24 -9
  36. package/src/app/[variants]/(main)/group/features/Conversation/Header/ShareButton/index.tsx +26 -9
  37. package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/AspectRatioSelect/index.tsx +1 -2
  38. package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageNum.tsx +54 -173
  39. package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ResolutionSelect.tsx +22 -67
  40. package/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx +18 -0
  41. package/src/app/[variants]/router/desktopRouter.config.tsx +18 -0
  42. package/src/app/[variants]/share/t/[id]/SharedMessageList.tsx +54 -0
  43. package/src/app/[variants]/share/t/[id]/_layout/index.tsx +170 -0
  44. package/src/app/[variants]/share/t/[id]/features/Portal/index.tsx +66 -0
  45. package/src/app/[variants]/share/t/[id]/index.tsx +112 -0
  46. package/src/app/robots.tsx +1 -1
  47. package/src/business/client/BusinessMobileRoutes.tsx +1 -1
  48. package/src/features/Conversation/ChatList/index.tsx +12 -5
  49. package/src/features/Conversation/Messages/AssistantGroup/Tool/Render/index.tsx +8 -4
  50. package/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx +15 -10
  51. package/src/features/Conversation/Messages/AssistantGroup/Tools.tsx +3 -1
  52. package/src/features/Conversation/Messages/AssistantGroup/components/ContentBlock.tsx +3 -2
  53. package/src/features/Conversation/Messages/AssistantGroup/components/GroupItem.tsx +2 -2
  54. package/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx +25 -26
  55. package/src/features/Conversation/Messages/Supervisor/components/Group.tsx +4 -2
  56. package/src/features/Conversation/Messages/Tool/Tool/index.tsx +16 -12
  57. package/src/features/Conversation/Messages/Tool/index.tsx +20 -11
  58. package/src/features/Conversation/Messages/index.tsx +1 -1
  59. package/src/features/Conversation/store/slices/data/action.ts +2 -1
  60. package/src/features/SharePopover/index.tsx +215 -0
  61. package/src/features/SharePopover/style.ts +10 -0
  62. package/src/libs/next/proxy/define-config.ts +4 -1
  63. package/src/locales/default/chat.ts +26 -0
  64. package/src/proxy.ts +1 -0
  65. package/src/server/routers/lambda/__tests__/message.test.ts +152 -0
  66. package/src/server/routers/lambda/__tests__/share.test.ts +227 -0
  67. package/src/server/routers/lambda/__tests__/topic.test.ts +174 -0
  68. package/src/server/routers/lambda/index.ts +2 -0
  69. package/src/server/routers/lambda/message.ts +37 -4
  70. package/src/server/routers/lambda/share.ts +55 -0
  71. package/src/server/routers/lambda/topic.ts +45 -0
  72. package/src/services/message/index.ts +1 -0
  73. package/src/services/topic/index.ts +16 -0
@@ -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, discover, settings) | desktopRouter.config.tsx |
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 { dynamicElement, redirectElement, ErrorBoundary, RouteConfig } from '@/utils/router';
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: {