Skip to content

Conversation

@gamersprogrammer
Copy link

@gamersprogrammer gamersprogrammer commented Oct 31, 2025

Closes #

📝 Description

The UI for rendering brand review was too basic and looked nothing like an AI powered web application, so, I decided to update the UI.

🔧 Changes Made

I added a custom input-like Ui with better flex layouts
I added a hover effect on the inputs with a purple color to match AI vibes
I added a purple border to the empty logo
I changed the color of the heading texts to purple too

🤝 Collaboratiom

No. All by myself

✅ Checklist

  • [yes] I have added tests that prove my fix is effective or that my feature works.
  • [yes ] I have added necessary documentation (if applicable).
  • [yes ] Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features

    • Redesigned Brand review summary with organized sections for details, contact information, platforms, and collaboration preferences.
    • Added status feedback messaging for brand submissions.
  • Style

    • Enhanced logo preview styling with improved sizing and placeholders.
    • Refined button states with progress feedback and visual polish throughout the Brand review experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 2025

Walkthrough

The pull request refactors the Brand onboarding review section with a new ReadOnlyField component for presenting structured, sectioned details (Brand Details, Contact Information, Platforms, Collaboration Preferences) in a read-only format. It adds enhanced styling, status messaging for submission states, and UI refinements to the Brand review flow.

Changes

Cohort / File(s) Summary
Formatting updates
Frontend/index.html
Minor whitespace and trailing whitespace adjustments; no functional changes.
Brand onboarding UI refactor
Frontend/src/components/Onboarding.tsx
Introduces ReadOnlyField component and type for rendering labeled read-only fields. Restructures Brand review UI with sectioned layout (Brand Details, Contact Information, Platforms, Collaboration Preferences). Updates logo rendering with enhanced styling and placeholders. Adds submission status messaging (brandSubmitError, brandSubmitSuccess). Refines button states, conditional rendering, typography, and grid layouts across the Brand review path.

Sequence Diagram

sequenceDiagram
    actor User
    participant BrandForm as Brand Form
    participant ReviewUI as Review & Submit Section
    participant ReadOnlyField as ReadOnlyField Component
    participant Submission as Submit Handler

    User->>BrandForm: Enter brand details
    BrandForm->>ReviewUI: Trigger review phase
    ReviewUI->>ReadOnlyField: Render Brand Details section
    ReadOnlyField-->>ReviewUI: Display labeled read-only fields
    ReviewUI->>ReadOnlyField: Render Contact Information section
    ReviewUI->>ReadOnlyField: Render Platforms section
    ReviewUI->>ReadOnlyField: Render Collaboration Preferences section
    User->>ReviewUI: Click Submit button
    ReviewUI->>Submission: Submit brand data
    alt Submission Success
        Submission-->>ReviewUI: brandSubmitSuccess = true
        ReviewUI-->>User: Show green success message
    else Submission Error
        Submission-->>ReviewUI: brandSubmitError set
        ReviewUI-->>User: Show red error message
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • New component logic: The introduction of the ReadOnlyField component and its type requires careful review of prop handling, styling, and reusability across multiple sections.
  • Restructured Brand review flow: Multiple sectioned layouts with conditional rendering for status messages and button states increase logic complexity.
  • UI/UX refinements: Extensive changes to typography, grid layouts, logo rendering, and placeholders throughout the Brand path warrant careful verification against design intent.

Poem

🐰 A rabbit hops through the review screen,
Where read-only fields gleam bright and clean,
Brand details sectioned, styled with care,
Status messages floating through the air,
The UI now structured, polished, and grand—
A smoother review journey, wonderfully planned! ✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "brand review layout update" directly and clearly aligns with the primary changes in the changeset. The PR focuses on restructuring the Brand onboarding review UI with a new ReadOnlyField component, reorganizing content into detailed sections, updating styling (purple colors, borders, improved layouts), and refining the overall visual presentation. The title accurately captures the essence of these layout and UI improvements without being vague or misleading, and it's sufficiently specific that a teammate scanning history would understand this PR updates the brand review interface's structure and appearance.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3be437 and 88e03f6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • Frontend/index.html (1 hunks)
  • Frontend/src/components/Onboarding.tsx (2 hunks)

Comment on lines +1013 to +1083
{(brandLogoPreview || brandData.logo) ? (
<img
src={brandLogoPreview || (brandData.logo ? URL.createObjectURL(brandData.logo) : undefined)}
alt="Logo Preview"
className="h-20 w-20 rounded-full object-cover border"
/>
) : (
<div className="h-20 w-20 rounded-full bg-gray-100 flex items-center justify-center text-gray-400 border border-purple-600">
No Logo
</div>
)}
</div>

