Repository navigation
feat(announcements): add scheduled publishing controls to composer - #1464
Open
Noobb-byte wants to merge 1 commit into
Open
Noobb-byte wants to merge 1 commit into
Noobb-byte wants to merge 1 commit into
Conversation
|
@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! 🚀 |
Member
✅ PR Ready for ReviewDue 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:
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AnnouncementComposer: Added an accessible "Publish now" / "Schedule" radio toggle. Default behavior remains "Publish now" (immediate on-chain publication after IPFS upload).datetime-localinput displaying and selecting times in the creator's local timezone.validateScheduledTimewith constantsMIN_SCHEDULE_LEAD_MINUTES = 5andMAX_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.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."Published", synchronizes with server state, and automatically removes it from the scheduled list without requiring a page refresh.ScheduledAnnouncementsListcomponent: 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-dialogconfirmation modal for cancellations.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
CreatorDetailPage.tsxrequired for buildannouncement.service.tswith typed contracts and implementation plan documentedcloses #1380