Skip to content

Feature/collections page - #19

Merged
ebulgakov merged 3 commits into
mainfrom
feature/collections-page
Jul 31, 2026
Merged

Feature/collections page#19
ebulgakov merged 3 commits into
mainfrom
feature/collections-page

Conversation

@ebulgakov

@ebulgakov ebulgakov commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Authenticated users now see their collections directly on the home page.
    • Unauthenticated visitors continue to see the standard welcome view.
  • Bug Fixes
    • Improved authentication request handling for actions that submit data.
    • Collections now load more reliably and efficiently for the signed-in user.
    • Session handling is refreshed when determining the appropriate home page view.

@vercel

vercel Bot commented Jul 31, 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 Jul 31, 2026 10:01am

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 281a427f-0fad-4e4a-a129-336dc6f89281

📥 Commits

Reviewing files that changed from the base of the PR and between c040d8d and 6b0cb71.

📒 Files selected for processing (1)
  • server/api/auth/[...all].ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/api/auth/[...all].ts

📝 Walkthrough

Walkthrough

The PR adds a user-scoped useCollections composable, updates authenticated collection rendering, and changes the auth proxy to forward request methods and bodies with explicit HTTPS and host headers.

Changes

Collections session flow

Layer / File(s) Summary
Collections fetch contract
app/features/collections/index.ts, app/features/collections/model/use-collections.ts
The feature exports CollectionsList and useCollections. The composable fetches collections from /api/collections with a user-specific cache key.
Collections list integration
app/features/collections/ui/collections-list.vue
CollectionsList resolves the session and uses useCollections with the session user ID.
Home session routing
app/pages/index.vue
The home page performs an uncached session lookup. Authenticated sessions render CollectionsList; unauthenticated sessions retain the existing home view.

Auth proxy forwarding

Layer / File(s) Summary
Auth request forwarding
server/api/auth/[...all].ts
The asynchronous proxy preserves request methods, forwards bodies for payload methods, removes the original content-length, sets HTTPS and host headers, and uses sendProxy.

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

Sequence Diagram(s)

sequenceDiagram
  participant HomePage
  participant AuthSession
  participant CollectionsList
  participant useCollections
  participant CollectionsAPI
  HomePage->>AuthSession: getSession()
  AuthSession-->>HomePage: session state
  HomePage->>CollectionsList: render authenticated view
  CollectionsList->>AuthSession: getSession()
  AuthSession-->>CollectionsList: user ID
  CollectionsList->>useCollections: fetch collections for user ID
  useCollections->>CollectionsAPI: request /api/collections
  CollectionsAPI-->>useCollections: collections
Loading
sequenceDiagram
  participant Client
  participant AuthProxy
  participant NeonAuth
  Client->>AuthProxy: request with method and optional body
  AuthProxy->>NeonAuth: sendProxy with method, headers, and body
  NeonAuth-->>AuthProxy: auth response
  AuthProxy-->>Client: proxied response
Loading

Possibly related PRs

  • ebulgakov/linkfolio#16: Refactors the collections list to use the useCollections composable and exports it with CollectionsList.
🚥 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 identifies the main change: adding the collections page feature.
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 feature/collections-page

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.

@ebulgakov

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

🧹 Nitpick comments (1)
app/features/collections/ui/collections-list.vue (1)

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

Move authentication and data-loading orchestration out of the UI component.

CollectionsList resolves the session and starts useCollections internally. Move this orchestration to a model composable or the page, then pass the resolved collection state into the component. This keeps CollectionsList presentational and removes its hidden authentication dependency.

As per coding guidelines, app/features/**/ui/*.vue must keep feature UI components presentational only; business logic belongs in model composables.

🤖 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 `@app/features/collections/ui/collections-list.vue` around lines 10 - 12, Move
the session lookup and useCollections orchestration out of CollectionsList into
a model composable or its parent page, then pass the resolved collections,
pending, and error state into CollectionsList through props. Remove the
component’s direct useAuth and useCollections dependencies while preserving the
existing collection-loading behavior.

Source: Coding guidelines

🤖 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 `@server/api/auth/`[...all].ts:
- Around line 34-36: Update the payload-body handling in the request forwarding
flow to remove the catch that converts readRawBody failures to undefined. For
PAYLOAD_METHODS, let readRawBody(event, false) reject and propagate its original
error before sendProxy is invoked; preserve the undefined body for non-payload
methods.

---

Nitpick comments:
In `@app/features/collections/ui/collections-list.vue`:
- Around line 10-12: Move the session lookup and useCollections orchestration
out of CollectionsList into a model composable or its parent page, then pass the
resolved collections, pending, and error state into CollectionsList through
props. Remove the component’s direct useAuth and useCollections dependencies
while preserving the existing collection-loading behavior.
🪄 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: 56692f12-b226-4f28-863f-3b0df19d63b6

📥 Commits

Reviewing files that changed from the base of the PR and between 1632fdd and c040d8d.

📒 Files selected for processing (5)
  • app/features/collections/index.ts
  • app/features/collections/model/use-collections.ts
  • app/features/collections/ui/collections-list.vue
  • app/pages/index.vue
  • server/api/auth/[...all].ts

Comment thread server/api/auth/[...all].ts Outdated
@ebulgakov
ebulgakov merged commit eb7d3bf into main Jul 31, 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