{/* Brand Details */}
<section>
<h3 className="text-lg font-semibold text-purple-500 mb-3">Brand Details</h3>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<ReadOnlyField label="Name" value={brandData.brand_name} />
<ReadOnlyField label="Website" value={brandData.website_url} />
<ReadOnlyField label="Industry" value={brandData.industry} />
<ReadOnlyField label="Company Size" value={brandData.company_size} />
<ReadOnlyField label="Location" value={brandData.location} />
<ReadOnlyField label="Description" value={brandData.description} />
</div>
<div className="mb-4">
<h3 className="font-semibold">Brand Details</h3>
<ul className="text-sm">
<li><b>Name:</b> {brandData.brand_name}</li>
<li><b>Website:</b> {brandData.website_url}</li>
<li><b>Industry:</b> {brandData.industry}</li>
<li><b>Company Size:</b> {brandData.company_size}</li>
<li><b>Location:</b> {brandData.location}</li>
<li><b>Description:</b> {brandData.description}</li>
</ul>
</section>

{/* Contact Info */}
<section>
<h3 className="text-lg font-semibold text-purple-500 mb-3">Contact Information</h3>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<ReadOnlyField label="Contact Person" value={brandData.contact_person} />
<ReadOnlyField label="Email" value={brandData.contact_email} />
<ReadOnlyField label="Phone" value={brandData.contact_phone} />
<ReadOnlyField label="Role" value={brandData.role} />
</div>
<div className="mb-4">
<h3 className="font-semibold">Contact Information</h3>
<ul className="text-sm">
<li><b>Contact Person:</b> {brandData.contact_person}</li>
<li><b>Email:</b> {brandData.contact_email}</li>
<li><b>Phone:</b> {brandData.contact_phone}</li>
<li><b>Role:</b> {brandData.role}</li>
</ul>
</section>

{/* Platforms */}
<section>
<h3 className="text-lg font-semibold text-purple-500 mb-3">Platforms & Social Links</h3>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
{brandData.platforms.map(platform => {
const key = allBrandPlatforms.find(p => p.name === platform)?.key;
return (
<ReadOnlyField
key={platform}
label={platform}
value={key ? brandData.social_links[key] : ""}
/>
);
})}
</div>
<div className="mb-4">
<h3 className="font-semibold">Platforms & Social Links</h3>
<ul className="text-sm">
{brandData.platforms.map(platform => {
const key = allBrandPlatforms.find(p => p.name === platform)?.key;
return (
<li key={platform}><b>{platform}:</b> {key ? brandData.social_links[key] : ""}</li>
);
})}
</ul>
</section>

{/* Collaboration Preferences */}
<section>
<h3 className="text-lg font-semibold text-purple-500 mb-3">Collaboration Preferences</h3>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<ReadOnlyField
label="Collaboration Types"
value={brandData.collaboration_types.join(", ")}
/>
<ReadOnlyField
label="Preferred Creator Categories"
value={brandData.preferred_creator_categories.join(", ")}
/>
<ReadOnlyField label="Brand Values" value={brandData.brand_values.join(", ")} />
<ReadOnlyField label="Preferred Tone" value={brandData.preferred_tone.join(", ")} />
</div>
<div className="mb-4">
<h3 className="font-semibold">Collaboration Preferences</h3>
<ul className="text-sm">
<li><b>Collaboration Types:</b> {brandData.collaboration_types.join(", ")}</li>
<li><b>Preferred Creator Categories:</b> {brandData.preferred_creator_categories.join(", ")}</li>
<li><b>Brand Values:</b> {brandData.brand_values.join(", ")}</li>
<li><b>Preferred Tone:</b> {brandData.preferred_tone.join(", ")}</li>
</ul>
</section>

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix logo preview crash when onboarding resumes

Restoring brandData from localStorage gives you a plain object for logo (Files aren’t JSON‑serializable). After this change the review step now does URL.createObjectURL(brandData.logo) and later brandData.logo.name.split(...), so if the user reloads mid-onboarding the first render throws a TypeError and handleBrandSubmit will also explode when it hits .name. Please guard every File-specific operation with instanceof File, and don’t persist the raw File in brandData (omit it or store a serializable preview URL before calling localStorage.setItem). Without those changes brand onboarding becomes unrecoverable after a page refresh.

@Saahi30
Copy link
Collaborator

Saahi30 commented Nov 1, 2025

@gamersprogrammer Great work...but as communicated, kindly create an issue first.

@gamersprogrammer
Copy link
Author

@gamersprogrammer Great work...but as communicated, kindly create an issue first.

I will next time

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.

2 participants