@nexttylabs/echo 0.4.0 → 0.6.0

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 (262) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/app/(dashboard)/admin/feedback/[id]/edit/page.tsx +12 -6
  3. package/app/(dashboard)/admin/feedback/new/page.tsx +19 -17
  4. package/app/(dashboard)/admin/layout.tsx +16 -6
  5. package/app/(dashboard)/layout.tsx +4 -2
  6. package/app/(dashboard)/settings/api-keys/page.tsx +13 -3
  7. package/app/(dashboard)/settings/layout.tsx +25 -2
  8. package/app/(dashboard)/settings/organization/page.tsx +8 -9
  9. package/app/(public)/[organizationSlug]/roadmap/page.tsx +19 -1
  10. package/app/api/admin/backup/route.ts +22 -4
  11. package/app/api/auth/register/handler.ts +1 -2
  12. package/app/api/feedback/[id]/comments/[commentId]/route.ts +13 -4
  13. package/app/api/feedback/[id]/reclassify/route.ts +4 -4
  14. package/app/api/organizations/handler.ts +2 -4
  15. package/components/settings/settings-sidebar.tsx +4 -4
  16. package/hooks/use-organization.tsx +116 -0
  17. package/hooks/use-permissions.ts +24 -11
  18. package/lib/auth/config.ts +0 -7
  19. package/lib/auth/organization.ts +20 -0
  20. package/lib/auth/permissions.ts +10 -0
  21. package/lib/db/migrations/0000_needy_leech.sql +335 -0
  22. package/lib/db/migrations/meta/0000_snapshot.json +2186 -1
  23. package/lib/db/migrations/meta/_journal.json +2 -135
  24. package/lib/db/schema/auth.ts +0 -1
  25. package/lib/db/schema/index.ts +0 -1
  26. package/lib/portal/public-context.tsx +5 -0
  27. package/package.json +20 -1
  28. package/.changeset/README.md +0 -21
  29. package/.changeset/config.json +0 -11
  30. package/.changeset/cozy-ghosts-care.md +0 -5
  31. package/.changeset/sharp-lines-stand.md +0 -5
  32. package/.changeset/sour-doodles-eat.md +0 -5
  33. package/.changeset/tender-moose-shop.md +0 -5
  34. package/.github/pull_request_template.md +0 -13
  35. package/.github/workflows/ci.yml +0 -41
  36. package/.github/workflows/publish.yml +0 -44
  37. package/.github/workflows/release.yml +0 -73
  38. package/AGENTS.md +0 -92
  39. package/Dockerfile +0 -57
  40. package/Makefile +0 -77
  41. package/bun.lock +0 -2503
  42. package/components/portal/project-switcher.tsx +0 -20
  43. package/docker-compose.dev.yml +0 -26
  44. package/docker-compose.yml +0 -98
  45. package/docs/architecture.md +0 -259
  46. package/docs/component-inventory.md +0 -261
  47. package/docs/database-migrations.md +0 -76
  48. package/docs/development-guide.md +0 -209
  49. package/docs/e2e-user-flows.csv +0 -31
  50. package/docs/er-diagram-feedback.mmd +0 -138
  51. package/docs/er-diagram.mmd +0 -281
  52. package/docs/i18n-check-report.md +0 -296
  53. package/docs/index.md +0 -214
  54. package/docs/logic-chain.md +0 -94
  55. package/docs/plans/2026-01-02-database-migration-scripts.md +0 -496
  56. package/docs/plans/2026-01-02-user-login-design.md +0 -37
  57. package/docs/plans/2026-01-02-user-login.md +0 -437
  58. package/docs/plans/2026-01-02-user-registration-design.md +0 -47
  59. package/docs/plans/2026-01-02-user-registration.md +0 -628
  60. package/docs/plans/2026-01-03-roles-permissions-design.md +0 -20
  61. package/docs/plans/2026-01-03-roles-permissions.md +0 -266
  62. package/docs/plans/2026-01-05-authentication-middleware.md +0 -207
  63. package/docs/plans/2026-01-05-member-removal.md +0 -186
  64. package/docs/plans/2026-01-05-organization-creation.md +0 -374
  65. package/docs/plans/2026-01-05-rbac-middleware.md +0 -112
  66. package/docs/plans/2026-01-05-role-configuration.md +0 -441
  67. package/docs/plans/2026-01-06-file-upload-support.md +0 -804
  68. package/docs/plans/2026-01-06-permission-check-hook.md +0 -155
  69. package/docs/plans/2026-01-06-resource-ownership-check.md +0 -231
  70. package/docs/plans/2026-01-07-feedback-tracking-link.md +0 -459
  71. package/docs/plans/2026-01-09-logout-redirect-design.md +0 -52
  72. package/docs/plans/2026-01-09-phase2-3-plan.md +0 -654
  73. package/docs/plans/2026-01-09-portal-execution-plan.md +0 -408
  74. package/docs/plans/2026-01-09-project-delete-feature-design.md +0 -163
  75. package/docs/plans/2026-01-09-project-delete-implementation.md +0 -451
  76. package/docs/plans/2026-01-09-project-edit-delete-design.md +0 -52
  77. package/docs/plans/2026-01-09-settings-center-design.md +0 -114
  78. package/docs/plans/2026-01-09-settings-center.md +0 -948
  79. package/docs/plans/2026-01-10-organization-only-design.md +0 -66
  80. package/docs/plans/2026-01-10-organization-only-implementation.md +0 -433
  81. package/docs/plans/2026-01-10-portal-settings-restructure-plan.md +0 -18
  82. package/docs/plans/2026-01-10-project-settings-tabs-design-implementation.md +0 -296
  83. package/docs/plans/2026-01-14-e2e-playwright-feedback.md +0 -173
  84. package/docs/plans/2026-01-15-feedback-management-org-context-design.md +0 -82
  85. package/docs/plans/2026-01-15-feedback-management-org-context-implementation-plan.md +0 -521
  86. package/docs/plans/2026-01-16-admin-feedback-filters-design.md +0 -75
  87. package/docs/plans/2026-01-16-admin-feedback-filters-implementation.md +0 -293
  88. package/docs/plans/2026-01-16-admin-feedback-route-consolidation.md +0 -180
  89. package/docs/plans/2026-01-16-e2e-test-fixes.md +0 -158
  90. package/docs/plans/2026-01-17-admin-feedback-filters.md +0 -214
  91. package/docs/plans/2026-01-17-admin-feedback-improvements.md +0 -453
  92. package/docs/plans/2026-01-18-changesets-design.md +0 -40
  93. package/docs/product_changes.md +0 -37
  94. package/docs/project-overview.md +0 -159
  95. package/docs/project-scan-report.json +0 -104
  96. package/docs/route-role-visibility.md +0 -51
  97. package/docs/source-tree-analysis.md +0 -150
  98. package/docs/testing/delete-project-manual-tests.md +0 -18
  99. package/docs/user-story-tracking.md +0 -191
  100. package/eslint.config.mjs +0 -19
  101. package/lib/db/migrations/.gitkeep +0 -0
  102. package/lib/db/migrations/0000_cynical_gladiator.sql +0 -53
  103. package/lib/db/migrations/0001_wandering_sunfire.sql +0 -27
  104. package/lib/db/migrations/0002_shallow_speedball.sql +0 -1
  105. package/lib/db/migrations/0003_add_org_description.sql +0 -1
  106. package/lib/db/migrations/0003_boring_wild_pack.sql +0 -13
  107. package/lib/db/migrations/0004_windy_tyrannus.sql +0 -27
  108. package/lib/db/migrations/0005_perpetual_doorman.sql +0 -5
  109. package/lib/db/migrations/0006_aberrant_captain_midlands.sql +0 -13
  110. package/lib/db/migrations/0007_clever_captain_cross.sql +0 -14
  111. package/lib/db/migrations/0008_sparkling_pandemic.sql +0 -2
  112. package/lib/db/migrations/0009_happy_black_tom.sql +0 -29
  113. package/lib/db/migrations/0010_kind_junta.sql +0 -8
  114. package/lib/db/migrations/0011_mute_squadron_supreme.sql +0 -25
  115. package/lib/db/migrations/0012_giant_power_man.sql +0 -24
  116. package/lib/db/migrations/0013_damp_titanium_man.sql +0 -17
  117. package/lib/db/migrations/0014_blue_alice.sql +0 -18
  118. package/lib/db/migrations/0015_webhook_tables.sql +0 -41
  119. package/lib/db/migrations/0016_github_integration.sql +0 -30
  120. package/lib/db/migrations/0016_overjoyed_ghost_rider.sql +0 -22
  121. package/lib/db/migrations/0017_slimy_inhumans.sql +0 -6
  122. package/lib/db/migrations/0018_same_spitfire.sql +0 -1
  123. package/lib/db/migrations/0019_jittery_loners.sql +0 -16
  124. package/lib/db/migrations/0019_remove_projects_add_org_settings.sql +0 -14
  125. package/lib/db/migrations/meta/0001_snapshot.json +0 -553
  126. package/lib/db/migrations/meta/0002_snapshot.json +0 -560
  127. package/lib/db/migrations/meta/0003_snapshot.json +0 -650
  128. package/lib/db/migrations/meta/0004_snapshot.json +0 -852
  129. package/lib/db/migrations/meta/0005_snapshot.json +0 -900
  130. package/lib/db/migrations/meta/0006_snapshot.json +0 -1011
  131. package/lib/db/migrations/meta/0007_snapshot.json +0 -1125
  132. package/lib/db/migrations/meta/0008_snapshot.json +0 -1146
  133. package/lib/db/migrations/meta/0009_snapshot.json +0 -1386
  134. package/lib/db/migrations/meta/0010_snapshot.json +0 -1419
  135. package/lib/db/migrations/meta/0011_snapshot.json +0 -1615
  136. package/lib/db/migrations/meta/0012_snapshot.json +0 -1805
  137. package/lib/db/migrations/meta/0013_snapshot.json +0 -1948
  138. package/lib/db/migrations/meta/0014_snapshot.json +0 -2082
  139. package/lib/db/migrations/meta/0015_snapshot.json +0 -2476
  140. package/lib/db/migrations/meta/0016_snapshot.json +0 -2633
  141. package/lib/db/migrations/meta/0017_snapshot.json +0 -2680
  142. package/lib/db/migrations/meta/0018_snapshot.json +0 -2686
  143. package/lib/db/migrations/meta/0019_snapshot.json +0 -2741
  144. package/lib/db/schema/projects.ts +0 -145
  145. package/lib/db/schema/user-profiles.ts +0 -31
  146. package/lib/validations/projects.ts +0 -49
  147. package/next-env.d.ts +0 -6
  148. package/playwright.config.ts +0 -44
  149. package/proxy.test.ts +0 -131
  150. package/proxy.ts +0 -116
  151. package/scripts/backup-db.sh +0 -57
  152. package/scripts/backup-db.ts +0 -24
  153. package/scripts/generate-openapi.ts +0 -22
  154. package/scripts/migration-helper.ts +0 -39
  155. package/scripts/pre-deploy.ts +0 -75
  156. package/scripts/restore-db.sh +0 -60
  157. package/scripts/rollback.ts +0 -72
  158. package/scripts/seed-tags.ts +0 -48
  159. package/tests/api/feedback-bulk.test.ts +0 -47
  160. package/tests/api/feedback-by-id.test.ts +0 -67
  161. package/tests/api/feedback-comments-route-import.test.ts +0 -26
  162. package/tests/api/feedback-create.test.ts +0 -71
  163. package/tests/api/feedback-delete.test.ts +0 -160
  164. package/tests/api/feedback-filter.test.ts +0 -250
  165. package/tests/api/feedback-list.test.ts +0 -234
  166. package/tests/api/feedback-route-assignee-condition.test.ts +0 -32
  167. package/tests/api/feedback-similar.test.ts +0 -46
  168. package/tests/api/feedback-sort.test.ts +0 -261
  169. package/tests/api/feedback-status-enum.test.ts +0 -49
  170. package/tests/api/feedback-status-filter.test.ts +0 -117
  171. package/tests/api/feedback-submit-on-behalf.test.ts +0 -269
  172. package/tests/api/feedback.test.ts +0 -175
  173. package/tests/api/identify-jwt.test.ts +0 -25
  174. package/tests/api/invitation-accept.test.ts +0 -213
  175. package/tests/api/organization-invitations.test.ts +0 -186
  176. package/tests/api/organization-members-list.test.ts +0 -79
  177. package/tests/api/organization-members.test.ts +0 -340
  178. package/tests/api/organizations.test.ts +0 -149
  179. package/tests/api/register.test.ts +0 -112
  180. package/tests/api/upload.test.ts +0 -103
  181. package/tests/api/vote.test.ts +0 -82
  182. package/tests/app/admin-feedback-detail-page.test.tsx +0 -25
  183. package/tests/app/admin-feedback-list-page.test.tsx +0 -25
  184. package/tests/app/admin-feedback-new-page.test.tsx +0 -25
  185. package/tests/app/health-route-helpers.test.ts +0 -27
  186. package/tests/app/login-page.test.ts +0 -26
  187. package/tests/app/portal-page.test.ts +0 -29
  188. package/tests/app/project-portal-overview.test.tsx +0 -25
  189. package/tests/app/widget-page-import.test.ts +0 -25
  190. package/tests/components/create-post-dialog-defaults.test.ts +0 -43
  191. package/tests/components/feedback/duplicate-suggestions-inline.test.tsx +0 -27
  192. package/tests/components/feedback/embedded-feedback-form.test.tsx +0 -96
  193. package/tests/components/feedback/feedback-detail.test.tsx +0 -25
  194. package/tests/components/feedback/feedback-stats.test.tsx +0 -49
  195. package/tests/components/feedback-bulk-actions.test.tsx +0 -39
  196. package/tests/components/feedback-i18n-keys.test.ts +0 -70
  197. package/tests/components/feedback-list-controls-compile.test.ts +0 -25
  198. package/tests/components/feedback-list-controls.test.tsx +0 -204
  199. package/tests/components/feedback-list-item.test.tsx +0 -67
  200. package/tests/components/landing/hero.test.tsx +0 -46
  201. package/tests/components/layout/language-switcher.test.tsx +0 -25
  202. package/tests/components/layout/sidebar.test.tsx +0 -157
  203. package/tests/components/login-form.test.ts +0 -25
  204. package/tests/components/organization-form.test.ts +0 -32
  205. package/tests/components/organization-switcher.test.ts +0 -25
  206. package/tests/components/pagination.test.tsx +0 -43
  207. package/tests/components/portal-overview.test.tsx +0 -25
  208. package/tests/components/profile-form.test.tsx +0 -139
  209. package/tests/components/role-selector.test.ts +0 -31
  210. package/tests/components/status-chart.test.tsx +0 -90
  211. package/tests/e2e/auth.e2e.ts +0 -323
  212. package/tests/e2e/feedback-actions.e2e.ts +0 -471
  213. package/tests/e2e/feedback-attachment.e2e.ts +0 -168
  214. package/tests/e2e/feedback-customer.e2e.ts +0 -226
  215. package/tests/e2e/feedback-management.e2e.ts +0 -565
  216. package/tests/e2e/feedback-submit.e2e.ts +0 -133
  217. package/tests/e2e/feedback-view.e2e.ts +0 -297
  218. package/tests/e2e/fixtures/test-data.ts +0 -235
  219. package/tests/e2e/health-check.e2e.ts +0 -230
  220. package/tests/e2e/helpers/test-utils-helpers.test.ts +0 -43
  221. package/tests/e2e/helpers/test-utils.ts +0 -298
  222. package/tests/e2e/integration-placeholders.e2e.ts +0 -199
  223. package/tests/e2e/organization.e2e.ts +0 -292
  224. package/tests/e2e/permissions.e2e.ts +0 -424
  225. package/tests/e2e/project-widget.e2e.ts +0 -63
  226. package/tests/feedback/filters.test.ts +0 -29
  227. package/tests/hooks/use-permissions.test.ts +0 -52
  228. package/tests/lib/ai/classifier.test.ts +0 -104
  229. package/tests/lib/ai/duplicate-detector.test.ts +0 -234
  230. package/tests/lib/attachments-schema.test.ts +0 -30
  231. package/tests/lib/auth/session.test.ts +0 -49
  232. package/tests/lib/auth-client.test.ts +0 -37
  233. package/tests/lib/auth-config.test.ts +0 -26
  234. package/tests/lib/feedback-prefill.test.ts +0 -52
  235. package/tests/lib/feedback-processor.test.ts +0 -41
  236. package/tests/lib/feedback-schema.test.ts +0 -33
  237. package/tests/lib/file-validator.test.ts +0 -48
  238. package/tests/lib/get-feedback-by-id.test.ts +0 -37
  239. package/tests/lib/invitations.test.ts +0 -35
  240. package/tests/lib/login-schema.test.ts +0 -36
  241. package/tests/lib/org-context.test.ts +0 -95
  242. package/tests/lib/organization-access.test.ts +0 -44
  243. package/tests/lib/organization-member-role-schema.test.ts +0 -41
  244. package/tests/lib/permissions.test.ts +0 -88
  245. package/tests/lib/portal-analytics.test.ts +0 -25
  246. package/tests/lib/portal-contributors.test.ts +0 -25
  247. package/tests/lib/portal-copy.test.ts +0 -27
  248. package/tests/lib/portal-i18n.test.ts +0 -30
  249. package/tests/lib/portal-leaderboard-settings.test.ts +0 -25
  250. package/tests/lib/portal-modules.test.ts +0 -25
  251. package/tests/lib/portal-seo.test.ts +0 -25
  252. package/tests/lib/portal-sharing.test.ts +0 -25
  253. package/tests/lib/portal-sorting.test.ts +0 -25
  254. package/tests/lib/portal-theme.test.ts +0 -25
  255. package/tests/lib/rate-limit.test.ts +0 -142
  256. package/tests/lib/resolve-locale.test.ts +0 -34
  257. package/tests/lib/services/backup.test.ts +0 -145
  258. package/tests/lib/user-organizations.test.ts +0 -42
  259. package/tests/lib/user-role-schema.test.ts +0 -33
  260. package/tests/lib/user-schema.test.ts +0 -25
  261. package/tests/setup.ts +0 -74
  262. package/vercel.json +0 -4
