Skip to content

feat(announcements): add scheduled publishing controls to composer - #1464

Open
Noobb-byte wants to merge 1 commit into
accesslayerorg:devfrom
Noobb-byte:feat/1380-scheduled-announcements
Open

Noobb-byte wants to merge 1 commit into
accesslayerorg:devfrom
Noobb-byte:feat/1380-scheduled-announcements

Conversation

@Noobb-byte

Copy link
Copy Markdown
Contributor

Summary

  • Publishing timing controls in AnnouncementComposer: Added an accessible "Publish now" / "Schedule" radio toggle. Default behavior remains "Publish now" (immediate on-chain publication after IPFS upload).
  • Date & time picker: Integrated native HTML5 datetime-local input displaying and selecting times in the creator's local timezone.
  • Lead-time validation: Created validateScheduledTime with constants MIN_SCHEDULE_LEAD_MINUTES = 5 and MAX_SCHEDULE_LEAD_DAYS = 90. Form provides inline error messages ("Pick a time at least 5 minutes from now", "Pick a time within the next 90 days"), blocks submit while invalid, and re-validates at submit time against the current clock.
  • Timezone conversion: Converted local datetime inputs to UTC ISO 8601 strings (new Date(localVal).toISOString()) for API transmission.
  • useScheduledAnnouncements(keyId) hook: Implemented query for scheduled and draft announcements with cache invalidation and single-timer lifecycle management (cleared on unmount). Includes optimistic cancellation with automatic rollback on error.
  • Automatic publication transition without reload: A timer fires when the next scheduled time arrives, transitions the item's status to "Published", synchronizes with server state, and automatically removes it from the scheduled list without requiring a page refresh.
  • ScheduledAnnouncementsList component: Displays scheduled announcements with creator's local time, labeled timezone, and hover tooltip/title showing the exact UTC value for that instant. Includes edit, reschedule, and cancel actions with a @radix-ui/react-dialog confirmation modal for cancellations.
  • Status preservation while editing: Editing an existing scheduled announcement keeps its status intact until saved.
  • Integrated into CreatorAnnouncementsPanel: Connected the composer, scheduled list, and posted announcements feed into the creator dashboard.

Testing

  • pnpm lint — passed with 0 errors and 0 warnings across all modified and new files.
  • pnpm build (tsc -b && vite build) — passed with 0 type errors; production client bundle rendered successfully.
  • pnpm test (Vitest) — 25/25 passing tests covering:
    • src/utils/__tests__/announcementSchedule.utils.test.ts (10 tests: 5 min boundary, 4:59 rejection, 90 days boundary, 90 days + 1 min rejection, past times, empty/invalid inputs, date formatting)
    • src/hooks/__tests__/useScheduledAnnouncements.test.tsx (5 tests: listing scheduled/draft items, cancellation with optimistic rollback, editing status preservation, fake-timer automated transition to published and removal)
    • src/components/common/__tests__/AnnouncementComposer.test.tsx (6 tests: toggle behavior, picker visibility, unchanged "Publish now" flow, inline errors, submit blocking, UTC conversion, editing flow)
    • src/components/common/__tests__/ScheduledAnnouncementsList.test.tsx (4 tests: empty state, local + UTC time display, cancellation confirmation modal, edit action status preservation)

Checklist

  • Linked issue or backlog item
  • Scope is limited to the stated change: Only touched announcement publishing, scheduling, and resolved pre-existing syntax errors in CreatorDetailPage.tsx required for build
  • Updated docs if behavior or setup changed: Clean module isolation in announcement.service.ts with typed contracts and implementation plan documented
  • Added screenshots for UI changes when relevant: Verified responsive UI with labeled timezone, UTC hover tooltips, Radix dialogs, and accessible ARIA attributes

closes #1380

@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@Noobb-byte Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093

Copy link
Copy Markdown
Member

✅ PR Ready for Review

Due to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging.

This PR has passed all automated checks:

  • ✅ Security scan — no malicious code detected
  • ✅ No merge conflicts
  • ✅ CI checks passed

Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514

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.

Add scheduled publishing controls to the announcement composer

2 participants