Skip to content

Comments

Refactor/updated the timeline tab#383

Merged
0xdevcollins merged 5 commits intomainfrom
refactor/updated-the-timeline-tab
Feb 16, 2026
Merged

Refactor/updated the timeline tab#383
0xdevcollins merged 5 commits intomainfrom
refactor/updated-the-timeline-tab

Conversation

@0xdevcollins
Copy link
Collaborator

@0xdevcollins 0xdevcollins commented Feb 16, 2026

Summary by CodeRabbit

  • New Features

    • Redesigned timeline editor with inline date/time inputs, phase management, and curated timezone selector
    • Added DateTime input and field label UI components
    • Publish flow now surfaces structured publish details to drive the published modal and navigation
  • Bug Fixes

    • Expanded and strengthened fallback logic for deriving hackathon end dates and timeline status when fields are missing

- Updated HackathonPublishedModal to utilize new publish response structure.
- Refactored TimelineSection to display additional timeline details including judging start/end and winner announcement dates.
- Introduced DateTimeInput component for better date and time selection.
- Added FieldLabel component for improved form labeling with tooltips.
- Created timelineConstants for standardized tooltips and timezone options.
- Modified timelineSchema to include new fields for judging start, end, and winner announcement dates with validation.
- Enhanced TimelineSettingsTab to support new timeline fields and improved user experience with time inputs.
- Updated use-hackathon-publish hook to handle new publish response format and manage state accordingly.
- Adjusted use-hackathons hook to ensure proper handling of publish responses.
- Updated API interfaces and utility functions to accommodate new timeline structure.
- Improved validation logic for hackathon steps to ensure all necessary dates are set correctly.
- Enhanced timeline calculation logic to reflect new judging and announcement phases.
@vercel
Copy link

vercel bot commented Feb 16, 2026

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

Project Deployment Actions Updated (UTC)
boundless-kd16 Ready Ready Preview, Comment Feb 16, 2026 1:49am

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

📝 Walkthrough

Walkthrough

Reworks the hackathon timeline model: replaces legacy fields with new timeline fields (judgingStart, judgingEnd, winnersAnnouncedAt, endDate) and updates types, schemas, UI, hooks, utilities, and sitemap/preview logic to use new fields with backward-compatible fallbacks.

Changes

Cohort / File(s) Summary
Core types & API
types/hackathon/core.ts, lib/api/hackathons.ts
Introduce new timeline fields (judgingStart, endDate, optional judgingEnd, winnersAnnouncedAt), keep legacy judgingDate/winnerAnnouncementDate as optional; make transactionHash nullable and add message.
Form schemas & validation
components/organization/hackathons/new/tabs/schemas/timelineSchema.ts, lib/utils/hackathon-step-validation.ts
Rename/reorder timeline fields in schema, add judgingEnd/winnersAnnouncedAt, update cross-field validation rules, and require judgingStart in step validation.
New timeline UI & helpers
components/organization/hackathons/new/tabs/TimelineTab.tsx, .../components/timeline/DateTimeInput.tsx, .../FieldLabel.tsx, .../timelineConstants.ts
Replace popover calendars with inline DateTimeInput, add FieldLabel and TIMEZONES constants, field-array phases, toggles for optional judgingEnd/winnersAnnouncedAt, and layout/tooltip changes.
Settings UI
components/organization/hackathons/settings/TimelineSettingsTab.tsx
Add time inputs, toggles for judgingEnd/winnersAnnouncedAt, timezone Select using TIMEZONES, and time helpers (format/apply time).
Review / Publish flow & modal
components/.../new/tabs/ReviewTab.tsx, .../review/HackathonPublishedModal.tsx, .../review/TimelineSection.tsx
Expose and watch publishResponse, open modal on publishResponse, update modal to use publishResponse/organizationId, add escrow viewing, adjust timeline display labels (Judging Start, End Date) and optional sections.
Publish hook & publishing flow
hooks/use-hackathon-publish.ts, hooks/use-hackathons.ts, components/organization/hackathons/new/NewHackathonTab.tsx
Add PublishResponseData type and publishResponse state; publish() returns normalized PublishResponseData; publishDraftAction normalizes API responses; NewHackathonTab passes publishResponse to ReviewTab.
Transform & timeline utilities
lib/utils/hackathon-form-transforms.ts, lib/utils/hackathon-timeline.ts
Update transforms to map new/legacy timeline fields, include optional judgingEnd/winnersAnnouncedAt, and compute phases/status using new date boundaries with conditional phase creation.
Draft preview & org listing fallbacks
app/(landing)/hackathons/preview/[orgId]/[draftId]/page.tsx, app/(landing)/organizations/[id]/hackathons/page.tsx
Expand endDate resolution to a multi-tier fallback chain (winnersAnnouncedAt → winnerAnnouncementDate → judgingEnd → judgingDate → judgingStart → submissionDeadline → startDate) and prefer judgingStart where applicable for completion logic.
Sitemap type usage
app/sitemap.ts
Switch sitemap hackathon type to the API-provided alias (HackathonAPI) for consistency in type annotations.

Sequence Diagram

sequenceDiagram
    actor User
    participant NewHackathonTab
    participant useHackathonPublish
    participant API as Backend API
    participant ReviewTab
    participant Modal as HackathonPublishedModal

    User->>NewHackathonTab: Click "Publish"
    NewHackathonTab->>useHackathonPublish: publish()
    useHackathonPublish->>API: publishDraftAction(request)
    API-->>useHackathonPublish: response (hackathon, escrow, tx)
    useHackathonPublish->>useHackathonPublish: normalize to publishResponse
    useHackathonPublish-->>NewHackathonTab: return publishResponse
    NewHackathonTab->>ReviewTab: pass publishResponse prop
    ReviewTab->>ReviewTab: useEffect detects publishResponse
    ReviewTab->>Modal: open with publishResponse & organizationId
    Modal->>User: show View Hackathon / View Escrow / Back to Org
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐰 I hopped through dates, both old and new,
I stitched the timelines, one and two,
Phases stretch, fallbacks dance and play,
Escrows gleam along the way,
A little rabbit says: publish away! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title uses vague language ('Refactor/updated') and is overly broad; it doesn't clearly convey what specific aspect of the timeline tab was changed or why. Consider a more specific title that describes the key changes, such as 'Add timeline field customization and phases management' or 'Replace calendar popovers with inline date-time inputs in timeline tab'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 refactor/updated-the-timeline-tab

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

@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: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
components/organization/hackathons/new/tabs/components/review/TimelineSection.tsx (1)

29-55: ⚠️ Potential issue | 🟡 Minor

Grid declares 3 columns but always renders 4 items.

The grid is md:grid-cols-3, yet there are 4 always-visible children (Start Date, Submission Deadline, Judging Start, End Date), plus up to 2 conditional ones. The 4th item will wrap to a new row, which may look unbalanced when the optional fields aren't present. If all 4 core fields should sit on one row, consider md:grid-cols-4; otherwise, if the 2×2 wrap is intentional, this is fine as-is.

components/organization/hackathons/settings/TimelineSettingsTab.tsx (1)

104-335: 🛠️ Refactor suggestion | 🟠 Major

This file duplicates the inline calendar+time pattern 6 times instead of using DateTimeInput.

TimelineTab.tsx uses the new DateTimeInput component for all date fields, but TimelineSettingsTab manually inlines the same Popover + Calendar + time <Input> pattern for each field (startDate, submissionDeadline, judgingStart, endDate, judgingEnd, winnersAnnouncedAt). This accounts for ~230 lines that could be replaced with ~6 <DateTimeInput> usages.

For example, the startDate block (lines 104–160) could become:

<FormField
  control={form.control}
  name='startDate'
  render={({ field }) => (
    <FormItem className='gap-3'>
      <FormLabel className='text-sm'>
        Start Date <span className='text-error-400'>*</span>
      </FormLabel>
      <DateTimeInput field={field} placeholder='Select start date' disabledPast={false} />
      <FormMessage className='text-error-400 text-xs' />
    </FormItem>
  )}
/>

Apply the same pattern for all 6 date fields.

components/organization/hackathons/new/tabs/TimelineTab.tsx (1)

33-38: ⚠️ Potential issue | 🟡 Minor

Remove unused onContinue prop from interface.

onContinue is declared in TimelineTabProps but is not destructured or used anywhere in the component. Navigation is handled via the onSave callback instead. Remove the unused prop from the interface to keep it clean.

lib/utils/hackathon-step-validation.ts (1)

38-43: ⚠️ Potential issue | 🟡 Minor

isStepSavedInDraft doesn't check for judgingStart, but isStepDataValid requires it.

isStepDataValid (line 101) requires judgingStart per the schema, but isStepSavedInDraft (lines 38-43) only checks startDate and submissionDeadline. While these functions serve different purposes (API response persistence vs. form validation), this inconsistency could cause confusion if the functions are used together for UI state logic.

Add judgingStart to the draft check:

♻️ Suggested fix
     case 'timeline':
       return !!(
         draft.data.timeline &&
         draft.data.timeline.startDate &&
-        draft.data.timeline.submissionDeadline
+        draft.data.timeline.submissionDeadline &&
+        draft.data.timeline.judgingStart
       );
components/organization/hackathons/new/tabs/schemas/timelineSchema.ts (1)

5-19: ⚠️ Potential issue | 🟠 Major

Replace message with error parameter in all Zod schema definitions for Zod v4 compatibility.

Zod v4 replaced the message parameter with a unified error parameter. The current code uses the deprecated Zod v3 syntax, which will not customize validation error messages correctly at runtime. This applies to all z.date() calls throughout the schema (lines 5–19, 31–35) and custom error messages in .superRefine() calls (lines 46, 54, 62, 70, 78, 88).

Fix for z.date() definitions (lines 5–19, 31–35)
     startDate: z.date({
-      message: 'Start date is required',
+      error: 'Start date is required',
     }),

     submissionDeadline: z.date({
-      message: 'Submission deadline is required',
+      error: 'Submission deadline is required',
     }),

     judgingStart: z.date({
-      message: 'Judging start date is required',
+      error: 'Judging start date is required',
     }),

     endDate: z.date({
-      message: 'End date is required',
+      error: 'End date is required',
     }),
🤖 Fix all issues with AI agents
In
`@components/organization/hackathons/new/tabs/components/review/HackathonPublishedModal.tsx`:
- Around line 29-34: The navigation guard in handleViewHackathon checks
publishResponse?.id but then navigates using publishResponse.slug, which can be
empty (per use-hackathon-publish fallback) and lead to an incorrect /hackathons/
route; update handleViewHackathon to require a non-empty publishResponse.slug
before calling router.push (or fall back to publishResponse.id by pushing
`/hackathons/${publishResponse.slug || publishResponse.id}`), and ensure
onOpenChange(false) still runs only when a valid navigation target exists; look
for handleViewHackathon, publishResponse.slug, publishResponse.id and
use-hackathon-publish to implement the fix.
- Around line 45-53: Update handleViewEscrow to build the Stellar Explorer URL
using the NEXT_PUBLIC_STELLAR_NETWORK env var instead of hardcoding "testnet":
read process.env.NEXT_PUBLIC_STELLAR_NETWORK and map 'public' to 'public'
otherwise default to 'testnet', then construct the URL with that network and
publishResponse.escrowAddress and open it; change references inside
handleViewEscrow (and keep window.open call) so the explorer path uses the
computed network value rather than the literal "testnet".

In
`@components/organization/hackathons/new/tabs/components/timeline/DateTimeInput.tsx`:
- Line 72: In DateTimeInput (the disabled prop callback that uses disabledPast),
normalize the right-hand side to midnight so today's date isn't accidentally
treated as past; compute a "todayStart" (e.g., new Date() with
hours/minutes/seconds/milliseconds set to 0) and change the predicate from date
=> date < new Date() to date => date < todayStart (or use a startOfDay helper)
so comparisons use day-only values when deciding whether to disable a date.

In
`@components/organization/hackathons/new/tabs/components/timeline/timelineConstants.ts`:
- Line 26: The timezone labels in timelineConstants.ts use the ambiguous "CST"
abbreviation for both Central and China time; update the two entries that use
'CST' (the object with label 'CST (Central Standard Time)' and the other 'CST
(China Standard Time)') to disambiguate — e.g., change the China entry to "China
Standard Time (CST)" or "CST/China (China Standard Time)" or rename the Central
one to "Central Standard Time (CST)" so labels clearly indicate which region
each timezone (value 'America/Chicago' and the China timezone entry) refers to.
- Line 48: The timezone entry { label: 'IST (India Standard Time)', value:
'Asia/Kolkata' } is incorrectly placed under the "Middle East & Africa"
grouping; move this object into the "Asia" section of timelineConstants.ts
(place it after the existing Asia entries) so that 'Asia/Kolkata' is listed
under Asia rather than Middle East & Africa.

In `@components/organization/hackathons/new/tabs/ReviewTab.tsx`:
- Around line 67-73: Remove the temporary debug console.log calls inside the
useEffect in ReviewTab that watch publishResponse; keep the existing effect
logic that calls setShowPublishedModal(true) when publishResponse is truthy
(i.e., remove the two console.log statements that reference 'ReviewTab -
publishResponse changed:' and 'Setting showPublishedModal to true' but leave
useEffect, publishResponse, and setShowPublishedModal intact).
- Line 41: The ReviewTabProps interface and ReviewTab component still declare
and destructure hackathonUrl even though it is unused and not passed from the
parent; remove the hackathonUrl property from the ReviewTabProps type and delete
hackathonUrl from the destructuring in the ReviewTab function
signature/parameters so the prop is no longer declared or referenced in the
component (look for ReviewTabProps and the ReviewTab function/component to apply
the change).

In `@components/organization/hackathons/new/tabs/schemas/timelineSchema.ts`:
- Around line 67-81: Validation for judgingEnd is inconsistent: the first check
uses <= to enforce strict after judgingStart but the second uses > which allows
equality with endDate; update the second validation condition that references
data.judgingEnd and data.endDate (the if that calls ctx.addIssue for
['judgingEnd']) to use >= instead of > so judgingEnd is strictly before
data.endDate, leaving the existing error message intact.

In `@hooks/use-hackathon-publish.ts`:
- Line 103: The debug console.log calls in the use-hackathon-publish hook
(search for console.log occurrences in hooks/use-hackathon-publish.ts, e.g.,
inside the publish/response handling in the useHackathonPublish function) must
be removed before merging; locate the console.log lines that print "Publish
response received:" and other response structures and delete them (or replace
with a sanitized processLogger/analytics call if you need non-sensitive
telemetry), ensuring no internal response objects are written to the browser
console.

In `@lib/utils/hackathon-timeline.ts`:
- Around line 112-148: The current guard uses fallback values (judgingEnd =
timeline.judgingEnd || judgingStart and winnersAnnouncedAt = ... || judgingEnd)
which makes the if checks always truthy and can create zero-duration phases;
update the phase-creation guards in lib/utils/hackathon-timeline.ts so you only
create the Judging phase when an explicit end exists (use timeline.judgingEnd or
timeline.judgingDate presence checks rather than judgingEnd fallback) and only
create the Winner Announcement phase when an explicit announcement date exists
(use timeline.winnersAnnouncedAt or timeline.winnerAnnouncementDate), or
alternatively skip pushing a phase if startDate === endDate; adjust the
conditions around the phases.push calls (around the uses of judgingStart,
judgingEnd, winnersAnnouncedAt and the isPhaseCompleted/isPhaseActive logic) so
zero-length phases are not emitted.

In `@types/hackathon/core.ts`:
- Around line 70-81: The core HackathonTimeline type is missing the required
endDate field which causes a mismatch with API types; add a required endDate:
string property to the exported interface HackathonTimeline so its shape matches
the API's HackathonTimeline (keep existing fields like startDate,
submissionDeadline, judgingStart, judgingEnd?, winnersAnnouncedAt?,
judgingDate?, winnerAnnouncementDate?, timezone, phases?). Ensure the updated
interface name HackathonTimeline is exported so imports (e.g., in draft types)
pick up the new field.
🧹 Nitpick comments (14)
components/organization/hackathons/new/NewHackathonTab.tsx (2)

85-85: Remove leftover debug console.log.

console.log('sjcdkformData', formData) appears to be an accidental debug statement with a nonsensical prefix. This will pollute the browser console in production.

🧹 Proposed fix
-      console.log('sjcdkformData', formData);

205-212: Redundant catch-and-rethrow.

The try/catch block catches the error only to re-throw it unchanged, which is a no-op. Either remove the try/catch or add meaningful error handling (e.g., toast notification, logging).

♻️ Simplified version
  const handlePublish = async () => {
-    try {
-      await publish();
-      updateStepCompletion('review', true);
-    } catch (error) {
-      throw error;
-    }
+    await publish();
+    updateStepCompletion('review', true);
  };
components/organization/hackathons/new/tabs/components/review/TimelineSection.tsx (3)

22-26: Prefer const arrow function with explicit type annotation.

Per coding guidelines, prefer const arrow functions over function declarations for component exports.

♻️ Suggested refactor
-export default function TimelineSection({
-  data,
-  onEdit,
-  formatDate,
-}: TimelineSectionProps) {
+const TimelineSection: React.FC<TimelineSectionProps> = ({
+  data,
+  onEdit,
+  formatDate,
+}) => {
   return (
     ...
   );
-}
+};
+
+export default TimelineSection;

As per coding guidelines, "Prefer const arrow functions with explicit type annotations over function declarations".


10-20: formatDateShort doesn't guard against invalid date strings.

If date is a malformed string (e.g. "not-a-date"), new Date(date) yields an Invalid Date and toLocaleString will return "Invalid Date". Consider an early return for this case.

🛡️ Suggested fix
 const formatDateShort = (date: Date | string | undefined): string => {
   if (!date) return 'Not set';
   const d = typeof date === 'string' ? new Date(date) : date;
+  if (isNaN(d.getTime())) return 'Not set';
   return d.toLocaleString('en-US', {

4-8: formatDate prop is only used in the phases section — potential redundancy.

The component accepts a formatDate prop but uses the local formatDateShort for all main timeline fields (lines 33, 41, 47, 53, 60, 70). The prop is only consumed in the phases block (line 89). If both formatters are intentional, a brief comment clarifying the distinction would help; otherwise, consider consolidating to one approach.

app/(landing)/hackathons/preview/[orgId]/[draftId]/page.tsx (1)

135-143: Inconsistent endDate fallback order with the hackathons list page.

The fallback chain here starts with winnersAnnouncedAt, but in app/(landing)/organizations/[id]/hackathons/page.tsx (lines 400–409) the draft endDate resolution starts with submissionDeadline before winnersAnnouncedAt. The same draft could display different end dates in these two views.

Consider extracting a shared utility (e.g., resolveEndDate(timeline)) to ensure consistent resolution across both pages.

♻️ Example shared utility
// e.g., in lib/utils/hackathon-timeline.ts
export const resolveEndDate = (timeline?: HackathonTimeline): string => {
  if (!timeline) return '';
  return (
    timeline.winnersAnnouncedAt ||
    timeline.winnerAnnouncementDate ||
    timeline.judgingEnd ||
    timeline.judgingDate ||
    timeline.judgingStart ||
    timeline.submissionDeadline ||
    timeline.startDate ||
    ''
  );
};
hooks/use-hackathons.ts (1)

453-468: The response fallback can silently pass a non-Hackathon object into state.

response?.data || response falls back to the full API response wrapper (with success, message, data fields) if data is somehow falsy. While the hackathon.id guard on line 457 catches this at runtime, the variable is untyped, so TypeScript won't warn if downstream code accesses Hackathon-specific fields on a response wrapper.

Consider narrowing explicitly:

♻️ Suggested improvement
-        const hackathon = response?.data || response;
-
-        if (!hackathon || !hackathon.id) {
-          throw new Error('Invalid publish response: missing hackathon ID');
-        }
+        const hackathon: Hackathon | undefined =
+          response?.data ?? undefined;
+
+        if (!hackathon?.id) {
+          throw new Error('Invalid publish response: missing hackathon data');
+        }
app/(landing)/organizations/[id]/hackathons/page.tsx (1)

400-411: Different endDate semantics compared to the preview page — intentional?

Here the draft endDate prioritizes submissionDeadline first, while the preview page (app/(landing)/hackathons/preview/…/page.tsx, lines 135–143) prioritizes winnersAnnouncedAt first. If this is intentional (list view shows submission deadline, preview shows event end), it would benefit from a clarifying comment. If not, see the related comment on the preview page about extracting a shared utility.

lib/api/hackathons.ts (1)

447-448: message field on the Hackathon domain type looks like API response leakage.

The message field is typically part of the API response wrapper (ApiResponse), not the domain entity itself. Adding it to the Hackathon type blurs the boundary between API response metadata and domain data, and may encourage downstream code to rely on it as if it were a persistent property.

Was this added to support the publish response normalization in use-hackathons.ts (line 455: response?.data || response)? If so, fixing the normalization logic (as suggested in that file's review) would remove the need for this field.

components/organization/hackathons/new/tabs/components/timeline/FieldLabel.tsx (1)

17-17: Prefer const arrow function with explicit type annotation per coding guidelines.

♻️ Suggested change
-export default function FieldLabel({
+const FieldLabel: React.FC<FieldLabelProps> = ({
   label,
   tooltip,
   required,
   useFormLabel = true,
-}: FieldLabelProps) {
+}) => {
   return (
     // ... unchanged
   );
-}
+};
+
+export default FieldLabel;

As per coding guidelines, **/*.{ts,tsx}: "Prefer const arrow functions with explicit type annotations over function declarations".

components/organization/hackathons/new/tabs/components/timeline/DateTimeInput.tsx (2)

24-28: Use a const arrow function with an explicit return type.

As per coding guidelines, "Prefer const arrow functions with explicit type annotations over function declarations".

♻️ Suggested change
-export default function DateTimeInput({
-  field,
-  placeholder,
-  disabledPast = true,
-}: DateTimeInputProps) {
+const DateTimeInput = ({
+  field,
+  placeholder,
+  disabledPast = true,
+}: DateTimeInputProps): React.ReactElement => {

Then at the bottom of the file:

export default DateTimeInput;

29-41: Extract formatTimeValue and applyTimeToDate into a shared utility.

Both functions are duplicated identically in DateTimeInput.tsx (lines 29–41) and TimelineSettingsTab.tsx (lines 70–82). Move them to timelineConstants.ts and import them in both files to keep the code DRY.

hooks/use-hackathon-publish.ts (1)

107-107: Use consthackathon is never reassigned.

-      let hackathon = response;
+      const hackathon = response;
components/organization/hackathons/new/tabs/TimelineTab.tsx (1)

192-290: Toggle sections for Judging End and Winner Announcement are duplicated across TimelineTab and TimelineSettingsTab.

The Judging End toggle (lines 192–240) and Winner Announcement toggle (lines 242–290) share the same structure — a toggle card, a fallback date resolver, and a conditional DateTimeInput. This same block is repeated in TimelineSettingsTab.tsx. Consider extracting a shared OptionalDateToggle component to keep both tabs in sync and reduce duplication.

…improve DateTimeInput logic, and update timeline constants
… created with non-zero duration and add endDate to HackathonTimeline interface
Copy link

@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.

🧹 Nitpick comments (3)
components/organization/hackathons/new/tabs/components/timeline/timelineConstants.ts (1)

21-64: Consider adding as const for stricter type inference.

Adding as const to both exports would narrow the value properties to literal string types (e.g., 'UTC' instead of string), which improves type safety when these values are used downstream (e.g., in discriminated logic or schema validation).

♻️ Suggested change
-export const TIMEZONES = [
+export const TIMEZONES = [
   // ...
-];
+] as const;

Same for TIMELINE_FIELD_TOOLTIPS:

-export const TIMELINE_FIELD_TOOLTIPS = {
+export const TIMELINE_FIELD_TOOLTIPS = {
   // ...
-};
+} as const;
components/organization/hackathons/new/tabs/schemas/timelineSchema.ts (1)

83-92: winnersAnnouncedAt has no upper-bound constraint — verify this is intentional.

The validation ensures winnersAnnouncedAt > max(judgingEnd, judgingStart) but does not constrain it relative to endDate. If winner announcements should occur before the hackathon end date, an additional check is needed. If announcements can happen after endDate, this is fine as-is.

components/organization/hackathons/new/tabs/components/review/HackathonPublishedModal.tsx (1)

30-35: "View Hackathon" button silently does nothing when slug is missing.

If publishResponse.slug is empty/falsy, handleViewHackathon is a no-op with no user feedback. Consider disabling the button or providing a fallback:

♻️ Suggested approach
             <BoundlessButton
               onClick={handleViewHackathon}
               size='xl'
               fullWidth
+              disabled={!publishResponse?.slug}
               className='bg-primary hover:bg-primary/90 text-black'
             >
               View Hackathon
             </BoundlessButton>

Also applies to: 86-93

@0xdevcollins 0xdevcollins merged commit d5f7977 into main Feb 16, 2026
7 of 9 checks passed
Benjtalkshow added a commit that referenced this pull request Feb 19, 2026
* Judging dashboard (#382)

* fix: modify api.ts

* fix: remove google auth buttom

* fix: fixes responsive fixes on organization

* fix: minor fixes

* fix: modify create organization

* fix: modify create organization

* fix: fix organization permission

* fix: merge into main

* feat: hackathon overview page

* feat: hackathon overview page

* feat: implement participant overview

* feat: implement participant overview

* feat: implement resources tab

* feat: implement the submission tab

* feat: implement comment tab

* fix: implement provider for hackathon

* fix: implement provider for hackathon

* fix: minor fixes

* fix: hackathon banner

* fix: hackathon banner

* fix: fix organization page

* fix: fix organization page

* fix: use transform

* fix: add tagline

* fix: add tagline

* fix: minor fixes

* fix: minor fixes

* fix: fix timeline and prizes

* fix: correct timeline events

* fix: implement registration deadline policy

* fix: implement registration deadline policy

* feat: implement leave hackathon

* feat: implement leave hackathon

* fix: delete hackathon

* fix: implement invite participants

* fix: implement participant profile viewing

* feat: fetch participants team

* fix: redesign hackathon banner

* fix: fix hackthon card

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix error in fetching team posts

* feat: implement create team, get my team

* feat: implement create team, get my team

* feat: implement hackathon project submission flow

* feat: implement voting for submission

* fix: team formation updates

* fix: implement team invitation

* feat: hackathon submissions bulk actions, ranking and ui refinements

* fix: implement empty state for hackathons page

* feat: Implement  submission visibility and explore submissions

* feat: Implement winners tab for hackathon winners display

* feat: implement hackathon analytics

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix organization settings data persistence, hackathondrafts and population

* feat: fix user profile

* feat: Implemented the participant-facing and hackathon organizers announcement features

* feat: Implement judging dashboard and detailed breakdowns

* feat: Implement judging dashboard and detailed breakdowns

* fix: fix coderabbit corrections

* Refactor/updated the timeline tab (#383)

* feat: enhance hackathon timeline management and publishing flow

- Updated HackathonPublishedModal to utilize new publish response structure.
- Refactored TimelineSection to display additional timeline details including judging start/end and winner announcement dates.
- Introduced DateTimeInput component for better date and time selection.
- Added FieldLabel component for improved form labeling with tooltips.
- Created timelineConstants for standardized tooltips and timezone options.
- Modified timelineSchema to include new fields for judging start, end, and winner announcement dates with validation.
- Enhanced TimelineSettingsTab to support new timeline fields and improved user experience with time inputs.
- Updated use-hackathon-publish hook to handle new publish response format and manage state accordingly.
- Adjusted use-hackathons hook to ensure proper handling of publish responses.
- Updated API interfaces and utility functions to accommodate new timeline structure.
- Improved validation logic for hackathon steps to ensure all necessary dates are set correctly.
- Enhanced timeline calculation logic to reflect new judging and announcement phases.

* chore: update markdown-it to version 14.1.1 and remove framer-motion dependency

* refactor: clean up ReviewTab and HackathonPublishedModal components, improve DateTimeInput logic, and update timeline constants

* refactor: update timeline calculation logic to ensure phases are only created with non-zero duration and add endDate to HackathonTimeline interface

* Judging dashboard (#384)

* fix: modify api.ts

* fix: remove google auth buttom

* fix: fixes responsive fixes on organization

* fix: minor fixes

* fix: modify create organization

* fix: modify create organization

* fix: fix organization permission

* fix: merge into main

* feat: hackathon overview page

* feat: hackathon overview page

* feat: implement participant overview

* feat: implement participant overview

* feat: implement resources tab

* feat: implement the submission tab

* feat: implement comment tab

* fix: implement provider for hackathon

* fix: implement provider for hackathon

* fix: minor fixes

* fix: hackathon banner

* fix: hackathon banner

* fix: fix organization page

* fix: fix organization page

* fix: use transform

* fix: add tagline

* fix: add tagline

* fix: minor fixes

* fix: minor fixes

* fix: fix timeline and prizes

* fix: correct timeline events

* fix: implement registration deadline policy

* fix: implement registration deadline policy

* feat: implement leave hackathon

* feat: implement leave hackathon

* fix: delete hackathon

* fix: implement invite participants

* fix: implement participant profile viewing

* feat: fetch participants team

* fix: redesign hackathon banner

* fix: fix hackthon card

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix error in fetching team posts

* feat: implement create team, get my team

* feat: implement create team, get my team

* feat: implement hackathon project submission flow

* feat: implement voting for submission

* fix: team formation updates

* fix: implement team invitation

* feat: hackathon submissions bulk actions, ranking and ui refinements

* fix: implement empty state for hackathons page

* feat: Implement  submission visibility and explore submissions

* feat: Implement winners tab for hackathon winners display

* feat: implement hackathon analytics

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix organization settings data persistence, hackathondrafts and population

* feat: fix user profile

* feat: Implemented the participant-facing and hackathon organizers announcement features

* feat: Implement judging dashboard and detailed breakdowns

* feat: Implement judging dashboard and detailed breakdowns

* fix: fix coderabbit corrections

* fix: submission management ux refinements

* fix: submission management ux refinements

* fix: submission management ux refinements

* fix: submission management ux refinements

* fix: submission management ux refinements

* feat: implement organizer override functionality for judging scores a… (#385)

* feat: implement organizer override functionality for judging scores and enhance judging UI

* fix: update response handling in score submission and enhance submissions list styling

* fix: update eslint dependencies to latest versions for improved linting

* fix: update ajv and json-schema-traverse dependencies in package-lock.json

* fix: update

* fix: update security audit level to high in pre-push checks

* fix: update eslint dependencies and ensure security audit fails on error

---------

Co-authored-by: Collins Ikechukwu <collinschristroa@gmail.com>
0xdevcollins added a commit that referenced this pull request Feb 21, 2026
* Judging dashboard (#382)

* fix: modify api.ts

* fix: remove google auth buttom

* fix: fixes responsive fixes on organization

* fix: minor fixes

* fix: modify create organization

* fix: modify create organization

* fix: fix organization permission

* fix: merge into main

* feat: hackathon overview page

* feat: hackathon overview page

* feat: implement participant overview

* feat: implement participant overview

* feat: implement resources tab

* feat: implement the submission tab

* feat: implement comment tab

* fix: implement provider for hackathon

* fix: implement provider for hackathon

* fix: minor fixes

* fix: hackathon banner

* fix: hackathon banner

* fix: fix organization page

* fix: fix organization page

* fix: use transform

* fix: add tagline

* fix: add tagline

* fix: minor fixes

* fix: minor fixes

* fix: fix timeline and prizes

* fix: correct timeline events

* fix: implement registration deadline policy

* fix: implement registration deadline policy

* feat: implement leave hackathon

* feat: implement leave hackathon

* fix: delete hackathon

* fix: implement invite participants

* fix: implement participant profile viewing

* feat: fetch participants team

* fix: redesign hackathon banner

* fix: fix hackthon card

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix error in fetching team posts

* feat: implement create team, get my team

* feat: implement create team, get my team

* feat: implement hackathon project submission flow

* feat: implement voting for submission

* fix: team formation updates

* fix: implement team invitation

* feat: hackathon submissions bulk actions, ranking and ui refinements

* fix: implement empty state for hackathons page

* feat: Implement  submission visibility and explore submissions

* feat: Implement winners tab for hackathon winners display

* feat: implement hackathon analytics

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix organization settings data persistence, hackathondrafts and population

* feat: fix user profile

* feat: Implemented the participant-facing and hackathon organizers announcement features

* feat: Implement judging dashboard and detailed breakdowns

* feat: Implement judging dashboard and detailed breakdowns

* fix: fix coderabbit corrections

* Refactor/updated the timeline tab (#383)

* feat: enhance hackathon timeline management and publishing flow

- Updated HackathonPublishedModal to utilize new publish response structure.
- Refactored TimelineSection to display additional timeline details including judging start/end and winner announcement dates.
- Introduced DateTimeInput component for better date and time selection.
- Added FieldLabel component for improved form labeling with tooltips.
- Created timelineConstants for standardized tooltips and timezone options.
- Modified timelineSchema to include new fields for judging start, end, and winner announcement dates with validation.
- Enhanced TimelineSettingsTab to support new timeline fields and improved user experience with time inputs.
- Updated use-hackathon-publish hook to handle new publish response format and manage state accordingly.
- Adjusted use-hackathons hook to ensure proper handling of publish responses.
- Updated API interfaces and utility functions to accommodate new timeline structure.
- Improved validation logic for hackathon steps to ensure all necessary dates are set correctly.
- Enhanced timeline calculation logic to reflect new judging and announcement phases.

* chore: update markdown-it to version 14.1.1 and remove framer-motion dependency

* refactor: clean up ReviewTab and HackathonPublishedModal components, improve DateTimeInput logic, and update timeline constants

* refactor: update timeline calculation logic to ensure phases are only created with non-zero duration and add endDate to HackathonTimeline interface

* Judging dashboard (#384)

* fix: modify api.ts

* fix: remove google auth buttom

* fix: fixes responsive fixes on organization

* fix: minor fixes

* fix: modify create organization

* fix: modify create organization

* fix: fix organization permission

* fix: merge into main

* feat: hackathon overview page

* feat: hackathon overview page

* feat: implement participant overview

* feat: implement participant overview

* feat: implement resources tab

* feat: implement the submission tab

* feat: implement comment tab

* fix: implement provider for hackathon

* fix: implement provider for hackathon

* fix: minor fixes

* fix: hackathon banner

* fix: hackathon banner

* fix: fix organization page

* fix: fix organization page

* fix: use transform

* fix: add tagline

* fix: add tagline

* fix: minor fixes

* fix: minor fixes

* fix: fix timeline and prizes

* fix: correct timeline events

* fix: implement registration deadline policy

* fix: implement registration deadline policy

* feat: implement leave hackathon

* feat: implement leave hackathon

* fix: delete hackathon

* fix: implement invite participants

* fix: implement participant profile viewing

* feat: fetch participants team

* fix: redesign hackathon banner

* fix: fix hackthon card

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix search bar in blog page

* fix: fix error in fetching team posts

* feat: implement create team, get my team

* feat: implement create team, get my team

* feat: implement hackathon project submission flow

* feat: implement voting for submission

* fix: team formation updates

* fix: implement team invitation

* feat: hackathon submissions bulk actions, ranking and ui refinements

* fix: implement empty state for hackathons page

* feat: Implement  submission visibility and explore submissions

* feat: Implement winners tab for hackathon winners display

* feat: implement hackathon analytics

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix coderabbit corrections

* fix: fix organization settings data persistence, hackathondrafts and population

* feat: fix user profile

* feat: Implemented the participant-facing and hackathon organizers announcement features

* feat: Implement judging dashboard and detailed breakdowns

* feat: Implement judging dashboard and detailed breakdowns

* fix: fix coderabbit corrections

* fix: submission management ux refinements

* fix: submission management ux refinements

* fix: submission management ux refinements

* fix: submission management ux refinements

* fix: submission management ux refinements

* feat: implement organizer override functionality for judging scores a… (#385)

* feat: implement organizer override functionality for judging scores and enhance judging UI

* fix: update response handling in score submission and enhance submissions list styling

* fix: update eslint dependencies to latest versions for improved linting

* fix: update ajv and json-schema-traverse dependencies in package-lock.json

* fix: update

* fix: update security audit level to high in pre-push checks

* fix: update eslint dependencies and ensure security audit fails on error

* refactor: Dynamically determine Stellar network and centralize wallet utility functions, including explorer URLs and API key handling.

---------

Co-authored-by: Nnaji Benjamin <60315147+Benjtalkshow@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Feb 22, 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