Skip to content

Add shared Logo component and password_reset_tokens migration#73

Merged
GRACENOBLE merged 2 commits into
mainfrom
add-shared-logo-component
Jul 9, 2026
Merged

Add shared Logo component and password_reset_tokens migration#73
GRACENOBLE merged 2 commits into
mainfrom
add-shared-logo-component

Conversation

@GRACENOBLE

@GRACENOBLE GRACENOBLE commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract a shared Logo component used by both AppSidebar and header, removing duplicated logo markup
  • Add horizontal padding to Container
  • Remove unused default Next.js public assets (svgs, firebase-messaging-sw.js) that had no references in the codebase
  • Add password_reset_tokens goose migration (backend, no application code wired up yet)

Test plan

  • cd web && pnpm lint && pnpm build
  • cd web && pnpm test
  • cd backend && make migrate-status to confirm the new migration is picked up

Summary by CodeRabbit

  • New Features

    • Added a consistent, reusable logo linking to the home page across the header and sidebar.
    • Improved container spacing for better layout consistency.
    • Added support for password reset token storage and expiration tracking.
  • Bug Fixes

    • Removed obsolete background push notification handling from the web service worker.

Replace duplicated header/sidebar logo links with a single reusable
Logo component, add container padding, and remove unused default
Next.js public assets.
@github-actions github-actions Bot added area: backend Go REST API area: web Next.js web app labels Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds password reset token database storage, introduces a shared homepage logo component, updates header and sidebar branding, adds container padding, and removes Firebase messaging logic from the service worker.

Changes

Password reset storage

Layer / File(s) Summary
Password reset token migration
backend/internal/infrastructure/database/migrations/20260627161855_password_reset_tokens.sql
Creates the password_reset_tokens table with UUID, email, token, expiry, usage, and creation fields, adds a token index, and defines rollback behavior.

Web shell updates

Layer / File(s) Summary
Shared logo and layout integration
web/components/common/Logo.tsx, web/components/common/container.tsx, web/components/layout/AppSidebar.tsx, web/components/layout/header.tsx
Adds the shared Logo component, uses it in the header and sidebar, and adds default horizontal container padding.
Messaging service worker removal
web/public/firebase-messaging-sw.js
Removes Firebase script imports and push/configuration event handlers.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the two main additions: a shared Logo component and the password_reset_tokens migration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-shared-logo-component

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
backend/internal/infrastructure/database/migrations/20260627161855_password_reset_tokens.sql (1)

4-4: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider an index on email for common query patterns.

If the application queries tokens by email (e.g., checking for active resets, invalidating all tokens for an email after a successful reset), a query like WHERE email = $1 AND used_at IS NULL AND expires_at > NOW() would require a full table scan without an index on email. Adding one would improve lookup performance as the table grows.

This depends on the actual access patterns in the application layer.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@backend/internal/infrastructure/database/migrations/20260627161855_password_reset_tokens.sql`
at line 4, The password reset token table may require an index for email-based
lookups. Review the application queries for active or invalidated tokens by
email, and if applicable add an index on the email column in the migration,
optionally including used_at and expires_at when supported by the query
patterns.
web/components/common/Logo.tsx (1)

5-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use cn() instead of template string interpolation for className.

The Container component in this same PR uses cn() to merge Tailwind classes via twMerge, but Logo uses raw template interpolation. This means conflicting classes passed through className (e.g. text-lg vs the default text-sm) won't be resolved by twMerge and will rely on CSS source order. Use cn() for consistency and correct conflict resolution.

♻️ Proposed refactor
 import Link from 'next/link'
+import { cn } from '`@/lib/utils`'
 
 export function Logo({ className }: { className?: string }) {
   return (
-    <Link href="/" className={`text-sm font-semibold tracking-tight hover:opacity-70 transition-opacity ${className ?? ''}`}>
+    <Link href="/" className={cn("text-sm font-semibold tracking-tight hover:opacity-70 transition-opacity", className)}>
       App
     </Link>
   )
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/components/common/Logo.tsx` at line 5, Replace the template-string
className construction in the Logo component’s Link with the shared cn()
utility, passing the default classes and optional className as arguments so
Tailwind conflicts are resolved consistently with Container.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@backend/internal/infrastructure/database/migrations/20260627161855_password_reset_tokens.sql`:
- Line 4: The password reset token table may require an index for email-based
lookups. Review the application queries for active or invalidated tokens by
email, and if applicable add an index on the email column in the migration,
optionally including used_at and expires_at when supported by the query
patterns.

In `@web/components/common/Logo.tsx`:
- Line 5: Replace the template-string className construction in the Logo
component’s Link with the shared cn() utility, passing the default classes and
optional className as arguments so Tailwind conflicts are resolved consistently
with Container.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d490f8d4-9574-46d9-b2de-528f7c3c9bad

📥 Commits

Reviewing files that changed from the base of the PR and between 904b3cf and d1c993b.

⛔ Files ignored due to path filters (5)
  • web/public/file.svg is excluded by !**/*.svg
  • web/public/globe.svg is excluded by !**/*.svg
  • web/public/next.svg is excluded by !**/*.svg
  • web/public/vercel.svg is excluded by !**/*.svg
  • web/public/window.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • backend/internal/infrastructure/database/migrations/20260627161855_password_reset_tokens.sql
  • web/components/common/Logo.tsx
  • web/components/common/container.tsx
  • web/components/layout/AppSidebar.tsx
  • web/components/layout/header.tsx
  • web/public/firebase-messaging-sw.js
💤 Files with no reviewable changes (1)
  • web/public/firebase-messaging-sw.js

@GRACENOBLE GRACENOBLE merged commit 7670934 into main Jul 9, 2026
4 checks passed
@GRACENOBLE GRACENOBLE deleted the add-shared-logo-component branch July 9, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Go REST API area: web Next.js web app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant