Skip to content

Deeplink duration + validation fixes (recording warning states, upload disable, trim-sync refresh)#313

Open
adithya1012 wants to merge 5 commits intomieweb:mainfrom
adithya1012:video_duration_set
Open

Deeplink duration + validation fixes (recording warning states, upload disable, trim-sync refresh)#313
adithya1012 wants to merge 5 commits intomieweb:mainfrom
adithya1012:video_duration_set

Conversation

@adithya1012
Copy link
Copy Markdown
Collaborator

@adithya1012 adithya1012 commented Mar 6, 2026

Summary

This PR improves deeplink-duration handling across recording and upload flows.

It introduces clearer warning behavior when users hit/exceed a locked duration, ensures uploads are blocked via disabled state (with inline explanation), and fixes a trim-sync bug where Shorts screen could still show stale over-limit warnings after trimming below the limit.

Demo

https://youtube.com/shorts/zvwQoqCpy_M

What changed

1) Recording behavior in Shorts (app/(camera)/shorts.tsx, components/RecordButton.tsx)

  • Allowed recording to continue in deeplink-locked mode after total duration is reached (while preserving stop behavior at threshold crossing for each segment).
  • Added warning visuals when limit is reached/exceeded:
    • timer text turns red,
    • warning icon shown next to timer,
    • icon blinks only while actively recording and stays steady after recording stops.

2) Upload gating in merged screen (app/merged-video.tsx)

  • Added trim-aware effective duration checks against locked deeplink duration.
  • Replaced blocking alert popup with an inline warning message.
  • Disabled Upload to Cloud button when over locked duration.
  • Kept upload guard in handler as safety fallback.

3) Trim-sync bug fix in Shorts (app/(camera)/shorts.tsx)

  • Fixed draft reload on focus to fetch draft by active mode (camera/upload) with fallback to the other mode.
  • This ensures trimmed segment durations are refreshed correctly after returning from trim/reorder screens.
  • Result: if trimming reduces total below lock, red warning state clears and timer returns to normal.

Files changed

  • components/RecordButton.tsx
  • app/(camera)/shorts.tsx
  • app/merged-video.tsx

How to test

  1. Open app via deeplink/QR with a locked duration.
  2. Record until reaching/exceeding limit.
    • Verify timer turns red and warning icon appears.
    • While recording over limit, warning icon blinks.
    • Stop recording: icon remains visible but stops blinking.
  3. Go to reorder/trim, trim enough to get below limit.
  4. Return to Shorts.
    • Verify timer/warning state resets to normal.
  5. Go to merged/upload screen.
    • If over limit: inline warning is shown and Upload button is disabled.
    • If trimmed below limit: warning disappears and Upload button is enabled (assuming destination/config is valid).

Notes

  • Duration calculations are trim-aware (trimStartTimeMs/trimEndTimeMs).
  • Type-check was run during development (npx tsc --noEmit).

Parse an optional `duration` query param from deeplinks and carry it
through upload routing, then persist it in per-draft upload config.

In the shorts camera flow, load the locked duration from deeplink/config,
track total used recording time, and enforce the duration cap during
recording. Add blinking locked-duration and warning indicators when users
hit the limit so upload recordings reliably match server-configured limits.feat(shorts): enforce deeplink duration limits in uploads

Parse an optional `duration` query param from deeplinks and carry it
through upload routing, then persist it in per-draft upload config.

In the shorts camera flow, load the locked duration from deeplink/config,
track total used recording time, and enforce the duration cap during
recording. Add blinking locked-duration and warning indicators when users
hit the limit so upload recordings reliably match server-configured limits.
@adithya1012 adithya1012 marked this pull request as ready for review March 6, 2026 17:03
@adithya1012 adithya1012 requested a review from Copilot March 6, 2026 17:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves deeplink “locked duration” handling across Shorts recording and the merged upload screen by persisting a per-draft duration lock, enhancing over-limit warning UX, and preventing uploads when the effective (trim-aware) duration exceeds the lock.

Changes:

  • Persist and load a per-draft durationSeconds in upload config (deeplink/QR-driven).
  • Update Shorts recording UI to show over-limit warning states and allow recording past the total limit in locked mode.
  • Add trim-aware duration validation on the merged upload screen, with inline warning + disabled Upload button.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utils/uploadConfig.ts Adds optional durationSeconds persistence and parsing for per-draft upload config.
components/RecordButton.tsx Allows starting a session at/over total duration (locked mode) and avoids auto-stop when configured.
app/(camera)/shorts.tsx Loads/derives locked duration, adds warning/blink UI, and refreshes drafts by active mode on focus.
app/merged-video.tsx Computes effective (trim-aware) draft duration and disables upload when over locked duration with inline warning.
app/index.tsx Parses duration deeplink param and forwards/stores it with upload config.
app/_layout.tsx Parses duration from runtime deeplinks and forwards/stores it with upload config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

adithya1012 and others added 2 commits March 7, 2026 04:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adithya1012 adithya1012 linked an issue Mar 6, 2026 that may be closed by this pull request
@adithya1012 adithya1012 changed the title Deeplink duration UX + validation fixes (recording warning states, upload disable, trim-sync refresh) Deeplink duration + validation fixes (recording warning states, upload disable, trim-sync refresh) Mar 6, 2026
@adithya1012 adithya1012 requested review from horner and morepriyam March 7, 2026 08:18
@morepriyam
Copy link
Copy Markdown
Collaborator

TY for the PR, on the review

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.

Limits should be soft.

4 participants