@@ -1,281 +0,0 @@
1
- erDiagram
2
- organizations {
3
- text id PK
4
- text name
5
- text slug
6
- text description
7
- timestamp created_at
8
- timestamp updated_at
9
- }
10
-
11
- organization_members {
12
- text organization_id FK
13
- text user_id FK
14
- text role
15
- timestamp created_at
16
- }
17
-
18
- invitations {
19
- text id PK
20
- text organization_id FK
21
- text email
22
- text role
23
- text token
24
- timestamp expires_at
25
- timestamp accepted_at
26
- timestamp created_at
27
- }
28
-
29
- organization_settings {
30
- text organizationId PK FK
31
- jsonb widgetConfig
32
- jsonb portalConfig
33
- text customDomain
34
- timestamp createdAt
35
- timestamp updatedAt
36
- }
37
-
38
- user {
39
- text id PK
40
- text name
41
- text email
42
- text role
43
- boolean email_verified
44
- text image
45
- timestamp created_at
46
- timestamp updated_at
47
- }
48
-
49
- user_profiles {
50
- text user_id PK FK
51
- text name
52
- timestamp created_at
53
- timestamp updated_at
54
- }
55
-
56
- session {
57
- text id PK
58
- timestamp expires_at
59
- text token
60
- text user_id FK
61
- }
62
-
63
- account {
64
- text id PK
65
- text user_id FK
66
- text provider_id
67
- text account_id
68
- }
69
-
70
- verification {
71
- text id PK
72
- text identifier
73
- text value
74
- timestamp expires_at
75
- }
76
-
77
- feedback {
78
- int feedbackId PK
79
- text title
80
- text description
81
- text type
82
- text priority
83
- text status
84
- text organizationId
85
- boolean submittedOnBehalf
86
- text submittedBy FK
87
- jsonb customerInfo
88
- timestamp createdAt
89
- timestamp updatedAt
90
- timestamp deletedAt
91
- boolean autoClassified
92
- text processingStatus
93
- timestamp processedAt
94
- int githubIssueId
95
- int githubIssueNumber
96
- text githubIssueUrl
97
- timestamp githubSyncedAt
98
- text githubStatus
99
- }
100
-
101
- attachments {
102
- int attachmentId PK
103
- int feedbackId FK
104
- text fileName
105
- text filePath
106
- int fileSize
107
- text mimeType
108
- timestamp createdAt
109
- }
110
-
111
- votes {
112
- int voteId PK
113
- int feedbackId FK
114
- text visitorId
115
- text userId FK
116
- timestamp createdAt
117
- }
118
-
119
- comments {
120
- int commentId PK
121
- int feedbackId FK
122
- text userId FK
123
- text authorName
124
- text authorEmail
125
- text guestToken
126
- text content
127
- boolean isInternal
128
- timestamp createdAt
129
- timestamp updatedAt
130
- }
131
-
132
- status_history {
133
- int historyId PK
134
- int feedbackId FK
135
- text oldStatus
136
- text newStatus
137
- text changedBy FK
138
- timestamp changedAt
139
- text comment
140
- }
141
-
142
- tags {
143
- int tagId PK
144
- text name
145
- text slug
146
- text color
147
- text description
148
- timestamp createdAt
149
- }
150
-
151
- feedback_tags {
152
- int id PK
153
- int feedbackId FK
154
- int tagId FK
155
- timestamp createdAt
156
- }
157
-
158
- ai_processing_results {
159
- int id PK
160
- int feedbackId FK
161
- jsonb classification
162
- jsonb tagSuggestions
163
- jsonb duplicateCandidates
164
- int processingTime
165
- text status
166
- text errorMessage
167
- timestamp createdAt
168
- timestamp updatedAt
169
- }
170
-
171
- duplicate_feedback {
172
- int id PK
173
- int originalFeedbackId FK
174
- int duplicateFeedbackId FK
175
- int similarity
176
- text status
177
- text confirmedBy FK
178
- timestamp confirmedAt
179
- timestamp createdAt
180
- }
181
-
182
- notifications {
183
- int notificationId PK
184
- text userId FK
185
- int feedbackId FK
186
- text type
187
- jsonb data
188
- text status
189
- timestamp sentAt
190
- text error
191
- timestamp createdAt
192
- }
193
-
194
- notification_preferences {
195
- text userId PK FK
196
- boolean statusChange
197
- boolean newComment
198
- timestamp updatedAt
199
- }
200
-
201
- api_keys {
202
- int keyId PK
203
- text name
204
- text hashedKey
205
- text prefix
206
- text organizationId FK
207
- boolean disabled
208
- timestamp lastUsed
209
- timestamp createdAt
210
- timestamp updatedAt
211
- }
212
-
213
- webhooks {
214
- int webhookId PK
215
- text organizationId FK
216
- text name
217
- text url
218
- text secret
219
- jsonb events
220
- boolean enabled
221
- timestamp createdAt
222
- timestamp updatedAt
223
- }
224
-
225
- webhook_events {
226
- int eventId PK
227
- int webhookId FK
228
- text eventType
229
- jsonb payload
230
- text status
231
- int responseStatus
232
- text responseBody
233
- int retryCount
234
- int maxRetries
235
- timestamp nextRetryAt
236
- timestamp deliveredAt
237
- timestamp createdAt
238
- timestamp updatedAt
239
- }
240
-
241
- github_integrations {
242
- int id PK
243
- text organizationId FK
244
- text accessToken
245
- text owner
246
- text repo
247
- jsonb labelMapping
248
- jsonb statusMapping
249
- boolean autoSync
250
- text webhookSecret
251
- timestamp createdAt
252
- timestamp updatedAt
253
- }
254
-
255
- organizations ||--o{ organization_members : has
256
- organizations ||--o{ invitations : has
257
- organizations ||--|| organization_settings : config
258
- organizations ||--o{ feedback : owns
259
- organizations ||--o{ api_keys : owns
260
- organizations ||--o{ webhooks : owns
261
- organizations ||--o{ github_integrations : owns
262
-
263
- user ||--o{ organization_members : member
264
- user ||--|| user_profiles : profile
265
- user ||--o{ session : sessions
266
- user ||--o{ account : accounts
267
- user ||--o{ notifications : receives
268
- user ||--|| notification_preferences : prefs
269
-
270
- feedback ||--o{ attachments : has
271
- feedback ||--o{ votes : has
272
- feedback ||--o{ comments : has
273
- feedback ||--o{ status_history : status
274
- feedback ||--o{ feedback_tags : tags
275
- feedback ||--o{ ai_processing_results : ai
276
- feedback ||--o{ duplicate_feedback : duplicates
277
- feedback ||--o{ notifications : notifies
278
-
279
- tags ||--o{ feedback_tags : maps
280
-
281
- webhooks ||--o{ webhook_events : events
@@ -1,296 +0,0 @@
1
- # 多语言支持(i18n)检查报告
2
-
3
- ## 检查日期
4
- 2026-01-17
5
-
6
- ## 项目概况
7
- - **项目名称**: Echo
8
- - **技术栈**: Next.js 16.1.1 + React 19 + TypeScript
9
- - **国际化方案**: next-intl
10
- - **支持语言**: en, zh-CN, jp
11
-
12
- ## 配置检查 ✅
13
-
14
- ### 1. i18n 配置文件
15
- - `/i18n/config.ts` - 完整配置,包含默认语言、支持的语言列表等
16
- - `/i18n/request.ts` - next-intl 请求配置
17
- - `/i18n/resolve-locale.ts` - 语言解析逻辑
18
-
19
- ### 2. 语言文件
20
- - `/messages/en.json` - 英文翻译(498行)
21
- - `/messages/zh-CN.json` - 中文翻译(491行)
22
- - `/messages/jp.json` - 日文翻译
23
-
24
- ## 组件检查结果
25
-
26
- ### 已实现 i18n 的组件(27个)
27
- ✅ 使用了 `useTranslations` 或 `getTranslations` 的组件:
28
- - `/components/dashboard/stats-cards.tsx`
29
- - `/components/shared/pagination.tsx`
30
- - `/components/feedback/vote-button.tsx`
31
- - `/components/integrations/github-config.tsx`
32
- - `/components/dashboard/status-chart.tsx`
33
- - `/components/feedback/feedback-detail-view.tsx`
34
- - `/components/feedback/feedback-filters.tsx`
35
- - `/components/feedback/feedback-list-item.tsx`
36
- - `/components/feedback/feedback-bulk-actions.tsx`
37
- - `/components/dashboard/recent-feedback-list.tsx`
38
- - `/components/feedback/feedback-list-controls.tsx`
39
- - `/components/feedback/feedback-edit-form.tsx`
40
- - `/components/feedback/auto-classification-badge.tsx`
41
- - `/components/feedback/feedback-list.tsx`
42
- - `/components/feedback/processing-status.tsx`
43
- - `/components/layout/sidebar.tsx`
44
- - `/components/layout/language-switcher.tsx`
45
- - `/components/layout/mobile-sidebar.tsx`
46
- - `/components/auth/register-form.tsx`
47
- - `/components/auth/login-form.tsx`
48
- - `/components/widget/widget-form.tsx`
49
- - `/components/portal/contributors-sidebar.tsx`
50
- - `/components/settings/notification-preferences.tsx`
51
- - `/components/settings/settings-sidebar.tsx`
52
- - `/components/settings/profile-form.tsx`
53
- - `/components/settings/appearance-form.tsx`
54
- - `/components/settings/api-keys-list.tsx`
55
-
56
- ### ❌ 未实现 i18n 的组件(59个)
57
-
58
- #### 1. 包含硬编码中文文本的组件
59
-
60
- **`/components/landing/hero.tsx`**
61
- - 硬编码文本:"开源产品反馈管理平台"、"专为初创公司设计"等
62
- - 导航链接:"登录"、"免费注册"等
63
-
64
- **`/components/dashboard/quick-actions.tsx`**
65
- - 硬编码文本:"提交新反馈"、"查看全部反馈"、"设置"、"组织设置"
66
-
67
- **`/components/feedback/embedded-feedback-form.tsx`**
68
- - 导出的常量包含中文:
69
- ```typescript
70
- export const FEEDBACK_TRIGGER_LABEL = "反馈";
71
- export const FEEDBACK_DIALOG_TITLE = "提交反馈";
72
- export const FEEDBACK_TITLE_LABEL = "标题";
73
- // ... 更多
74
- ```
75
-
76
- **`/components/portal/portal-modules-panel.tsx`**
77
- - 硬编码文本:"Portal 模块开关"、"控制门户中展示的功能模块"、"反馈"、"允许用户提交和浏览反馈"等
78
-
79
- **`/components/portal/settings-forms/copy-form.tsx`**
80
- - 默认值包含中文:
81
- ```typescript
82
- title: initialData?.title ?? "反馈中心",
83
- ctaLabel: initialData?.ctaLabel ?? "提交反馈",
84
- // ... 更多
85
- ```
86
-
87
- **`/components/settings/organization-form.tsx`**
88
- - 硬编码文本:"组织设置"、"创建新组织"
89
-
90
- **`/components/feedback/submit-on-behalf-form.tsx`**
91
- - 硬编码文本:"提交中..."、"提交反馈"
92
-
93
- **`/components/feedback/file-upload.tsx`**
94
- - 硬编码文本:"请先提交反馈"
95
-
96
- #### 2. 示例和演示组件
97
- - `/components/component-example.tsx` - 包含大量硬编码英文文本
98
- - `/components/example.tsx` - 基础组件,无显示文本
99
-
100
- #### 3. 其他需要检查的组件
101
- - `/components/api-keys/api-key-manager.tsx`
102
- - `/components/comment/` 目录下的所有组件
103
- - `/components/dashboard/organization-switcher.tsx`
104
- - `/components/feedback/` 目录下的大部分组件
105
- - `/components/integrations/` 目录下的组件
106
- - `/components/portal/` 目录下的组件
107
- - `/components/widget/` 目录下的组件
108
-
109
- ## 页面检查结果
110
-
111
- ### 已实现 i18n 的页面(67个)
112
- ✅ 使用了 `useTranslations` 或 `getTranslations` 的页面已正确实现
113
-
114
- ### ❌ 需要检查的页面(35个)
115
-
116
- #### 1. 公共页面
117
- - `/app/(public)/page.tsx` - 仅引用 Hero 组件
118
- - `/app/(public)/docs/page.tsx` - API 文档页面,包含硬编码文本
119
-
120
- #### 2. 认证页面
121
- - `/app/(auth)/login/page.tsx`
122
- - `/app/(auth)/register/page.tsx`
123
- - `/app/(auth)/sign-in/page.tsx`
124
-
125
- #### 3. 设置页面
126
- - `/app/(dashboard)/settings/` 目录下的多个子页面
127
-
128
- ## 建议修复方案
129
-
130
- ### 1. 立即修复(高优先级)
131
-
132
- #### `/components/landing/hero.tsx`
133
- ```typescript
134
- // 添加导入
135
- import { useTranslations } from "next-intl";
136
-
137
- export function Hero() {
138
- const t = useTranslations("hero");
139
-
140
- return (
141
- <div className="min-h-screen bg-linear-to-br from-slate-50 via-white to-slate-100">
142
- <header className="container mx-auto flex items-center justify-between px-4 py-6">
143
- <div className="flex items-center gap-2">
144
- <MessageSquare className="size-8 text-primary" />
145
- <span className="text-2xl font-bold text-slate-900">{t("title")}</span>
146
- </div>
147
- <nav className="flex items-center gap-4">
148
- <LanguageSwitcher variant="icon" />
149
- <Button variant="ghost" asChild>
150
- <Link href="/login">{t("login")}</Link>
151
- </Button>
152
- <Button asChild>
153
- <Link href="/register">{t("register")}</Link>
154
- </Button>
155
- </nav>
156
- </header>
157
- // ... 更多
158
- </div>
159
- );
160
- }
161
- ```
162
-
163
- 需要在语言文件中添加:
164
- ```json
165
- {
166
- "hero": {
167
- "title": "Echo",
168
- "login": "登录",
169
- "register": "免费注册",
170
- "headline": "开源产品反馈管理平台",
171
- "description": "专为初创公司设计,让团队能够集中管理产品反馈、发现洞察并做出明智的产品决策。",
172
- "cta1": "开始使用",
173
- "cta2": "查看文档",
174
- "coreValues": "核心价值"
175
- }
176
- }
177
- ```
178
-
179
- #### `/components/dashboard/quick-actions.tsx`
180
- ```typescript
181
- import { useTranslations } from "next-intl";
182
-
183
- export function QuickActions() {
184
- const t = useTranslations("dashboard.quickActions");
185
-
186
- return (
187
- <div className="flex flex-wrap gap-3">
188
- <Button asChild>
189
- <Link href="/admin/feedback/new">
190
- <Plus className="mr-2 h-4 w-4" />
191
- {t("submitFeedback")}
192
- </Link>
193
- </Button>
194
- // ... 更多
195
- </div>
196
- );
197
- }
198
- ```
199
-
200
- ### 2. 中期修复(中优先级)
201
-
202
- 1. **所有 feedback 相关组件**
203
- - 将导出的常量改为使用 useTranslations
204
- - 创建统一的翻译键命名空间
205
-
206
- 2. **所有 portal 相关组件**
207
- - 为门户设置创建专门的翻译节
208
- - 确保所有用户可见文本都支持多语言
209
-
210
- 3. **所有 settings 相关组件**
211
- - 统一设置页面的翻译键结构
212
- - 注意表单标签和提示信息
213
-
214
- ### 3. 长期优化(低优先级)
215
-
216
- 1. **创建翻译键命名规范**
217
- - 建议使用点分隔的命名空间:`section.component.field`
218
- - 避免过深的嵌套
219
-
220
- 2. **建立翻译检查流程**
221
- - 在 CI/CD 中添加翻译完整性检查
222
- - 确保新增的文本都包含翻译
223
-
224
- 3. **优化翻译文件结构**
225
- - 考虑按功能模块拆分翻译文件
226
- - 减少单个文件的复杂度
227
-
228
- ## 缺失的翻译键示例
229
-
230
- 基于检查结果,以下是一些需要添加的翻译键:
231
-
232
- ```json
233
- {
234
- "hero": { ... },
235
- "dashboard": {
236
- "quickActions": {
237
- "submitFeedback": "提交新反馈",
238
- "viewAllFeedback": "查看全部反馈",
239
- "settings": "设置",
240
- "organizationSettings": "组织设置"
241
- }
242
- },
243
- "feedback": {
244
- "trigger": "反馈",
245
- "dialogTitle": "提交反馈",
246
- "title": "标题",
247
- "description": "描述",
248
- "type": "反馈类型",
249
- "priority": "优先级",
250
- "submit": "提交",
251
- "cancel": "取消",
252
- "success": "反馈提交成功",
253
- "trackingLink": "跟踪链接"
254
- },
255
- "portal": {
256
- "modules": {
257
- "title": "Portal 模块开关",
258
- "description": "控制门户中展示的功能模块",
259
- "feedback": "反馈",
260
- "feedbackDescription": "允许用户提交和浏览反馈",
261
- "roadmap": "路线图",
262
- "roadmapDescription": "展示产品开发计划和进度",
263
- "changelog": "更新日志",
264
- "changelogDescription": "发布产品更新和改进说明"
265
- },
266
- "copy": {
267
- "title": "反馈中心",
268
- "ctaLabel": "提交反馈",
269
- "emptyState": "还没有反馈,成为第一个分享想法的人!",
270
- "success": "感谢您的反馈!我们会认真阅读。"
271
- }
272
- },
273
- "settings": {
274
- "organization": {
275
- "title": "组织设置",
276
- "create": "创建新组织"
277
- }
278
- }
279
- }
280
- ```
281
-
282
- ## 总结
283
-
284
- - ✅ **已完成**: 27个组件和67个页面已正确实现 i18n
285
- - ❌ **需要修复**: 59个组件和35个页面需要添加 i18n 支持
286
- - 📊 **完成度**: 约 55%
287
-
288
- **建议优先级**:
289
- 1. 先修复包含硬编码中文的组件(高优先级)
290
- 2. 再修复其他用户可见的组件(中优先级)
291
- 3. 最后优化和规范化(低优先级)
292
-
293
- **注意事项**:
294
- - 修复时确保所有三种语言(en、zh-CN、jp)都有对应翻译
295
- - 测试语言切换功能是否正常工作
296
- - 注意动态内容(如日期、数字)的本地化