Skip to content

Unify homepage for guest/user; restore my-collections at /collections - #28

Merged
ebulgakov merged 3 commits into
mainfrom
feature/collections-page-1
Aug 1, 2026
Merged

Unify homepage for guest/user; restore my-collections at /collections#28
ebulgakov merged 3 commits into
mainfrom
feature/collections-page-1

Conversation

@ebulgakov

@ebulgakov ebulgakov commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • / is now a single homepage shown to both guests and logged-in users (landing hero + highlights + published-collections showcase), instead of branching into a guest landing page vs. the user's own collections list.
  • The sign up / log in CTAs on the landing hero are hidden once the viewer is logged in (useLandingHero in features/home-landing/model/).
  • The user's own collections list moves back to /collections (auth-gated via the existing auth middleware, restoring its pre-merge location), rendering the already-existing CollectionsList component.
  • AuthButtons gains a "My Collections" nav link, visible only when logged in.
  • Every place that hard-coded "/" as the logged-in user's home now points at /collections instead: post-login redirect (sanitizeRedirect's no-?redirect= fallback), post-signup redirect, the guest middleware (already-logged-in users hitting /login//signup), and the collection-edit success redirect.

Test plan

  • pnpm type-check
  • pnpm lint
  • pnpm test (341 passed; updated redirect-target assertions in use-login-form, use-signup-form, use-collection-form tests)
  • Manual browser check (pnpm dev):
    • Guest / shows landing page with CTAs + showcase; guest /collections redirects to /login?redirect=/collections
    • Sign up → redirects to /collections
    • Logged-in / shows landing page without CTAs; header shows "My Collections"; logged-in /login redirects to /collections
    • No hydration/console warnings introduced

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a dedicated My Collections page for authenticated users.
    • Added a My Collections navigation button in English and Russian.
    • The homepage now displays landing content and published collections for all visitors.
    • Login and signup buttons are hidden for authenticated visitors.
  • Bug Fixes

    • Successful login, signup, and collection edits now take users to My Collections.
    • Improved redirect handling for invalid or unsafe destinations.
    • Authenticated visitors are redirected to My Collections from guest-only routes.

The homepage no longer branches on auth state - the landing page (hero,
highlights, published-collections showcase) is shown to everyone, with the
sign up/log in CTAs hidden once logged in. The user's own collections list
moves back to /collections (auth-gated, as it was before being folded into
"/"), and every place that used to treat "/" as the logged-in user's home
(login/signup success, guest middleware, sanitizeRedirect's fallback) now
points at /collections instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
linkfolio Ready Ready Preview Aug 1, 2026 7:52pm

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ebulgakov, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c040c7b-3a6b-4389-8560-cfaaabafc7fb

📥 Commits

Reviewing files that changed from the base of the PR and between 7542c6f and 746a3ba.

📒 Files selected for processing (2)
  • app/features/home-landing/model/__tests__/use-landing-hero.test.ts
  • app/shared/testing/mocks/use-auth.ts
📝 Walkthrough

Walkthrough

The homepage now serves published collections to all visitors. Authenticated users access /collections, and authentication flows redirect there. The landing hero reads session state and hides login and signup actions for authenticated users.

Changes

Authenticated collections flow

Layer / File(s) Summary
Collections route and homepage split
app/pages/collections/index.vue, app/pages/index.vue, app/features/auth-buttons/ui/auth-buttons.vue, i18n/locales/*.json
Adds the authenticated /collections page, keeps published collections on the homepage, and adds the localized “My Collections” navigation button.
Landing authentication state
app/features/home-landing/index.ts, app/features/home-landing/model/use-landing-hero.ts, app/features/home-landing/ui/landing-hero.vue
Adds useLandingHero, reads the current session, and hides signup and login actions for authenticated visitors.
Authenticated redirect destinations
app/middleware/guest.ts, app/features/login/..., app/features/signup/..., app/features/collection-form/...
Redirects authenticated users and unsafe login destinations to /collections. Updates the related tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant Visitor
  participant GuestMiddleware
  participant CollectionsPage
  participant CollectionsList
  Visitor->>GuestMiddleware: request authenticated destination
  GuestMiddleware->>CollectionsPage: redirect to /collections
  CollectionsPage->>CollectionsList: render collection list
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: a unified homepage and moving authenticated users' collections to /collections.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/collections-page-1

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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@app/features/login/model/use-login-form.ts`:
- Around line 5-14: Update sanitizeRedirect to reject same-origin URLs whose
url.pathname starts with "//" before constructing the sanitized return value,
falling back to "/collections"; preserve the existing handling for valid
same-origin paths, external URLs, and invalid candidates.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba07c282-d377-4eab-ade4-cad80f9a995c

📥 Commits

Reviewing files that changed from the base of the PR and between f798653 and f8b9e98.

📒 Files selected for processing (15)
  • app/features/auth-buttons/ui/auth-buttons.vue
  • app/features/collection-form/model/__tests__/use-collection-form.test.ts
  • app/features/collection-form/model/use-collection-form.ts
  • app/features/home-landing/index.ts
  • app/features/home-landing/model/use-landing-hero.ts
  • app/features/home-landing/ui/landing-hero.vue
  • app/features/login/model/__tests__/use-login-form.test.ts
  • app/features/login/model/use-login-form.ts
  • app/features/signup/model/__tests__/use-signup-form.test.ts
  • app/features/signup/model/use-signup-form.ts
  • app/middleware/guest.ts
  • app/pages/collections/index.vue
  • app/pages/index.vue
  • i18n/locales/en.json
  • i18n/locales/ru.json

Comment thread app/features/login/model/use-login-form.ts
A same-origin URL like "https://<origin>//evil.com/phish" passed the
origin check but its pathname ("//evil.com/phish") is itself
protocol-relative - Nuxt's navigateTo treats that as an external
destination via hasProtocol(..., { acceptRelative: true }), aborting
post-login navigation instead of falling back to /collections.

Found by CodeRabbit on PR #28.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
useLandingHero() (added in PR #28's homepage unification) had no test
coverage. Add app/shared/testing/mocks/use-auth.ts to mock the useAuth()
factory the same way auth-client.ts mocks the authClient singleton, then
cover useLandingHero's loggedIn derivation for a present session and for
null/undefined session data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ebulgakov
ebulgakov merged commit 208c99c into main Aug 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant