Skip to content

feat: Dynamic expiry days selector based on max_transfer_days_valid#2518

Merged
monkeyiq merged 1 commit intofilesender:development3from
victoritis:transfers-day-selector
Jan 28, 2026
Merged

feat: Dynamic expiry days selector based on max_transfer_days_valid#2518
monkeyiq merged 1 commit intofilesender:development3from
victoritis:transfers-day-selector

Conversation

@victoritis
Copy link
Copy Markdown

@victoritis victoritis commented Jan 20, 2026

Description

This PR improves the UX of the expiry days selector in upload_page. Instead of using a static list or requiring manual configuration of selectable_transfer_days_valid, this change dynamically generates a progressive list of options based on the max_transfer_days_valid setting.

The Problem

Previously (in master/v3), the selector had hardcoded values (7, 15, 30, 40). In development3, it relied on selectable_transfer_days_valid, but this requires admins to manually sync two configuration arrays. If max_transfer_days_valid was set to a low value (e.g., 5 days), users might see no options or only the default.

The Solution

The selectable_*_days_valid arrays now default to empty. When empty, the code generates options dynamically:

  • Days 1-7: Shown individually (for fine-grained control on short transfers).
  • Days 8-30: Shown in weekly intervals (14, 21, 28).
  • Days 30+: Shown in monthly intervals (30, 60, 90...).
  • Max limit: The configured max_transfer_days_valid is always included.
  • Default: The default_transfer_days_valid is always included.

If an admin explicitly configures the array with custom values, those are used instead (backward compatible).

This logic is applied to:

  • Standard Uploads (templates/upload_page.php)
  • Guest Invitations (templates/new_invitation_page.php), respecting min_guest_days_valid

Examples

  • max_days=5 -> Options: 1, 2, 3, 4, 5
  • max_days=14 -> Options: 1...7, 10 (default), 14
  • max_days=90 -> Options: 1...7, 14, 21, 28, 30, 60, 90

Type of change

  • Bug fix
  • New feature (non-breaking change which adds functionality)
  • Enhancement (UX improvement)

@WebSpider
Copy link
Copy Markdown
Collaborator

Please make this configurable. Some installs explicitly choose these values.

@victoritis
Copy link
Copy Markdown
Author

Please make this configurable. Some installs explicitly choose these values.

Do you mean something like this 'transfer_days_valid_is_progressive = true/false' ?

@victoritis victoritis force-pushed the transfers-day-selector branch from e1eeb85 to 7a4438b Compare January 20, 2026 12:39
- Changed selectable_transfer_days_valid and selectable_guest_days_valid
  defaults to empty array
- When empty: generates progressive day options (1-7 daily, 8-30 weekly, 30+ monthly)
- When populated: uses admin-configured values (backward compatible)
- Applies to both upload_page.php and new_invitation_page.php
@victoritis victoritis force-pushed the transfers-day-selector branch from f7c8a8f to 689aecd Compare January 20, 2026 13:46
@victoritis
Copy link
Copy Markdown
Author

Thanks for the feedback! I've updated the implementation:

Instead of adding new boolean config flags, I changed the default value of selectable_transfer_days_valid and selectable_guest_days_valid to an empty array.

Empty array (default): Uses progressive day generation automatically.
Populated array: Uses the admin's custom values (fully backward compatible).
This way, existing installs that have explicitly configured these arrays will continue working as before, while new installs get the improved. In addition, this is done for instalations where a low 'max_transfer_days_valid' is setted.

@monkeyiq monkeyiq merged commit 7a68ef1 into filesender:development3 Jan 28, 2026
5 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

Development

Successfully merging this pull request may close these issues.

3 participants