Skip to content

Bugfix/make-brands-perfect - #178

Merged
rahul-sinha1908 merged 2 commits into
masterfrom
bugfix/make-brands-perfect
Aug 27, 2025
Merged

rahul-sinha1908 merged 2 commits into
masterfrom
bugfix/make-brands-perfect

Conversation

@rahul-sinha1908

@rahul-sinha1908 rahul-sinha1908 commented Aug 27, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Inline “Save Brand Details” button within Brand Profile with loading feedback and toasts.
    • Brand age selection via chips.
    • Onboarding now validates required brand age and website format with clear error messages.
  • Refactor

    • Brand Profile redesigned into a card-based, responsive two-column layout with consistent theming.
    • Industry selection UI updated for clarity and consistency.
    • Save action moved from header to in-page content for improved usability.

@coderabbitai

coderabbitai Bot commented Aug 27, 2025 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Moves Save action from header to inline within BrandProfile, adds age and website validation to onboarding, and overhauls BrandProfile UI to a card-based, responsive layout using React Native Paper with a new action prop for rendering custom actions.

Changes

Cohort / File(s) Summary of Changes
BrandProfile save control relocation
app/(main)/(drawer)/(secondary)/brand-profile.tsx
Removed header Save button; passed a Button via new action prop to BrandProfile to trigger handleSave; adjusted imports (removed ActivityIndicator/Pressable/Colors). Core save logic unchanged.
Onboarding validations
app/(main)/(onboarding)/onboarding-your-brand.tsx
Added validations in handleCreateBrand: require brandData.age; conditional website format check with URL regex; early-return with Toaster errors on failure. No exported API changes.
BrandProfile UI overhaul
components/brand-profile/index.tsx
Refactored to card-based, responsive layout using React Native Paper (Surfaces, TextInputs, HelperText, Divider). Added brand age chip selector with AGE_OPTIONS. Updated industry multi-select. Introduced theming via Colors(theme) and useBreakpoints. Supports optional action prop, wrapped in a Surface when provided.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Screen as Brand Profile Screen
  participant BrandProfile as BrandProfile (component)
  participant Save as handleSave()
  participant Backend as Storage/DB

  User->>Screen: Open Brand Profile
  User->>BrandProfile: Tap "Save Brand Details" (action prop)
  BrandProfile->>Save: onPress()
  Save->>Backend: Upload images / update brand
  Backend-->>Save: Success/Failure
  Save-->>BrandProfile: Resolve with status
  BrandProfile-->>User: Toaster: success/error
Loading
sequenceDiagram
  actor User
  participant Onboarding as OnboardingScreen
  participant Validator as Validation
  participant Backend as Storage/DB

  User->>Onboarding: Submit Create Brand
  Onboarding->>Validator: Check phone (existing)
  Validator-->>Onboarding: OK
  Onboarding->>Validator: Check age present (new)
  alt Age missing
    Validator-->>Onboarding: Fail
    Onboarding-->>User: Toaster "Please specify your brand age"
    Onboarding--x Backend: Stop
  else Age present
    Onboarding->>Validator: If website provided, validate URL (new)
    alt Website invalid
      Validator-->>Onboarding: Fail
      Onboarding-->>User: Toaster "Invalid website format"
      Onboarding--x Backend: Stop
    else Valid or not provided
      Onboarding->>Backend: Upload/create brand (existing)
      Backend-->>Onboarding: Result
      Onboarding-->>User: Continue flow
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • Manan-Sharma-5

Poem

I hopped through cards of papered sheen,
Chips of age in tidy green 🟩,
A button now where eyes can see—
“Save” within the warren, not the tree.
URLs neat, birthdays told,
Brands now polished, brave and bold.
(thump-thump) Approved, behold! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9979a19 and ff40c58.

📒 Files selected for processing (3)
  • app/(main)/(drawer)/(secondary)/brand-profile.tsx (2 hunks)
  • app/(main)/(onboarding)/onboarding-your-brand.tsx (1 hunks)
  • components/brand-profile/index.tsx (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/make-brands-perfect

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rahul-sinha1908
rahul-sinha1908 merged commit 8d20aa5 into master Aug 27, 2025
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