Skip to content

Conversation

@Benjtalkshow
Copy link
Collaborator

@Benjtalkshow Benjtalkshow commented Feb 5, 2026

Hackathon Submissions: Bulk Actions, Ranking, and UI Refinements

Description

This PR implements several key features for hackathon organization and refines the participant submission experience. Major additions include bulk management actions (approve, disqualify, reset), numerical ranking for submissions, and several critical bug fixes related to status display and false-positive error notifications.


Key Features

1. Bulk Submission Management

Toolbar

  • Added a contextual toolbar in SubmissionsManagement that appears when one or more submissions are selected.

Actions

  • Supports bulk Approve (shortlist), Disqualify, and Reset to Submitted actions.

Selection

  • Implemented multi-select checkboxes for both grid and table views in the organizer dashboard.

2. Submission Ranking

Inline Editing

  • Added a numerical rank input in the SubmissionsList component.

Organizer Control

  • Organizers can now assign specific ranks to projects directly from the management dashboard.

API Integration

  • Connected to a new /rank endpoint via a custom useUpdateRank hook.

3. Organizer UI Improvements

Action Dropdown

  • Replaced direct Approve/Reject buttons in the table view with a cleaner 3-dot DropdownMenu to improve visual hierarchy.

Enhanced Feedback

  • Integrated loading states and toast notifications for all management actions.

Bug Fixes

Submission Status Mapping

  • Resolved an issue where participant submission cards frequently displayed Pending regardless of their backend state.
  • Implemented a case-insensitive mapping layer to handle various backend status conventions:
    • shortlistedApproved
    • disqualifiedRejected

False Positive Error Toasts

  • Removed an aggressive toast.error from the useTeamPosts hook that triggered a "Failed to fetch team posts" message on initial page loads, even when data was correctly retrieved.

TypeScript Type Safety

  • Fixed several ts(2367) errors in SubmissionTab related to status comparisons and type overlaps.

Technical Changes

API & Types

  • Added the following types to lib/api/hackathons.ts:
    • BulkActionRequest
    • BulkActionResponse
    • UpdateRankRequest
    • UpdateRankResponse
  • Implemented:
    • bulkActionSubmissions
    • updateSubmissionRank API functions.

Hooks

  • Created useBulkAction: Manages state and logic for performing actions on multiple submissions.
  • Created useUpdateRank: Handles debounced or enter-triggered updates to submission rankings.

Components

  • SubmissionsManagement.tsx
    • Centralized state management for selection and bulk actions.
  • SubmissionsList.tsx
    • Added selection logic, rank inputs, and refactored table actions into DropdownMenu.
  • SubmissionTab.tsx
    • Updated status mapping logic and fixed background styling classes.
  • use-team-posts.ts
    • Refined error handling to prioritize state-based errors over UI-blocking toasts.

Summary by CodeRabbit

  • New Features

    • Team role hiring status management: toggle role "filled" status when recruiting.
    • Leave team functionality with confirmation dialog.
    • Submission management: review, rank, and bulk disqualify with reason entry.
    • Team invitation error handling with retry capability.
  • Bug Fixes

    • Improved submission status normalization and display accuracy.
    • Enhanced error recovery in team invitations workflow.
  • UI/UX

    • Unified card-based design for loading, error, and success states across team invitations and rejections.
    • Consistent error messaging and retry options throughout.

@vercel
Copy link

vercel bot commented Feb 5, 2026

@Benjtalkshow is attempting to deploy a commit to the Threadflow Team on Vercel.

A member of the Team first needs to authorize it.

@Benjtalkshow Benjtalkshow merged commit 867d7b0 into boundlessfi:main Feb 5, 2026
1 of 6 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR extends hackathon team formation and submission management by adding leave-team functionality, per-role hiring status toggling, submission review/disqualification/rank updates, and bulk submission actions. New hooks encapsulate these operations while UI components are refactored with Card-based layouts.

Changes

