Skip to content

Adds link to open sync from youtube page#3431

Merged
tzarebczan merged 2 commits intomasterfrom
odysync-login
Feb 25, 2026
Merged

Adds link to open sync from youtube page#3431
tzarebczan merged 2 commits intomasterfrom
odysync-login

Conversation

@tzarebczan
Copy link
Contributor

@tzarebczan tzarebczan commented Feb 25, 2026

Adds a button to open the Odysee sync page directly from the YouTube transfer status page using a deep link.

Enables auto-opening YouTube sync deep link

Allows the application to automatically launch the YouTube sync deep link when specific URL parameters (open_in_sync or open_app) are present.

This streamlines the user flow by initiating the sync process immediately upon page load for users directed with these parameters. It also removes the auto-open parameters from the URL after the attempt.

Adjusts YouTube self-sync card visibility

Expands the display conditions for the self-sync alternative card to include users with autoOpenSync enabled, improving discoverability for relevant users.

Removes the direct "Open in Odysee Sync" button, streamlining the UI and potentially simplifying the user's journey for initiating the sync process. The self-sync token remains available for manual transfer.

Fixes

Issue Number:

What is the current behavior?

What is the new behavior?

Other information

PR Checklist

Toggle...

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

Summary by CodeRabbit

  • New Features

    • Added auto-launch for YouTube sync via URL params and a self-sync launcher that can open automatically once.
    • Loading page now attempts automatic launch navigation and shows status/help with a retry button when applicable.
  • UI/Behavior

    • Portal view now derives tiles, background, header, navigation, and indicators from the main portal dataset for consistent rendering.
  • Style

    • Added spacing improvements to the transfer status UI.

Adds a button to open the Odysee sync page directly
from the YouTube transfer status page using a deep link.

Enables auto-opening YouTube sync deep link

Allows the application to automatically launch the YouTube sync deep link when specific URL parameters (`open_in_sync` or `open_app`) are present.

This streamlines the user flow by initiating the sync process immediately upon page load for users directed with these parameters. It also removes the auto-open parameters from the URL after the attempt.

Adjusts YouTube self-sync card visibility

Expands the display conditions for the self-sync alternative card to include users with `autoOpenSync` enabled, improving discoverability for relevant users.

Removes the direct "Open in Odysee Sync" button, streamlining the UI and potentially simplifying the user's journey for initiating the sync process. The self-sync token remains available for manual transfer.
@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0ccc81 and 7732485.

📒 Files selected for processing (2)
  • ui/page/youtubeSync/view.jsx
  • web/src/spinner.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/page/youtubeSync/view.jsx

📝 Walkthrough

Walkthrough

Refactors portal rendering to use derived mainPortal/mainPortals variables, adds query-driven auto-open for YouTube transfer self-sync, introduces URL cleanup and popup-guarding logic, tweaks YouTube transfer styling, and expands the spinner to handle an optional odysee:// launch URL with UI and inline navigation script.

Changes

Cohort / File(s) Summary
Portal Component Refactor
ui/component/portals/view.jsx
Introduce mainPortal and mainPortals; replace direct portals.mainPortal.portals references. Update rotate calculation, interval/resize logic, useEffect deps, render guard, background/header sources, tile rendering, navigation/indicator logic, and defensive merge for categories.
YouTube Transfer Status — View
ui/component/youtubeTransferStatus/view.jsx
Add autoOpenSync prop and URL flags, compute selfSyncDeepLink/selfSyncLauncherUrl, derive showSelfSyncCard, add auto-open effect with popup-block fallback and URL-cleanup helper, and guard to prevent repeated auto-opens.
YouTube Transfer Status — Styles
ui/component/youtubeTransferStatus/style.lazy.scss
Add .token-display__open-link rule (margin-top spacing) within .token-display.
YouTube Sync Page Parameter Handling
ui/page/youtubeSync/view.jsx
Add OPEN_IN_SYNC/OPEN_APP query keys and isTruthyQueryValue helper; compute shouldAutoOpenSync from URL and pass autoOpenSync to YoutubeTransferStatus.
Spinner Launch Handling
web/src/spinner.js
Parse optional launch query param (validate odysee://token/...), sanitize/escape launch href, render alternate UI with status/help/button when launchUrl exists, inject inline script to attempt navigation, and add responsive layout/loader markup and styles.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Page as YouTubeSync Page
    participant Component as YoutubeTransferStatus
    participant Launcher as Sync Launcher / Popup

    User->>Page: Visit page with ?open_in_sync=true (or ?open_app=true)
    Page->>Page: Parse query params -> shouldAutoOpenSync
    Page->>Component: Render with autoOpenSync={true}
    Component->>Component: Compute selfSyncLauncherUrl (from token + DOMAIN)
    Component->>Component: showSelfSyncCard = true
    Component->>Component: useEffect triggers auto-open (once)
    Component->>Launcher: window.open(selfSyncLauncherUrl)
    alt popup allowed
        Launcher->>Launcher: Launch native sync app
        Launcher->>Component: (user returns) sync completed
    else popup blocked
        Component->>Component: Mark popup-blocked, show fallback UI
        Component->>User: Display manual launch button/link
    end
    Component->>Page: clearAutoOpenParamsFromUrl()
    Page->>User: URL params removed/cleaned
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through portals, neat and spry,

mainPortals lined up in a tidy sky.
A sync button whispered, "Open, please,"
Spinners twirled and launched with ease.
Rabbit cheers — code sings, and features rise!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main feature added: enabling a link to open the sync page from the YouTube page, which aligns with the PR's core objective of adding deep-link functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch odysync-login

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
ui/component/youtubeTransferStatus/view.jsx (1)

30-31: Consider centralizing auto-open query param keys.

Line [30]-[31] duplicates literals also declared in ui/page/youtubeSync/view.jsx. Moving them to a shared constant avoids silent drift between parser and consumer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/component/youtubeTransferStatus/view.jsx` around lines 30 - 31, The two
duplicated constants AUTO_OPEN_SYNC_PARAM and AUTO_OPEN_SYNC_PARAM_ALT should be
centralized into a shared exported constant so parser and consumer use the same
source of truth; create a module exporting these keys (e.g. export const
AUTO_OPEN_SYNC_PARAM, AUTO_OPEN_SYNC_PARAM_ALT) and update both view.jsx files
to import and use those exports instead of declaring the literals locally,
ensuring both youtubeTransferStatus (AUTO_OPEN_SYNC_PARAM /
AUTO_OPEN_SYNC_PARAM_ALT) and youtubeSync reference the single exported
constants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/page/youtubeSync/view.jsx`:
- Around line 30-37: The isTruthyQueryValue function treats any falsy value as
false, which causes presence-only params (e.g. ?open_in_sync) to be ignored and
can mask alternate param checks; update isTruthyQueryValue to return true when
value === '' (presence-only) but still return false for null/undefined, and keep
the lowercase checks for '0'/'false'/'no'; additionally, in the code that reads
query params (the alternate param handling referenced around the existing
usage), prefer using URLSearchParams.has('open_in_sync') or explicitly call
isTruthyQueryValue on the result rather than relying on a falsy check so the
presence-only param is honored.

In `@web/src/spinner.js`:
- Around line 4-5: The value from ctx.query.launch (captured as launchParam and
normalized into launchUrl) is only prefix-checked but later injected into an
href attribute, so sanitize/validate it before use: instead of directly
interpolating launchUrl into the anchor href, validate against an allowlist or
strict pattern (e.g., require exact odysee://token/<base64-or-hex> form), reject
or nullify anything that doesn't match, and HTML-escape/URL-encode the value
prior to insertion; update the code paths that build the href (references around
where launchUrl is used/interpolated) to use the validated/escaped value or omit
the attribute when invalid.

---

Nitpick comments:
In `@ui/component/youtubeTransferStatus/view.jsx`:
- Around line 30-31: The two duplicated constants AUTO_OPEN_SYNC_PARAM and
AUTO_OPEN_SYNC_PARAM_ALT should be centralized into a shared exported constant
so parser and consumer use the same source of truth; create a module exporting
these keys (e.g. export const AUTO_OPEN_SYNC_PARAM, AUTO_OPEN_SYNC_PARAM_ALT)
and update both view.jsx files to import and use those exports instead of
declaring the literals locally, ensuring both youtubeTransferStatus
(AUTO_OPEN_SYNC_PARAM / AUTO_OPEN_SYNC_PARAM_ALT) and youtubeSync reference the
single exported constants.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bd4fee and d0ccc81.

📒 Files selected for processing (5)
  • ui/component/portals/view.jsx
  • ui/component/youtubeTransferStatus/style.lazy.scss
  • ui/component/youtubeTransferStatus/view.jsx
  • ui/page/youtubeSync/view.jsx
  • web/src/spinner.js

Enhances `odysee://token/` deep link handling with stricter regex validation and HTML attribute escaping, preventing potential XSS vulnerabilities.

Refines query parameter parsing for auto-opening the sync page, treating empty parameter values as truthy and ensuring primary parameters are prioritized.
@tzarebczan tzarebczan merged commit 41ada5a into master Feb 25, 2026
3 checks passed
@tzarebczan tzarebczan deleted the odysync-login branch February 25, 2026 16:54
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.

1 participant