Skip to content

Conversation

@codeunia-dev
Copy link
Owner

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

This pull request introduces important fixes and improvements to the company-related backend functions, ensuring accurate analytics tracking, better stability, and alignment with the latest schema updates.

✅ What’s Included

  • Fixed logic in increment_company_analytics to prevent incorrect field updates.
  • Improved function structure and safety with additional validation.
  • Synced analytics behaviour with new event and hackathon workflows.
  • Updated documentation to reflect latest platform capabilities.
  • Cleaned up deprecated sections in the README for clarity.
  • Enhanced event edit page layout and added collapsible UI components.

🛠️ Changes Made

  • Refactored and corrected company analytics increment logic.
  • Ensured correct handling of events/hackathons created, published, clicked, and viewed.
  • Removed outdated security policy references from documentation.
  • UI improvements in the event editing page for better usability.

🚀 Why This Matters

These fixes ensure:

  • Accurate daily analytics data
  • Prevention of duplicate or incorrect increments
  • More maintainable and robust backend functions
  • Better user experience on the event edit page

🔍 Testing

All affected functions were manually tested with:

  • Event creation
  • Publishing
  • View/Click/Registration actions
  • Hackathon workflows

No breaking changes observed.

🔗 Closing

This PR fixes the underlying company analytics issues and improves internal documentation and UI consistency.

Authored by: @akshay0611

Summary by CodeRabbit

  • New Features

    • Event deletion with confirmation dialogs to prevent accidental removals
    • Collapsible company information section in event forms for improved layout
    • Enhanced dark mode styling throughout the dashboard
  • Documentation

    • Updated README with platform highlights and intellectual property information
    • Removed security policy documentation

…URITY.md

- Expand README with comprehensive platform highlights and value proposition
- Reorganize features section with detailed descriptions of core capabilities
- Update intellectual property notice with clearer GitHub organization information
- Add emphasis on multi-company marketplace, analytics, and event management features
- Remove outdated SECURITY.md template file
- Enhance company events management page with event deletion functionality
- Add delete event button with confirmation dialog to prevent accidental removal
- Implement API integration for event deletion with proper error handling and user feedback
- Add loading state indicator during event deletion process
- Consolidate event management UI with edit, view, and delete actions
…any info

- Reorganize edit event page with improved dark mode support and full-height container
- Move delete button to danger zone section at bottom of page with descriptive warning
- Simplify back button styling and positioning for better UX
- Add collapsible company information section to reduce visual clutter
- Implement Collapsible UI component for expandable/collapsible sections
- Update EventForm with collapsible company info and improved dark mode styling
- Add ChevronDown icon for collapsible state indication
- Improve visual hierarchy and spacing throughout the edit event interface
- Enhance dark mode compatibility with updated background and border colors
@vercel
Copy link

vercel bot commented Nov 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
codeunia Ready Ready Preview Comment Nov 15, 2025 5:16am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Documentation updates including README reframing and SECURITY.md removal. Event management pages enhanced with deletion workflows and confirmation dialogs. Event edit page restructured with delete moved to danger zone. EventForm adds collapsible company information section. New collapsible UI component introduced. Radix UI collapsible dependency added.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md, SECURITY.md
README reframed from generic description to professional platform overview with Platform Highlights section and updated IP notice. SECURITY.md entirely removed.
Event Deletion Workflows
app/dashboard/company/[slug]/events/page.tsx, app/dashboard/company/events/page.tsx
Added per-event deletion with state tracking, DELETE API requests, confirmation dialogs with participant warnings, loading spinners, success/error toasts, and automatic list refresh. Imports Trash2 icon and AlertDialog components.
Event Edit Page Restructure
app/dashboard/company/[slug]/events/[eventSlug]/edit/page.tsx
Layout refactored with min-h-screen outer container. Back button converted to ghost variant. Delete action relocated from header to bottom "Danger Zone" section with destructive alert dialog.
Form Component Enhancement
components/dashboard/EventForm.tsx
Company Information section converted to collapsible with open/close state. Dark mode styling applied to multiple cards. Collapsible trigger includes rotating ChevronDown icon.
UI Component Addition
components/ui/collapsible.tsx
New collapsible wrapper component re-exporting Radix UI primitives: Collapsible, CollapsibleTrigger, CollapsibleContent with prop forwarding and data-slot attributes.
Dependencies
package.json
Added @radix-ui/react-collapsible@^1.1.12 dependency.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant EventsPage
    participant AlertDialog
    participant API as /api/events/{slug}
    participant Toast
    participant EventsList

    User->>EventsPage: Click delete button
    EventsPage->>AlertDialog: Show confirmation dialog
    User->>AlertDialog: Confirm deletion
    AlertDialog->>EventsPage: Trigger handleDeleteEvent
    EventsPage->>EventsPage: Set deletingEventSlug, disable button
    EventsPage->>API: DELETE request
    
    rect rgb(100, 200, 100)
        API-->>EventsPage: Success response
        EventsPage->>Toast: Show success notification
    end
    
    alt Error occurs
        rect rgb(200, 100, 100)
            API-->>EventsPage: Error response
            EventsPage->>Toast: Show error notification
        end
    end
    
    EventsPage->>EventsList: Refresh events list
    EventsPage->>EventsPage: Clear deletingEventSlug
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Event deletion workflows (two files): Similar patterns but slightly different contexts (company-scoped vs. general events). Requires verification of DELETE endpoint handling, error cases, and state management consistency.
  • Event edit page restructure: Layout changes and delete movement are primarily UI reorganization but need careful testing to ensure delete functionality still works correctly after repositioning.
  • Collapsible component integration: New dependency and component wrapper introduction—verify proper re-export of Radix primitives and integration in EventForm.
  • Dark mode styling consistency: Multiple cards updated with dark mode classes; ensure consistent application across the form.

Possibly related PRs

Poem

🐰 A rabbit hops through UI trees,
Collapsibles dance on the gentle breeze,
Events deleted with care and grace,
A danger zone marks deletion's place,
Dark mode shadows, confirmations clear—
Spring cleaning for the platform, my dear! 🌱

✨ 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 120ae39 and 2f871d1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • README.md (1 hunks)
  • SECURITY.md (0 hunks)
  • app/dashboard/company/[slug]/events/[eventSlug]/edit/page.tsx (1 hunks)
  • app/dashboard/company/[slug]/events/page.tsx (3 hunks)
  • app/dashboard/company/events/page.tsx (3 hunks)
  • components/dashboard/EventForm.tsx (6 hunks)
  • components/ui/collapsible.tsx (1 hunks)
  • package.json (1 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 2b5210b into main Nov 15, 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