feat: native comments, bug reports, dictionary, type safety#200
Conversation
…overhaul Comments system: - Replace Giscus (GitHub Discussions) with native comment section on word pages - Comments table in Postgres (shared with bug reports via type field) - Real-time game result badges via single SQL query with correlated subquery - Badge rules: N/maxGuesses for wordle modes, N guesses for semantic, skip speed - Mode label only shown when user has 2+ badges for the same word - Basic moderation: profanity filter, URL blocking, rate limiting, hidden flag - Flat list, auth required to post, public to read Bug reports & feedback: - In-app report modal replacing GitHub Issues link in sidebar - Reports stored in comments table (type='report'/'feedback') - Auto-collects URL, browser, screen size, PWA status, language, mode - Optional email notification via Resend (works without it) Word page improvements: - WordDictionary: full Wiktionary entries (senses, etymology, IPA, forms) - WordTranslations: cross-language word links with SSR-safe language names - Fix hydration mismatch: translations now use server-resolved names instead of client-side cache (useNuxtData), eliminating 80+ hydration warnings that were corrupting Vue's component tree and breaking teleports/event handlers - Fix @unhead/vue dispose crash: merge 3 useHead/useSeoMeta calls into 1 - JSON-LD enriched with pronunciation and etymology from kaikki data - Image handling moved from HEAD-probe to server-provided image_url Type safety (45 errors → 0): - Add type annotations to all implicit-any parameters across server utils - Extend UiStrings and LanguageHelp types with missing optional properties - Fix null vs undefined mismatches in Vue components - Fix Nuxt route type recursion (ofetch import bypasses typed $fetch) - Add trackCustomEvent to analytics composable - Fix semantic.vue notification, game complete params, and compass types - Add TargetNeighbor model to Prisma schema (was orphaned, 4.4M rows) Passkey auth improvements (LoginModal rewrite): - Multi-step flow: main → passkey choice → register/authenticate - Platform-aware ordering (passkey first on iOS, Google first elsewhere) - Email sign-in placeholder Other: - Dictionary import script (scripts/import_dictionary.py) - Gitignore: design/, kaikki_processed/, public exploration files - TODO: leaderboard comments, comment admin tooling, Resend setup
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 49 minutes and 9 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (20)
📝 WalkthroughWalkthroughThis pull request introduces a comprehensive system for user feedback and word discovery, adding in-app bug report/feedback submission, native word discussion comments, structured dictionary content, word images, and redesigned passkey authentication. It includes new database models, a Python dictionary ingestion pipeline, and multiple frontend components with supporting server APIs. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ReportModal as ReportModal Component
participant API as POST /api/report
participant Toast as Toast Notification
User->>ReportModal: Click "Report a Bug/Feedback"
ReportModal->>ReportModal: Show modal form
User->>ReportModal: Enter message, select type
User->>ReportModal: Submit (Ctrl+Enter or button)
ReportModal->>ReportModal: Validate length (≥5 chars)
ReportModal->>ReportModal: Collect context (URL, lang, UA, PWA flag)
ReportModal->>API: POST with type/message/metadata
API->>API: Rate-limit check (3/hour per IP)
API->>API: Validate & trim message
API->>API: Optional: Send email via Resend
API-->>ReportModal: 200 { ok: true }
ReportModal->>ReportModal: Show "Report received" state
User->>ReportModal: Close modal
ReportModal->>Toast: Trigger success toast
Toast-->>User: Display toast notification
sequenceDiagram
participant User
participant WordComments as WordComments Component
participant API as POST /api/comments
participant DB as Database
User->>WordComments: Scroll to comments section
WordComments->>WordComments: Fetch existing comments (GET)
WordComments-->>User: Render comment list
User->>WordComments: Type comment message
User->>WordComments: Press Ctrl+Enter to submit
WordComments->>WordComments: Validate length (5-500 chars)
WordComments->>API: POST with targetType/targetKey/body
API->>API: Rate-limit check (5/10min per user)
API->>API: Moderation scan (blocklist/spam)
API->>DB: Create comment row + fetch badges
API->>API: Query user badges for appearances
API-->>WordComments: Return new comment + badges
WordComments->>WordComments: Prepend to list, increment count
User-->>User: See comment posted
sequenceDiagram
participant Browser
participant WordPage as Word Page Component
participant WordAPI as GET /api/[lang]/word/[slug]
participant DB as Database
participant Prisma as Prisma
Browser->>WordPage: Navigate to word page
WordPage->>WordAPI: Fetch word data
WordAPI->>Prisma: Query definition, appearances, image
Prisma->>DB: Select from Definition, Result models
DB-->>Prisma: Return structured dictionary + appearances
WordAPI->>WordAPI: Enrich translations with language metadata
WordAPI->>WordAPI: Format appearances by mode/date
WordAPI-->>WordPage: Return basicData with dictionary/images/appearances
WordPage->>WordPage: Render title, image strip, dictionary
WordPage->>WordPage: Render appearances list (multi-mode)
WordPage->>WordPage: Render comments section
Browser-->>Browser: Display complete word page
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
SEO audit
All word page SEO elements verified in SSR output:
<title>, description, OG tags, Twitter cards, canonical, robots — identical to beforeSecurity audit
{{ }}auto-escapes, no v-htmlTest plan
vue-tsc --noEmit— 0 errorspnpm test— 590 passed (1 flaky DB timeout, pre-existing)/en/word/light(seeded test data)Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes