InPactAI icon indicating copy to clipboard operation
InPactAI copied to clipboard

Feature: creator availability status

Open Swaim-Sahay opened this issue 1 year ago • 2 comments

closes #209

What this does

Lets creators show if they're available for work. Shows up as a toggle on their dashboard with 3 options (Available/Busy/Not Looking) and optional custom message.

Brands see a colored badge on creator profiles and can filter search by availability.

Files changed

Frontend:

  • Added AvailabilityToggle component
  • Added AvailabilityBadge component
  • Created CreatorCard with badge
  • Built CreatorSearch page with filter
  • Updated dashboard to show toggle
  • Added route for creator search

Backend:

  • SQL file to add availability columns to users table

Testing done

  • No TS errors
  • Passes linting
  • Tested status changes save correctly
  • Filter works in search
  • Looks good on mobile

Before merging

Run the SQL migration in Backend/add_availability_feature_COMPLETE.sql to add the database columns.

Preview

https://github.com/user-attachments/assets/ea4c6ddb-0855-47e5-9ebe-d63903dd94e6

Summary by CodeRabbit

  • New Features
    • Users can set an availability status (available, busy, not_looking) and an optional custom message on their profiles
    • Creator profiles display an availability badge and message preview
    • Brands can search and filter creators by availability on a new "Find Creators" page
    • Dashboard shows an availability toggle for creators
    • Added a scroll-to-top button for improved navigation

✏️ Tip: You can customize this high-level summary in your review settings.

Swaim-Sahay avatar Dec 02 '25 12:12 Swaim-Sahay

[!WARNING]

Rate limit exceeded

@Swaim-Sahay has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between f6a4fe66b841665de8496805d133a6b9c17a22d4 and b30dfef591f5d332a3fc67bce12acbd531af9e24.

📒 Files selected for processing (1)
  • Frontend/src/components/CreatorCard.tsx (1 hunks)

Walkthrough

Adds a creator availability feature: DB migration adds availability columns, constraint, index, and comments; frontend adds availability badge, toggle, creator card, search page, scroll-to-top UI, route, and dashboard integration so creators can set status/message and brands can filter/search by availability.

Changes

Cohort / File(s) Summary
Database migrations
Backend/add_availability_feature_COMPLETE.sql, Backend/add_availability_status.sql
Add availability_status (TEXT, default 'available') and availability_message (TEXT, default NULL) to public.users; recreate check_availability_status to allow 'available','busy','not_looking'; create index idx_users_availability; add column comments; backfill NULLs to 'available'.
Availability UI components
Frontend/src/components/AvailabilityBadge.tsx, Frontend/src/components/AvailabilityToggle.tsx
New AvailabilityBadge component (status, icon, colors, optional message). New AvailabilityToggle component that loads/saves availability_status and availability_message via Supabase, provides three-state controls, optional 150-char custom message, preview, loading states, and error handling.
Creator presentation & utilities
Frontend/src/components/CreatorCard.tsx, Frontend/src/components/ui/scroll-to-top.tsx
New CreatorCard shows profile, follower totals, platform icons, and AvailabilityBadge; action button adapts to status. New ScrollToTop floating progress button with scroll progress indicator and smooth scroll behavior.
Brand search page
Frontend/src/pages/Brand/CreatorSearch.tsx
New Brand CreatorSearch page: queries users (id, username, profile_image, category, country, availability_status, availability_message, social_profiles) filtered by role='creator' and availability filter; client-side search by username/category; renders CreatorCard grid with loading/empty states.
App routing & dashboard integration
Frontend/src/App.tsx, Frontend/src/pages/DashboardPage.tsx
Add global ScrollToTop under AuthProvider; new protected route /brand/creators → CreatorSearch; import and render AvailabilityToggle in Dashboard Overview; add "Find Creators" nav item.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Brand as Browser (Brand UI)
    participant Frontend as Web App (React)
    participant Supabase as Supabase (Postgres)
    Note over Brand,Frontend: Brand searches or views creators
    Brand->>Frontend: Navigate to /brand/creators or set filters
    Frontend->>Supabase: SELECT users WHERE role='creator' + availability filter
    Supabase-->>Frontend: Return creators (incl. availability_status, availability_message, social_profiles)
    Frontend->>Brand: Render CreatorCard grid with AvailabilityBadge
    Note over Brand,Frontend: Creator updates availability from Dashboard
    Brand->>Frontend: Interact with AvailabilityToggle (change status/message)
    Frontend->>Supabase: UPDATE users SET availability_status/message
    Supabase-->>Frontend: OK / Error
    Frontend->>Brand: Update preview & UI or show error

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus review on:
    • Frontend/src/components/AvailabilityToggle.tsx — async save logic, error handling, and character-limit enforcement.
    • Frontend/src/pages/Brand/CreatorSearch.tsx — availability filtering logic (especially "all" excluding 'not_looking') and selected fields query shape.
    • DB migrations — idempotency of constraint/index creation, correct backfill, and alignment of allowed status values with frontend.

Suggested reviewers

  • chandansgowda

Poem

🐰 I hopped into code with a cheerful twitch,
Badges, toggles, and search stitched in a stitch.
Creators can flag when they're free or booked,
Brands can find fits without being mistooked.
A tiny hop, a status light — matches take flight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 'Feature: creator availability status' directly and clearly summarizes the main change—introducing a creator availability feature with status options and messaging.
Linked Issues check ✅ Passed All coding requirements from issue #209 are met: toggle on dashboard (AvailabilityToggle), three status options with custom messaging (AvailabilityToggle + backend columns), availability badge on profiles (AvailabilityBadge in CreatorCard), search/filter functionality (CreatorSearch with availabilityFilter), and non-looking creators excluded from results.
Out of Scope Changes check ✅ Passed All changes directly support the availability feature: database migration adds required columns, frontend components implement required UI, new route/page enable search filtering, and dashboard integration provides the toggle—no unrelated modifications detected.

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 and usage tips.

coderabbitai[bot] avatar Dec 02 '25 12:12 coderabbitai[bot]

Hi @chandansgowda

Raised a PR here here #210 .Please review and let me know if any further changes required. Thank you.

Swaim-Sahay avatar Dec 02 '25 12:12 Swaim-Sahay