Cohort / File(s) Summary
Pages & Routes
app/(landing)/hackathons/[slug]/page.tsx, app/(landing)/hackathons/[slug]/team-invitations/[token]/accept/page.tsx, app/(landing)/hackathons/[slug]/team-invitations/[token]/reject/page.tsx
Updated with new state (activeTab, hackathonId, modal flags), Card-based UI for loading/error/success states, refined routing logic (redirects to /hackathons or slug-specific pages), and authentication flow simplifications.
Team Formation Components
components/hackathons/team-formation/MyInvitationsList.tsx, components/hackathons/team-formation/TeamDetailsSheet.tsx, components/hackathons/team-formation/TeamFormationTab.tsx, components/hackathons/team-formation/TeamRecruitmentPostCard.tsx
Added leave-team workflow with confirmation dialog, per-role hiring status management with toggle UI, error-handling branches with retry buttons, and cascading refresh callbacks for data sync after membership changes.
Submission Management
components/organization/hackathons/submissions/SubmissionsList.tsx, components/organization/hackathons/submissions/SubmissionsManagement.tsx, components/organization/hackathons/submissions/DisqualifyDialog.tsx, components/hackathons/submissions/submissionTab.tsx
Introduced selection mechanics, review actions, rank editing, and disqualification workflows; new DisqualifyDialog component; bulk action state and UI bar; updated status mapping logic (shortlisted→Approved, disqualified→Rejected); styling updates (bg-background-main-bg).
Submission & Team Hooks
hooks/hackathon/use-review-submission.ts, hooks/hackathon/use-disqualify-submission.ts, hooks/hackathon/use-bulk-action.ts, hooks/hackathon/use-update-rank.ts, hooks/hackathon/use-leave-team.ts
New hooks for submission review, disqualification, bulk actions, rank updates, and team-leave operations; each manages loading/error states, shows toast notifications, and handles API integration with optional callbacks.
Team Invitations & Posts Hooks
hooks/hackathon/use-team-invitations.ts, hooks/hackathon/use-team-posts.ts
Updated response handling to support multiple API response shapes; exposed error and fetch functions for error-recovery UI; removed error toast on page-load failures (post fetch only).
API Layer
lib/api/hackathons.ts, lib/api/hackathons/teams.ts, app/(landing)/organizations/[id]/hackathons/[hackathonId]/submissions/page.tsx
Extended API with new types (ReviewSubmissionRequest/Response, DisqualifySubmissionRequest/Response, BulkActionRequest/Response, UpdateRankRequest/Response, TeamRole, ToggleRoleHiredRequest/Response) and functions (reviewSubmission, disqualifyHackathonSubmission, bulkActionSubmissions, updateSubmissionRank, toggleRoleHired, leaveHackathonTeam); updated GetInvitationsResponse to union type; added organizationId/hackathonId prop threading.

Sequence Diagrams

sequenceDiagram
    participant User
    participant UI as TeamRecruitmentPostCard
    participant Hook as useLeaveTeam Hook
    participant API as Hackathon API
    participant Server

    User->>UI: Clicks Leave Team
    UI->>UI: Open Confirmation Dialog
    User->>UI: Confirms Leave
    UI->>Hook: Call leaveTeam()
    Hook->>Hook: Check Authentication
    Hook->>API: POST leaveHackathonTeam()
    API->>Server: Leave Team Request
    Server->>API: Success Response
    API->>Hook: Return Result
    Hook->>UI: Show Success Toast
    Hook->>UI: onLeaveSuccess Callback
    UI->>UI: Refresh Data (fetchMyTeam, fetchPosts)
    UI->>User: Update UI
Loading
sequenceDiagram
    participant User
    participant UI as SubmissionsList/SubmissionsManagement
    participant Dialog as DisqualifyDialog
    participant Hook as useDisqualifySubmission/useBulkAction
    participant API as Hackathon API
    participant Server

    User->>UI: Select Submission(s)
    UI->>UI: Show Selection Checkboxes
    User->>UI: Click Disqualify Action
    UI->>Dialog: Open DisqualifyDialog
    User->>Dialog: Enter Reason (10+ chars)
    Dialog->>Dialog: Validate Input
    User->>Dialog: Submit
    Dialog->>Hook: Call disqualify() or performBulkAction()
    Hook->>Hook: Set Loading State
    Hook->>API: POST disqualifyHackathonSubmission() or bulkActionSubmissions()
    API->>Server: Disqualify Request
    Server->>API: Success Response
    API->>Hook: Return Result
    Hook->>Hook: Clear Error, Show Toast
    Hook->>UI: Return Control
    UI->>UI: Refresh Submissions
    UI->>User: Clear Selection, Update List
Loading
sequenceDiagram
    participant User
    participant UI as TeamDetailsSheet
    participant Hook as useToggleRoleHired
    participant API as Hackathon API
    participant Server

    User->>UI: Load Team Details
    UI->>UI: Initialize hiredRoles from rolesStatus
    User->>UI: Click Role Hired Toggle
    UI->>Hook: Call toggleRoleHired()
    Hook->>Hook: Optimistically Update hiredRoles
    Hook->>Hook: Set togglingRole Loading State
    Hook->>API: PATCH toggleRoleHired()
    API->>Server: Toggle Request
    Server->>API: Success/Error Response
    API->>Hook: Return Result
    Hook->>UI: Show Toast (Success or Rollback)
    UI->>UI: Update Role UI (Filled/Open Badge)
    UI->>User: Reflect New State
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Fix hackathon #374: Modifies the same hackathon team-invitations flow (accept/reject pages) and team-invitations hooks/API signatures for invitation handling consistency.
  • Fix hackathon #372: Updates styling and logic in the same team-formation components (TeamDetailsSheet, TeamRecruitmentPostCard) that this PR extends with new features.

Suggested reviewers

  • 0xdevcollins

Poem

🐰 A rabbit hops through teams that form,
With roles that flip and members swarm,
Leave or stay, now both feel right,
Submissions ranked and sorted tight,
The hackathon gleams ever bright! 🌟

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot mentioned this pull request Feb 11, 2026
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