Skip to content

feat(cloud): offer "Open in Comfy Desktop" on cloud web#12808

Closed
deepme987 wants to merge 1 commit into
mainfrom
deepme987/feat/open-in-desktop
Closed

feat(cloud): offer "Open in Comfy Desktop" on cloud web#12808
deepme987 wants to merge 1 commit into
mainfrom
deepme987/feat/open-in-desktop

Conversation

@deepme987

@deepme987 deepme987 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

WIP PR: Needs product / UIUX decision

Summary

Adds a slim, dismissible "Open in Comfy Desktop" banner on cloud.comfy.org when viewed in a regular browser, deep-linking into the companion Comfy Desktop app.

Changes

  • What: New cloud-only banner (OpenInDesktopBanner.vue) mounted in the app shell (GraphView.vue) alongside the other toast/notification controllers. A useOpenInDesktopBanner composable owns the show/hide gating, deep-link firing, and dismissal persistence; the component stays thin. The CTA fires:

    window.location.href = `comfy://open?url=${encodeURIComponent(window.location.href)}`
    

    Comfy Desktop registers the comfy:// scheme and navigates its Cloud window to that URL. If the app is not installed the link silently no-ops, so the banner stays dismissible and includes a "Get the app" link to https://www.comfy.org/download. Companion to the Comfy-Desktop PR that handles the comfy://open scheme.

Review Focus

Banner renders only when all three gates hold:

  1. Cloud buildisCloud compile-time distribution flag (src/platform/distribution/types.ts). Never renders otherwise.
  2. Not embedded in Desktop — hidden when window.__comfyDesktop2Remote is truthy (the desktop app injects this into its cloud webview), so it never shows inside the app itself.
  3. Not previously dismissed — persisted in localStorage under comfy.openInDesktop.dismissed.

Unit tests cover all three gates, the encoded deep-link contract, and dismissal persistence.

Screenshots (if applicable)

Shows a slim dismissible banner on cloud.comfy.org (regular browser) that
deep-links into the companion Comfy Desktop app via comfy://open?url=...

Gated to render only when all hold: cloud build (isCloud), not already
embedded in Desktop's cloud webview (window.__comfyDesktop2Remote falsy),
and not previously dismissed (localStorage).
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a banner prompt that encourages cloud users to open the application in Comfy Desktop via a deep link. The feature includes conditional visibility (cloud builds only, not embedded), dismissal persistence, a localized UI component, and integration into the main GraphView.

Changes

Open in Desktop Banner

Layer / File(s) Summary
Banner composable and visibility logic
src/platform/cloud/desktop/useOpenInDesktopBanner.ts, src/platform/cloud/desktop/useOpenInDesktopBanner.test.ts
useOpenInDesktopBanner() hook computes visibility based on cloud build, embedding detection, and localStorage dismissal state; constructs comfy://open?url=... deep links; and provides openInDesktop() and dismiss() action handlers. Comprehensive tests verify visibility across scenarios (cloud/non-cloud, embedded/non-embedded, dismissed/undismissed) and validate localStorage persistence and deep-link navigation.
Banner component and localization
src/platform/cloud/desktop/OpenInDesktopBanner.vue, src/locales/en/main.json
OpenInDesktopBanner.vue renders a fixed-position dismissible banner with two actions—an external link to download the desktop app and a button to open the current page via deep link—both wired to the composable. English localization strings (openInDesktop.message, openInDesktop.action, openInDesktop.getApp, openInDesktop.dismiss) provide the prompt text and button labels.
GraphView integration
src/views/GraphView.vue
Banner component is imported and rendered in the GraphView template to activate the feature across the application.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

size:M

Suggested reviewers

  • AustinMroz
  • benceruleanlu
  • DrJKL

Poem

A banner hops onto the cloud so bright, ✨
Whispers "Come join us on desktop tonight!"
Users dismiss with a click—how divine,
Deep links and localStorage in perfect align. 🐰🖥️


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ❓ Inconclusive PR title has no bug-fix keywords; changes are under src and none under browser_tests, but commit subjects weren’t provided to verify condition (1). Need the PR commit subjects (or confirmation none contain fix/hotfix/bugfix language) to determine whether all failure conditions are met.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main feature being added: a cloud-only banner to prompt users to open the app in Comfy Desktop.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Adr Compliance For Entity/Litegraph Changes ✅ Passed PR changes only add cloud desktop banner/i18n and tests; no files under src/lib/litegraph/, src/ecs/, or graph entities paths appear in the changed list.
Description check ✅ Passed The PR description comprehensively covers summary, changes, review focus with technical details, and includes deep-link specifications.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deepme987/feat/open-in-desktop

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

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 06/12/2026, 12:51:12 AM UTC

Links

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

🎭 Playwright: ✅ 1666 passed, 0 failed · 3 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1645 / ❌ 0 / ⚠️ 3 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

@deepme987

Copy link
Copy Markdown
Contributor Author

Companion PRs

This PR produces the comfy://open?url=... links; #1073 consumes them. Needs a packaged/ToDesktop build of #1073 for the end-to-end OS handoff.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/platform/cloud/desktop/OpenInDesktopBanner.vue`:
- Around line 2-38: The banner is a single-row flex that can overflow on narrow
viewports; update the root container in OpenInDesktopBanner.vue to allow
wrapping and a stacked layout on small screens (e.g., change the root div
classes to include "flex-col sm:flex-row flex-wrap" while keeping items-center
and justify-center), and add "flex-shrink-0" to the primary action button and
the download link (DESKTOP_DOWNLOAD_URL) so they don't get truncated; ensure the
message span can wrap (remove any hard truncation) so the message, buttons
(openInDesktop, dismiss) and link reflow vertically on narrow viewports.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3ec79f30-1998-43f2-b39e-ea34a4ba2a28

