Skip to content

Conversation

mj-kiwi
Copy link
Contributor

@mj-kiwi mj-kiwi commented Oct 8, 2025

Description

This PR updates the Transfer Window period picker to align with the latest design specifications.
Previously, the picker displayed durations in seconds or allowed manual input of seconds, which was confusing and inconsistent.

The updated picker now offers a fixed set of human-readable transfer window options for improved usability and clarity:

  • Hourly
  • Daily
  • Weekly (7 days)
  • Bi-Weekly (14 days)
  • Monthly (30 days)
  • Yearly (365 days)

These predefined options provide a more opinionated and user-friendly experience, covering the majority of use cases while maintaining consistency with the design direction.

Related issues

Fixes: #396

Manual testing steps

  1. Go to the page where the transfer period picker is displayed.

  2. Open the period picker dropdown.

  3. Verify that the options available are:

    • Hourly
    • Daily
    • Weekly (7 days)
    • Bi-Weekly (14 days)
    • Monthly (30 days)
    • Yearly (365 days)
  4. Select any option and confirm that:

    • The UI updates to show the selected duration.
    • The selection is correctly reflected in the underlying configuration or transaction preview.
  5. Verify that manual second input is no longer available.

Screenshots/Recordings

Before

Period duration shown in seconds or manual seconds input field.

After

SCR-20251009-llwi

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adds fixed transfer window options (Hourly/Daily/Weekly/Biweekly/Monthly/Yearly), removes custom seconds input, and validates/maps durations to standard periods across periodic permissions.

  • Periodic Permissions UI (ERC20/Native):
    • Rename label to Transfer Window; remove manual periodDuration input and render only startTime, periodAmount, periodType, expiry.
    • Expand periodType options to Hourly, Daily, Weekly, Biweekly, Monthly, Yearly.
  • Types/Schema:
    • TimePeriod enum expanded (add HOURLY, BIWEEKLY, YEARLY).
    • periodType now strictly TimePeriod (remove 'Other').
    • Zod: replace zTimestamp with zPeriodDuration for periodDuration.
  • Logic/Validation:
    • Add TIME_PERIOD_TO_SECONDS for all periods (monthly ≈ 30 days); new getClosestTimePeriod(seconds).
    • In contexts, parse/validate periodDuration (positive bigint) and map to closest standard period; set canonical duration.
    • periodType rule validates input and derives periodDuration from mapping.
  • Tests:
    • Update snapshots for new label/options and removed custom duration field.
    • Extend stream dropdowns with new periods.
    • Add tests for getClosestTimePeriod and time utilities.

Written by Cursor Bugbot for commit a51061f. This will update automatically on new commits. Configure here.

@mj-kiwi mj-kiwi marked this pull request as ready for review October 9, 2025 03:22
@mj-kiwi mj-kiwi requested a review from a team as a code owner October 9, 2025 03:22
cursor[bot]

This comment was marked as outdated.

@mj-kiwi mj-kiwi requested a review from MoMannn October 14, 2025 22:19
… token contexts; add tests for edge cases in getClosestTimePeriod function
MoMannn
MoMannn previously approved these changes Oct 15, 2025
…ve token contexts; add zPeriodDuration definition
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.

2 participants