Skip to content

feat: auto-save drafts, timezone picker, contract archival, staging env#191

Merged
Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
yosemite01:fix/issues-168-170-174-177
Jun 27, 2026
Merged

feat: auto-save drafts, timezone picker, contract archival, staging env#191
Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
yosemite01:fix/issues-168-170-174-177

Conversation

@yosemite01

Copy link
Copy Markdown
Contributor

Summary

Resolves issues #168, #170, #174, and #177 in a single branch.


#168 — Auto-save create stream form drafts

Closes #168

  • New hooks/use-form-draft.ts hook saves form state to localStorage on every change, debounced 500 ms.
  • On page load, if a draft exists (and is less than 24 h old) a restore banner appears: Restore or Discard.
  • Draft is cleared automatically on successful stream creation.
  • clearExpiredDrafts() is called on mount to prune any stale entries.

#170 — Timezone-aware date/time picker

Closes #170

  • User's detected timezone (via Intl.DateTimeFormat) is displayed next to every date/time input as (UTC±N).
  • A timezone selector dropdown lets users schedule in a different timezone.
  • Replaced toISOString().slice(0, 16) in localDatetimeMin and addDuration with locale-safe local-time formatting so dates are displayed in the browser's local time, not UTC.
  • Stream detail page now shows UTC time alongside local time for Start and End fields.

#174 — Smart contract storage archival for completed streams

Closes #174

  • Added ArchiveSentBy(Address) and ArchiveReceivedBy(Address) keys to DataKey.
  • On cancel, stream IDs are moved from SentBy/ReceivedBy to the corresponding archive keys — active indexes stay lean.
  • On withdraw, when a stream is fully drained after end_time, it is likewise moved to the archive.
  • New read functions: get_archived_sent_streams and get_archived_received_streams (paginated).
  • New cleanup_stream(caller, stream_id) lets either party reclaim storage for cancelled/completed streams (removes from all indexes and deletes the stream entry).

#177 — Staging environment with separate testnet contract deployment

Closes #177

  • Added .github/workflows/staging.yml:
    • Pushes to the staging branch deploy to Vercel with the staging contract (STAGING_CONTRACT_ID_TESTNET secret).
    • Every PR gets a Vercel preview deployment; the preview URL is posted as a PR comment.
  • Updated .env.local.example with staging variable documentation and the NEXT_PUBLIC_APP_ENV flag.
  • Required GitHub secrets: STAGING_CONTRACT_ID_TESTNET, VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID (configured in the staging environment in repo settings).

Test plan

  • Create stream form: fill fields, navigate away, reload — restore banner appears with correct timestamp
  • Click Restore — fields repopulate; click Discard — banner dismisses and draft is gone
  • Timezone dropdown shows detected tz; offset label updates next to each date input
  • Stream detail page shows UTC time alongside local time for Start and End
  • Contract: cancel a stream and verify the stream ID is no longer in get_sent_streams but appears in get_archived_sent_streams
  • Contract: cleanup_stream removes data for a cancelled stream
  • Push a commit to staging branch and verify Vercel deploys with staging contract ID

🤖 Generated with Claude Code

…wwStar#177

- FlowwStar#168 Auto-save create stream form drafts to localStorage (debounced
  500ms) with restore/discard banner on page load; drafts older than
  24h expire automatically and are cleared on successful submission.

- FlowwStar#170 Timezone-aware date/time picker: detect and display the user's
  timezone offset next to every date/time input; add timezone selector
  dropdown for scheduling in a different tz; replace toISOString().slice()
  with locale-safe local-time formatting; show UTC alongside local time
  on the stream detail page.

- FlowwStar#174 Smart contract storage archival: add ArchiveSentBy/ArchiveReceivedBy
  index keys; on cancel or full withdrawal after end_time, stream IDs are
  moved from active to archive indexes so get_sent/received_streams only
  returns live streams; add get_archived_sent/received_streams queries and
  a cleanup_stream function for voluntary storage reclamation.

- FlowwStar#177 Staging environment: add .github/workflows/staging.yml that builds
  and deploys to Vercel on pushes to the staging branch and on every PR
  (preview URL commented back on the PR); document required secrets and
  NEXT_PUBLIC_APP_ENV in .env.local.example.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

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

@Austinaminu2 Austinaminu2 merged commit 421beec into FlowwStar:main Jun 27, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants