Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Nov 14, 2025

  • Refactor asset upload and removal API endpoint for more robust handling
  • Update logo and banner upload methods to use query parameters
  • Add new methods for removing logo and banner with improved error handling
  • Implement page reload after asset changes to ensure UI consistency
  • Remove unnecessary export button from analytics page
  • Improve asset management error handling and user feedback
  • Simplify asset upload and removal process in company settings

Summary by CodeRabbit

  • New Features

    • Added ability to remove logo and banner assets from company branding settings with dedicated "Remove" buttons.
  • Improvements

    • Enhanced asset upload UX with dynamic status messages ("Uploading" or "Removing") based on operation type.
  • Removals

    • Removed export to CSV button from analytics page.

- Refactor asset upload and removal API endpoint for more robust handling
- Update logo and banner upload methods to use query parameters
- Add new methods for removing logo and banner with improved error handling
- Implement page reload after asset changes to ensure UI consistency
- Remove unnecessary export button from analytics page
- Improve asset management error handling and user feedback
- Simplify asset upload and removal process in company settings
@vercel
Copy link

vercel bot commented Nov 14, 2025

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

Project Deployment Preview Comments Updated (UTC)
codeunia Building Building Preview Comment Nov 14, 2025 10:17am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes refactor asset management and export functionality across the company dashboard. The asset deletion API route switches from service-layer calls to direct Supabase updates. The analytics page removes the export UI button and related state management. The settings page introduces asset removal workflows with DELETE endpoints and adds destructive Remove buttons for logo and banner assets.

Changes

Cohort / File(s) Summary
Asset Management API
app/api/companies/[slug]/assets/route.ts
DELETE route now performs direct Supabase update instead of service-layer call; computes asset URL column name (logo_url or banner_url) from assetType parameter and sets to null; preserves cache invalidation.
Asset Removal UI and Workflows
app/dashboard/company/[slug]/settings/page.tsx
Added handleLogoRemove and handleBannerRemove DELETE request handlers with error handling and page reload; added Remove buttons overlaid on logo and banner assets with conditional rendering; updated upload payloads to use type query parameter instead of FormData; dynamic status text displays "Uploading" or "Removing" based on asset state.
Analytics Export UI
app/dashboard/company/[slug]/analytics/page.tsx
Removed Download icon import, isExporting state management, and export button from UI; retained internal handleExport handler and onExport prop passing to AnalyticsCharts component.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Route change: Verify error handling in direct Supabase update and confirm cache invalidation still executes correctly
  • Settings page: Test asset removal workflows thoroughly—success path (wait, refresh, reload), error handling, timing of state updates, and conditional Remove button rendering
  • Analytics page: Confirm removal of export state and UI has no unintended side effects on child components or data flow; verify onExport handler remains functional

Poem

🐰 A rabbit hops through assets bright,
Removing logos left and right—
No export button clutters the view,
Just clean workflows, fresh and new! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/companyfunctions

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23a6679 and 33ea6be.

📒 Files selected for processing (3)
  • app/api/companies/[slug]/assets/route.ts (1 hunks)
  • app/dashboard/company/[slug]/analytics/page.tsx (1 hunks)
  • app/dashboard/company/[slug]/settings/page.tsx (7 hunks)

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.

@codeunia-dev codeunia-dev merged commit 728b59a into main Nov 14, 2025
2 of 4 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.

3 participants