Skip to content

feat: add custom background images for user profiles - #645

Merged
vishnukothakapu merged 2 commits into
vishnukothakapu:mainfrom
Dev1822:feat/custom-background-images
Aug 5, 2026
Merged

feat: add custom background images for user profiles#645
vishnukothakapu merged 2 commits into
vishnukothakapu:mainfrom
Dev1822:feat/custom-background-images

Conversation

@Dev1822

@Dev1822 Dev1822 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #644

This PR introduces the highly requested Custom Background Images feature. It takes customization a step further by allowing users to provide an external image URL to serve as a full-screen wallpaper for their public profile. This enables creative users to use photography, digital art, or other highly customized visuals instead of flat colors or standard gradient themes.

Changes Made

  • Prisma Schema (prisma/schema.prisma): Added the backgroundImage (String, optional) field to the User, ProfileDraft, and ProfileVersion models.
  • API Updates (app/api/user/background/route.ts): Added a new PATCH endpoint at /api/user/background to securely save the provided background image URL to the database.
  • Dashboard UI (app/dashboard/AppearanceSection.tsx): Expanded the "Appearance" tab with a new input field and save button allowing users to define their custom background image URL.
  • Public Profile (app/[username]/page.tsx): The backgroundImage is now passed to the public route. When present, the image covers the entire screen behind the user's links using a fixed background container. A slight dark/blur CSS backdrop filter (bg-black/40 backdrop-blur-[2px]) sits directly behind the content to ensure text and buttons remain perfectly legible regardless of the image's brightness.

Acceptance Criteria Met

  • Users can save a valid image URL to their profile.
  • The public profile successfully renders the background image, covering the entire screen on both mobile and desktop (background-size: cover).
  • Text and buttons remain completely legible on top of the image via a CSS dimming/blur overlay.

How to Test

  1. Pull the branch locally and run npm run dev.
  2. Navigate to your dashboard and go to the Appearance tab.
  3. Paste a valid image URL into the "Custom Background" input and hit "Save".
  4. Visit your public profile link and verify that the background image renders successfully and scales properly on different screen sizes (desktop/mobile).
  5. Ensure the links, text, and share buttons remain readable over the background image.

Summary by CodeRabbit

  • New Features
    • Added support for custom background images on public profile pages.
    • Added appearance settings to enter, save, update, or remove a profile background image.
    • Background images display with cover positioning, a dark overlay, and blur for improved readability.
    • Saved background settings now persist across profile views.
  • Bug Fixes
    • Added validation and clear error handling for unauthorized or invalid background-image updates.

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

@Dev1822 is attempting to deploy a commit to the vishnukothakapu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 47 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: 099f5398-c716-4c21-a878-ffdc2a9b6dbb

📥 Commits

Reviewing files that changed from the base of the PR and between ee61bbb and a4a271d.

📒 Files selected for processing (4)
  • app/api/user/background/route.ts
  • app/dashboard/AppearanceSection.tsx
  • lib/profileWorkflow.ts
  • prisma/migrations/20260805_add_background_image/migration.sql
📝 Walkthrough

Walkthrough

The change adds optional persisted profile background images. The dashboard can save or clear a background URL through a protected API route. Public profiles retrieve and render the configured image with overlay and blur layers.

Changes

Profile background image

Layer / File(s) Summary
Profile background data contract
prisma/schema.prisma, lib/userLookup.ts
The User, ProfileDraft, and ProfileVersion models now store optional backgroundImage values. Public profile lookup includes the value.
Dashboard background update flow
app/dashboard/page.tsx, app/dashboard/DashboardClient.tsx, app/dashboard/AppearanceSection.tsx, app/api/user/background/route.ts
The dashboard initializes, edits, saves, and clears the background URL. The API validates the request, checks the session, updates the user record, and returns the saved value.
Public profile background rendering
app/[username]/page.tsx
The public profile renders the background image with cover positioning, a dark overlay, backdrop blur, and foreground content layering.

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

Possibly related issues

  • vishnukothakapu/linkid issue 644 — Directly concerns custom profile background images across the schema, dashboard, API, and public profile.

Possibly related PRs

Suggested labels: feature, type:design

Suggested reviewers: udaycodespace, vishnukothakapu

Sequence Diagram(s)

sequenceDiagram
  participant DashboardUser
  participant AppearanceSection
  participant BackgroundRoute
  participant PrismaUser
  DashboardUser->>AppearanceSection: Enter or clear background URL
  AppearanceSection->>BackgroundRoute: PATCH backgroundImage with CSRF token
  BackgroundRoute->>PrismaUser: Update user backgroundImage
  PrismaUser-->>BackgroundRoute: Return updated value
  BackgroundRoute-->>AppearanceSection: Return saved backgroundImage
  AppearanceSection-->>DashboardUser: Show success or error toast
Loading
🚥 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 and concisely summarizes the main change: adding custom background images for user profiles.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 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/api/user/background/route.ts`:
- Around line 20-25: After the successful Prisma update in the background-image
route, invalidate the affected public-profile cache entry used by
resolveUserByUsername so subsequent profile reads return updated backgroundImage
data; preserve the existing response flow and avoid leaving stale cached
profiles.

In `@app/dashboard/AppearanceSection.tsx`:
- Around line 207-223: Update the background URL input in the Background Image
Section to provide an accessible name, preferably by adding a visible label
associated with the input; otherwise add aria-label="Background image URL".
Preserve the existing input behavior and styling.

In `@prisma/schema.prisma`:
- Line 20: Add migration coverage for the nullable backgroundImage field on the
User, ProfileDraft, and ProfileVersion Prisma models. Create and apply a
migration that adds the corresponding columns before relying on the server
code’s User.backgroundImage reads and writes, preserving the existing schema
definitions.
- Line 218: Update upsertProfileDraft, publishProfileDraft, and
rollbackProfileVersion to include backgroundImage in ProfileSnapshot data and in
their user.update/profileVersion.create payloads, using the corresponding
profileDraft or profileVersion value so draft changes publish and rollback
restores the correct image.
🪄 Autofix

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: 6bef5855-b1a6-4500-9d13-a6f091e8ac3c

📥 Commits

Reviewing files that changed from the base of the PR and between 9c74653 and ee61bbb.

📒 Files selected for processing (7)
  • app/[username]/page.tsx
  • app/api/user/background/route.ts
  • app/dashboard/AppearanceSection.tsx
  • app/dashboard/DashboardClient.tsx
  • app/dashboard/page.tsx
  • lib/userLookup.ts
  • prisma/schema.prisma

Comment thread app/api/user/background/route.ts
Comment thread app/dashboard/AppearanceSection.tsx
Comment thread prisma/schema.prisma
email String @unique
emailVerified DateTime?
image String?
backgroundImage String?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Schema declarations:"
rg -n 'backgroundImage' prisma/schema.prisma

echo "Migration references:"
rg -n 'backgroundImage' prisma/migrations 2>/dev/null || true

Repository: vishnukothakapu/linkid

Length of output: 292


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repository files relevant to Prisma/migrations:"
git ls-files | rg '(^|/)prisma(/|$)|schema\.prisma|migration\.)|migrations' | sed -n '1,200p'

echo
echo "schema.prisma around declarations:"
sed -n '1,40p;200,245p' prisma/schema.prisma

echo
echo "Changed files summary:"
git diff --stat

Repository: vishnukothakapu/linkid

Length of output: 381


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repository files relevant to Prisma/migrations:"
git ls-files | rg '(^|/)prisma(/|$)|schema\.prisma|migration|index\.d\.prisma|migrations' | sed -n '1,220p' || true

echo
echo "schema.prisma around backgroundImage declarations:"
sed -n '1,40p;200,245p' prisma/schema.prisma

echo
echo "Changed files summary:"
git diff --stat

Repository: vishnukothakapu/linkid

Length of output: 3722


Add migration coverage for backgroundImage.

backgroundImage exists on User, ProfileDraft, and ProfileVersion, but no migration SQL adds these columns. Add and apply a migration that introduces the missing nullable columns before the new server code makes User.backgroundImage readable/writable.

🤖 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 `@prisma/schema.prisma` at line 20, Add migration coverage for the nullable
backgroundImage field on the User, ProfileDraft, and ProfileVersion Prisma
models. Create and apply a migration that adds the corresponding columns before
relying on the server code’s User.backgroundImage reads and writes, preserving
the existing schema definitions.

Comment thread prisma/schema.prisma
@vishnukothakapu

Copy link
Copy Markdown
Owner

Hi @Dev1822 , Could you please address this CodeRabbit suggestion? We need to add a Prisma migration for the newly introduced backgroundImage field on User, ProfileDraft, and ProfileVersion so the database schema stays in sync with schema.prisma. Thanks!

@Dev1822

Dev1822 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@vishnukothakapu I have already resolved that in the last commit. Also this pr is done for GSSoC and ELUSOC

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
linkid Ready Ready Preview Aug 5, 2026 12:11pm

@vishnukothakapu
vishnukothakapu merged commit 20d95d9 into vishnukothakapu:main Aug 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Custom Background Images

2 participants