📥 Commits

Reviewing files that changed from the base of the PR and between fefbe78 and 75d8548.

📒 Files selected for processing (5)
  • src/locales/en/main.json
  • src/platform/cloud/desktop/OpenInDesktopBanner.vue
  • src/platform/cloud/desktop/useOpenInDesktopBanner.test.ts
  • src/platform/cloud/desktop/useOpenInDesktopBanner.ts
  • src/views/GraphView.vue

Comment on lines +2 to +38
<div
v-if="visible"
class="fixed inset-x-0 top-0 z-1100 flex items-center justify-center gap-3 bg-secondary-background px-4 py-2 text-base-foreground shadow-sm"
role="region"
:aria-label="t('openInDesktop.action')"
>
<i
class="icon-[lucide--monitor] size-4 text-text-secondary"
aria-hidden="true"
/>
<span class="font-inter text-[12px] leading-normal">
{{ t('openInDesktop.message') }}
</span>
<button
type="button"
class="rounded-md bg-primary-background px-3 py-1 font-inter text-[12px] font-medium text-base-foreground transition-colors hover:bg-primary-background-hover"
@click="openInDesktop"
>
{{ t('openInDesktop.action') }}
</button>
<a
:href="DESKTOP_DOWNLOAD_URL"
target="_blank"
rel="noopener noreferrer"
class="font-inter text-[12px] text-text-secondary underline-offset-2 hover:underline"
>
{{ t('openInDesktop.getApp') }}
</a>
<button
type="button"
class="ml-1 flex size-6 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-secondary-background-hover"
:aria-label="t('openInDesktop.dismiss')"
@click="dismiss"
>
<i class="icon-[lucide--x] size-4" aria-hidden="true" />
</button>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a wrapping fallback for narrow viewports.

This banner is forced into one horizontal flex row, so the message and actions can overflow or get clipped when the viewport is narrower than expected. A small wrap/stacking fallback would make the new top banner safer.

♻️ Suggested fix
-    class="fixed inset-x-0 top-0 z-1100 flex items-center justify-center gap-3 bg-secondary-background px-4 py-2 text-base-foreground shadow-sm"
+    class="fixed inset-x-0 top-0 z-1100 flex flex-wrap items-center justify-center gap-3 bg-secondary-background px-4 py-2 text-base-foreground shadow-sm"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div
v-if="visible"
class="fixed inset-x-0 top-0 z-1100 flex items-center justify-center gap-3 bg-secondary-background px-4 py-2 text-base-foreground shadow-sm"
role="region"
:aria-label="t('openInDesktop.action')"
>
<i
class="icon-[lucide--monitor] size-4 text-text-secondary"
aria-hidden="true"
/>
<span class="font-inter text-[12px] leading-normal">
{{ t('openInDesktop.message') }}
</span>
<button
type="button"
class="rounded-md bg-primary-background px-3 py-1 font-inter text-[12px] font-medium text-base-foreground transition-colors hover:bg-primary-background-hover"
@click="openInDesktop"
>
{{ t('openInDesktop.action') }}
</button>
<a
:href="DESKTOP_DOWNLOAD_URL"
target="_blank"
rel="noopener noreferrer"
class="font-inter text-[12px] text-text-secondary underline-offset-2 hover:underline"
>
{{ t('openInDesktop.getApp') }}
</a>
<button
type="button"
class="ml-1 flex size-6 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-secondary-background-hover"
:aria-label="t('openInDesktop.dismiss')"
@click="dismiss"
>
<i class="icon-[lucide--x] size-4" aria-hidden="true" />
</button>
</div>
<div
v-if="visible"
class="fixed inset-x-0 top-0 z-1100 flex flex-wrap items-center justify-center gap-3 bg-secondary-background px-4 py-2 text-base-foreground shadow-sm"
role="region"
:aria-label="t('openInDesktop.action')"
>
<i
class="icon-[lucide--monitor] size-4 text-text-secondary"
aria-hidden="true"
/>
<span class="font-inter text-[12px] leading-normal">
{{ t('openInDesktop.message') }}
</span>
<button
type="button"
class="rounded-md bg-primary-background px-3 py-1 font-inter text-[12px] font-medium text-base-foreground transition-colors hover:bg-primary-background-hover"
`@click`="openInDesktop"
>
{{ t('openInDesktop.action') }}
</button>
<a
:href="DESKTOP_DOWNLOAD_URL"
target="_blank"
rel="noopener noreferrer"
class="font-inter text-[12px] text-text-secondary underline-offset-2 hover:underline"
>
{{ t('openInDesktop.getApp') }}
</a>
<button
type="button"
class="ml-1 flex size-6 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-secondary-background-hover"
:aria-label="t('openInDesktop.dismiss')"
`@click`="dismiss"
>
<i class="icon-[lucide--x] size-4" aria-hidden="true" />
</button>
</div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/cloud/desktop/OpenInDesktopBanner.vue` around lines 2 - 38, The
banner is a single-row flex that can overflow on narrow viewports; update the
root container in OpenInDesktopBanner.vue to allow wrapping and a stacked layout
on small screens (e.g., change the root div classes to include "flex-col
sm:flex-row flex-wrap" while keeping items-center and justify-center), and add
"flex-shrink-0" to the primary action button and the download link
(DESKTOP_DOWNLOAD_URL) so they don't get truncated; ensure the message span can
wrap (remove any hard truncation) so the message, buttons (openInDesktop,
dismiss) and link reflow vertically on narrow viewports.

@deepme987

Copy link
Copy Markdown
Contributor Author

closing - UX is terrible to work around.

@deepme987 deepme987 closed this Jul 15, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant