feat(profile): calendar subscription card for RSVP'd events - #51
Open
elijahchancey wants to merge 2 commits into
Open
feat(profile): calendar subscription card for RSVP'd events#51elijahchancey wants to merge 2 commits into
elijahchancey wants to merge 2 commits into
Conversation
Surfaces the iCal subscription URL from the EdgeOS_API backend on the profile page so users can sync the events they've RSVP'd to into Apple, Google, or Outlook Calendar. - CalendarSubscriptions card: shows the RSVP feed URL with copy-to- clipboard, a webcal:// "Subscribe" button, and a "Regenerate link" action (with confirmation, since it revokes the old link). - useCalendarSubscription hook: idempotently get-or-creates the token via POST /calendar/subscription and rotates it via .../regenerate, reusing the existing Bearer-token auth pattern. - sonner toasts for copy / regenerate feedback. Depends on p2p-lanes/EdgeOS_API#16 (the backend endpoints). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@elijahchancey is attempting to deploy a commit to the p2planes Team on Vercel. A member of the Team first needs to authorize it. |
Address Codex review: a rapid double-fire of regenerate() could rotate the token twice and apply the earlier (already-revoked) response as current state, leaving the user with a dead calendar URL. Add a ref-based single-flight guard so concurrent regenerations are ignored until the in-flight one settles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What & why
Surfaces the iCal calendar subscription URL on the profile page so a user can sync the events they've RSVP'd to into Apple, Google, or Outlook Calendar. The feed and token come from the backend — see p2p-lanes/EdgeOS_API#16, which this PR depends on.
Calendar apps poll subscription URLs unauthenticated, so the backend issues a per-user, revocable token embedded in the URL; this PR just displays it and lets the user copy / subscribe / regenerate.
Changes
CalendarSubscriptionscard (src/components/profile/CalendarSubscriptions.tsx) on the profile page, placed under Referral Links. Mirrors the existingReferralLinkscopy pattern:Check/Copyfeedback),webcal://"Subscribe" button (one-tap add in calendar apps),sonnertoasts for copy / regenerate feedback, plus loading/error states.useCalendarSubscriptionhook (src/hooks/useCalendarSubscription.ts): idempotently get-or-creates the token viaPOST /calendar/subscriptionand rotates it viaPOST /calendar/subscription/regenerate, reusing the existinglocalStorageBearer-token auth pattern (same asuseGetProfile).CalendarSubscriptiontype (src/types/CalendarSubscription.ts).No new dependencies; lockfiles untouched.
Scope
This is the RSVP'd-events feed only, matching the backend PR. An "all events" feed was intentionally deferred (needs a popup→Social-Layer-group mapping).
Testing
npm run lint— no new findings in the added files.npm run build— succeeds and type-checks;/portal/profilecompiles with the new card.🤖 Generated with Claude Code