diff --git a/.claude/skills/starter-templates/SKILL.md b/.claude/skills/starter-templates/SKILL.md deleted file mode 100644 index c4218bae8..000000000 --- a/.claude/skills/starter-templates/SKILL.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -name: starter-templates -description: Change which starter templates the desktop install picker offers. Use when someone wants to swap, add, feature or refresh a starter template, or asks what the picker shows after install. -argument-hint: '[what you want to change]' -allowed-tools: Bash(node scripts/starter-templates.mjs *) Bash(git checkout *) Bash(git switch *) Bash(git add *) Bash(git commit *) Bash(git push *) Bash(gh pr create *) Read ---- - -# Starter templates - -Change the starter templates the desktop installer offers, then open a PR. - -The picker shows 4 templates in each of 4 tabs: `video`, `image`, `3d`, `audio`. -The list is `assets/starter-templates.json`, which desktop reads from R2 at boot, -so a merged change reaches users on their next launch with no app release. - -## Rules - -**Never edit the JSON directly.** Every command below regenerates the display -fields from the live template index. Hand-editing puts stale titles and sizes in -front of users and fails CI. - -**Only ever pass template ids.** Titles, descriptions, sizes and thumbnails are -derived. If the user supplies them, ignore them and let the script fill them in. - -**Confirm the id before writing.** Run `list` first and show the user the -matching titles. Ids differ by one character (`video_minimax_h3_t2v` vs -`..._i2v`), so never infer one from a product name. - -**Never work around a rejection.** Read the message, fix the input, and tell the -user what was wrong. Do not edit the JSON to get past it. - -## Steps - -### 1. Find the id - -```bash -node scripts/starter-templates.mjs list --modality video --free -``` - -`--modality` is `video`, `image`, `3d` or `audio`. `--free` or `--paid` narrows -it. Report the handful of relevant matches with titles and sizes, then confirm. - -### 2. Make the change - -Pick the command from what the user is changing. - -Swap the featured (auto-selected) pick: - -```bash -node scripts/starter-templates.mjs set --modality video --id --recommended -``` - -Swap the paid API-node pick: - -```bash -node scripts/starter-templates.mjs set --modality video --id --paid -``` - -Swap one specific card, leaving the others alone: - -```bash -node scripts/starter-templates.mjs set --modality video --id --replaces -``` - -Rebuild every tab at once, for a seasonal refresh. Four ids per tab, `*` marks -the featured card, `$` marks the paid one. Single-quote each list so the shell -leaves `$` alone: - -```bash -node scripts/starter-templates.mjs replace \ - --video '*id_a,$api_id,id_c,id_d' \ - --image '*id_a,$api_id,id_c,id_d' \ - --3d '*id_a,$api_id,id_c,id_d' \ - --audio '*id_a,$api_id,id_c,id_d' -``` - -Refresh titles and sizes for the ids already in the list, changing nothing else: - -```bash -node scripts/starter-templates.mjs regenerate -``` - -Each tab holds 4 slots, so `set` replaces rather than appends. The script -validates before writing, so a refusal leaves the file untouched. - -The spec pins the slot rule, not the exact order: every tab keeps its -recommended pick in slot 1 and its paid card in slot 2, while slots 3 and 4 -may reorder freely. So a plain swap of the two free cards needs no spec -change. The `TABS` fixture in `scripts/starter-templates.spec.mjs` only feeds -the negative `replace` cases — its own order is never compared against the -file — so leave it alone unless you add or drop an id there. - -### 3. Open a PR - -```bash -git switch -c templates/ -git add assets/starter-templates.json -git commit -m "content(templates): " -git push -u origin HEAD -gh pr create --title "content(templates): " --body "" -``` - -Name the old and new template in the PR body, and why it changed. A swap, -feature or paid change touches only `assets/starter-templates.json`. Add -`scripts/starter-templates.spec.mjs` to the commit only if you introduced or -removed an id that the `TABS` fixture references. Nothing else should change; -if `git status` shows more, you edited the JSON by hand instead of running the -script. - -### 4. Report back - -Tell the user which template replaced which, and that it reaches users on their -next app launch once the PR merges. Nothing ships before then. - -## What the script refuses - -These fail silently in the app, so they fail here instead. - -- Exactly 4 templates per tab. -- Exactly 1 featured per tab, and it must be free. -- Exactly 1 paid (API-node) template per tab. -- Every id must exist in the live template index. -- No duplicate ids anywhere, including across tabs. -- Ids and text within the app's length caps. - -## If something fails - -`is not in the template index` — the id is wrong or was renamed upstream. Run -`list` for that modality and pick from the output. - -`cannot be both --recommended and paid` — the featured card must be free. Ask -which the user meant. - -`needs exactly 1 paid template` — a tab lost or gained its API-node card. Use -`--replaces` to swap like for like. - -`could not read the template index` — the live index is unreachable. This is -network, not input. Retry rather than changing the request. - -First run in a fresh clone: see [setup.md](setup.md). Needs Node 22 and -`gh auth login`, no build step. diff --git a/.claude/skills/starter-templates/setup.md b/.claude/skills/starter-templates/setup.md deleted file mode 100644 index 73144624d..000000000 --- a/.claude/skills/starter-templates/setup.md +++ /dev/null @@ -1,67 +0,0 @@ -# First-time setup - -Everything below is one-time. After it, changing a template is one sentence to -Claude. - -## What you need - -**Node 22+** — check with `node --version`. If it's missing or older, install -from [nodejs.org](https://nodejs.org) (take the LTS build). - -**The repo:** - -```bash -git clone https://github.com/Comfy-Org/Comfy-Desktop.git -cd Comfy-Desktop -``` - -You do **not** need to install dependencies or build the app. The template -script runs on Node alone. - -**GitHub CLI**, so Claude can open the PR for you: - -```bash -gh auth login -``` - -Pick GitHub.com, HTTPS, and authenticate in the browser. - -## Check it works - -```bash -node scripts/starter-templates.mjs validate -``` - -Expected: - -``` - ✓ 16 templates, 4 per tab, rules hold -``` - -If you see that, you are done. - -## Using it - -Open Claude Code in the repo folder and ask in plain English: - -> swap the recommended video template to Wan 2.2 - -Claude finds the id, makes the change, validates it, and opens a PR for review. -You can also run `/starter-templates` to invoke it directly. - -You never edit JSON by hand. You only ever choose which template goes where. - -## If something goes wrong - -**`node: command not found`** — Node is not installed, or the terminal needs -reopening after installing it. - -**`could not read the template index`** — no internet, or GitHub is blocked. -The script reads the live template list from raw.githubusercontent.com. - -**`"" is not in the template index`** — that template id does not exist -upstream. Run `node scripts/starter-templates.mjs list --modality video` to see -what is available. - -**Anything else** — paste the error into Claude Code. The messages are written -to say what to do next. diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 386cd3440..fe52b21a3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -21,4 +21,4 @@ # Root-anchored rule so the top-level AGENTS.md has an explicit DRI (a bare # `**/`-prefixed pattern doesn't match a repo-root file in every CODEOWNERS # reader). -/AGENTS.md @benceruleanlu @deepme987 @Kosinkadink +/AGENTS.md @benceruleanlu diff --git a/.github/scripts/check-gcs.sh b/.github/scripts/check-gcs.sh index b14a231e3..d80f5af6c 100755 --- a/.github/scripts/check-gcs.sh +++ b/.github/scripts/check-gcs.sh @@ -1,6 +1,4 @@ #!/usr/bin/env bash -# Reports what the mirror service account can do. Uses the JSON API with the -# token `google-github-actions/auth` exports, rather than the gcloud CLI. set -uo pipefail BUCKET=comfy-desktop-public @@ -26,7 +24,6 @@ fi say "- Service account: \`$(jq -r '.client_email // "unknown"' "$CREDS")\`" say "- Project: \`$(jq -r '.project_id // "unknown"' "$CREDS")\`" -# Mint an access token from the service-account key. TOKEN=$(python3 - "$CREDS" <<'PY' import base64, json, sys, time, urllib.parse, urllib.request from cryptography.hazmat.primitives import hashes, serialization @@ -79,8 +76,6 @@ write_code=$(curl -sS --connect-timeout 10 --max-time 30 -o "$TMP/gcs-write.json say "- Write a throwaway object: HTTP $write_code" if [ "$write_code" = "200" ]; then - # Publishing overwrites an existing object, which a create-only credential - # cannot do, so prove overwrite rather than just create. again=$(curl -sS --connect-timeout 10 --max-time 30 -o /dev/null -w '%{http_code}' -X POST \ "https://storage.googleapis.com/upload/storage/v1/b/$BUCKET/o?uploadType=media&name=$(printf %s "$KEY" | jq -sRr @uri)" \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ diff --git a/.github/scripts/check-r2.sh b/.github/scripts/check-r2.sh index 416d1d8ed..9f79d8dcd 100755 --- a/.github/scripts/check-r2.sh +++ b/.github/scripts/check-r2.sh @@ -1,7 +1,4 @@ #!/usr/bin/env bash -# Reports what the R2 token can do against the bucket the workflow publishes to. -# Separates "token invalid" from "cannot see the bucket" from "read but not -# write", so a failure names the permission to ask for. set -uo pipefail API=https://api.cloudflare.com/client/v4 @@ -17,8 +14,6 @@ say() { say "### R2" -# Without this, `set -u` aborts with a bare "unbound variable" and the script -# reports nothing, which is the opposite of its job. for v in CF_ACCOUNT CF_TOKEN; do if [ -z "${!v:-}" ]; then say "- **\`$v\` is not set on this run.** Add it to the starter-templates environment." @@ -29,8 +24,6 @@ done TMP=$(mktemp -d) trap 'rm -rf "$TMP"' EXIT -# Account-owned tokens are rejected by /user/tokens/verify with code 1000 even -# when perfectly valid, so try the account endpoint too before calling it bad. verify=$(curl -sS --connect-timeout 10 --max-time 30 "$API/accounts/$CF_ACCOUNT/tokens/verify" -H "Authorization: Bearer $CF_TOKEN") kind="account-owned" if ! jq -e '.success == true' <<<"$verify" >/dev/null 2>&1; then diff --git a/.github/workflows/agents-md-integrity.yml b/.github/workflows/agents-md-integrity.yml index 59c2a7ecd..004dd60bf 100644 --- a/.github/workflows/agents-md-integrity.yml +++ b/.github/workflows/agents-md-integrity.yml @@ -1,12 +1,5 @@ name: AGENTS.md Integrity -# Thin caller for the shared reusable AGENTS.md integrity check. The checker -# lives in Comfy-Org/github-workflows (single source of truth), loaded from -# the pinned workflows_ref — never from this repo's checkout. Bump the SHA to -# pick up upstream changes and keep `workflows_ref` matching so the check -# script loads from the same commit; the upstream bump dispatcher -# (AGENTS_MD_CALLERS) opens SHA-bump PRs automatically once registered. - on: pull_request: push: diff --git a/.github/workflows/benchmark-templates.yml b/.github/workflows/benchmark-templates.yml index e3b9cebfe..4674b2506 100644 --- a/.github/workflows/benchmark-templates.yml +++ b/.github/workflows/benchmark-templates.yml @@ -1,8 +1,5 @@ name: Benchmark templates -# Guards `assets/benchmark-templates.json`, the example workflows the performance -# test page offers. An example whose prompt or parent template is not on the -# workflow_templates repo's `main` fails for every user who picks it. on: pull_request: paths: @@ -28,5 +25,4 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 - # Shape the app accepts, and every example downloadable from GitHub `main`. - run: node scripts/benchmark-templates.mjs validate diff --git a/.github/workflows/build-bootstrap-python.yml b/.github/workflows/build-bootstrap-python.yml index c84035f59..4800949ca 100644 --- a/.github/workflows/build-bootstrap-python.yml +++ b/.github/workflows/build-bootstrap-python.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: tag: - description: "Release tag for the bootstrap-python assets (e.g. bootstrap-v3)" + description: 'Release tag for the bootstrap-python assets (e.g. bootstrap-v3)' required: true - default: "bootstrap-v3" + default: 'bootstrap-v3' permissions: contents: write @@ -19,8 +19,6 @@ jobs: include: - platform: win-x64 os: windows-latest - # Native Windows on Arm (NVIDIA RTX Spark). GitHub's arm64 Windows - # runners are free for public repositories. - platform: win-arm64 os: windows-11-arm - platform: mac-arm64 @@ -39,13 +37,9 @@ jobs: uses: actions/setup-node@v7 with: package-manager-cache: false - node-version: "20" + node-version: '20' - name: Build bootstrap Python - # The script downloads python-build-standalone, installs pygit2, and - # places a pinned uv binary alongside python. No system Python or - # uv is required — all Python invocations use the just-extracted - # interpreter. run: node scripts/build-bootstrap-python.mjs --platform ${{ matrix.platform }} --output bootstrap-python - name: Package archive diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 768325aa6..b05aea7e4 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -14,8 +14,6 @@ on: permissions: contents: write - # Required for Workload Identity Federation (keyless GCP auth) used to fetch - # the proprietary PP Formula font from gs://comfy-org-fonts before building. id-token: write concurrency: @@ -76,12 +74,6 @@ jobs: echo "${delimiter}" } >> "$GITHUB_OUTPUT" - # Fetch the proprietary PP Formula font into the renderer public dir - # before the build. It is gitignored (never committed to this public - # repo) and pulled from a private bucket via keyless Workload Identity - # Federation. Release builds must ship the licensed display face, so the - # fetch fails loudly (no --soft-fail); a missing font would otherwise - # silently fall back to Inter. - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2 with: @@ -117,27 +109,14 @@ jobs: run: pnpm run datadog:sourcemaps:upload - name: Install ToDesktop CLI - # 1.28.0 is the first release whose todesktop.json schema accepts - # `targetOverrides`, which selects the per-architecture Windows - # bootstrap-python (win-x64 vs win-arm64) in todesktop.json. run: npm install --location=global @todesktop/cli@1.28.1 - name: Pre-fetch bootstrap-python for all platforms - # @todesktop/cli now eagerly validates the `extraResources` paths in - # todesktop.json *before* invoking the `beforeBuild` hook, so the - # platform-specific bootstrap-python directories must exist locally - # at the time `todesktop build` is invoked. env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: pnpm run bootstrap:fetch - name: Verify bootstrap-python is populated for every platform - # Belt-and-braces check: even though fetch-bootstrap-python.mjs now - # exits non-zero on failure, surface the directory state in the build - # log and explicitly fail if any platform's Python binary is missing. - # The 0.6.4 installer shipped without bootstrap-python because a fetch - # error was swallowed and the directory was empty going into the - # packaging step. That class of failure must never be quiet again. shell: bash run: | set -euo pipefail @@ -174,8 +153,6 @@ jobs: done mkdir -p todesktop-targets/linux-x64 mv bootstrap-python/linux-x64 todesktop-targets/linux-x64/bootstrap-python - # ToDesktop requires matching resource paths across architectures. - # Keep the ARM64 directory nonempty for upload, without a Python binary. mkdir -p todesktop-targets/linux-arm64/bootstrap-python printf '%s\n' 'Bootstrap Python is not available for Linux ARM64.' > todesktop-targets/linux-arm64/bootstrap-python/README.txt @@ -213,8 +190,6 @@ jobs: NODE - name: Fetch ToDesktop build metadata - # `builds` returns only five rows unless count is explicit. Keep enough history - # to find this build when other builds finish while this job is waiting. run: todesktop builds --config=todesktop.json --count 100 --format=json --exit > todesktop-build.json - name: Extract build details @@ -493,11 +468,6 @@ jobs: exit 0 fi - # Classify the tag. Anything with a pre-release suffix - # (vX.Y.Z-rc.N, -beta.N, -alpha.N, etc.) ships as a GitHub - # "Pre-release" — visible at /releases but not surfaced as - # "Latest" and not picked up by auto-update unless the user - # explicitly opts in. Plain vX.Y.Z is the stable channel. if [[ "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-.+$ ]]; then channel_flag="--prerelease" channel_label="pre-release" @@ -506,11 +476,6 @@ jobs: channel_label="latest" fi - # Prefer the release PR body as release notes when the - # workflow was dispatched with a pr_number. Falls back to - # GitHub's auto-generated PR-titles list when no PR is - # known (manual tag push, etc.) so we never ship a release - # with empty notes. notes_file="" if [[ -n "${PR_NUMBER}" ]]; then notes_file="$(mktemp)" @@ -541,9 +506,6 @@ jobs: comment-on-release-pr: needs: [build, smoke-linux-appimage] - # Post the ToDesktop build page + downloads back onto the version-bump PR - # that produced this tag. Runs on success or failure (a link to a failed - # build is still useful); skipped only when no build id was produced. if: > always() && startsWith(github.ref, 'refs/tags/v') && @@ -575,7 +537,6 @@ jobs: app_id="$(jq -r '.id' todesktop.json)" build_url="https://app.todesktop.com/apps/${app_id}/builds/${BUILD_ID}" - # Which PR produced this tagged commit? pr="${INPUT_PR:-}" if [[ -z "${pr}" ]]; then pr="$(gh api "repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls" --jq '.[0].number' 2>/dev/null || true)" @@ -611,7 +572,6 @@ jobs: if [[ -n "${LINUX_URL}" ]]; then printf -- '- Linux: %s\n' "${LINUX_URL}" >> comment.md; have_links=1; fi if [[ "${have_links}" -eq 0 ]]; then printf '_No per-platform download links reported._\n' >> comment.md; fi - # Upsert: update our previous comment (matched by marker) or create a new one. existing="$(gh api "repos/${GITHUB_REPOSITORY}/issues/${pr}/comments" --paginate \ --jq ".[] | select(.body | contains(\"${marker}\")) | .id" 2>/dev/null | head -1 || true)" if [[ -n "${existing}" && "${existing}" != "null" ]]; then diff --git a/.github/workflows/ci-cursor-review.yml b/.github/workflows/ci-cursor-review.yml index e4d2d0263..ef1eb30e9 100644 --- a/.github/workflows/ci-cursor-review.yml +++ b/.github/workflows/ci-cursor-review.yml @@ -1,11 +1,5 @@ name: CI - Cursor Review -# Thin caller for the shared reusable cursor-review workflow in -# Comfy-Org/github-workflows. The review logic (panel matrix, judge -# consolidation, prompts, extract/post/notify scripts) lives there as the -# single source of truth, so this repo only carries the repo-specific diff -# excludes. - on: pull_request: types: [labeled, unlabeled] @@ -19,9 +13,6 @@ jobs: permissions: contents: read pull-requests: write - # SHA-pinned per zizmor `unpinned-uses: hash-pin`. Bump this SHA to pick up - # upstream changes; keep `workflows_ref` matching so prompts/scripts load - # from the same commit as the workflow definition. uses: Comfy-Org/github-workflows/.github/workflows/cursor-review.yml@ece4c3eaa71812a5a665f48d5d1f4bb0ff5f655e # github-workflows main (ece4c3e) with: workflows_ref: ece4c3eaa71812a5a665f48d5d1f4bb0ff5f655e diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3aa6500f..51a26868a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,10 +26,6 @@ jobs: - name: Ensure PP Formula is not committed run: | set -euo pipefail - # PP Formula (Pangram Pangram) is license-restricted and must never be - # committed to this public repo. It is fetched at build time from - # gs://comfy-org-fonts (see scripts/fetch-font.mjs). This guard fails - # the build if any PP Formula binary is tracked in git. matches="$(git ls-files '*PPFormula*' '*ppformula*' '*pp-formula*' '*pp_formula*' || true)" if [ -n "$matches" ]; then echo "::error::Proprietary PP Formula font files are committed to the repo:" @@ -42,7 +38,7 @@ jobs: checks: name: ${{ matrix.name }} - runs-on: ubuntu-latest + runs-on: ${{ matrix.needs_browser && 'ubuntu-24.04' || 'ubuntu-latest' }} strategy: fail-fast: false matrix: @@ -55,6 +51,7 @@ jobs: command: pnpm run typecheck && pnpm run bridge-types:check - name: Test command: pnpm run test + needs_browser: true - name: Test (integration) command: pnpm run test:integration @@ -74,6 +71,10 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Install Chromium for browser tests + if: matrix.needs_browser + run: pnpm exec playwright install --with-deps --only-shell chromium + - name: Run ${{ matrix.name }} run: ${{ matrix.command }} @@ -113,16 +114,12 @@ jobs: - name: Require a version bump when the contract changes env: BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} - # The checked-out tree is the merge ref, which already carries main's - # later commits; diff the branch tip so only this change is measured. HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} shell: bash run: | set -euo pipefail PACKAGE_JSON=packages/comfyui-desktop-bridge-types/package.json MERGE_BASE=$(git merge-base "$BASE_SHA" "$HEAD_SHA") - # Glob the declarations: tsc emits one file per source module, so the - # set is not fixed. if git diff --quiet "$MERGE_BASE" "$HEAD_SHA" -- \ src/types/comfyDesktopBridge.ts \ 'packages/comfyui-desktop-bridge-types/*.d.ts' \ @@ -135,10 +132,7 @@ jobs: read_version() { git show "$1:$PACKAGE_JSON" | node -p "JSON.parse(require('fs').readFileSync(0, 'utf8')).version"; } BASE_VERSION=$(read_version "$MERGE_BASE") HEAD_VERSION=$(read_version "$HEAD_SHA") - # Exported, not just assigned: the comparator reads them from env. export BASE_VERSION HEAD_VERSION - # Prerelease-aware precedence, inline so an unrelated registry outage - # cannot fail this PR. Build metadata is ignored, per semver. if ! node -e ' const parse = (v) => { const m = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(v) diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 9b65cc772..7efa8af13 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -10,7 +10,7 @@ on: permissions: actions: write - contents: read # 'read' is enough because signatures live in a REMOTE repo + contents: read pull-requests: write statuses: write @@ -22,9 +22,6 @@ jobs: if: github.event_name == 'merge_group' run: echo "CLA was required before each pull request entered the merge queue." - # The CLA action normally requires every commit author in a PR to sign. - # We only want the PR author to sign, so we allowlist all other committers - # by computing them from the PR's commits and excluding the PR author. - name: Build author-only allowlist id: allowlist if: > @@ -38,8 +35,6 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} PR_AUTHOR: ${{ github.event.pull_request.user.login || github.event.issue.user.login }} BASE_ALLOWLIST: action@github.com,actions-user,ampagent,claude,comfy-pr-bot,GitHub Action,github-actions,github-actions[bot],Glary Bot,Glary-Bot,*[bot] - # For each commit emit the GitHub login when the author/committer email resolves to a GitHub account - # otherwise fall back to the raw git name. run: | if ! commit_authors=$(gh api "repos/${{ github.repository }}/pulls/${PR_NUMBER}/commits" --paginate \ --jq '.[] | (.author.login // .commit.author.name // empty), (.committer.login // .commit.committer.name // empty)'); then @@ -54,8 +49,6 @@ jobs: fi - name: CLA Assistant - # Run on open/update PR events, on "recheck", or when someone posts the signing phrase. - # IMPORTANT: this phrase must match `custom-pr-sign-comment` below. if: > (github.event_name == 'pull_request_target' && github.event.action != 'closed') || (github.event_name == 'issue_comment' && github.event.issue.pull_request && ( @@ -65,26 +58,19 @@ jobs: uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # PAT required to write to the centralized signatures repo. PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} with: lock-pullrequest-aftermerge: false - # Where the CLA document lives (shown to contributors) path-to-document: https://github.com/Comfy-Org/comfy-cla/blob/main/comfyui_icla.md - # Centralized signature storage remote-organization-name: comfy-org remote-repository-name: comfy-cla path-to-signatures: signatures/cla.json branch: main - # Only the PR author must sign: bots plus every non-author committer - # are allowlisted via the "Build author-only allowlist" step above. - # *[bot] is a catch-all for any GitHub App bot account. allowlist: ${{ steps.allowlist.outputs.allowlist }} - # Custom PR comment messages custom-notsigned-prcomment: | 🎉 Thank you for your contribution, we really appreciate it! 🎉 diff --git a/.github/workflows/lifecycle.yml b/.github/workflows/lifecycle.yml index 1da442308..cf4439246 100644 --- a/.github/workflows/lifecycle.yml +++ b/.github/workflows/lifecycle.yml @@ -3,13 +3,7 @@ name: Lifecycle Tests on: workflow_dispatch: schedule: - # Nightly at 09:00 UTC - cron: '0 9 * * *' - # On-demand per-PR run: add the `run-lifecycle` label to a PR to run - # the CPU lifecycle chain against it. The job below skips every other - # label event, so normal PR activity never triggers this workflow. - # Re-run by removing and re-adding the label (or via Actions re-run). - # Do NOT make this a required check - it is opt-in by design. pull_request: types: [labeled] @@ -23,7 +17,6 @@ concurrency: jobs: lifecycle: name: Lifecycle (windows) - # Label events fire for every label; only `run-lifecycle` runs the job. if: github.event_name != 'pull_request' || github.event.label.name == 'run-lifecycle' runs-on: windows-latest timeout-minutes: 120 @@ -44,10 +37,6 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - # Lifecycle tests exercise the real install path, which prefers the - # bundled bootstrap-python git backend (the same backend shipped to - # users). Fetch it so the run covers production wiring instead of - # silently falling back to the runner's system git. - name: Fetch bootstrap Python env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -57,7 +46,6 @@ jobs: run: pnpm run build - name: Run lifecycle tests - # Hosted runners have no GPU - pin the CPU variant explicitly. env: LIFECYCLE_VARIANT: cpu run: pnpm run test:e2e:lifecycle diff --git a/.github/workflows/publish-bridge-types.yml b/.github/workflows/publish-bridge-types.yml index 393e39b1a..e13c4949d 100644 --- a/.github/workflows/publish-bridge-types.yml +++ b/.github/workflows/publish-bridge-types.yml @@ -1,8 +1,5 @@ name: Publish Bridge Types -# One workflow owns every publish because npm trusted publishing authorizes an -# exact workflow filename. Automatic and manual runs both publish only the -# checked-out main commit; there is intentionally no free-form ref input. on: push: branches: [main] @@ -22,8 +19,6 @@ on: permissions: contents: read -# npm package versions are immutable, so publishing this package must always -# serialize, regardless of the event or requested dist-tag. concurrency: group: publish-comfyui-desktop-bridge-types cancel-in-progress: false @@ -31,7 +26,6 @@ concurrency: jobs: publish_bridge_types: name: Publish @comfyorg/comfyui-desktop-bridge-types - # Defense in depth around the environment's main-only deployment policy. if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest environment: npm-publish @@ -60,8 +54,6 @@ jobs: echo "::error title=Package name mismatch::Expected $EXPECTED_NAME, found $NAME" >&2 exit 1 fi - # A dispatcher who names a version is asserting what they expect main - # to hold; the checked-out main commit remains the source of truth. if [ -n "$INPUT_VERSION" ] && [ "$INPUT_VERSION" != "$VERSION" ]; then echo "::error title=Version mismatch::${PACKAGE_JSON} version $VERSION does not match input $INPUT_VERSION" >&2 exit 1 @@ -90,8 +82,6 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v7 with: - # npm trusted publishing requires Node >=22.14 and npm >=11.5.1. - # Node 26 supplies a compatible npm CLI. node-version: 26 package-manager-cache: false registry-url: https://registry.npmjs.org @@ -122,9 +112,6 @@ jobs: fi echo "exists=true" >> "$GITHUB_OUTPUT" - # A rerun is harmless only when npm already serves the exact package. - # Compare packed artifacts so package.json entrypoints and the files - # allowlist are covered. README-only edits may ride with the next bump. WORK=$(mktemp -d "$RUNNER_TEMP/bridge-types.XXXXXX") mkdir -p "$WORK/published-tar" "$WORK/published" "$WORK/local-tar" "$WORK/local" npm pack --ignore-scripts "${NAME}@${VER}" --pack-destination "$WORK/published-tar" >/dev/null diff --git a/.github/workflows/release-from-pr-label.yml b/.github/workflows/release-from-pr-label.yml index 3755013c9..b29b97cc5 100644 --- a/.github/workflows/release-from-pr-label.yml +++ b/.github/workflows/release-from-pr-label.yml @@ -126,9 +126,6 @@ jobs: run: | set -euo pipefail - # Pass the release PR's number so build-release.yml can pull - # the PR body as the GitHub Release notes (replaces the - # auto-generated PR-titles dump). gh workflow run build-release.yml \ --repo "${GITHUB_REPOSITORY}" \ --ref "${TAG}" \ diff --git a/.github/workflows/starter-templates.yml b/.github/workflows/starter-templates.yml index d0f931ff3..9360cdbe9 100644 --- a/.github/workflows/starter-templates.yml +++ b/.github/workflows/starter-templates.yml @@ -1,8 +1,5 @@ name: Starter templates -# Guards `assets/starter-templates.json`, which desktop reads from R2 at boot. -# A bad edit is silent in the app: a short tab quietly backfills and a paid -# auto-pick spends the user's credits, so it has to fail here instead. on: pull_request: paths: @@ -14,12 +11,8 @@ on: branches: [main] paths: - 'assets/starter-templates.json' - # A change to the validator itself must re-check the committed list on - # main, not only on the PR that changed it. - 'scripts/starter-templates.mjs' - '.github/workflows/starter-templates.yml' - # Lets us prove the credentials work before merging, rather than finding out - # on the merge that publishes to users. workflow_dispatch: inputs: dry_run: @@ -40,25 +33,13 @@ jobs: with: package-manager-cache: false node-version: 22 - # Checks the tab counts and the one-paid-per-tab rule, and confirms every - # id still exists upstream. - run: node scripts/starter-templates.mjs validate - # Every way an edit can break the picker silently: wrong counts, a paid - # auto-pick, a duplicate id, a free card with no size. - # `node --test`, so this needs no dependency install. - name: guardrails hold run: node --test scripts/starter-templates.spec.mjs - # A hand-edit that skipped the script would drift from the index, so - # regenerating must be a no-op. - # A warning, not a failure: these fields are refreshed from upstream's - # `main`, so an unrelated edit there would otherwise redden every open PR - # and send the author hunting a hand-edit that does not exist. - name: display fields match the live index run: | - # `bash -e` would fail the step on a die(), which is the upstream - # drift this warning exists to tolerate. node scripts/starter-templates.mjs regenerate >/dev/null || { echo "::warning::Could not reach the template index to check for drift." exit 0 @@ -71,11 +52,7 @@ jobs: fi git checkout -- assets/starter-templates.json - # Merging to main publishes the list. Desktop reads it at boot, so users pick - # the change up on their next launch with no app release. publish: - # Only publishes share this group. At workflow level the PR runs would share - # it too, and a queued merge could be displaced by a later PR run. concurrency: group: starter-templates-publish cancel-in-progress: false @@ -93,16 +70,11 @@ jobs: package-manager-cache: false node-version: 22 - # Authenticate first. It is the likeliest failure and writes nothing, so - # a bad key aborts before R2 is mutated and the hosts can diverge. - name: authenticate to GCS uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GCS_MIRROR_SA_KEY }} - # Uploaded to both hosts: regions where R2's edge is throttled read the - # GCS mirror, and a list that exists on only one of them is invisible to - # half the users it was written for. - name: publish to R2 if: inputs.dry_run != true env: @@ -119,17 +91,10 @@ jobs: with: path: assets/starter-templates.json destination: comfy-desktop-public/standalone-environments - # Without this the object lands under .../standalone-environments/assets/ parent: false headers: |- content-type: application/json - # A real write and delete under a throwaway key, so the token is proven to - # have write access without touching the file users read. - # Diagnoses the token rather than just failing: which permissions it - # carries, and whether the bucket is even in this account. - # Reports what each credential can and cannot do, so a failure names the - # permission to request rather than just saying it was refused. - name: dry run - R2 credentials if: inputs.dry_run == true env: @@ -137,10 +102,6 @@ jobs: CF_TOKEN: ${{ secrets.R2_STARTER_TEMPLATES_TOKEN }} run: bash .github/scripts/check-r2.sh - # `always()` so an R2 failure never hides the mirror's status; the job - # still fails overall if either is refused. - # Preinstalled on ubuntu-latest today, but an undeclared dependency would - # surface as "the key is malformed" rather than "the package is missing". - name: ensure the JWT signing dependency if: ${{ !cancelled() && inputs.dry_run == true }} run: python3 -c "import cryptography" || pip install --quiet cryptography @@ -157,8 +118,6 @@ jobs: https://desktop-assets.comfy.org/standalone-environments/starter-templates.json \ https://storage.googleapis.com/comfy-desktop-public/standalone-environments/starter-templates.json do - # Both hosts sit behind a CDN, so a read straight after the write can - # still serve the previous object. Poll rather than fail on the race. ok=false for _ in $(seq 1 12); do code=$(curl -s --connect-timeout 10 --max-time 30 \ diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index b75a50d74..8cfae0fff 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -53,8 +53,6 @@ jobs: with: fetch-depth: 0 ref: ${{ inputs.target_branch }} - # Use the bot token so the branch push is the bot's and triggers - # downstream workflows (the default GITHUB_TOKEN does not). token: ${{ steps.app-token.outputs.token }} - name: Setup Node.js @@ -83,10 +81,6 @@ jobs: const channel = process.env.CHANNEL const pkgPath = 'package.json' const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) - // Accept X.Y.Z, X.Y.Z-rc, or X.Y.Z-rc.N. Bare `-rc` (no `.N`) - // shows up when an earlier manual bump landed without the - // numeric suffix — treat it as `-rc.0` so the next rc bump - // produces `-rc.1` and a stable bump drops the suffix. const match = String(pkg.version).match(/^(\d+)\.(\d+)\.(\d+)(-rc(?:\.(\d+))?)?$/) if (!match) { @@ -96,8 +90,6 @@ jobs: let major = Number(match[1]) let minor = Number(match[2]) let patch = Number(match[3]) - // match[4] is the whole suffix (e.g. "-rc", "-rc.3", or undefined). - // match[5] is the explicit N. Missing N on a present suffix → 0. const currentRc = match[4] === undefined ? null : (match[5] === undefined ? 0 : Number(match[5])) const applyBaseBump = () => { @@ -117,7 +109,6 @@ jobs: let nextVersion if (channel === 'stable') { - // stable: drop -rc suffix if present, otherwise apply the requested bump if (currentRc !== null) { nextVersion = `${major}.${minor}.${patch}` } else { @@ -125,7 +116,6 @@ jobs: nextVersion = `${major}.${minor}.${patch}` } } else if (channel === 'rc') { - // rc: increment -rc.N if already on the same base, otherwise bump base and start at -rc.1 if (currentRc !== null) { nextVersion = `${major}.${minor}.${patch}-rc.${currentRc + 1}` } else { @@ -182,8 +172,6 @@ jobs: run: | set -euo pipefail - # Last released tag (annotated or lightweight). If the repo has - # no tags yet (first release), fall back to the full history. LAST_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)" if [ -n "${LAST_TAG}" ]; then RANGE="${LAST_TAG}..HEAD" @@ -196,8 +184,6 @@ jobs: : > "${FEATS}" : > "${FIXES}" - # Group conventional commits by type. Strip the prefix/scope. - # Drop the version-bump commit itself (always a chore). while IFS= read -r line; do [ -z "${line}" ] && continue msg="$(printf '%s' "${line}" | sed -E 's/^(feat|fix|chore|docs|refactor|test|infra|ci|perf|build|style)(\([^)]*\))?(!)?: //')" @@ -211,7 +197,6 @@ jobs: esac done < <(git log --no-merges --pretty='format:%s' "${RANGE}") - # Placeholder when a section is empty so the human notices. [ -s "${FEATS}" ] || echo "- _(no \`feat:\` commits since ${LAST_TAG:-repo start} — add highlights here)_" > "${FEATS}" [ -s "${FIXES}" ] || echo "- _(no \`fix:\` commits since ${LAST_TAG:-repo start} — add highlights here)_" > "${FIXES}" diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..d6b9876fe --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +pnpm-lock.yaml +assets/starter-templates.json +assets/benchmark-templates.json +.claude/ diff --git a/AGENTS.md b/AGENTS.md index 1787f3e8a..630bf1541 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,20 +1,11 @@ -This repository has a zero tolerance policy for flaky tests. +# Agent guidelines -## Pull request descriptions +## No code comments -Every PR description must include a change breakdown that separates product code from test code. For each category, report its file count and paths, added lines, deleted lines, and share of total changed lines. Calculate total changed lines as added lines plus deleted lines. List documentation, configuration, generated files, lockfiles, and vendored code separately when present; do not count merge-only changes. +This repository does not allow code comments. -Use this breakdown to make the implementation size clear when tests account for most of the diff. Summarize the feature behavior separately from the test coverage. - -## ComfyUI-Manager is v4 (not the legacy v3 layout) - -Installs launched by this app run **Manager v4**: the `comfyui_manager` Python package inside the standalone env, enabled through ComfyUI's `--enable-manager` flag. Do not reason about Manager from the v3 codebase. - -- **Source of truth: the `manager-v4` branch** of Comfy-Org/ComfyUI-Manager. The `main` branch (legacy `glob/manager_server.py` layout) does NOT describe what desktop ships - reading it gives wrong answers about security gates, endpoints, and config. A workspace checkout of ComfyUI-Manager is typically on `main`; use `git show origin/manager-v4:` or check out the branch. -- **Per-install config** lives at `/ComfyUI/user/__manager/config.ini`, `[default]` section. The launcher reconciles per-install settings into it on launch (see `src/main/lib/managerConfig.ts`). -- **v4 security model** (differs from v3): - - Risk levels are subdivided: `block` / `high+` / `high` / `middle+` / `middle`. - - `network_mode` accepts `public | private | offline | personal_cloud`. - - With a non-loopback `--listen`, `middle+` actions (e.g. installing node packs) are denied at EVERY `security_level` unless `network_mode = personal_cloud`; `high+` additionally requires `security_level = weak`. - - `allow_git_url_install` / `allow_pip_install` are independent config flags, gated by the same network-position rule. -- **API is v2**: endpoints live under `/api/v2/...` (e.g. the lifecycle test probes `POST /api/v2/snapshot/remove`). +- Do not write code comments: no `//` lines, no `/* */` blocks, no JSDoc, and no Vue or HTML `` comments, in source, tests, scripts, or E2E specs. +- Make the code say it with names, extracted functions, types, and tests. In tests, a comment becomes an `it` title, a `test.step` name, an assertion message, or nothing. +- Rationale, history, ticket links, workarounds, and TODOs go in the commit message, the PR description, or an issue. +- Tool directives (`eslint-disable-next-line`, `@ts-expect-error`, `/// `, `@vitest-environment`, `prettier-ignore`) are allowed. Never append a prose reason to one. +- `desktop/no-comments` in `pnpm run lint` enforces this. `pnpm run lint:fix` deletes offending comments. See `scripts/eslint/README.md`. diff --git a/CLAUDE.md b/CLAUDE.md index 44fa605e2..43c994c2d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,2 +1 @@ - @AGENTS.md diff --git a/README.md b/README.md index e92476fc0..d6fdb21a4 100644 --- a/README.md +++ b/README.md @@ -116,52 +116,26 @@ pnpm run dev # Windows / macOS On Windows/macOS, set up a fresh clone and start the app in one command with `pnpm run init:dev`. -### Common tasks - -| Command | Description | -| -------------------------------- | --------------------------------------------------------------------- | -| `pnpm run init:dev` | Install dependencies, build bootstrap Python, then run `pnpm run dev` | -| `pnpm run dev` | Start the app in dev mode | -| `pnpm test` | Unit tests ([Vitest](https://vitest.dev/)) | -| `pnpm run test:integration` | Integration suite | -| `pnpm run test:e2e` | End-to-end tests ([Playwright](https://playwright.dev/)) | -| `pnpm run test:e2e:lifecycle` | Lifecycle Playwright project (real installs/downloads; see `e2e/README.md`) | -| `pnpm run typecheck` | Type-check (node + web + e2e + integration) | -| `pnpm run lint` / `lint:fix` | Lint (ESLint) | -| `pnpm run format` | Format (Prettier) | -| `pnpm run build:{win,mac,linux}` | Build local distributables → `dist/` | - -For the test categories, how to run each, and which one a new test belongs in, see [`TESTING.md`](TESTING.md). - -### Project structure - -``` -src/ - main/ # Electron main process (TypeScript) - sources/ # Install-method plugins (standalone, portable, git, …) - lib/ # Shared main-process logic + IPC - preload/ # Context-bridge preload scripts - renderer/src/ # Vue 3 renderer (components, composables, stores, views) - types/ # Shared IPC types (single source of truth) -locales/ # i18n translations -``` -
Bootstrap Python (the bundled Git backend) The app ships a minimal (~15–20 MB) standalone Python with `pygit2` baked in, under `bootstrap-python//`. It provides git operations (clone, fetch, ls-remote) before any standalone ComfyUI environment is provisioned, so the app works on machines without system `git`. -| Command | What it does | -| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `pnpm run bootstrap` | Build locally via `scripts/build-bootstrap-python.mjs` (no system Python needed). Auto-detects the host platform and architecture; pass `--platform win-x64\|win-arm64\|mac-arm64\|linux-x64` for another. | -| `pnpm run bootstrap:fetch` | Download a prebuilt archive from the [`bootstrap-v3`](https://github.com/Comfy-Org/Comfy-Desktop/releases/tag/bootstrap-v3) release (faster). Set `GITHUB_TOKEN` to authenticate. | - -Both write to `bootstrap-python/{win-x64,win-arm64,mac-arm64,linux-x64}/` (gitignored). The directory must exist before `pnpm run dev` or `pnpm run build:*`. `win-arm64` is the native Windows on Arm build (NVIDIA RTX Spark, Snapdragon X); the app picks `win-` in dev and ToDesktop's `targetOverrides` select it for the arm64 installer. +Build it with `pnpm run bootstrap`, or download a prebuilt archive with `pnpm run bootstrap:fetch` (set `GITHUB_TOKEN`). Both write to `bootstrap-python/{win-x64,win-arm64,mac-arm64,linux-x64}/` (gitignored). The directory must exist before `pnpm run dev` or `pnpm run build:*`. `win-arm64` is the native Windows on Arm build (NVIDIA RTX Spark, Snapdragon X); the app picks `win-` in dev and ToDesktop's `targetOverrides` select it for the arm64 installer. At runtime the main process picks a git backend in priority order ([`src/main/lib/ipc/index.ts`](src/main/lib/ipc/index.ts)): bootstrap pygit2 → standalone-install pygit2 → system `git`. Set `COMFY_FORCE_BOOTSTRAP_GIT=1` (or `pnpm run dev:bootstrap`) to verify the bundled path that ships to users without git.
+### Run tests + +```bash +pnpm run test:browser:install # once per Playwright version: downloads headless Chromium +pnpm test +``` + +Main, preload, and shared code is tested in Node. Renderer tests run in headless Chromium through [Vitest browser mode](https://vitest.dev/guide/browser/). To watch them in a visible browser, run `pnpm exec vitest --project browser --browser.headless=false`. + ## Releasing > Production builds go through [ToDesktop](https://www.todesktop.com/) in CI — nothing is built locally. Any maintainer can cut a release; it's one workflow run plus a PR merge. @@ -178,13 +152,7 @@ At runtime the main process picks a git backend in priority order ([`src/main/li
Pipeline & config -Three workflows in [`.github/workflows/`](.github/workflows/): - -| Workflow | Trigger | Role | -| --------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `version-bump.yml` | manual (**Run workflow**) | Opens the version-bump PR (bot-authored) and labels it `Release`. | -| `release-from-pr-label.yml` | `pull_request_target: closed` | On merge of a `Release`-labeled PR, tags `vX.Y.Z` and dispatches the build. | -| `build-release.yml` | push of a `v*` tag | Runs `pnpm run build`, uploads Datadog sourcemaps, runs `todesktop build`, and publishes the GitHub Release (`stable` → Latest, `-rc` → pre-release). | +The flow runs through `version-bump.yml`, `release-from-pr-label.yml` and `build-release.yml` in [`.github/workflows/`](.github/workflows/). CLI equivalent of step 1: @@ -241,7 +209,7 @@ Pass `--yes` (or `-Yes` on Windows) to skip the prompt. After cleanup, reinstall ## Contributing -Issues and pull requests are welcome. Before opening a PR, please run `pnpm run typecheck`, `pnpm run lint`, and `pnpm test` locally — see [Development](#development). For coding conventions, see [`AGENTS.md`](AGENTS.md). +Issues and pull requests are welcome. Before opening a PR, please run `pnpm run typecheck`, `pnpm run lint`, and `pnpm test` locally — see [Development](#development). ## Community diff --git a/TESTING.md b/TESTING.md deleted file mode 100644 index c92b69c20..000000000 --- a/TESTING.md +++ /dev/null @@ -1,91 +0,0 @@ -# Testing - -This repo has four test categories. They differ in what they are allowed to fake, -how fast they run, and when CI runs them. For the full lifecycle zero-mock policy -and a per-spec inventory, see [`e2e/README.md`](e2e/README.md). - -## The four categories - -| Category | What it tests | May fake | Speed | Runs in CI | -| --- | --- | --- | --- | --- | -| **Unit** | Individual modules/components in isolation ([Vitest](https://vitest.dev/), `happy-dom`) | Anything — mocks encouraged | Seconds | Every PR | -| **Integration** | Multiple main-process modules against real subprocesses/disk (Vitest, `node`, serial) | External services | Tens of seconds | Every PR | -| **E2E** | The real built app driven by [Playwright](https://playwright.dev/), per platform | Synthetic state via dev hooks; may assert on IPC dispatch instead of real side effects | Minutes | Every PR (`@windows` / `@macos` / `@linux`) | -| **Lifecycle** | Full user flows with **zero mocking**: real clicks, real downloads, real git, real disk | Nothing during app execution (staging fixtures and stubbed native OS dialogs only) | Up to hours (~500 MB real install) | Nightly + manual (`lifecycle.yml`) | - -Where they live: - -- Unit: `src/**/*.test.ts` (excluding `*.integration.test.ts`) -- Integration: `src/**/*.integration.test.ts` -- E2E + Lifecycle: `e2e/*.test.ts`, selected by tag in the test title - (`@windows @macos @linux` vs `@lifecycle`), mapped to Playwright projects in - `playwright.config.ts` - -## Running tests - -```bash -# Unit -pnpm test # run once -pnpm run test:watch # watch mode -pnpm exec vitest run src/main/lib/desktopDetect.test.ts # one file - -# Integration -pnpm run test:integration - -# E2E (build first — Playwright drives the built app) -pnpm run build -pnpm run test:e2e:windows # or :macos / :linux -pnpm exec playwright test --project=windows chooser.test.ts # one spec - -# Lifecycle (real installs/downloads — see warning below) -pnpm run build -pnpm run test:e2e:lifecycle -pnpm exec playwright test --project=lifecycle lifecycle-copy.test.ts # one spec -``` - -> [!WARNING] -> `pnpm run test:e2e` with no `--project` runs **all** projects, including -> `lifecycle` — which downloads ~500 MB and performs real installs. Use the -> per-platform or per-project scripts unless that is what you want. - -The lifecycle harness prints the per-run profile directory -(`[lifecycle-harness] fresh profile dir: …`); re-export it as -`LIFECYCLE_REUSE_DIR` to re-run individual tests against that profile. - -## Which category does my test belong in? - -- Testing a function, composable, or component contract → **unit**. -- Testing several main-process modules working together against real - subprocesses or the filesystem → **integration**. -- Driving the built app's UI, but seeding synthetic state via dev hooks - (`seedRunningSession`, `setAppUpdateState`, …) or asserting that an IPC was - dispatched → **E2E**, tagged `@windows @macos @linux`. -- Validating a complete user flow the way a human release tester would — real - clicks on real controls, real downloads, real side effects on disk → - **lifecycle**, tagged `@lifecycle`. The flow under test must be triggered - through the real UI control, never by calling `window.api` directly; a broken - button must fail the test. See the policy in - [`e2e/README.md`](e2e/README.md#zero-mock-policy-lifecycle-tests) before - writing one. - -## Before every commit - -```bash -pnpm run typecheck -pnpm run lint -pnpm run build -pnpm run test -``` - -Typecheck and lint are enforced by a husky pre-commit hook. Flaky tests are not -acceptable — fix them when discovered (see [`AGENTS.md`](AGENTS.md)). - -## CI mapping - -| Workflow | Trigger | What runs | -| --- | --- | --- | -| `ci.yml` | Every PR | Unit + integration on Linux; E2E per platform (`test:e2e:macos` / `:windows` / `:linux`) | -| `lifecycle.yml` | Nightly + manual dispatch | The whole `lifecycle` Playwright project | - -Playwright traces, videos, and screenshots for failures are uploaded as CI -artifacts (`playwright-report/`, `test-results/`). diff --git a/docs/instance-navigation-926-handoff.md b/docs/instance-navigation-926-handoff.md deleted file mode 100644 index f725f8f36..000000000 --- a/docs/instance-navigation-926-handoff.md +++ /dev/null @@ -1,109 +0,0 @@ -# Instance / Window Navigation (#926) - -Given the **current view** (Dashboard | Instance | Cloud) and the **clicked -target**, decide whether to switch in place, restart, focus an existing window, -or open a new one. - -The whole behavior matrix is **one pure function** — -[`decideNavigation`](../src/shared/navigation/navDecision.ts) — consumed by the -renderer (CTA label + caret) and main (executor). **To change a behavior, edit -that table and its test.** - -**Cloud ≡ Remote, with one asymmetry.** `navClass` folds `remote → cloud` (no -local process), so a Remote *host* navigates like a Cloud host, and a Remote -*target* routes through the Cloud-target cells. They diverge only on -**stoppability**: a remote session can be stopped, a cloud session can't — so the -caret offers **Stop** for a running remote and **nothing** for a running cloud. - -## Behavior matrix - -`Caret ▾` = the footer split-button's dropdown. **Rule:** "Open in new window" -shows only when the target is **not running** (a running one can't open a second -window); once running the caret offers **Stop** (remote) or nothing (cloud). - -| # | Current view | Target | State | Primary CTA | Caret ▾ | -|---|---|---|---|---|---| -| 1 | Dashboard | Dashboard | — | no-op | – | -| 2 | Dashboard | Instance | stopped | Start (same window) | – | -| 3 | Dashboard | Instance | running elsewhere | Switch (focus) | – | -| 4 | Dashboard | Cloud | stopped | Open Cloud (same window) | Open in new window | -| 5 | Dashboard | Cloud | running elsewhere | Switch (focus) | – | -| 6 | Dashboard | Remote | stopped | Open Remote (same window) | Open in new window | -| 7 | Dashboard | Remote | running elsewhere | Switch (focus) | Stop | -| 8 | Dashboard | + New Instance | — | New Install (wizard) | – | -| 9 | Instance | Dashboard | — | Open Dashboard (new window; instance keeps running) | – | -| 10 | Instance | self | running here | Restart | Stop | -| 11 | Instance | Instance B | stopped | Switch (swap in place) | Open in new window → 3-way confirm¹ | -| 12 | Instance | Instance B | running elsewhere | Switch (focus) | – | -| 13 | Instance | Cloud | stopped | Open Cloud (new window; instance keeps running) | – | -| 14 | Instance | Cloud | running elsewhere | Switch (focus) | – | -| 15 | Instance | Remote | stopped | Open Remote (new window; instance keeps running) | – | -| 16 | Instance | Remote | running elsewhere | Switch (focus) | Stop | -| 17 | Cloud | Dashboard | — | Open Dashboard (new window²) | – | -| 18 | Cloud | Instance | stopped | Open in new window (cloud keeps running) | – | -| 19 | Cloud | Instance | running elsewhere | Switch (focus) | – | -| 20 | Cloud | self | running here | Restart³ | – | -| 21 | Cloud | Cloud/Remote | stopped | Open in new window | – | -| 22 | Cloud | Cloud | running elsewhere | Switch (focus) | – | -| 23 | Cloud | Remote | running elsewhere | Switch (focus) | Stop | -| 24 | Cloud | + New Instance | — | New Install (wizard, new window) | – | - -¹ Fires only when the host is a local install (the swap would stop its process): -an in-drawer dialog — *Switch* (stop A, swap B in) / *Open in new window* (keep A) -/ *Cancel*. Cloud/remote/dashboard hosts have nothing to stop → straight switch. - -² **Deviation:** the matrix specified same-window. The "Open Dashboard" chip -routes through `activate('new-window')`, not the table — kept until the chip -consults `decideNavigation`. - -³ Matrix row 16 wanted a *second* cloud window; a second view of one session -isn't supported (single-window auth). The `allowDuplicate` plumbing is reserved -for a future implementation. - -## How it fits together - -- [`navDecision.ts`](../src/shared/navigation/navDecision.ts) — the table. - `NavInput (view × target × run) → NavDecision (window, verb, secondary)`. -- [`viewKind.ts`](../src/shared/viewKind.ts) — `ViewKind`/`Category`/`NavClass` - vocabulary + `navClass` (`remote ⇒ cloud`). -- [`useInstanceNavState.ts`](../src/renderer/src/composables/useInstanceNavState.ts) - — read-model: derives `NavInput` facts (reuses `useInstallCta` for run-state). -- [`useInstanceActions.ts`](../src/renderer/src/composables/useInstanceActions.ts) - — dispatcher: routes a decision's verb onto the bridge. -- [`ComfyUISettingsContent.vue`](../src/renderer/src/components/settings/ComfyUISettingsContent.vue) - — footer CTA + caret. Per-category wording ("Open Cloud" vs "Open Remote"); the - caret's Stop item is the install's existing `stop` action (absent for cloud). -- [`index.ts`](../src/main/index.ts) — `pickInstallFromPicker` (swap; `confirmed` - skips main's modal) and `openInstallInNewWindow` (focus-existing else spawn). -- The 3-way switch prompt lives in - [`InstancePickerView.vue`](../src/renderer/src/comfyTitlePopup/InstancePickerView.vue) - (`confirmSwitch`). - -## Tests - -- [`navDecision.test.ts`](../src/shared/navigation/navDecision.test.ts) — every - cell + the full `view × target × run × intent` cross-product (totality), plus a - guard that no reachable combo yields a no-op CTA, and that every CTA label key - resolves in `locales/en.json`. -- [`useInstanceActions.test.ts`](../src/renderer/src/composables/useInstanceActions.test.ts) - — verb → bridge routing; cloud-capacity + kill-confirm gates; 3-way outcomes. -- [`useInstanceNavState.test.ts`](../src/renderer/src/composables/useInstanceNavState.test.ts) - — run-state derivation; remote⇒cloud fold. -- [`ComfyUISettingsContent.test.ts`](../src/renderer/src/components/settings/ComfyUISettingsContent.test.ts) - — CTA label/decision per host; caret = Stop (running remote) / empty (running - cloud) / new-window (stopped). -- `e2e/nav-matrix-{dashboard,instance,cloud}.test.ts` — same-window launch, - focus-existing, new-window spawn, `allowDuplicate` primitive (via recorded IPC - + live `BrowserWindow` counts). Rebuild (`pnpm run build`) before running — e2e - uses the built bundle. - -## Manual check - -`pnpm dev`, then with two local installs (A, B) + Cloud/Remote available, walk -the matrix rows. Spot-checks worth confirming: -- A running **remote** target's caret shows **Stop**; a running **cloud** target - shows **no caret** (just Switch/focus). -- Cloud/Remote → a *different* Cloud/Remote target shows a live CTA, never a dead - "Start". -- Local restart still shows the in-drawer "Restart instance?" confirm; cloud/ - remote actions never show a local-process kill confirm. diff --git a/docs/torch-index-stacks.md b/docs/torch-index-stacks.md index fb4a5104f..02067103d 100644 --- a/docs/torch-index-stacks.md +++ b/docs/torch-index-stacks.md @@ -13,7 +13,7 @@ it ETag caching and the GCS mirror fallback (China-reachable) automatically. The app refreshes it on every check-update, persists the last valid copy for offline reads, and falls back to the in-app curated list (`src/main/sources/standalone/torchIndexManifest.ts`) until a remote manifest -has ever been fetched successfully. Publishing the file therefore *replaces* +has ever been fetched successfully. Publishing the file therefore _replaces_ the in-app list — include every stack that should be offered, and keep the mirror sync covering it. @@ -58,18 +58,18 @@ mirror sync covering it. Field reference (validation is default-deny — an entry failing any rule is dropped; other entries survive): -| Field | Required | Rules | -|---|---|---| -| `kind` | no | If present, must match the mechanism the accel implies: `pypi` for `mps`, `pytorch-index` for everything else - or name one of the extra mechanisms this app version implements: `pytorch-nightly-index` (dev tuples from the nightly namespace) or `amd-multi-arch-index` (`amd` only; pip-applied from AMD's hardcoded multi-arch index with `[device-all]` extras, the only mechanism serving Windows ROCm wheels). **Any new install mechanism must use a new kind** so app versions that don't implement it drop the entry instead of misapplying it - exactly how `amd-multi-arch-index` shipped. | -| `indexTag` | yes | Must be the tag the accel is served from: `cuN` for `nvidia`, `rocmN` for `amd`, `xpu` for `intel-xpu`, `cpu` for `cpu`, `pypi` for `mps`. Anything else drops the entry. | -| `accel` | yes | `nvidia`, `amd`, `intel-xpu`, `cpu`, or `mps`. Plain `amd` entries must not list `win32` (see below; `kind: "amd-multi-arch-index"` entries may); `mps` entries must list only `darwin`. | -| `platforms` | yes | Non-empty subset of `win32`, `linux`, `darwin`. | -| `packages` | yes | `torch` required; `torchvision`/`torchaudio` optional. Exact versions **with local tags** (`2.11.0+cu126`) so pip installs those exact builds. Versions are `[A-Za-z0-9._+]`. The torch local tag must equal `indexTag` (`mps` tuples must be untagged), and companion packages must carry the same tag or none — pip installs from the index the local tag derives, so a mismatched entry is dropped. Each `(kind, indexTag, torch version)` triple must be unique: it IS the stack's identity (`stackId` - `amd-multi-arch-index` entries mint in their own `amd-index:` namespace), and all colliding entries are dropped. | -| `date` | yes | ISO date (`YYYY-MM-DD…`), used for display ordering. | -| `computeCap` | no | Inclusive NVIDIA compute-capability range the wheels ship kernels for. Informational only: an entry no detected GPU can run stays offered but carries a warning in the picker and the change-confirmation dialog (detection can be wrong or partial - multi-GPU boxes, eGPUs). | -| `pythonAbis` | no | Python `major.minor` list the index publishes wheels for (e.g. `["3.12"]` for AMD's universal ROCm package). Omit when any Python resolves; an empty list is rejected. | -| `noteKey` | no | i18n key suffix under `standalone.` for the picker description. Used when this app version has the translation. | -| `note` | no | Plain-text (English) picker description, max 300 chars; the fallback when `noteKey` is absent or unknown to the running app version. | +| Field | Required | Rules | +| ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `kind` | no | If present, must match the mechanism the accel implies: `pypi` for `mps`, `pytorch-index` for everything else - or name one of the extra mechanisms this app version implements: `pytorch-nightly-index` (dev tuples from the nightly namespace) or `amd-multi-arch-index` (`amd` only; pip-applied from AMD's hardcoded multi-arch index with `[device-all]` extras, the only mechanism serving Windows ROCm wheels). **Any new install mechanism must use a new kind** so app versions that don't implement it drop the entry instead of misapplying it - exactly how `amd-multi-arch-index` shipped. | +| `indexTag` | yes | Must be the tag the accel is served from: `cuN` for `nvidia`, `rocmN` for `amd`, `xpu` for `intel-xpu`, `cpu` for `cpu`, `pypi` for `mps`. Anything else drops the entry. | +| `accel` | yes | `nvidia`, `amd`, `intel-xpu`, `cpu`, or `mps`. Plain `amd` entries must not list `win32` (see below; `kind: "amd-multi-arch-index"` entries may); `mps` entries must list only `darwin`. | +| `platforms` | yes | Non-empty subset of `win32`, `linux`, `darwin`. | +| `packages` | yes | `torch` required; `torchvision`/`torchaudio` optional. Exact versions **with local tags** (`2.11.0+cu126`) so pip installs those exact builds. Versions are `[A-Za-z0-9._+]`. The torch local tag must equal `indexTag` (`mps` tuples must be untagged), and companion packages must carry the same tag or none — pip installs from the index the local tag derives, so a mismatched entry is dropped. Each `(kind, indexTag, torch version)` triple must be unique: it IS the stack's identity (`stackId` - `amd-multi-arch-index` entries mint in their own `amd-index:` namespace), and all colliding entries are dropped. | +| `date` | yes | ISO date (`YYYY-MM-DD…`), used for display ordering. | +| `computeCap` | no | Inclusive NVIDIA compute-capability range the wheels ship kernels for. Informational only: an entry no detected GPU can run stays offered but carries a warning in the picker and the change-confirmation dialog (detection can be wrong or partial - multi-GPU boxes, eGPUs). | +| `pythonAbis` | no | Python `major.minor` list the index publishes wheels for (e.g. `["3.12"]` for AMD's universal ROCm package). Omit when any Python resolves; an empty list is rejected. | +| `noteKey` | no | i18n key suffix under `standalone.` for the picker description. Used when this app version has the translation. | +| `note` | no | Plain-text (English) picker description, max 300 chars; the fallback when `noteKey` is absent or unknown to the running app version. | ## Trust boundary @@ -94,7 +94,7 @@ entries. Consequences: first so their stale DLLs cannot shadow the new wheel-provided runtime. App versions predating the kind drop these entries. - An unknown `schemaVersion` rejects the whole document (the app keeps its - previous manifest); unknown *fields* on an entry are ignored, so additive + previous manifest); unknown _fields_ on an entry are ignored, so additive metadata is safe to introduce. - A non-empty document where no entry survives validation is rejected as a whole — it is indistinguishable from garbage, so it cannot replace the diff --git a/e2e/README.md b/e2e/README.md deleted file mode 100644 index dc5b45774..000000000 --- a/e2e/README.md +++ /dev/null @@ -1,225 +0,0 @@ -# E2E and Lifecycle Testing - -This document defines the test categories used in this repo, the zero-mock policy for -lifecycle tests, and an inventory of every Playwright spec. Background: -[#1242 — Lifecycle tests are very stale and not used now because of that staleness](https://github.com/Comfy-Org/Comfy-Desktop/issues/1242). - -## Test categories - -| Category | What it is | Command | Runs in CI | -| --- | --- | --- | --- | -| **Unit** | Fast Vitest tests of individual modules. | `pnpm test` | Every PR | -| **Integration** | Vitest suite with its own config (`vitest.integration.config.ts`). | `pnpm run test:integration` | Every PR | -| **E2E** | Playwright tests that drive the real built app, but **may** use dev hooks to inject synthetic state and may assert on IPC dispatch instead of real side effects. Must be fast. Tagged `@windows` / `@macos` / `@linux`. | `pnpm run test:e2e:` | Every PR, per platform | -| **Lifecycle** | Playwright tests that validate full user flows with **zero mocking** during app execution: real clicks, real downloads, real git, real disk. Tagged `@lifecycle`. | `pnpm run test:e2e:lifecycle` | Nightly + manual (`lifecycle.yml`) | - -The `lifecycle` Playwright project has a 180 s default per-test timeout -(`playwright.config.ts`); individual heavyweight steps raise it with `test.setTimeout`. - -> [!WARNING] -> `pnpm run test:e2e` with no `--project` runs **all** projects, including `lifecycle` — -> which downloads ~500 MB and performs real installs. Use the per-platform or -> per-project scripts unless that is what you want. - -## Zero-mock policy (lifecycle tests) - -Lifecycle tests replace manual release testing. A human tester does not mock the app, -so lifecycle tests must not either. During app execution the following are -**forbidden** in `@lifecycle` tests: - -- Monkey-patching Electron APIs or intercepting network routes -- Dev hooks that inject state the product normally computes: - `seedDownloads`, `setInstallUpdate`, `setAppUpdateState`, `seedRunningSession` -- Local substitutes for real services (GitHub, R2, cloud.comfy.org) -- Synthetic success/failure responses, or editing product state to fake an outcome -- Triggering the flow under test by calling `window.api` directly (e.g. - `runAction`, `probeInstallation`) or by synthesizing internal IPC messages - (e.g. a main→renderer `wc.send`) instead of driving the real UI control — a - broken button must fail these tests, since replacing manual click-through - testing is their entire purpose. Read-only `window.api` queries - (`getSnapshots`, `getDetailSections`, …) remain fine for assertions - -The following **scaffolding** is allowed, because it stages the scenario rather than -faking the product's behavior: - -- The isolated per-run profile directory and its cleanup (`electronHarness.ts`), - including the harness's global `dialog.showErrorBox` no-op — a native crash dialog - would hang the run instead of failing it -- Staging the scenario via `SeedOptions`: `settings` and `onSetup` apply before - Electron launches; `installations` (and their `snapshots`) are written by the - harness after launch but before the test interacts — e.g. a fixture git repo, a - legacy install tree, or snapshot envelopes -- Stubbing native OS file dialogs (`showOpenDialog` / `showSaveDialog`) with a - predetermined path — Playwright cannot drive OS-native dialogs. The stub may only - supply the path; it must never fake the operation's result -- Manipulating pre-conditions that only encode elapsed time (e.g. `ageReleaseCache`) - before the flow under test -- Observation-only hooks (`getIpcInvocations`, `getRunningSessionSnapshot`, - `getTitlePopupBounds`, …) — for assertions alongside, not instead of, real side - effects -- Reusing byte-identical cached downloads when download behavior is not what the test - validates - -**Independence:** every lifecycle spec must pass on a fresh profile without any other -spec having run first. Reusing artifacts from a previous run (e.g. a cached download) -is fine only if the spec still passes without them. Serial `test.describe.configure` -chains inside one spec file are acceptable; cross-file ordering dependencies are not. - -## Spec inventory - -Snapshot of `e2e/` as of 2026-07. "Meets zero-mock bar" applies the policy above to -`@lifecycle`-tagged specs; `n/a` means the spec is (correctly) an E2E test. - -| Spec | Tags | Meets zero-mock bar | Evidence | -| --- | --- | --- | --- | -| `cancel-flow.test.ts` | platform | n/a | `seedRunningSession` injects a synthetic running session. | -| `chooser.test.ts` | platform | n/a | Seeded settings only; UI assertions. | -| `copy-update-destination.test.ts` | platform | n/a | Copy result is synthetic; the real copy handler is bypassed; asserts IPC dispatch. | -| `dashboard-delete-flow.test.ts` | `@lifecycle` | Yes (light) | Really deletes the seeded install directory. | -| `deep-links.test.ts` | platform | n/a | Replays the internal `panel-trigger-overlay` IPC directly into the panel and asserts downstream IPC dispatch; never exercises real OS/app `comfy://` handling. | -| `devhooks-smoke.test.ts` | platform | n/a | Exists to test the dev-hooks bridge itself. | -| `downloads-shelf.test.ts` | platform | n/a | Injects downloads-tray state via `seedDownloads`. | -| `dropdowns.test.ts` | platform | n/a | UI regression tests. | -| `hardware-acceleration.test.ts` | `@windows` | n/a | On NVIDIA systems, launches Desktop with hardware acceleration enabled and disabled, then compares per-process dedicated GPU memory. | -| `lifecycle-add-existing.test.ts` | `@lifecycle` | Yes (light) | Real probe + tracking against a staged git repo, driven through the waffle menu → TrackModal → Browse → Track Install chain; native directory picker stubbed with the staged path. | -| `lifecycle-cloud.test.ts` | `@lifecycle` | Yes | Real navigation to `https://cloud.comfy.org/`. | -| `lifecycle-copy-update-fail.test.ts` | `@lifecycle` | Yes (light) | Real local copy chained into a real update failure, driven through the picker Update tab's Copy & Update button; failure text asserted from the durable app log. Picker opened via direct `openInstancePicker`, not a UI entry control. | -| `lifecycle-copy.test.ts` | `@lifecycle` | Yes (light) | Real local disk copy of a staged install, driven through the picker More → Copy flow and prompt UI. Picker opened via direct `openInstancePicker`, not a UI entry control. | -| `lifecycle-delete-untrack.test.ts` | `@lifecycle` | Yes (light) | Real directory preservation/removal on disk, driven through the dashboard kebab → menu → panel confirm chain. | -| `lifecycle-first-use-migrate.test.ts` | `@lifecycle` | Yes (light) | Real first-use flow into the migrate confirm; the adoption op really runs and its fixture-determined outcome (validate-venv failure on the stub `.venv`) renders in the progress error surface. A successful adoption needs a live legacy venv (python + torch), out of CI budget. | -| `lifecycle-first-use-skip.test.ts` | `@lifecycle` | Yes | Real ToS → Local → Continue chain into post-consent, then the waffle menu's Skip Onboarding item clicked in the real popup. | -| `lifecycle-migrate.test.ts` | `@lifecycle` | Yes (light) | Real auto-tracker detection on boot; kebab → Migrate → adoption confirm → Cancel driven through the real UI. The final test is a read-only `getFieldOptions` contract guard on the R2 release/variant feed the migrate flow's silent variant pick consumes. | -| `lifecycle-periodic-update-check.test.ts` | `@lifecycle` | Yes | Real background re-fetch of the release cache. | -| `lifecycle-snapshot-export.test.ts` | `@lifecycle` | Yes (light) | Writes real snapshot envelope JSON to disk; native save dialog stubbed with a fixed path. Picker opened via direct `openInstancePicker`, not a UI entry control. | -| `lifecycle-snapshot-import.test.ts` | `@lifecycle` | Yes (light) | Consumes a real envelope through the toolbar Import flow; import stages a restore target and must not commit history (#1137); native open dialog stubbed with a fixed path. Picker opened via direct `openInstancePicker`, not a UI entry control. Import success is only staged, never committed - a committed staged-import success path is an open coverage gap. | -| `lifecycle-snapshot-restore.test.ts` | `@lifecycle` | Yes (light) | Live restore moves real HEADs; both restore operations drive the real expanded-row Restore button and confirm. Picker opened via direct `openInstancePicker`, not a UI entry control. Seeded snapshots carry `skipPipSync` (fixture has no Python env), so the real pip-sync phase of restore is an open coverage gap. | -| `lifecycle-snapshot-roundtrip.test.ts` | `@lifecycle` | Yes (light) | Real export from install A, real import preview into install B proving envelope round-trip; import stages without committing history (#1137); native dialogs stubbed with fixed paths. Picker opened via direct `openInstancePicker`, not a UI entry control. | -| `lifecycle-snapshot-share.test.ts` | `@lifecycle` | Yes (light) | Real export of the latest snapshot; native save dialog stubbed with a fixed path. Picker opened via direct `openInstancePicker`, not a UI entry control. | -| `lifecycle-snapshot.test.ts` | `@lifecycle` | Yes (light) | Real snapshot capture driven through the picker save CTA and prompt UI; asserted via the rendered snapshot row plus read-only backend queries. Picker opened via direct `openInstancePicker`, not a UI entry control. | -| `lifecycle-startup-update-check.test.ts` | `@lifecycle` | Yes | One real `git ls-remote` to github.com per startup. | -| `lifecycle-update-check.test.ts` | `@lifecycle` | Yes (light) | Live `git ls-remote --tags` against Comfy-Org/ComfyUI, triggered by the real Check for Update button and Update-tab clicks; `ageReleaseCache` is time scaffolding. Picker opened via direct `openInstancePicker`, not a UI entry control. | -| `lifecycle.test.ts` | `@lifecycle` | Yes | Real ~500 MB install driven through the UI; every picker flow enters through a real control (dashboard kebab -> Manage, or the running host's title-bar install pill), stop + return drives the stopped card's Return to Dashboard button, snapshot capture goes through the Snapshots tab Save CTA, and both deletes run the kebab -> Delete -> confirm chain. Torch guard: after install the venv's real python imports torch and records the family signature (torch/torchvision/torchaudio/torchsde versions + `torch.version.cuda` + `torch.cuda.is_available()`, asserted to match the `LIFECYCLE_VARIANT` install variant - null/false for CPU, non-null/true for NVIDIA), re-checked unchanged after both updater runs and the snapshot restore - catches any requirements install touching the torch family (e.g. a stray `--upgrade`). Remaining scaffolding: a panel remount (`ensureInstallPanelView`) so read-only `window.api` assertions stay reachable, and closing the extra window the multi-window test opened. | -| `nav-matrix-cloud.test.ts` | platform | n/a | Seeded cloud record; `clearRunningSessions` dev hook between tests; asserts IPC dispatch + window count. No real cloud attach (that is `lifecycle-cloud.test.ts`). | -| `nav-matrix-dashboard.test.ts` | platform | n/a | `seedRunningSession`; asserts window/IPC behavior. | -| `nav-matrix-instance.test.ts` | platform | n/a | `seedRunningSession`; asserts window/IPC behavior. | -| `picker-cluster.test.ts` | platform | n/a | `seedRunningSession`; asserts IPC dispatch. | -| `picker-settings-staleness.test.ts` | platform | n/a | Seeded-state UI regression test. | -| `picker-stop-confirm.test.ts` | platform | n/a | `seedRunningSession` injects the running state under test. | -| `port-conflict.test.ts` | platform | n/a | Synthetic `portConflict` operation state; no real port conflict. | -| `progress-error-overflow.test.ts` | platform | n/a | Pure UI overflow regression test. | -| `progress-reboot.test.ts` | platform | n/a | `injectRetryableProgressError` fakes a failing operation and its retry outcome. | -| `quit-flow.spec.ts` | `@macos` | n/a | Tray-close quit behavior. | -| `title-bar-hover-gate-comfy-window.test.ts` | platform | n/a | Hover-gate state machine (probes cloud.comfy.org for the host window). | -| `title-bar-hover-gate.test.ts` | platform | n/a | Hover-gate state machine. | -| `update-pills.test.ts` | platform | n/a | Injects update states via `setAppUpdateState` / `setInstallUpdate`. | -| `window-visible.spec.ts` | platform | n/a | Launch smoke test. | - -Thirteen specs formerly tagged `@lifecycle` were retagged to the platform projects: they -inject synthetic runtime state or assert dispatch instead of real side effects, which -makes them E2E tests by the definitions above. The `lifecycle-` filename prefix was -dropped where present so filenames match projects. "Yes (light)" specs meet the bar -with allowed scaffolding (staged fixtures, stubbed native OS dialogs, read-only -queries); "Yes" specs need none. - -## Running lifecycle tests - -```bash -pnpm run build -pnpm run test:e2e:lifecycle # whole lifecycle project -pnpm exec playwright test --project=lifecycle lifecycle-copy.test.ts # one spec -``` - -The harness prints the per-run profile directory -(`[lifecycle-harness] fresh profile dir: …`); re-export it as `LIFECYCLE_REUSE_DIR` to -re-run individual tests against that profile. - -### Running a section of the main chained suite - -`lifecycle.test.ts` is a serial chain whose tests hand state to each other, so -individual tests cannot be cherry-picked freely. Instead every test carries a -`@sec-` tag grouping it with the tests it shares state with, and each -section has an npm script that runs it together with the setup spine -(`@sec-setup`, the first-use + install chain) and the metadata capture -(`@sec-meta`): - -```powershell -pnpm run test:e2e:lifecycle:install # setup spine only (install + validation) -pnpm run test:e2e:lifecycle:update # stop -> update-comfyui -> relaunch -pnpm run test:e2e:lifecycle:crosschannel # stable -> latest channel switch -pnpm run test:e2e:lifecycle:snapshot # snapshot capture + restore -pnpm run test:e2e:lifecycle:manager # Manager security level / network mode -pnpm run test:e2e:lifecycle:picker # picker Restart / Stop / Relaunch CTAs -pnpm run test:e2e:lifecycle:bootwindow # restart-during-boot regressions -pnpm run test:e2e:lifecycle:copy # copy / untrack / cleanup chain -pnpm run test:e2e:lifecycle:delete # real delete (destroys the install) -``` - -On a fresh profile each script builds the real install first, then runs just -its section. To pay the install cost once across many section runs, set -`LIFECYCLE_REUSE_DIR`: the setup spine self-skips on the hydrated profile and -`@sec-meta` plus the selected section execute. (Not supported on macOS, where -Electron resolves userData outside the isolated profile dir - the harness -fails fast there.) - -```powershell -$env:LIFECYCLE_REUSE_DIR = "$env:TEMP\comfyui-lifecycle-reuse" -pnpm run test:e2e:lifecycle:install # first run: builds the persistent install -pnpm run test:e2e:lifecycle:bootwindow # subsequent runs: section only -Remove-Item Env:\LIFECYCLE_REUSE_DIR -``` - -Caveats: `crosschannel` is one-shot per profile (it requires -`updateChannel=stable` and leaves it on `latest`); `update` requires an -available stable-channel update and fails when the profile is already at the -channel tip; and `delete` consumes the reusable profile (it removes the -install but leaves `firstUseCompleted` persisted, so the app boots to an -empty chooser instead of the first-use screen the setup spine expects) - -delete the reuse directory or point `LIFECYCLE_REUSE_DIR` somewhere fresh -afterward. - -### Install variants (`LIFECYCLE_VARIANT`) - -`lifecycle.test.ts` drives the install wizard's variant row from the -`LIFECYCLE_VARIANT` environment variable: - -- `cpu` (default on Windows) - deterministic CPU torch build; the post-install - torch probe asserts `torch.version.cuda` is null and `torch.cuda.is_available()` - is false. -- `nvidia` - selects the CUDA build (multi-GB download). Refuses to start unless - `nvidia-smi -L` succeeds, and after install + successful startup asserts the venv - carries a CUDA torch build with `torch.cuda.is_available() === true`, so the run - can never pass vacuously on a machine without a working GPU. -- unset on macOS/Linux - trusts the wizard's recommended pick (macOS only - publishes `mac-mps`; there is no `linux-cpu` variant). - -```powershell -# NVIDIA lifecycle run on a GPU machine (PowerShell): -$env:LIFECYCLE_VARIANT = 'nvidia' -pnpm run test:e2e:lifecycle -Remove-Item Env:\LIFECYCLE_VARIANT -``` - -A profile reused via `LIFECYCLE_REUSE_DIR` must match the requested variant; the -harness fails fast on a CPU-profile/`nvidia` (or vice versa) mismatch. - -In CI, the lifecycle project runs nightly and on demand via the **Lifecycle Tests** -workflow (`.github/workflows/lifecycle.yml`), always with the CPU variant (hosted -runners have no GPU). It can also be run on a specific PR by adding the -`run-lifecycle` label (remove and re-add the label to re-run). It is opt-in and not -PR-blocking. - -## Running the hardware acceleration test - -The Windows hardware acceleration test runs automatically in the Windows E2E suite -when an NVIDIA GPU is present. It can also be run directly: - -```powershell -pnpm run build -pnpm run test:e2e:hardware-acceleration -``` - -NVIDIA's per-process memory query reports `N/A` under Windows WDDM. The test uses -`nvidia-smi -L` to require an NVIDIA GPU and `nvidia-smi pmon` to confirm an Electron -GPU process is assigned to it, then reads Windows' per-process `GPU Process -Memory/Dedicated Usage` counter for the Electron process tree. It skips when the -required hardware or accounting facilities are unavailable. diff --git a/e2e/assets-startup-failure.test.ts b/e2e/assets-startup-failure.test.ts index e30290211..063d269ae 100644 --- a/e2e/assets-startup-failure.test.ts +++ b/e2e/assets-startup-failure.test.ts @@ -1,13 +1,3 @@ -/** - * E2E: a ComfyUI that turns the assets system on by default refuses to start when its asset - * database cannot open, printing `ASSETS_STARTUP_FAILED: ` and a message for the user, then - * exiting 1. Desktop shows that message instead of "Process exited with code 1", and when the - * kind is `in_use` (another ComfyUI holds the database) it shows its own lock copy, even though - * Desktop did not pass --enable-assets. - * - * Linux only: the ComfyUI stand-in is `fakeComfyInstall`, which is Linux-only (see its header). - */ - import os from 'node:os' import path from 'node:path' import { mkdtemp, rm, writeFile } from 'node:fs/promises' @@ -30,7 +20,6 @@ let ctx: AppContext | null = null test.describe.configure({ mode: 'serial' }) test.setTimeout(180_000) -/** What ComfyUI's logger prints: alembic noise first, then the marker behind a coloured tag. */ function coreRefusal(kind: string, ...message: string[]): string { return ( 'INFO [alembic.runtime.migration] Context impl SQLiteImpl.\n' + @@ -45,8 +34,7 @@ async function launchAndReadError(stderr: string): Promise { await ctx!.panel.waitForVisible(byTestId(TID.progressErrorMessage), { timeout: 60_000 }) await expect.poll(() => hasActiveLaunch(ctx!.app, INSTALL_ID), { timeout: 30_000 }).toBe(false) const text = await ctx!.panel.textOf(byTestId(TID.progressErrorMessage)) - // Back to the chooser for the next case. - expect(await ctx!.panel.click('.brand-progress__error-actions .brand-ghost')).toBe(true) + expect(await ctx!.panel.click(byTestId(TID.progressBack))).toBe(true) await expectChooserVisible(ctx!.panel) return text } @@ -58,12 +46,9 @@ test.beforeAll(async () => { const { port } = await writeFakeComfyInstall({ installPath, port: await reserveFreePort() }) ctx = await launchApp({ profileDir: path.join(rootDir, 'profile'), - cdpPort: await reserveFreePort(), settings: { firstUseCompleted: true, telemetryEnabled: false, - // No --enable-assets: the v0.3.99 record below sits under Desktop's 0.38.0 assets floor, - // and the lock case must hold without it. betaFeaturesEnabled: false, hasSeenCentralPillHint: true }, @@ -75,7 +60,6 @@ test.beforeAll(async () => { sourceLabel: 'ComfyBuilder', installPath, status: 'installed', - // No --enable-assets: the core under test has assets on by default. launchArgs: `--port ${port}`, launchMode: 'window', seen: true, diff --git a/e2e/beta-activation-notice-firstrun.test.ts b/e2e/beta-activation-notice-firstrun.test.ts index f111b7e50..739a486cb 100644 --- a/e2e/beta-activation-notice-firstrun.test.ts +++ b/e2e/beta-activation-notice-firstrun.test.ts @@ -1,23 +1,3 @@ -/** - * E2E: the Core beta activation notice, end to end through a real launch. - * - * Every gate the notice depends on is exercised for real here rather than stubbed: - * - * - the grant arrives the way a returning user's does, from `ops-flags.json` (PostHog is - * unreachable under the harness, so `coreBetaGrants` falls back to the persisted value); - * - it clears the version window against the seeded `comfyVersion`; - * - it clears the running core's args schema, parsed from a real `main.py --help` spawn; - * - the launch spawns, the stub serves, the boot wait succeeds and the window attaches; - * - only then does the title bar drain the pending notice and raise the card. - * - * The card lives in its own WebContentsView, so assertions go through the popup's webContents - * - * Tagged `@linux` only — the fixture cannot run on Windows (no PE interpreter stub) or macOS - * (nothing isolates `userData`, so the ops-flag seed would hit the real profile). Both reasons - * are spelled out in `fakeComfyInstall.ts`'s header. - * - * Run: `pnpm exec playwright test --project=linux e2e/beta-activation-notice-firstrun.test.ts` - */ import os from 'node:os' import path from 'node:path' import { mkdtemp, rm } from 'node:fs/promises' @@ -28,40 +8,24 @@ import { WebContentsPage } from './support/cdpPages' import { opsFlagsGrantSeed, reserveFreePort, - writeFakeComfyInstall, + writeFakeComfyInstall } from './support/fakeComfyInstall' -// A real launch (args-schema spawn, port wait, attach) does not fit the default 45s budget. test.describe.configure({ mode: 'serial', timeout: 180_000 }) const INSTALL_ID = 'inst-beta-notice-firstrun' const INSTALL_NAME = 'Beta Notice Fixture' -/** Chosen at run time rather than hard-coded: a constant collides with whatever else happens - * to be on the machine, and this repo does not tolerate flaky tests. Passed explicitly in - * `launchArgs` so the launcher's port-conflict auto-shift cannot move it afterwards. */ let port = 0 -/** The grant under test. `--enable-asset-hashing` is on the real allowlist and the stub's `--help` - * advertises it, so it survives selection AND the schema filter. */ const GRANT_ARG = '--enable-asset-hashing' -/** Comfortably below the seeded `baseTag`, so the version window opens. */ const GRANT_MIN_CORE = '0.3.80' - let ctx: AppContext let installPath: string -/** The coachmark popup, addressed by the card it is currently rendering. The hover-tooltip - * popup shares the same HTML entry point, so a URL marker alone could resolve to either; - * matching on `.coachmark` picks the one showing a card. */ function coachmarkPopup(app: ElectronApplication): WebContentsPage { return new WebContentsPage(app, 'comfyTitleTooltip') } - -/** PostHog's own value for the flag wins over the persisted one, and a live fetch would make - * this run depend on a real project's flag state. Pointing the SDK at a closed port makes the - * fetch `unreachable`, which is the documented path where `ops-flags.json` is authoritative — - * the same path an offline launch takes for a user who already has the grant. */ const UNREACHABLE_POSTHOG_HOST = 'http://127.0.0.1:1' let previousPosthogHost: string | undefined @@ -76,11 +40,8 @@ test.beforeAll(async () => { ctx = await launchApp({ settings: { firstUseCompleted: true, - // Beta grants are gated on the opt-in, which is itself gated on consent. telemetryEnabled: true, - betaFeaturesEnabled: true, - // Deliberately NOT spent: this spec exists to drive the genuine first-run collision, - // where the onboarding hint and the beta notice contend for the one shared popup. + betaFeaturesEnabled: true }, installations: [ { @@ -94,21 +55,15 @@ test.beforeAll(async () => { launchMode: 'window', browserPartition: 'unique', seen: true, - // What the version gate reads. `commitsAhead: 0` makes the tag exact and - // `baseTagVerified` makes it ancestry-established; without both, the grant is refused. comfyVersion: { commit: 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2', baseTag: 'v0.3.99', commitsAhead: 0, - baseTagVerified: true, - }, - }, + baseTagVerified: true + } + } ], - // Delivered through `E2E_OPS_FLAGS_SEED` so main writes it to the real `configDir()` - // before its first read — the harness cannot place that file on macOS, where `userData` - // ignores the HOME override. Present from the app's first boot, which is how a returning - // user's already-granted flag actually arrives. - opsFlags: opsFlagsGrantSeed({ arg: GRANT_ARG, minCoreVersion: GRANT_MIN_CORE }), + opsFlags: opsFlagsGrantSeed({ arg: GRANT_ARG, minCoreVersion: GRANT_MIN_CORE }) }) await expectChooserVisible(ctx.panel) }) @@ -120,17 +75,6 @@ test.afterAll(async () => { else process.env['POSTHOG_HOST'] = previousPosthogHost }) -/** - * The regression this spec exists for. - * - * One popup serves both cards. On a real first run the beta notice can show FIRST and then be - * displaced when the onboarding hint configures the same popup — which is not a hide, so the - * composable was never told and went on believing its card was up, refusing every later show. - * The notice stayed armed in main and invisible to the user for the rest of the session. - * - * Both other specs seed `hasSeenCentralPillHint: true`, so neither could ever see this. That - * seeding is why a green suite shipped a build where the card never appeared. - */ test('first run: the hint takes the popup, and dismissing it releases the beta card @linux', async () => { await clickInstallTile(ctx.panel, INSTALL_NAME) await ctx.panel.waitFor( @@ -138,9 +82,9 @@ test('first run: the hint takes the popup, and dismissing it releases the beta c (await ctx.app.evaluate( ({ webContents }, p) => webContents.getAllWebContents().some((wc) => wc.getURL().includes(String(p))), - port, + port )) === true, - { timeout: 90_000, message: 'ComfyUI stub never came up / the host never attached' }, + { timeout: 90_000, message: 'ComfyUI stub never came up / the host never attached' } ) const popup = coachmarkPopup(ctx.app) @@ -152,19 +96,17 @@ test('first run: the hint takes the popup, and dismissing it releases the beta c return false } }, - { timeout: 30_000, message: 'no coachmark appeared at all on a first run' }, + { timeout: 30_000, message: 'no coachmark appeared at all on a first run' } ) - // The hint wins the collision — that part is by design and is not what this pins. expect(await popup.textOf('.coachmark-title')).toBe('Switch & manage instances') - // The notice is queued in main the whole time, waiting for the popup to free up. - expect(await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`)) - .not.toBeNull() + expect( + await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`) + ).not.toBeNull() expect(await popup.click('.coachmark-dismiss')).toBe(true) - // THE ASSERTION: the deferred card must actually arrive once the hint lets go of the popup. await popup.waitFor( async () => { try { @@ -173,10 +115,9 @@ test('first run: the hint takes the popup, and dismissing it releases the beta c return false } }, - { timeout: 30_000, message: 'beta notice never drew after the hint was dismissed' }, + { timeout: 30_000, message: 'beta notice never drew after the hint was dismissed' } ) - // Generic copy, and the way out is present — same contract the seeded spec asserts. expect(await popup.textOf('.coachmark-text')).not.toContain(GRANT_ARG) expect(await popup.textOf('.coachmark-action')).toBe('Settings') }) diff --git a/e2e/beta-activation-notice-lockdown.test.ts b/e2e/beta-activation-notice-lockdown.test.ts index 25d421c9d..56fada914 100644 --- a/e2e/beta-activation-notice-lockdown.test.ts +++ b/e2e/beta-activation-notice-lockdown.test.ts @@ -1,34 +1,3 @@ -/** - * E2E: first-use lockdown must never cost the user their beta notice. - * - * The card's anchor is the news bell, and the bell is `v-if="!isFirstUseLockdown"`. Reading - * only that, it looks as though a brand-new user's notice is swallowed: no anchor, no card, - * deferred to some later launch — a whole first session running the beta unannounced, which - * would defeat a feature whose entire purpose is informed activation plus opt-out. - * - * It is not swallowed, and this spec pins the two independent reasons, because both are - * load-bearing and neither is obvious from the code that gates the bell: - * - * 1. The launch that ARMS the notice also ends the lockdown. Attaching an install rebuilds - * the panel, and main resets `firstUseMode` to `'none'` on that rebuild - * (`host/panelView.ts`). So the anchor is back before the card is ever raised. - * 2. If lockdown arrives LATER — the first-use chain re-asserts `'post-consent'` after - * attach — the gate watcher hides the card and re-raises it on the transition back, - * in the same session. Hiding retires nothing, so main still holds the pending notice - * and the card is not spent. - * - * Respecting the takeover stays deliberate: nothing is drawn while onboarding owns the screen. - * What is pinned is that the deferral is temporary rather than terminal. - * - * VISIBILITY IS ASKED OF MAIN, NOT THE DOM. `EmbeddedPopupView.hide()` calls - * `popup.setVisible(false)`; the popup keeps its markup and its renderer goes on reporting - * `document.visibilityState === 'visible'`. Both of those read as "the card is up" and both - * are wrong, so the assertions below read `getVisible()` off the attached view instead. - * - * Tagged `@linux` only, for the reasons in `fakeComfyInstall.ts`'s header. - * - * Run: `pnpm exec playwright test --project=linux e2e/beta-activation-notice-lockdown.test.ts` - */ import os from 'node:os' import path from 'node:path' import { mkdtemp, rm } from 'node:fs/promises' @@ -42,7 +11,6 @@ import { writeFakeComfyInstall } from './support/fakeComfyInstall' -// A real launch (args-schema spawn, port wait, attach) does not fit the default 45s budget. test.describe.configure({ mode: 'serial', timeout: 180_000 }) const INSTALL_ID = 'inst-beta-notice-lockdown' @@ -58,8 +26,6 @@ function coachmarkPopup(app: ElectronApplication): WebContentsPage { return new WebContentsPage(app, 'comfyTitleTooltip') } -/** Title of whatever card the shared popup is rendering, or null when it renders none. - * DOM-level, so it answers "which card" — never "can the user see it". */ async function cardTitle(popup: WebContentsPage): Promise { try { if (!(await popup.exists('.coachmark'))) return null @@ -69,8 +35,6 @@ async function cardTitle(popup: WebContentsPage): Promise { } } -/** Whether the coachmark popup is actually on screen, read from main. - * `'detached'` when the view does not exist yet — distinct from attached-but-hidden. */ async function popupVisible(app: ElectronApplication): Promise { return app.evaluate(({ BrowserWindow }) => { const win = BrowserWindow.getAllWindows()[0] @@ -90,9 +54,6 @@ async function popupVisible(app: ElectronApplication): Promise { const bell = await titleBar.exists('.title-announcement-button') const pill = await titleBar.exists('.title-install-pill.is-interactive') @@ -115,9 +76,6 @@ test.beforeAll(async () => { firstUseCompleted: true, telemetryEnabled: true, betaFeaturesEnabled: true, - // Spent deliberately: the hint-versus-notice collision is - // `beta-activation-notice-firstrun.test.ts`'s job, and leaving it unspent here would - // put a second claimant on the shared popup and blur which gate released the card. hasSeenCentralPillHint: true }, installations: [ @@ -155,7 +113,6 @@ test.afterAll(async () => { test('first-use lockdown never costs the user the beta notice @linux', async () => { const popup = coachmarkPopup(ctx.app) - // Onboarding is in progress when the first launch happens — the new user's real sequence. await ctx.panel.evaluate(`window.api.setFirstUseMode('post-consent')`) await ctx.titleBar.waitFor(async () => lockdownEngaged(ctx.titleBar), { timeout: 10_000, @@ -173,13 +130,10 @@ test('first-use lockdown never costs the user the beta notice @linux', async () { timeout: 90_000, message: 'ComfyUI stub never came up / the host never attached' } ) - // Armed in main: the grant cleared every gate and the notice is waiting on the renderer. expect( await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`) ).not.toBeNull() - // REASON 1. The launch ended the lockdown by itself, so the anchor is back and the card is - // raised in this session rather than waiting for a later one. await popup.waitFor(async () => (await cardTitle(popup)) === 'A beta feature is on', { timeout: 30_000, message: 'beta notice never drew after the launch that armed it' @@ -187,8 +141,6 @@ test('first-use lockdown never costs the user the beta notice @linux', async () expect(await popupVisible(ctx.app)).toBe(true) expect(await lockdownEngaged(ctx.titleBar)).toBe(false) - // REASON 2. Lockdown arrives again while the card is up — the chain re-asserting - // `post-consent` after attach. The card must go away with the rest of the chrome. await ctx.panel.evaluate(`window.api.setFirstUseMode('post-consent')`) await ctx.titleBar.waitFor(async () => lockdownEngaged(ctx.titleBar), { timeout: 10_000, @@ -201,14 +153,10 @@ test('first-use lockdown never costs the user the beta notice @linux', async () }) .toBe(false) - // Hidden, never retired: main still holds it, so it is not spent. expect( await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`) ).not.toBeNull() - // THE ASSERTION. Lockdown ends, and the card comes back in the SAME session — no relaunch, - // no reload. Without the gate watcher re-attempting on the transition, it would wait for - // the user's next launch, which is the whole session of unannounced beta this pins against. await ctx.panel.evaluate(`window.api.setFirstUseMode('none')`) await expect .poll(async () => popupVisible(ctx.app), { diff --git a/e2e/beta-activation-notice-named.test.ts b/e2e/beta-activation-notice-named.test.ts index c0e52eadf..e66daad40 100644 --- a/e2e/beta-activation-notice-named.test.ts +++ b/e2e/beta-activation-notice-named.test.ts @@ -1,16 +1,3 @@ -/** - * E2E: payload-controlled wording for the Core beta activation notice. - * - * The companion spec (`beta-activation-notice.test.ts`) covers the generic card and the whole - * trigger path. This one covers only what the PostHog payload adds: a `description` reaching - * the card as a feature name, through the real parser and the real launch. - * - * Tagged `@linux` only, for the two reasons documented in `fakeComfyInstall.ts`: the - * interpreter stub cannot be a PE executable on Windows, and nothing isolates `userData` on - * macOS, so the ops-flag seed would hit the real profile. - * - * Run: `pnpm exec playwright test --project=linux e2e/beta-activation-notice-named.test.ts` - */ import os from 'node:os' import path from 'node:path' import { mkdir, mkdtemp, rm } from 'node:fs/promises' @@ -18,18 +5,19 @@ import { expect, test, type ElectronApplication } from '@playwright/test' import { launchApp, type AppContext } from './launchApp' import { clickInstallTile, expectChooserVisible } from './support/chooserHelpers' import { WebContentsPage } from './support/cdpPages' -import { opsFlagsGrantSeed, reserveFreePort, writeFakeComfyInstall } from './support/fakeComfyInstall' +import { + opsFlagsGrantSeed, + reserveFreePort, + writeFakeComfyInstall +} from './support/fakeComfyInstall' import { captureHostWindow } from './support/windowCapture' -// A real launch does not fit the default 45s budget. test.describe.configure({ mode: 'serial', timeout: 180_000 }) const INSTALL_ID = 'inst-beta-notice-named' const INSTALL_NAME = 'Named Beta Fixture' const GRANT_ARG = '--enable-asset-hashing' const GRANT_MIN_CORE = '0.3.80' -/** What the payload calls the feature. Deliberately not derivable from the arg token, so a - * card showing it proves the payload reached the copy rather than a table in Desktop. */ const FEATURE_NAME = 'Asset hashing' let ctx: AppContext @@ -37,8 +25,6 @@ let installPath: string let port: number let previousPosthogHost: string | undefined -/** See the companion spec: a closed port makes the flag fetch `unreachable`, which is the - * documented path where the persisted `ops-flags.json` is authoritative. */ const UNREACHABLE_POSTHOG_HOST = 'http://127.0.0.1:1' function coachmarkPopup(app: ElectronApplication): WebContentsPage { @@ -80,8 +66,6 @@ test.beforeAll(async () => { } } ], - // Env-delivered so main writes it to the real `configDir()`; the harness cannot place - // that file on macOS, where `userData` ignores the HOME override. opsFlags: opsFlagsGrantSeed({ arg: GRANT_ARG, minCoreVersion: GRANT_MIN_CORE, @@ -125,9 +109,7 @@ test('a payload-supplied feature name reaches the card @linux', async () => { expect(await popup.textOf('.coachmark-title')).toBe(`The ${FEATURE_NAME} beta is on`) expect(await popup.textOf('.coachmark-text')).toContain(FEATURE_NAME) - // Naming the feature must not cost the card its way out. expect(await popup.textOf('.coachmark-action')).toBe('Settings') - // The raw token still never reaches the user. expect(await popup.textOf('.coachmark-text')).not.toContain(GRANT_ARG) const shotPath = path.join(test.info().outputDir, '03-notice-named-by-payload.png') diff --git a/e2e/beta-activation-notice.test.ts b/e2e/beta-activation-notice.test.ts index 97d7f430e..d45f10f1f 100644 --- a/e2e/beta-activation-notice.test.ts +++ b/e2e/beta-activation-notice.test.ts @@ -1,27 +1,3 @@ -/** - * E2E: the Core beta activation notice, end to end through a real launch. - * - * Every gate the notice depends on is exercised for real here rather than stubbed: - * - * - the grant arrives the way a returning user's does, from `ops-flags.json` (PostHog is - * unreachable under the harness, so `coreBetaGrants` falls back to the persisted value); - * - it clears the version window against the seeded `comfyVersion`; - * - it clears the running core's args schema, parsed from a real `main.py --help` spawn; - * - the launch spawns, the stub serves, the boot wait succeeds and the window attaches; - * - only then does the title bar drain the pending notice and raise the card. - * - * The card lives in its own WebContentsView, so assertions go through the popup's webContents - * and the screenshots come from `BrowserWindow.capturePage()` — the whole host window, - * chrome and canvas and floating card together, which is the thing a reviewer needs to see. - * - * Tagged `@linux` only — the fixture cannot run on Windows (no PE interpreter stub) or macOS - * (nothing isolates `userData`, so the ops-flag seed would hit the real profile). Both reasons - * are spelled out in `fakeComfyInstall.ts`'s header. - * - * Run: `pnpm exec playwright test --project=linux e2e/beta-activation-notice.test.ts` - * Screenshots go to Playwright's own output dir and are attached to the report, not written - * into the repo. - */ import os from 'node:os' import path from 'node:path' import { mkdir, mkdtemp, rm } from 'node:fs/promises' @@ -32,52 +8,31 @@ import { WebContentsPage, titlePopupPage } from './support/cdpPages' import { opsFlagsGrantSeed, reserveFreePort, - writeFakeComfyInstall, + writeFakeComfyInstall } from './support/fakeComfyInstall' import { captureHostWindow } from './support/windowCapture' -// A real launch (args-schema spawn, port wait, attach) does not fit the default 45s budget. test.describe.configure({ mode: 'serial', timeout: 180_000 }) const INSTALL_ID = 'inst-beta-notice' const INSTALL_NAME = 'Beta Notice Fixture' -/** Chosen at run time rather than hard-coded: a constant collides with whatever else happens - * to be on the machine, and this repo does not tolerate flaky tests. Passed explicitly in - * `launchArgs` so the launcher's port-conflict auto-shift cannot move it afterwards. */ let port = 0 -/** The grant under test. `--enable-asset-hashing` is on the real allowlist and the stub's `--help` - * advertises it, so it survives selection AND the schema filter. */ const GRANT_ARG = '--enable-asset-hashing' -/** Comfortably below the seeded `baseTag`, so the version window opens. */ const GRANT_MIN_CORE = '0.3.80' - let ctx: AppContext let installPath: string -/** The coachmark popup, addressed by the card it is currently rendering. The hover-tooltip - * popup shares the same HTML entry point, so a URL marker alone could resolve to either; - * matching on `.coachmark` picks the one showing a card. */ function coachmarkPopup(app: ElectronApplication): WebContentsPage { return new WebContentsPage(app, 'comfyTitleTooltip') } -/** The whole host window, every view composited — not a per-view crop, because the claim - * being evidenced is that the card floats OVER live ComfyUI. - * - * Written under Playwright's per-test output dir, never into the repo: these are generated - * artifacts, and `.gitignore` already excludes every other one. `attach` puts them in the HTML - * report, which CI uploads. */ async function captureWindow(app: ElectronApplication, name: string): Promise { const file = path.join(test.info().outputDir, `${name}.png`) await mkdir(path.dirname(file), { recursive: true }) return captureHostWindow(app, ctx.panel, file) } -/** PostHog's own value for the flag wins over the persisted one, and a live fetch would make - * this run depend on a real project's flag state. Pointing the SDK at a closed port makes the - * fetch `unreachable`, which is the documented path where `ops-flags.json` is authoritative — - * the same path an offline launch takes for a user who already has the grant. */ const UNREACHABLE_POSTHOG_HOST = 'http://127.0.0.1:1' let previousPosthogHost: string | undefined @@ -92,13 +47,9 @@ test.beforeAll(async () => { ctx = await launchApp({ settings: { firstUseCompleted: true, - // Beta grants are gated on the opt-in, which is itself gated on consent. telemetryEnabled: true, betaFeaturesEnabled: true, - // Spend the onboarding pill hint up front. Both cards share one popup per window, and - // the hint wins when they collide — which is correct behaviour, and covered by a unit - // test, but it would make this run assert the wrong card. - hasSeenCentralPillHint: true, + hasSeenCentralPillHint: true }, installations: [ { @@ -112,21 +63,15 @@ test.beforeAll(async () => { launchMode: 'window', browserPartition: 'unique', seen: true, - // What the version gate reads. `commitsAhead: 0` makes the tag exact and - // `baseTagVerified` makes it ancestry-established; without both, the grant is refused. comfyVersion: { commit: 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2', baseTag: 'v0.3.99', commitsAhead: 0, - baseTagVerified: true, - }, - }, + baseTagVerified: true + } + } ], - // Delivered through `E2E_OPS_FLAGS_SEED` so main writes it to the real `configDir()` - // before its first read — the harness cannot place that file on macOS, where `userData` - // ignores the HOME override. Present from the app's first boot, which is how a returning - // user's already-granted flag actually arrives. - opsFlags: opsFlagsGrantSeed({ arg: GRANT_ARG, minCoreVersion: GRANT_MIN_CORE }), + opsFlags: opsFlagsGrantSeed({ arg: GRANT_ARG, minCoreVersion: GRANT_MIN_CORE }) }) await expectChooserVisible(ctx.panel) }) @@ -141,17 +86,14 @@ test.afterAll(async () => { test('a first beta activation raises a nonblocking notice over live ComfyUI @linux', async () => { await clickInstallTile(ctx.panel, INSTALL_NAME) - // The grant reaches the real command line, not just the selection step: this is what the - // notice is claiming happened, so it is asserted from the launch's own output rather than - // inferred from the card being up. await ctx.panel.waitFor( async () => (await ctx.app.evaluate( ({ webContents }, p) => webContents.getAllWebContents().some((wc) => wc.getURL().includes(String(p))), - port, + port )) === true, - { timeout: 90_000, message: 'ComfyUI stub never came up / the host never attached' }, + { timeout: 90_000, message: 'ComfyUI stub never came up / the host never attached' } ) const popup = coachmarkPopup(ctx.app) @@ -160,17 +102,14 @@ test('a first beta activation raises a nonblocking notice over live ComfyUI @lin try { return await popup.exists('.coachmark') } catch { - // The popup view is created lazily, so "not found" is a normal pre-show state. return false } }, - { timeout: 30_000, message: 'beta activation notice never appeared' }, + { timeout: 30_000, message: 'beta activation notice never appeared' } ) expect(await popup.textOf('.coachmark-title')).toBe('A beta feature is on') - // Generic copy: the card must not name the arg, so it cannot be wrong about which feature. expect(await popup.textOf('.coachmark-text')).not.toContain(GRANT_ARG) - // The way out is what makes this more than an FYI. expect(await popup.textOf('.coachmark-action')).toBe('Settings') expect(await popup.textOf('.coachmark-dismiss')).toBe('Got it') @@ -179,17 +118,6 @@ test('a first beta activation raises a nonblocking notice over live ComfyUI @lin }) test('the card is anchored on the bell it points at @linux', async () => { - // Asserted on the BEAK's own position in window coordinates, not the popup view's. - // - // This test used to compare the VIEW's centre against the bell, on the reasoning that the - // beak sits at a fixed position inside the card so centring the popup centres the beak. The - // middle step was false: the card is narrower than the view by a shadow gutter each side, - // and it was rendering flush-LEFT inside it rather than centred. So the view was centred on - // the bell — which this test checked, and which was never broken — while the card and its - // beak sat one gutter to the left, which is what a user sees. It shipped a real misalignment - // (-18px on Windows) under a green assertion for exactly that reason. - // - // Measuring the beak end to end is the only version that cannot pass while the card is off. const bellCentre = await ctx.titleBar.evaluate(`(() => { const el = document.querySelector('.title-announcement-button') if (!el) return -1 @@ -211,35 +139,9 @@ test('the card is anchored on the bell it points at @linux', async () => { }) expect(popup, 'coachmark popup view not found').not.toBeNull() - // The card must COVER the bell horizontally — that holds whether or not the view clamped. expect(popup!.x).toBeLessThanOrEqual(bellCentre) expect(popup!.right).toBeGreaterThanOrEqual(bellCentre) - // Where the beak actually is: its centre inside the popup page, plus the page's own - // position in the window. - // - // POLLED, not sampled once. Main shows the popup at a provisional size and resizes it once - // the card reports its measured width, and for a beat after that the page is still laid out - // against the OLD viewport — measured mid-flight it reads several px off and settles to 0. - // A single read can land in that window, which is a flaky test rather than a real failure, - // and this repo does not tolerate those. Reading until it settles asserts the same property - // without racing the resize. - /** One complete, self-consistent reading: the bell, the popup's bounds, and the card's own - * rects — all re-read together so the asserted offset and the printed terms describe the - * same moment. - * - * Every part of that matters here. Holding the view bounds from before the loop while - * re-reading the beak mixes a stale origin with a live measurement, and the reposition this - * loop waits out is exactly what invalidates those bounds. Reading the card's rects in a - * separate round trip from the beak lets the two straddle a layout change. Either way the - * numbers stop reconciling, which defeats the point: a diagnostic that describes a - * different moment than the failure is worse than none, because it reads as evidence. - * - * The offset is `view.x + beak - bell`, so a failure is one of three things: the view not - * centred on the bell, the card not centred in the view, or the beak not centred in the - * card. `viewCentreVsBell` and `cardLeft` separate them, and `pageWidth` catches the case - * where the page is still laid out at its previous width and centres the card against a - * viewport that no longer exists. */ const sample = async (): Promise<{ offset: number; detail: string } | null> => { try { const bell = await ctx.titleBar.evaluate(`(() => { @@ -282,32 +184,18 @@ test('the card is anchored on the bell it points at @linux', async () => { ` | viewCentreVsBell=${view.x + view.width / 2 - bell}` } } catch { - // A renderer torn down or replaced mid-read. `expect.poll` would have retried this; a - // hand-rolled loop has to do it explicitly, or a transient becomes a test failure. return null } } expect(await sample(), 'could not read the card geometry at all').not.toBeNull() - // When nothing clamped it, the beak must land ON the bell. Asserted only in the unclamped - // case: with the bell too close to a window edge the card cannot centre, and the beak's - // edge margin deliberately wins over exact tracking — `positionCoachmark`'s unit tests - // cover that trade directly. const windowWidth = await ctx.app.evaluate(({ BrowserWindow }) => { const win = BrowserWindow.getAllWindows().find((w) => !w.isDestroyed() && w.isVisible()) return win ? win.getContentBounds().width : 0 }) const clamped = popup!.x <= 0 || popup!.right >= windowWidth if (!clamped) { - // Sampled in a loop rather than through `expect.poll`, because poll's `message` is built - // ONCE while the options object is constructed — so a failure ten seconds later reports - // the geometry from before polling began. That is the opposite of what this diagnostic is - // for: the numbers we need are the ones from the sample that actually failed, and on an - // intermittent failure the two need not agree. - // Budget started AFTER the first reading, and bounded by iterations too: on a loaded - // runner the round trips alone can eat a wall-clock deadline, which would silently - // degrade this back to the single mid-resize read it exists to avoid. let taken = await sample() const deadline = Date.now() + 10_000 for (let i = 0; i < 40 && (taken === null || taken.offset > 2); i++) { @@ -321,15 +209,12 @@ test('the card is anchored on the bell it points at @linux', async () => { const detail = taken!.detail expect( offset, - 'the beak must point at the bell, not merely sit in a view that is centred on it. ' + detail, + 'the beak must point at the bell, not merely sit in a view that is centred on it. ' + detail ).toBeLessThanOrEqual(2) } }) test('the notice does not block the canvas underneath it @linux', async () => { - // Nonblocking is the firm constraint, and it is a property of the popup's BOUNDS: the card - // is its own small WebContentsView, so it takes clicks only where it is drawn. A full-window - // overlay would report a height near the host window's. const bounds = await ctx.app.evaluate(({ BrowserWindow, WebContentsView }) => { const win = BrowserWindow.getAllWindows().find((w) => !w.isDestroyed() && w.isVisible()) if (!win) throw new Error('no visible window') @@ -356,14 +241,14 @@ test('the settings link lands on the beta opt-in row and retires the card @linux await settings.waitForVisible('.global-settings', { timeout: 15_000 }) await settings.waitForVisible('[data-field-id="betaFeaturesEnabled"]', { timeout: 15_000 }) - // Landing on the tab is not the claim — landing on the ROW is. The flash class is what - // carries the user's eye to a control that sits below the fold. await settings.waitFor( () => settings.exists('[data-field-id="betaFeaturesEnabled"].gs-field-flash'), - { timeout: 10_000, message: 'beta opt-in row was never highlighted' }, + { timeout: 10_000, message: 'beta opt-in row was never highlighted' } ) - // The switch it points at is the real opt-out, and it is live (on, and not consent-blocked). - const state = await settings.evaluate<{ checked: string | null; disabled: string | null }>(`(() => { + const state = await settings.evaluate<{ + checked: string | null + disabled: string | null + }>(`(() => { const el = document.querySelector('[data-field-id="betaFeaturesEnabled"] button[role="switch"]') if (!el) return { checked: null, disabled: null } return { @@ -379,15 +264,13 @@ test('the settings link lands on the beta opt-in row and retires the card @linux }) test('the notice is spent: a second launch stays silent @linux', async () => { - // The whole point of persisting on retire rather than on show. Read through the same IPC - // the title bar uses, so this asserts the contract the renderer actually depends on. const stillPending = await ctx.titleBar.evaluate( - `window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`, + `window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})` ) expect(stillPending).toBeNull() const announced = await ctx.titleBar.evaluate( - `window.api.getSetting('betaNoticeAnnouncedArgs')`, + `window.api.getSetting('betaNoticeAnnouncedArgs')` ) expect(announced).toEqual([GRANT_ARG]) }) diff --git a/e2e/cancel-flow.test.ts b/e2e/cancel-flow.test.ts index d114aadb4..5e968e1b3 100644 --- a/e2e/cancel-flow.test.ts +++ b/e2e/cancel-flow.test.ts @@ -1,15 +1,3 @@ -/** - * Cancel-flow coverage: ProgressModal Return-to-Dashboard against an - * in-flight cancellable op, and `useActionGuard.checkBeforeAction` - * surfacing the "Operation in progress" confirm + driving its cancel - * branch end-to-end. - * - * Both branches share a controllable in-flight op seeded via - * `__e2eRenderer.startInFlightOp` — the apiCall is a Promise the test - * resolves with `settleInFlightOp` so the op stays mid-air until the - * cancel paths fire their teardown IPCs. - */ - import os from 'node:os' import path from 'node:path' import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' @@ -21,7 +9,7 @@ import { clearRunningSessions, getIpcInvocations, resetIpcInvocations, - seedRunningSession, + seedRunningSession } from './support/devHooks' let ctx: AppContext @@ -46,9 +34,9 @@ test.beforeAll(async () => { name: INSTALL_NAME, installPath, sourceId: 'standalone', - status: 'installed', - }, - ], + status: 'installed' + } + ] }) await expectChooserVisible(ctx.panel) }) @@ -63,14 +51,9 @@ test.beforeEach(async () => { await resetIpcInvocations(ctx.app, 'cancel-operation') await resetIpcInvocations(ctx.app, 'stop-comfyui') await clearRunningSessions(ctx.app) - // Drop any pending in-flight op left over from a previous test so its - // settler can't intercept this test's seed. await settleInFlightOp({ ok: false, cancelled: true }) }) -/** Seed an in-flight op whose apiCall stays pending until the test - * resolves it. ProgressModal mounts on the chooser host's takeover - * slot exactly the way a real long-running action would render. */ async function startInFlightOp(opts: { destroysInstance?: boolean } = {}): Promise { await ctx.panel.evaluate( `(async () => { @@ -80,7 +63,7 @@ async function startInFlightOp(opts: { destroysInstance?: boolean } = {}): Promi opKind: 'update', destroysInstance: ${opts.destroysInstance ? 'true' : 'false'}, }) - })()`, + })()` ) await ctx.panel.waitForVisible('.brand-progress', { timeout: 10_000 }) } @@ -90,12 +73,10 @@ async function settleInFlightOp(result: { ok: boolean; cancelled?: boolean }): P `window.__e2eRenderer.settleInFlightOp({ installationId: ${JSON.stringify(INSTALL_ID)}, result: ${JSON.stringify(result)}, - })`, + })` ) } -/** Kick off `runActionGuard` and stash the verdict promise on `window` - * so the test can await it later (after driving the confirm modal). */ async function runGuardInBackground(actionLabel: string): Promise { await ctx.panel.evaluate( `(() => { @@ -103,7 +84,7 @@ async function runGuardInBackground(actionLabel: string): Promise { installationId: ${JSON.stringify(INSTALL_ID)}, actionLabel: ${JSON.stringify(actionLabel)}, }) - })()`, + })()` ) } @@ -112,30 +93,21 @@ function readGuardVerdict(): Promise { } test('useActionGuard fires cancel-operation when the user confirms cancelling the busy op @windows @macos @linux', async () => { - // Active session + in-flight op makes the guard's busy check fire. await startInFlightOp() await runGuardInBackground('Restart ComfyUI') - // useActionGuard fires a plain confirm (no details / checkboxes), so - // ModalDialog routes it through `BaseAlert` — its action button uses - // the `baseAlertAction` test id, not `modalConfirm`. await ctx.panel.waitForVisible(byTestId(TID.baseAlertAction), { timeout: 10_000 }) expect(await ctx.panel.click(byTestId(TID.baseAlertAction))).toBe(true) - // The guard fires window.api.cancelOperation immediately after the - // user confirms. main records the invocation before the poll starts. await expect .poll(async () => (await getIpcInvocations(ctx.app, 'cancel-operation')).length, { timeout: 5_000, - intervals: [100, 200], + intervals: [100, 200] }) .toBeGreaterThanOrEqual(1) - const cancelCalls = await getIpcInvocations(ctx.app, 'cancel-operation') as string[] + const cancelCalls = (await getIpcInvocations(ctx.app, 'cancel-operation')) as string[] expect(cancelCalls[0]).toBe(INSTALL_ID) - // Settle the apiCall so progressStore marks the op finished — - // getProgressInfo flips to null and the guard's poll exits, returning - // true so the action would proceed. await settleInFlightOp({ ok: false, cancelled: true }) expect(await readGuardVerdict()).toBe(true) }) @@ -148,74 +120,55 @@ test('useActionGuard returns false without cancelling when the user dismisses th expect(await ctx.panel.click(byTestId(TID.baseAlertCancel))).toBe(true) expect(await readGuardVerdict()).toBe(false) - // Cancel-operation must NOT fire when the user backs out of the - // confirm — that would punish them for accidentally hitting an - // action against a busy install. const cancelCalls = await getIpcInvocations(ctx.app, 'cancel-operation') expect(cancelCalls.length).toBe(0) - // Clean up the seeded op so the next test starts fresh. await settleInFlightOp({ ok: false, cancelled: true }) }) test('Return-to-Dashboard from in-flight op cancels and closes the takeover @windows @macos @linux', async () => { - // Seed a real running session so cancelling also drops the session - // (the in-flight confirm prompt itself appears for any install). await seedRunningSession(ctx.app, { installationId: INSTALL_ID, - installationName: INSTALL_NAME, + installationName: INSTALL_NAME }) - // Wait for the renderer to see the install as running — without this - // the operation would resolve too fast and the user's perception of - // running state would race the broadcast. await expect .poll( - async () => ctx.panel.evaluate( - `window.__e2eRenderer.isRunning(${JSON.stringify(INSTALL_ID)})`, - ), - { timeout: 5_000, intervals: [100, 200] }, + async () => + ctx.panel.evaluate( + `window.__e2eRenderer.isRunning(${JSON.stringify(INSTALL_ID)})` + ), + { timeout: 5_000, intervals: [100, 200] } ) .toBe(true) await startInFlightOp() - // The footer renders the Return-to-Dashboard button only when the op - // is non-destroying (otherwise Cancel takes its place). expect(await ctx.panel.clickByText('button', 'Return to Dashboard')).toBe(true) - // Local-install in-flight: ModalDialog confirm appears as a simple - // confirm (no details / checkboxes), so it routes through BaseAlert. await ctx.panel.waitForVisible(byTestId(TID.baseAlertAction), { timeout: 10_000 }) expect(await ctx.panel.click(byTestId(TID.baseAlertAction))).toBe(true) - // progressStore.cancelOperation fires both cancel-operation and - // stop-comfyui — the latter is what actually drops the running - // session so the install isn't orphaned. await expect .poll(async () => (await getIpcInvocations(ctx.app, 'cancel-operation')).length, { timeout: 5_000, - intervals: [100, 200], + intervals: [100, 200] }) .toBeGreaterThanOrEqual(1) await expect .poll(async () => (await getIpcInvocations(ctx.app, 'stop-comfyui')).length, { timeout: 5_000, - intervals: [100, 200], + intervals: [100, 200] }) .toBeGreaterThanOrEqual(1) - const cancelCalls = await getIpcInvocations(ctx.app, 'cancel-operation') as string[] + const cancelCalls = (await getIpcInvocations(ctx.app, 'cancel-operation')) as string[] expect(cancelCalls[0]).toBe(INSTALL_ID) - // Takeover closes — `.brand-progress` is unmounted. await expect .poll(async () => ctx.panel.exists('.brand-progress'), { timeout: 5_000, - intervals: [100, 200], + intervals: [100, 200] }) .toBe(false) - // Resolve the apiCall so the op cleans up. cancelOperation does not - // mark op.finished — the promise has to settle for the store to - // clear the op. await settleInFlightOp({ ok: false, cancelled: true }) }) diff --git a/e2e/chooser.test.ts b/e2e/chooser.test.ts index 21ef2d1bc..5f5bb36a5 100644 --- a/e2e/chooser.test.ts +++ b/e2e/chooser.test.ts @@ -1,27 +1,16 @@ -/** - * Chooser E2E: validates the install-less host window's chooser body and - * its title bar after launch. No installs seeded — covers the cold-start - * path where the user lands on the chooser. - * - * Includes regression tests for the three embedded WebContentsView popups - * hung off the chooser host (titlePopup, systemModal, titleTooltip) so the - * upcoming P0.1 / P0.2 extractions can be validated end-to-end. - */ - import { test, expect, type ElectronApplication } from '@playwright/test' import { launchApp, type AppContext } from './launchApp' import { clickNewInstallTile, openTitleMenu, expectChooserVisible, - expectTakeoverOpen, - dismissOverlay, + expectTakeoverOpen } from './support/chooserHelpers' import { findWebContentsId, isPopupVisible, TITLE_REOPEN_SUPPRESSION_MS, - waitForWebContents, + waitForWebContents } from './support/cdpPages' import { evalWithRetry } from './support/evalRetry' @@ -30,9 +19,6 @@ let ctx: AppContext test.describe.configure({ mode: 'serial' }) test.beforeAll(async () => { - // `firstUseCompleted: true` keeps the first-use takeover from racing - // the renderer mount and locking the title bar (consent-lockdown hides - // the waffle button, breaking the title-popup tests below). ctx = await launchApp({ settings: { firstUseCompleted: true, telemetryEnabled: false } }) }) @@ -43,13 +29,8 @@ test.afterAll(async () => { test('chooser body renders on cold start @windows @macos @linux', async () => { await expectChooserVisible(ctx.panel) expect(await ctx.panel.exists('.chooser-tile-new')).toBe(true) - expect( - ( - await ctx.panel.textOf( - '[data-testid="devplatform-workspace-selector"] .workspace-selector__name', - ) - )?.trim(), - ).toBe('Personal') + expect(await ctx.panel.exists('[data-testid="app-sidebar"]')).toBe(true) + expect(await ctx.panel.exists('[data-testid="devplatform-account-signin"]')).toBe(true) }) test('title bar shows install-less pill on chooser host @windows @macos @linux', async () => { @@ -61,174 +42,176 @@ test('clicking New Install tile opens the new-install takeover @windows @macos @ await clickNewInstallTile(ctx.panel) await expectTakeoverOpen(ctx.panel) expect(await ctx.panel.exists('[data-testid="workspace-install-source-managed"]')).toBe(true) - await dismissOverlay(ctx.panel) + expect(await ctx.panel.click('.config-back-to-dashboard')).toBe(true) + await expect.poll(() => ctx.panel.exists('.brand-takeover-root')).toBe(false) await expectChooserVisible(ctx.panel) }) -// --------------------------------------------------------------------------- -// Host registry regression coverage. `openOrFocusAnyHostWindow` / -// `openOrFocusChooserHostWindow` must dedup against the existing chooser -// host instead of spawning a duplicate; the popup-open tests below double -// as a check that title-bar IPC routing still resolves the existing entry -// after the dedup path runs. -// --------------------------------------------------------------------------- +test('Builds dropdown opens both import flows and restores focus on Escape @windows @macos @linux', async () => { + const trigger = '[data-testid="build-actions-menu-trigger"]' + expect(await ctx.panel.click(trigger)).toBe(true) + await ctx.panel.waitForVisible('[data-testid="build-actions-add-existing"]') + await ctx.panel.pressKey('Escape') + await expect + .poll(() => + ctx.panel.evaluate(`document.activeElement?.matches('${trigger}') ?? false`) + ) + .toBe(true) + + for (const [action, modal] of [ + ['add-existing', 'track-modal'], + ['load-snapshot', 'load-snapshot-modal'] + ]) { + expect(await ctx.panel.click(trigger)).toBe(true) + const item = `[data-testid="build-actions-${action}"]` + await ctx.panel.waitForVisible(item) + expect(await ctx.panel.click(item)).toBe(true) + await ctx.panel.waitForVisible(`[data-testid="${modal}"]`) + expect(await ctx.panel.click('.takeover-back')).toBe(true) + await expect.poll(() => ctx.panel.exists(`[data-testid="${modal}"]`)).toBe(false) + await expectChooserVisible(ctx.panel) + } +}) test('activate hook focuses the existing chooser host instead of spawning a duplicate @windows @macos @linux', async () => { - // Baseline: exactly one host BrowserWindow is open from `beforeAll`. - const before = await evalWithRetry(() => ctx.app.evaluate(({ BrowserWindow }) => - BrowserWindow.getAllWindows().filter((w) => !w.isDestroyed()).length, - )) + const before = await evalWithRetry(() => + ctx.app.evaluate( + ({ BrowserWindow }) => BrowserWindow.getAllWindows().filter((w) => !w.isDestroyed()).length + ) + ) expect(before).toBe(1) - // Trigger the platform re-launch hook the registry guards against. - // `app.on('activate', () => openOrFocusAnyHostWindow())` is registered - // unconditionally in `whenReady` so emitting it is portable across OSes. - // Deliberately not retried: a retry could emit 'activate' twice. - await ctx.app.evaluate(({ app }) => { app.emit('activate') }) - // Window construction is synchronous in the dedup miss path; the dedup - // hit path is even faster. A short settle covers both. + await ctx.app.evaluate(({ app }) => { + app.emit('activate') + }) await new Promise((r) => setTimeout(r, 200)) - const after = await evalWithRetry(() => ctx.app.evaluate(({ BrowserWindow }) => - BrowserWindow.getAllWindows().filter((w) => !w.isDestroyed()).length, - )) + const after = await evalWithRetry(() => + ctx.app.evaluate( + ({ BrowserWindow }) => BrowserWindow.getAllWindows().filter((w) => !w.isDestroyed()).length + ) + ) expect(after).toBe(1) }) -// --------------------------------------------------------------------------- -// Embedded popup WebContentsView regression coverage. These all live on the -// chooser host and use the same `EmbeddedPopupView`-shaped lifecycle that -// the upcoming P0.1 (titleTooltip) / P0.2 (systemModal) extractions need to -// preserve. -// --------------------------------------------------------------------------- - test('title popup + system modal webContents are pre-warmed on the chooser host @windows @macos @linux', async () => { - // Both popups are pre-warmed in `comfy-window:title-bar-ready` so the - // first user trigger doesn't pay the load cost. await waitForWebContents(ctx.app, 'comfyTitlePopup.html', 10_000) await waitForWebContents(ctx.app, 'comfySystemModal.html', 10_000) }) test('title popup opens, renders menu items, and closes via bridge @windows @macos @linux', async () => { - // Click the waffle menu — main pushes a config to the cached title popup - // and flips it visible. We assert the popup is no longer marked hidden - // by the EmbeddedPopupView contract (the WebContentsView's bounds become - // non-empty when shown). await openTitleMenu(ctx.titleBar) - await expect.poll( - () => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), - { timeout: 5_000, intervals: [100, 200] }, - ).toBe(true) + await expect + .poll(() => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(true) - // Renderer mounts an unordered menu list with at least one actionable item. const popupItems = await readPopupMenuItems(ctx.app, 'comfyTitlePopup.html') - expect(popupItems.length).toBeGreaterThan(0) - - // Close via the popup's own bridge — Escape on the title-bar webContents - // doesn't reach the popup (separate WebContentsView with its own DOM). - await evalWithRetry(() => ctx.app.evaluate(({ webContents }) => { - const wc = webContents.getAllWebContents().find((w) => w.getURL().includes('comfyTitlePopup.html')) - // The cached popup can be torn down between the visibility poll and this - // call; an absent webContents means it is already closed. - if (!wc) return - return wc.executeJavaScript(`(window).__comfyTitlePopup.close()`) - })) - await expect.poll( - () => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), - { timeout: 5_000, intervals: [100, 200] }, - ).toBe(false) + expect(popupItems).toEqual(['Open Dashboard', 'Desktop Settings', 'Close Window', 'Quit Desktop']) + + await evalWithRetry(() => + ctx.app.evaluate(({ webContents }) => { + const wc = webContents + .getAllWebContents() + .find((w) => w.getURL().includes('comfyTitlePopup.html')) + if (!wc) return + return wc.executeJavaScript(`(window).__comfyTitlePopup.close()`) + }) + ) + await expect + .poll(() => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(false) }) test('title popup reopens after a blur dismiss (menu-closed IPC clears the reopen guard) @windows @macos @linux', async () => { - // The previous test dismissed the popup via the close bridge — that - // stamps the title-bar's `menuClosedAt.menu` so a click within 100ms - // is suppressed by the time-based reopen guard. Wait past that - // window so the *first* open in this test isn't dropped. await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) - // Open the popup once normally. await openTitleMenu(ctx.titleBar) - await expect.poll( - () => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), - { timeout: 5_000, intervals: [100, 200] }, - ).toBe(true) - - // Dismiss via a blur on the popup webContents — the same path the - // OS exercises when the user clicks anywhere outside the popup. The - // EmbeddedPopupView primitive's `hideOnPopupBlur` listener is what - // handles this; without an `onHide` notify the title-bar renderer's - // `isMenuOpen` flag stayed stuck true and every subsequent click was - // routed to `dismissFileMenu` (a no-op since the popup is already - // hidden) instead of reopening. - // Deliberately not retried: a retry could emit 'blur' twice, and one blur - // must map to exactly one hide for the reopen-guard assertion below. + await expect + .poll(() => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(true) + await ctx.app.evaluate(({ webContents }) => { - const wc = webContents.getAllWebContents().find((w) => w.getURL().includes('comfyTitlePopup.html')) + const wc = webContents + .getAllWebContents() + .find((w) => w.getURL().includes('comfyTitlePopup.html')) if (!wc) throw new Error('title popup webContents missing') ;(wc as unknown as { emit: (event: string) => void }).emit('blur') }) - await expect.poll( - () => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), - { timeout: 5_000, intervals: [100, 200] }, - ).toBe(false) - - // Step past the title-bar's 100ms reopen-guard so the second click - // isn't suppressed by the time-based debounce — the bug under test - // is the *flag*-based guard (`isMenuOpen.value`), not the timer. + await expect + .poll(() => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(false) + await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) - // Reopen — must succeed, otherwise the title bar still thinks the - // menu is open and the click goes to the dismiss path. await openTitleMenu(ctx.titleBar) - await expect.poll( - () => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), - { timeout: 5_000, intervals: [100, 200] }, - ).toBe(true) + await expect + .poll(() => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(true) }) test('title-bar tooltip popup is created on demand and hides cleanly @windows @macos @linux', async () => { - // No webContents for the tooltip popup exists before the first show — - // unlike titlePopup / systemModal, the tooltip is NOT pre-warmed. expect(await findWebContentsId(ctx.app, 'comfyTitleTooltip.html')).toBeNull() - // Drive the bridge directly from the title-bar webContents so the test - // works on Windows too (the Vue `pointermove` handler short-circuits - // off-mac, so a hover-based test would only cover macOS). - await evalWithRetry(() => ctx.app.evaluate(({ webContents }) => { - const wc = webContents.getAllWebContents().find((w) => w.getURL().includes('comfyTitleBar.html')) - if (!wc) throw new Error('title-bar webContents missing') - return wc.executeJavaScript( - `(window).__comfyTitleBar.showTooltip({ text: 'e2e tooltip', leftX: 50, rightX: 200, bottomY: 30 })`, - ) - })) + await evalWithRetry(() => + ctx.app.evaluate(({ webContents }) => { + const wc = webContents + .getAllWebContents() + .find((w) => w.getURL().includes('comfyTitleBar.html')) + if (!wc) throw new Error('title-bar webContents missing') + return wc.executeJavaScript( + `(window).__comfyTitleBar.showTooltip({ text: 'e2e tooltip', leftX: 50, rightX: 200, bottomY: 30 })` + ) + }) + ) - // Tooltip popup webContents now exists. await waitForWebContents(ctx.app, 'comfyTitleTooltip.html', 5_000) - await expect.poll( - () => isPopupVisible(ctx.app, 'comfyTitleTooltip.html'), - { timeout: 5_000, intervals: [100, 200] }, - ).toBe(true) - - // Hide via the same bridge. - await evalWithRetry(() => ctx.app.evaluate(({ webContents }) => { - const wc = webContents.getAllWebContents().find((w) => w.getURL().includes('comfyTitleBar.html')) - if (!wc) throw new Error('title-bar webContents missing') - return wc.executeJavaScript(`(window).__comfyTitleBar.hideTooltip()`) - })) - - await expect.poll( - () => isPopupVisible(ctx.app, 'comfyTitleTooltip.html'), - { timeout: 5_000, intervals: [100, 200] }, - ).toBe(false) + await expect + .poll(() => isPopupVisible(ctx.app, 'comfyTitleTooltip.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(true) + + await evalWithRetry(() => + ctx.app.evaluate(({ webContents }) => { + const wc = webContents + .getAllWebContents() + .find((w) => w.getURL().includes('comfyTitleBar.html')) + if (!wc) throw new Error('title-bar webContents missing') + return wc.executeJavaScript(`(window).__comfyTitleBar.hideTooltip()`) + }) + ) + + await expect + .poll(() => isPopupVisible(ctx.app, 'comfyTitleTooltip.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(false) }) -/** Read the popup's currently-rendered menu item labels. */ async function readPopupMenuItems(app: ElectronApplication, marker: string): Promise { - return evalWithRetry(() => app.evaluate(({ webContents }, m) => { - const wc = webContents.getAllWebContents().find((w) => w.getURL().includes(m)) - if (!wc) throw new Error(`${m} webContents missing`) - return wc.executeJavaScript(`(() => { + return evalWithRetry(() => + app.evaluate(({ webContents }, m) => { + const wc = webContents.getAllWebContents().find((w) => w.getURL().includes(m)) + if (!wc) throw new Error(`${m} webContents missing`) + return wc.executeJavaScript(`(() => { const candidates = [ 'button.menu-item', '[role="menuitem"]', @@ -242,5 +225,6 @@ async function readPopupMenuItems(app: ElectronApplication, marker: string): Pro } return [] })()`) as Promise - }, marker)) + }, marker) + ) } diff --git a/e2e/comfybuilder-launch.test.ts b/e2e/comfybuilder-launch.test.ts index b68d7c74e..f41ee1659 100644 --- a/e2e/comfybuilder-launch.test.ts +++ b/e2e/comfybuilder-launch.test.ts @@ -1,28 +1,3 @@ -/** - * E2E: launching a ComfyBuilder build from the chooser. - * - * The renderer resolves launch ONLY from `get-list-actions` - * (`performChooserLaunch`), so a source plugin without `getListActions` - * hands it an empty array, which reads as "this install cannot launch" and - * bounces the tile click into the new-install wizard. This file pins the - * comfybuilder plugin's `getListActions` end-to-end: - * - * 1. an installed build tile launches (run-action `launch` plus the - * progress takeover) and never mounts the wizard; - * 2. clicking a not-ready one explains itself instead of bouncing there. - * - * The per-status action contract itself lives in the plugin unit test, which - * pins it without needing a seeded record. - * - * Tagged @windows @macos only: seeding install records does not work under the - * linux CI project (every other seeding test in this directory is lifecycle-only, - * and lifecycle is not in the CI matrix), so the tiles never render there. - * - * The seeded venv python exits immediately, so the launch is attempted and - * then fails at the boot wait. Attempted-vs-never-attempted is the whole - * discriminator here; a real ComfyUI boot is not. - */ - import os from 'node:os' import path from 'node:path' import { chmod, mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' @@ -33,8 +8,6 @@ import { clickInstallTile, expectChooserVisible } from './support/chooserHelpers import { getIpcInvocations, hasActiveLaunch, resetIpcInvocations } from './support/devHooks' import { byTestId, TID } from './support/testIds' -/** Both steps of the new-install wizard: the surface a missing launch action - * used to bounce the user into. */ const NEW_INSTALL_WIZARD = '.config-shell, .template-shell' interface BuildCase { @@ -51,10 +24,6 @@ const INSTALLED: BuildCase = { installPath: '' } -/** `failed` is the only not-installed status that renders a tile: - * `enrichInstallationsForRenderer` filters `installing` out. The per-status - * action contract is pinned deterministically by the plugin unit test; here we - * only cover what a user can actually click. */ const FAILED: BuildCase = { id: 'inst-comfybuilder-failed', name: 'desktop-4target-stg-v0192', @@ -67,7 +36,6 @@ let rootDir: string test.describe.configure({ mode: 'serial' }) -/** Mirrors what the build install handler writes for a real build install. */ function buildRecord(build: BuildCase): SeedInstallation { return { id: build.id, @@ -90,10 +58,6 @@ function buildRecord(build: BuildCase): SeedInstallation { } } -/** `buildLaunchSpec` returns null unless the venv interpreter and - * `ComfyUI/main.py` both exist, and a null launch command fails the launch - * before it is ever attempted. Written for every case so the disabled-action - * assertions prove the gate is the record status, not the disk. */ async function writeBuildLayout(installPath: string): Promise { await mkdir(path.join(installPath, 'ComfyUI'), { recursive: true }) await writeFile(path.join(installPath, 'ComfyUI', 'main.py'), '') @@ -104,8 +68,6 @@ async function writeBuildLayout(installPath: string): Promise { } await mkdir(path.join(installPath, 'venv', 'bin'), { recursive: true }) const python = path.join(installPath, 'venv', 'bin', 'python3') - // Exits straight away so the attempted launch dies at the boot wait rather - // than leaking a background process. await writeFile(python, '#!/bin/sh\nexit 1\n') await chmod(python, 0o755) } @@ -134,9 +96,6 @@ test('clicking an installed ComfyBuilder tile launches it instead of opening the await resetIpcInvocations(ctx.app) await clickInstallTile(ctx.panel, INSTALLED.name) - // The whole chain (tile pick -> get-list-actions -> useListAction -> - // show-progress -> run-action) ends here; with no launch action in the - // list it never starts and the wizard takes over instead. await expect .poll( async () => { @@ -153,10 +112,6 @@ test('clicking an installed ComfyBuilder tile launches it instead of opening the await ctx.panel.waitForVisible('.brand-progress', { timeout: 10_000 }) expect(await ctx.panel.exists(NEW_INSTALL_WIZARD)).toBe(false) - // The seeded interpreter dies at the boot wait, so the launch is still in - // flight when the assertions above pass. Wait for the launch handler to - // settle and dismiss its failure surface, so the serial next test starts - // from an idle chooser instead of racing this launch's terminal UI. await expect .poll(() => hasActiveLaunch(ctx.app, INSTALLED.id), { timeout: 30_000, @@ -164,17 +119,13 @@ test('clicking an installed ComfyBuilder tile launches it instead of opening the }) .toBe(false) await ctx.panel.waitForVisible(byTestId(TID.progressErrorMessage), { timeout: 10_000 }) - // Back (the ghost button; Reboot is the primary) returns to the chooser - // without a confirm for a finished op. - expect(await ctx.panel.click('.brand-progress__error-actions .brand-ghost')).toBe(true) + expect(await ctx.panel.click(byTestId(TID.progressBack))).toBe(true) await expectChooserVisible(ctx.panel) }) test('clicking a not-ready ComfyBuilder tile explains itself instead of opening the new-install wizard @windows @macos', async () => { await clickInstallTile(ctx.panel, FAILED.name) - // `useListAction` short-circuits a disabled action into an alert, so the - // user is told why nothing launched rather than being handed a wizard. await ctx.panel.waitForVisible(byTestId(TID.baseAlertAction), { timeout: 10_000 }) expect(await ctx.panel.textOf('.base-alert-message-text')).toContain(en.errors.installNotReady) expect(await ctx.panel.exists(NEW_INSTALL_WIZARD)).toBe(false) diff --git a/e2e/comfybuilder-models.test.ts b/e2e/comfybuilder-models.test.ts index 342316fd5..c15d4cfba 100644 --- a/e2e/comfybuilder-models.test.ts +++ b/e2e/comfybuilder-models.test.ts @@ -1,18 +1,3 @@ -/** - * E2E: staging a Build's models in the real app. - * - * A Build archive carries no model weights, so the comfybuilder install - * downloads the version's declared models into `/ComfyUI/models/ - * /` before launch. This drives the REAL staging code (real - * Electron download, real fs, real sha256) in the real main process, decoupled - * from the archive/auth path via the E2E hook, and serves the model bytes from a - * local HTTP server so the run is hermetic and deterministic. - * - * The manifest source is the `COMFY_BUILDER_MODELS_MANIFEST` env seam (a file the - * test rewrites per case), which is exactly how the mocked manifest is injected - * until the builder endpoint is deployed. - */ - import { createHash } from 'node:crypto' import { createServer, type Server } from 'node:http' import { mkdtempSync, rmSync, mkdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs' @@ -23,7 +8,6 @@ import { launchApp, type AppContext } from './launchApp' const sha = (b: Buffer): string => createHash('sha256').update(b).digest('hex') -// Two deterministic "model" payloads served locally. const DECODER = Buffer.from('taesd-decoder-bytes-fixture') const ENCODER = Buffer.from('taesd-encoder-bytes-fixture') @@ -40,13 +24,9 @@ function freshInstall(): string { return dir } -/** Ask the app to run the real staging against installPath, reading the manifest - * from the env-pointed file the test controls. */ async function stage( installPath: string ): Promise<{ staged?: string[]; error?: string; kind?: string }> { - // Deliberately not retried: staging mutates the install's model tree, so a - // retry after a lost result could run the real staging twice. return ctx.app.evaluate( async (_electron, arg) => { const helpers = ( @@ -125,7 +105,6 @@ test('stages verified models into ComfyUI/models// @windows @mac expect(existsSync(decoder)).toBe(true) expect(readFileSync(decoder)).toEqual(DECODER) expect(existsSync(encoder)).toBe(true) - // No leftover partials. expect(existsSync(`${decoder}.partial`)).toBe(false) }) diff --git a/e2e/copy-update-destination.test.ts b/e2e/copy-update-destination.test.ts index dc7c12635..517c24324 100644 --- a/e2e/copy-update-destination.test.ts +++ b/e2e/copy-update-destination.test.ts @@ -1,33 +1,10 @@ -/** - * Copy / copy-update destination focus (issue #582 FLOW 2). - * - * `handleCopy` / `handleCopyUpdate` / `handleReleaseUpdate` now return - * `{ ok: true, navigate: 'list', newInstallationId }` and - * `ProgressModal.handleDone` reads `newInstallationId` to call - * `window.api.openInstallWindow(newInstallationId)` — opening the - * newly-created destination install in its own window without - * swapping the source host. - * - * Test strategy: drive the panel's existing show-progress chain with - * a synthetic apiCall that resolves to a success payload carrying - * `newInstallationId`. The actual copy handler is bypassed (it's covered - * by integration tests + the field is populated unconditionally on - * the success path of all three handlers); this exercises the - * renderer-side handleDone branch + the main-side - * `open-install-window` IPC + the focus-existing-or-open-new - * behaviour. - */ - import os from 'node:os' import path from 'node:path' import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' import { test, expect } from '@playwright/test' import { launchApp, type AppContext } from './launchApp' import { expectChooserVisible } from './support/chooserHelpers' -import { - getIpcInvocations, - resetIpcInvocations, -} from './support/devHooks' +import { getIpcInvocations, resetIpcInvocations } from './support/devHooks' let ctx: AppContext let sourcePath: string @@ -52,9 +29,9 @@ test.beforeAll(async () => { name: SOURCE_NAME, installPath: sourcePath, sourceId: 'standalone', - status: 'installed', - }, - ], + status: 'installed' + } + ] }) await expectChooserVisible(ctx.panel) }) @@ -69,44 +46,36 @@ test.beforeEach(async () => { }) test('Copy success opens the destination install in a new window @windows @macos @linux', async () => { - // Drive ProgressModal with a synthetic copy result carrying the - // destination install id. The renderer's `handleDone` consumes - // `op.result.newInstallationId` and calls `openInstallWindow`. await ctx.panel.evaluate( `window.__e2eRenderer.injectProgressSuccess({ installationId: ${JSON.stringify(SOURCE_ID)}, title: 'Copy — ' + ${JSON.stringify(SOURCE_NAME)}, newInstallationId: ${JSON.stringify(DEST_ID)}, - })`, + })` ) - // The brand loader auto-closes 700ms after `finished`, then - // handleDone fires. Poll the recorded IPC invocations. await expect .poll(async () => (await getIpcInvocations(ctx.app, 'open-install-window')).length, { timeout: 5_000, - intervals: [100, 250], + intervals: [100, 250] }) .toBeGreaterThanOrEqual(1) - const calls = await getIpcInvocations(ctx.app, 'open-install-window') as - { installationId?: string }[] + const calls = (await getIpcInvocations(ctx.app, 'open-install-window')) as { + installationId?: string + }[] expect(calls.length).toBe(1) expect(calls[0]?.installationId).toBe(DEST_ID) }) test('No newInstallationId → no open-install-window call @windows @macos @linux', async () => { - // Same shape but no newInstallationId — should NOT trigger - // openInstallWindow. Guards the conditional branch in handleDone - // against accidentally firing for non-copy success paths. await ctx.panel.evaluate( `window.__e2eRenderer.injectProgressSuccess({ installationId: ${JSON.stringify(SOURCE_ID)}, title: 'Other op — ' + ${JSON.stringify(SOURCE_NAME)}, - })`, + })` ) - // Wait for handleDone's auto-close window to elapse (≥700ms). await new Promise((r) => setTimeout(r, 1_500)) const calls = await getIpcInvocations(ctx.app, 'open-install-window') diff --git a/e2e/core-beta-args-pill-commit.test.ts b/e2e/core-beta-args-pill-commit.test.ts index e77770320..3eb57a291 100644 --- a/e2e/core-beta-args-pill-commit.test.ts +++ b/e2e/core-beta-args-pill-commit.test.ts @@ -1,14 +1,3 @@ -/** - * Beta-args pill for a STOPPED install whose grant is a Core commit range. - * - * The next launch runs the checkout's current HEAD, so the preview proves the range against it - * with read-only git, before any launch has happened. The fixture's ComfyUI dir is a real git - * repository the spec moves and then damages: a HEAD below the range, and an object store git - * cannot read, must both hide the grant without disturbing the rest of the settings view. - * - * Linux-only: `writeFakeComfyInstall` builds a shell-script interpreter. - */ - import os from 'node:os' import path from 'node:path' import { execFileSync } from 'node:child_process' @@ -21,10 +10,14 @@ import { titlePopupPage, TITLE_REOPEN_SUPPRESSION_MS, waitForWebContents, - type WebContentsPage, + type WebContentsPage } from './support/cdpPages' import { getIpcInvocations, resetIpcInvocations } from './support/devHooks' -import { opsFlagsGrantSeed, reserveFreePort, writeFakeComfyInstall } from './support/fakeComfyInstall' +import { + opsFlagsGrantSeed, + reserveFreePort, + writeFakeComfyInstall +} from './support/fakeComfyInstall' import { byTestId, TID } from './support/testIds' test.describe.configure({ mode: 'serial' }) @@ -40,7 +33,6 @@ let repo: string const sha: Record = {} let previousPosthogHost: string | undefined -/** Git variables a test run can inherit (from a hook, say) that would point git at another repo. */ const INHERITED_GIT_STATE = [ 'GIT_DIR', 'GIT_WORK_TREE', @@ -65,8 +57,8 @@ function git(...args: string[]): string { GIT_COMMITTER_NAME: 't', GIT_COMMITTER_EMAIL: 't@example.com', GIT_CONFIG_NOSYSTEM: '1', - GIT_CONFIG_GLOBAL: os.devNull, - }, + GIT_CONFIG_GLOBAL: os.devNull + } }).trim() } @@ -76,7 +68,6 @@ function commit(message: string): string { } test.beforeAll(async () => { - // Launching the app can run well past the 45s default on a loaded machine. test.setTimeout(120_000) previousPosthogHost = process.env['POSTHOG_HOST'] process.env['POSTHOG_HOST'] = UNREACHABLE_POSTHOG_HOST @@ -93,7 +84,7 @@ test.beforeAll(async () => { firstUseCompleted: true, telemetryEnabled: true, betaFeaturesEnabled: true, - hasSeenCentralPillHint: true, + hasSeenCentralPillHint: true }, installations: [ { @@ -105,14 +96,19 @@ test.beforeAll(async () => { status: 'installed', launchArgs: `--port ${port}`, seen: true, - comfyVersion: { commit: sha.head, baseTag: 'v0.3.99', commitsAhead: 0, baseTagVerified: true }, - }, + comfyVersion: { + commit: sha.head, + baseTag: 'v0.3.99', + commitsAhead: 0, + baseTagVerified: true + } + } ], opsFlags: opsFlagsGrantSeed({ arg: '--enable-asset-hashing', commitRanges: [[sha.fix!, null]], - description: 'Asset hashing', - }), + description: 'Asset hashing' + }) }) await expectChooserVisible(ctx.panel) }) @@ -128,7 +124,7 @@ async function openStartupArgs(): Promise { await closeTitlePopupIfOpen(ctx.app) await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) await ctx.panel.evaluate( - `window.api.openInstancePicker({ installationId: ${JSON.stringify(INSTALL_ID)}, initialTab: 'config' })`, + `window.api.openInstancePicker({ installationId: ${JSON.stringify(INSTALL_ID)}, initialTab: 'config' })` ) await waitForWebContents(ctx.app, 'comfyTitlePopup.html') const popup = titlePopupPage(ctx.app) @@ -139,26 +135,19 @@ async function openStartupArgs(): Promise { const pillLabel = (popup: WebContentsPage): Promise => popup.evaluate( - `document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null`, + `document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null` ) -/** Open with the request count reset, so absence can be read against this open's own answers. */ async function openCounted(): Promise { await resetIpcInvocations(ctx.app, 'get-core-beta-args') return openStartupArgs() } -/** - * The pill renders nothing both before its answer and for an empty one, so absence only means - * something once the answers are in. A fresh open asks twice (on mount, and again once the args - * field's schema load settles), so wait for both, then require no pill and no loading placeholder - * for long enough that a late answer would have shown. - */ async function expectAnsweredWithNoPill(popup: WebContentsPage, message: string): Promise { await expect .poll(async () => (await getIpcInvocations(ctx.app, 'get-core-beta-args')).length, { timeout: 15_000, - intervals: [100, 200], + intervals: [100, 200] }) .toBeGreaterThanOrEqual(2) const deadline = Date.now() + 2_000 @@ -185,7 +174,6 @@ test('moving HEAD below the range hides it @linux', async () => { }) test('an object store git cannot read hides the grant, and the settings view still loads @linux', async () => { - // Point HEAD at a commit no earlier open has proven, so nothing cached can answer for it. sha.next = commit('next') const objects = path.join(repo, '.git', 'objects') for (const entry of await readdir(objects)) { diff --git a/e2e/core-beta-args-pill-restart.test.ts b/e2e/core-beta-args-pill-restart.test.ts index 062660b79..8157d7f07 100644 --- a/e2e/core-beta-args-pill-restart.test.ts +++ b/e2e/core-beta-args-pill-restart.test.ts @@ -1,27 +1,22 @@ -/** - * Beta-args pill across a Restart from the instance picker. - * - * A restart replaces the session, but the picker that issued it is hidden for the restart and gets no - * snapshots meanwhile, so on reopen it sees one running -> running change. The pill is session-derived, so it must follow the new session: - * here the user adds the granted arg themselves, which overrides the grant, and after the restart - * the pill must be gone. (It went stale before the picker snapshot carried session identity.) - * - * Real launch of a fake install (Linux-only `writeFakeComfyInstall`), so the grant is recorded by - * the launch itself rather than seeded. - */ - import os from 'node:os' import path from 'node:path' import { mkdtemp, rm } from 'node:fs/promises' import { expect, test } from '@playwright/test' import { launchApp, type AppContext } from './launchApp' -import { clickInstallTile, expectChooserVisible, openPickerViaTitlePill } from './support/chooserHelpers' +import { + clickInstallTile, + expectChooserVisible, + openPickerViaTitlePill +} from './support/chooserHelpers' import { closeTitlePopupIfOpen, isPopupVisible, type WebContentsPage } from './support/cdpPages' import { getRunningSessionSnapshot } from './support/devHooks' -import { opsFlagsGrantSeed, reserveFreePort, writeFakeComfyInstall } from './support/fakeComfyInstall' +import { + opsFlagsGrantSeed, + reserveFreePort, + writeFakeComfyInstall +} from './support/fakeComfyInstall' import { byTestId, TID } from './support/testIds' -// Two real launches do not fit the default budget. test.describe.configure({ mode: 'serial', timeout: 240_000 }) const INSTALL_ID = 'inst-beta-args-restart' @@ -37,7 +32,6 @@ let port: number let previousPosthogHost: string | undefined test.beforeAll(async () => { - // Launching the app can run well past the 45s default on a loaded machine. test.setTimeout(120_000) previousPosthogHost = process.env['POSTHOG_HOST'] process.env['POSTHOG_HOST'] = UNREACHABLE_POSTHOG_HOST @@ -49,7 +43,7 @@ test.beforeAll(async () => { firstUseCompleted: true, telemetryEnabled: true, betaFeaturesEnabled: true, - hasSeenCentralPillHint: true, + hasSeenCentralPillHint: true }, installations: [ { @@ -67,11 +61,15 @@ test.beforeAll(async () => { commit: 'b1c2d3e4f5a6b1c2d3e4f5a6b1c2d3e4f5a6b1c2', baseTag: 'v0.3.99', commitsAhead: 0, - baseTagVerified: true, - }, - }, + baseTagVerified: true + } + } ], - opsFlags: opsFlagsGrantSeed({ arg: '--enable-asset-hashing', minCoreVersion: '0.3.80', description: 'Asset hashing' }), + opsFlags: opsFlagsGrantSeed({ + arg: '--enable-asset-hashing', + minCoreVersion: '0.3.80', + description: 'Asset hashing' + }) }) await expectChooserVisible(ctx.panel) }) @@ -92,7 +90,7 @@ async function openStartupArgs(): Promise { const pillLabel = (popup: WebContentsPage): Promise => popup.evaluate( - `document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null`, + `document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null` ) test('the pill follows the new session after a Restart that drops a grant @linux', async () => { @@ -101,7 +99,7 @@ test('the pill follows the new session after a Restart that drops a grant @linux await expect .poll(async () => (before = await getRunningSessionSnapshot(ctx.app, INSTALL_ID)), { timeout: 90_000, - intervals: [500, 1_000], + intervals: [500, 1_000] }) .not.toBeNull() @@ -109,28 +107,31 @@ test('the pill follows the new session after a Restart that drops a grant @linux await popup.waitForVisible(PILL, { timeout: 15_000 }) expect(await pillLabel(popup)).toBe('1 beta argument added for this session, show details') - // The user passes the granted arg themselves, which overrides the grant for the next launch. await popup.evaluate( `(() => { const input = document.querySelector(${JSON.stringify(`${ARGS_FIELD} input`)}) input.value = ${JSON.stringify(`--port ${port} --enable-asset-hashing`)} input.dispatchEvent(new Event('input', { bubbles: true })) input.dispatchEvent(new Event('change', { bubbles: true })) - })()`, + })()` ) - // The edit has landed once the field asks for a restart; the pill still shows the running - // session's grant, which the edit cannot take back before the restart. await popup.waitForVisible(RESTART_TAG, { timeout: 10_000 }) expect(await pillLabel(popup)).toBe('1 beta argument added for this session, show details') await expect - .poll(() => popup.textOf(byTestId(TID.pickerPrimaryCta)), { timeout: 10_000, intervals: [200, 400] }) + .poll(() => popup.textOf(byTestId(TID.pickerPrimaryCta)), { + timeout: 10_000, + intervals: [200, 400] + }) .toContain('Restart') expect(await popup.click(byTestId(TID.pickerPrimaryCta))).toBe(true) await popup.waitForVisible(byTestId(TID.baseAlertAction), { timeout: 10_000 }) expect(await popup.click(byTestId(TID.baseAlertAction))).toBe(true) await expect - .poll(() => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), { timeout: 10_000, intervals: [100, 200] }) + .poll(() => isPopupVisible(ctx.app, 'comfyTitlePopup.html'), { + timeout: 10_000, + intervals: [100, 200] + }) .toBe(false) await expect @@ -139,18 +140,17 @@ test('the pill follows the new session after a Restart that drops a grant @linux const after = await getRunningSessionSnapshot(ctx.app, INSTALL_ID) return (after?.startedAt ?? 0) > (before?.startedAt ?? 0) }, - { timeout: 120_000, intervals: [500, 1_000] }, + { timeout: 120_000, intervals: [500, 1_000] } ) .toBe(true) popup = await openStartupArgs() await popup.waitFor(async () => (await pillLabel(popup)) === null, { timeout: 10_000, - message: "the pill still showed the previous session's grant after the restart", + message: "the pill still showed the previous session's grant after the restart" }) - // The new session consumed the edit, so nothing is pending any more. await popup.waitFor(async () => !(await popup.exists(RESTART_TAG)), { timeout: 10_000, - message: '"Restart to apply" was still shown after the restart', + message: '"Restart to apply" was still shown after the restart' }) }) diff --git a/e2e/core-beta-args-pill-stopped.test.ts b/e2e/core-beta-args-pill-stopped.test.ts index efffb5742..da68796cf 100644 --- a/e2e/core-beta-args-pill-stopped.test.ts +++ b/e2e/core-beta-args-pill-stopped.test.ts @@ -1,18 +1,3 @@ -/** - * Beta-args pill for a STOPPED install — instance-picker Settings › Startup Args. - * - * While stopped, the pill shows the grants the install is eligible for at its next launch. Main decides - * them with the launch's own pure function, fed only inputs it can read without side effects: the - * seeded grant payload, the record's Core version, the user's args, and the args schema the - * settings view itself discovers (the fake install answers `--help`). The pill therefore appears - * only once that discovery has cached the schema, after which the pill asks again. - * - * The pill asks for its data itself, so the last case also pins what does NOT ask: a settings - * edit to another field, and the sections re-read it triggers. - * - * Linux-only: `writeFakeComfyInstall` builds a shell-script interpreter. - */ - import os from 'node:os' import path from 'node:path' import { mkdtemp, rm } from 'node:fs/promises' @@ -24,9 +9,13 @@ import { titlePopupPage, TITLE_REOPEN_SUPPRESSION_MS, waitForWebContents, - type WebContentsPage, + type WebContentsPage } from './support/cdpPages' -import { opsFlagsGrantSeed, reserveFreePort, writeFakeComfyInstall } from './support/fakeComfyInstall' +import { + opsFlagsGrantSeed, + reserveFreePort, + writeFakeComfyInstall +} from './support/fakeComfyInstall' import { byTestId, TID } from './support/testIds' import { getIpcInvocations, resetIpcInvocations } from './support/devHooks' @@ -35,11 +24,9 @@ test.describe.configure({ mode: 'serial' }) const INSTALL_ID = 'inst-beta-args-stopped' const ARGS_FIELD = '[data-field-id="launchArgs"]' const PILL = `${ARGS_FIELD} .beta-args button` -/** Teleported to , so not under the field. */ const MENU = '.beta-args-menu' const MANAGE = `${MENU} .ui-menu-item:not([aria-disabled])` const BETA_SWITCH = '.global-settings [data-field-id="betaFeaturesEnabled"] button[role="switch"]' -/** Keeps telemetry (needed so the opt-in can be turned back on) from leaving the machine. */ const UNREACHABLE_POSTHOG_HOST = 'http://127.0.0.1:1' let ctx: AppContext @@ -48,7 +35,6 @@ let port: number let previousPosthogHost: string | undefined test.beforeAll(async () => { - // Launching the app can run well past the 45s default on a loaded machine. test.setTimeout(120_000) previousPosthogHost = process.env['POSTHOG_HOST'] process.env['POSTHOG_HOST'] = UNREACHABLE_POSTHOG_HOST @@ -60,7 +46,7 @@ test.beforeAll(async () => { firstUseCompleted: true, telemetryEnabled: true, betaFeaturesEnabled: true, - hasSeenCentralPillHint: true, + hasSeenCentralPillHint: true }, installations: [ { @@ -76,15 +62,15 @@ test.beforeAll(async () => { commit: 'b1c2d3e4f5a6b1c2d3e4f5a6b1c2d3e4f5a6b1c2', baseTag: 'v0.3.99', commitsAhead: 0, - baseTagVerified: true, - }, - }, + baseTagVerified: true + } + } ], opsFlags: opsFlagsGrantSeed({ arg: '--enable-asset-hashing', minCoreVersion: '0.3.80', - description: 'Asset hashing', - }), + description: 'Asset hashing' + }) }) await expectChooserVisible(ctx.panel) }) @@ -100,7 +86,7 @@ async function openStartupArgs(): Promise { await closeTitlePopupIfOpen(ctx.app) await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) await ctx.panel.evaluate( - `window.api.openInstancePicker({ installationId: ${JSON.stringify(INSTALL_ID)}, initialTab: 'config' })`, + `window.api.openInstancePicker({ installationId: ${JSON.stringify(INSTALL_ID)}, initialTab: 'config' })` ) await waitForWebContents(ctx.app, 'comfyTitlePopup.html') const popup = titlePopupPage(ctx.app) @@ -111,28 +97,23 @@ async function openStartupArgs(): Promise { async function pillAriaLabel(popup: WebContentsPage): Promise { return popup.evaluate( - `document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null`, + `document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null` ) } -/** Absence is a real answer only against a fresh sections read. Every caller reaches here from the - * Desktop Settings popup kind, which unmounts the picker, so the args field `openStartupArgs` waited - * for was rendered from this open's own response. The schema is already cached by then, so no - * discovery-driven re-read is still coming either. */ async function expectNoPill(popup: WebContentsPage): Promise { expect(await pillAriaLabel(popup)).toBeNull() } test('shows the grants the next launch is eligible for @linux', async () => { const popup = await openStartupArgs() - // First open: the field's own schema discovery fills the cache, then the pill asks again. await popup.waitForVisible(PILL, { timeout: 15_000 }) expect(await pillAriaLabel(popup)).toBe( - '1 beta argument eligible for the next launch, show details', + '1 beta argument eligible for the next launch, show details' ) await popup.clickUntilVisible(PILL, MENU, { timeout: 10_000 }) const text = await popup.evaluate( - `document.querySelector(${JSON.stringify(MENU)}).textContent`, + `document.querySelector(${JSON.stringify(MENU)}).textContent` ) expect(text).toContain('Eligible for next launch') expect(text).toContain('--enable-asset-hashing') @@ -147,7 +128,7 @@ test('turning the beta opt-in off removes the pill on the next open, and on rest await popup.waitForVisible(BETA_SWITCH, { timeout: 10_000 }) const checked = (): Promise => popup.evaluate( - `document.querySelector(${JSON.stringify(BETA_SWITCH)})?.getAttribute('aria-checked') ?? null`, + `document.querySelector(${JSON.stringify(BETA_SWITCH)})?.getAttribute('aria-checked') ?? null` ) expect(await checked()).toBe('true') expect(await popup.click(BETA_SWITCH)).toBe(true) @@ -159,7 +140,7 @@ test('turning the beta opt-in off removes the pill on the next open, and on rest await closeTitlePopupIfOpen(ctx.app) await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) await ctx.panel.evaluate( - `window.api.openGlobalSettings('general', { highlightField: 'betaFeaturesEnabled' })`, + `window.api.openGlobalSettings('general', { highlightField: 'betaFeaturesEnabled' })` ) await waitForWebContents(ctx.app, 'comfyTitlePopup.html') popup = titlePopupPage(ctx.app) @@ -174,14 +155,13 @@ test('turning the beta opt-in off removes the pill on the next open, and on rest test('an opt-in change made while the picker is hidden shows on reopen @linux', async () => { let popup = await openStartupArgs() await popup.waitForVisible(PILL, { timeout: 10_000 }) - // Hidden, not swapped: the cached picker keeps its sections, which is what could go stale. await closeTitlePopupIfOpen(ctx.app) await ctx.panel.evaluate(`window.api.setSetting('betaFeaturesEnabled', false)`) popup = await openStartupArgs() await popup.waitFor(async () => (await pillAriaLabel(popup)) === null, { timeout: 10_000, - message: 'the pill survived an opt-out made while the picker was hidden', + message: 'the pill survived an opt-out made while the picker was hidden' }) await closeTitlePopupIfOpen(ctx.app) @@ -193,7 +173,6 @@ test('an opt-in change made while the picker is hidden shows on reopen @linux', const betaArgsRequests = async (): Promise => (await getIpcInvocations(ctx.app, 'get-core-beta-args')).length -/** Commit a new args value through the input's own change event, as a blur would. */ async function commitArgs(popup: WebContentsPage, value: string): Promise { await popup.evaluate( `(() => { @@ -201,26 +180,24 @@ async function commitArgs(popup: WebContentsPage, value: string): Promise input.value = ${JSON.stringify(value)} input.dispatchEvent(new Event('input', { bubbles: true })) input.dispatchEvent(new Event('change', { bubbles: true })) - })()`, + })()` ) } -test('only the pill asks: another field\'s save asks nothing, an args commit asks once @linux', async () => { +test("only the pill asks: another field's save asks nothing, an args commit asks once @linux", async () => { const popup = await openStartupArgs() await popup.waitForVisible(PILL, { timeout: 10_000 }) await resetIpcInvocations(ctx.app, 'get-core-beta-args') - // Save an unrelated field through the settings UI, and wait until main has stored it. const PORT_CONFLICT = '[data-field-id="portConflict"] .ui-select-trigger' - const OTHER_OPTION = '.ui-select-listbox [role="option"]:not([data-selected])' + const OTHER_OPTION = '.ui-select-listbox [role="option"]:not([data-state="checked"])' await popup.clickUntilVisible(PORT_CONFLICT, OTHER_OPTION, { timeout: 10_000 }) expect(await popup.click(OTHER_OPTION)).toBe(true) const stored = (): Promise => ctx.panel.evaluate( - `window.api.getInstallations().then((all) => all.find((i) => i.id === ${JSON.stringify(INSTALL_ID)})?.portConflict ?? null)`, + `window.api.getInstallations().then((all) => all.find((i) => i.id === ${JSON.stringify(INSTALL_ID)})?.portConflict ?? null)` ) await expect.poll(stored, { timeout: 10_000, intervals: [100, 200] }).not.toBeNull() - // The view re-reads its sections after a save; give that re-read time to land, then count. await expect.poll(() => popup.exists(PILL), { timeout: 5_000 }).toBe(true) expect(await betaArgsRequests(), 'a save of another field asked for beta args').toBe(0) @@ -233,17 +210,16 @@ test('only the pill asks: another field\'s save asks nothing, an args commit ask test("adding the grant's opposite to the startup args removes it @linux", async () => { const popup = await openStartupArgs() await popup.waitForVisible(PILL, { timeout: 10_000 }) - // Commit through the input's own change event, as a blur would. await popup.evaluate( `(() => { const input = document.querySelector(${JSON.stringify(`${ARGS_FIELD} input`)}) input.value = ${JSON.stringify(`--port ${port} --disable-asset-hashing`)} input.dispatchEvent(new Event('input', { bubbles: true })) input.dispatchEvent(new Event('change', { bubbles: true })) - })()`, + })()` ) await popup.waitFor(async () => (await pillAriaLabel(popup)) === null, { timeout: 10_000, - message: 'the overridden grant was still shown after the args were committed', + message: 'the overridden grant was still shown after the args were committed' }) }) diff --git a/e2e/core-beta-args-pill.test.ts b/e2e/core-beta-args-pill.test.ts index f794337b2..f0bcea472 100644 --- a/e2e/core-beta-args-pill.test.ts +++ b/e2e/core-beta-args-pill.test.ts @@ -1,19 +1,3 @@ -/** - * Beta-args pill — instance-picker Settings › Startup Args. - * - * While an install runs, the Core beta grants on its command line are shown as a read-only - * "+N beta" pill after the user's own args. The grants live on the main-process session record, - * the pill asks for them itself (`get-core-beta-args`), and its "Manage beta features" swaps the - * popup to Global Settings on the beta opt-in row. - * - * The session is seeded (`seedRunningSession` with `coreBetaArgs`) rather than launched: a real - * launch needs a ComfyUI to spawn. That makes the seeded link — launch recording the applied - * grants on the session — the one seam this spec does not cover; the launch unit tests - * (`launch.test.ts`, "session record of the applied grants") pin it against a real - * `handleLaunch`. Seeding happens before the picker opens because the seed, unlike a real - * launch, does not emit the session-lifecycle change the picker refreshes on. - */ - import os from 'node:os' import path from 'node:path' import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' @@ -25,7 +9,7 @@ import { titlePopupPage, TITLE_REOPEN_SUPPRESSION_MS, waitForWebContents, - type WebContentsPage, + type WebContentsPage } from './support/cdpPages' import { clearRunningSessions, seedRunningSession } from './support/devHooks' import { byTestId, TID } from './support/testIds' @@ -38,7 +22,6 @@ const MARKER_FILENAME = '.comfyui-desktop-2' const ARGS_FIELD = '[data-field-id="launchArgs"]' const PILL = `${ARGS_FIELD} .beta-args button` -/** Teleported to , so not under the field. */ const MENU = '.beta-args-menu' const MANAGE = `${MENU} .ui-menu-item:not([aria-disabled])` @@ -46,7 +29,6 @@ let ctx: AppContext let installPath: string test.beforeAll(async () => { - // Launching the app can run well past the 45s default on a loaded machine. test.setTimeout(120_000) installPath = await mkdtemp(path.join(os.tmpdir(), 'comfyui-launcher-beta-args-e2e-')) await mkdir(installPath, { recursive: true }) @@ -59,9 +41,9 @@ test.beforeAll(async () => { name: INSTALL_NAME, installPath, sourceId: 'standalone', - status: 'installed', - }, - ], + status: 'installed' + } + ] }) await expectChooserVisible(ctx.panel) }) @@ -72,7 +54,6 @@ test.afterAll(async () => { if (installPath) await rm(installPath, { recursive: true, force: true }) }) -/** Open the picker on the install's Startup Args and wait until its args field has rendered. */ async function openStartupArgs(): Promise { await closeTitlePopupIfOpen(ctx.app) await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) @@ -80,7 +61,7 @@ async function openStartupArgs(): Promise { `(() => { window.api.openInstancePicker({ installationId: ${JSON.stringify(INSTALL_ID)}, initialTab: 'config' }) return true - })()`, + })()` ) expect(opened).toBe(true) await waitForWebContents(ctx.app, 'comfyTitlePopup.html') @@ -90,14 +71,10 @@ async function openStartupArgs(): Promise { return popup } -// This fixture has no interpreter, so the settings view's schema discovery fails and the next-launch -// preview (which only reads a cached schema) cannot be computed: the pill must stay away rather than -// guess. The predictable stopped case is `core-beta-args-pill-stopped.test.ts`. test('a stopped install whose next launch cannot be predicted shows no beta pill @windows @macos @linux', async () => { const popup = await openStartupArgs() - // The args field is on screen (waited above), so the pill's absence is a real answer. expect(await popup.evaluate(`!!document.querySelector(${JSON.stringify(PILL)})`)).toBe( - false, + false ) }) @@ -107,8 +84,8 @@ test('a running install shows its grants and links to the beta opt-in @windows @ installationName: INSTALL_NAME, coreBetaArgs: [ { arg: '--enable-agent', name: 'Agent' }, - { arg: '--enable-asset-hashing', name: null }, - ], + { arg: '--enable-asset-hashing', name: null } + ] }) const popup = await openStartupArgs() @@ -117,7 +94,7 @@ test('a running install shows its grants and links to the beta opt-in @windows @ `(() => { const el = document.querySelector(${JSON.stringify(PILL)}) return { text: (el.textContent || '').trim(), expanded: el.getAttribute('aria-expanded') } - })()`, + })()` ) expect(pill).toEqual({ text: '+2 beta', expanded: 'false' }) @@ -127,15 +104,13 @@ test('a running install shows its grants and links to the beta opt-in @windows @ .map((row) => [ row.querySelector('.ui-menu-item-label').textContent.trim(), row.querySelector('.ui-menu-item-detail').textContent.trim(), - ])`, + ])` ) expect(rows).toEqual([ ['--enable-agent', 'Agent'], - ['--enable-asset-hashing', 'Beta feature'], + ['--enable-asset-hashing', 'Beta feature'] ]) - // The flash lasts ~2s, so record it as it happens rather than polling for it afterwards. The - // popup swaps kind in place (same WebContents), so the observer survives the switch. await popup.evaluate( `(() => { window.__betaRowFlashed = false @@ -144,15 +119,15 @@ test('a running install shows its grants and links to the beta opt-in @windows @ window.__betaRowFlashed = true } }).observe(document.body, { subtree: true, childList: true, attributes: true, attributeFilter: ['class'] }) - })()`, + })()` ) expect(await popup.click(MANAGE)).toBe(true) await popup.waitForVisible('.global-settings [data-field-id="betaFeaturesEnabled"]', { - timeout: 10_000, + timeout: 10_000 }) await popup.waitFor( async () => (await popup.evaluate('window.__betaRowFlashed === true')) === true, - { timeout: 5_000, message: 'the beta opt-in row was never flashed' }, + { timeout: 5_000, message: 'the beta opt-in row was never flashed' } ) }) diff --git a/e2e/core-beta-optin.test.ts b/e2e/core-beta-optin.test.ts index 6a9ccc449..008af7f66 100644 --- a/e2e/core-beta-optin.test.ts +++ b/e2e/core-beta-optin.test.ts @@ -1,19 +1,3 @@ -/** - * Beta-features opt-in consent gate — title-popup Global Settings. - * - * The opt-in is one-way gated: turning it ON requires explicit telemetry - * consent, turning it OFF never does. The gate is derived renderer-side in - * `GlobalSettingsView.vue` (`turnOnDisabled: !snapshot.telemetryGranted`) and - * rendered by `BooleanToggle.vue`, which keys the blocked state on - * `aria-disabled` rather than the native `disabled` attribute so the control - * stays focusable. These assertions therefore read the ARIA state, not the - * dimming CSS class that rides along with it. - * - * Consent is seeded pre-launch (`SeedOptions.settings`) because - * `telemetryGranted` is computed once per snapshot from persisted settings, so - * each state needs its own app instance rather than in-test mutation. - */ - import { expect, test } from '@playwright/test' import { launchApp, type AppContext } from './launchApp' import { openTitleMenu } from './support/chooserHelpers' @@ -21,34 +5,23 @@ import { closeTitlePopupIfOpen, titlePopupPage, TITLE_REOPEN_SUPPRESSION_MS, - type WebContentsPage, + type WebContentsPage } from './support/cdpPages' test.describe.configure({ mode: 'serial' }) -/** `settings.betaFeaturesEnabled` in locales/en.json — also the switch's - * `aria-label`, since `BooleanToggle` labels itself from `field.label`. */ const BETA_LABEL = 'Opt-in to beta features' const BETA_SWITCH = `.global-settings button[role="switch"][aria-label="${BETA_LABEL}"]` -/** `tooltips.betaFeaturesNeedTelemetry` in locales/en.json. */ const NEEDS_TELEMETRY_TOOLTIP = 'Beta features require confirming data sharing in Settings, even if telemetry is currently on.' interface BetaRowState { - /** `null` when the attribute is absent; Vue renders `"false"` when enabled. */ ariaDisabled: string | null ariaChecked: string | null - /** `null` when unblocked — the tooltip binding resolves to `undefined`. */ title: string | null - /** Text of the element `aria-describedby` points at, if any. */ describedText: string | null } -/** - * Read the beta switch's semantic state in one round trip. Attributes are read - * with `getAttribute` (not `.disabled` / `.checked`) because the component sets - * ARIA state on a plain ` + + + diff --git a/src/renderer/comfyTitleBar.html b/src/renderer/comfyTitleBar.html index d1c89b6c0..b3708b2a3 100644 --- a/src/renderer/comfyTitleBar.html +++ b/src/renderer/comfyTitleBar.html @@ -3,13 +3,6 @@ Comfy Desktop — Title Bar - - + Comfy Desktop — Title Popup - - -
+ +
diff --git a/src/renderer/comfyTitleTooltip.html b/src/renderer/comfyTitleTooltip.html index 77e9325c5..bb5d22d7d 100644 --- a/src/renderer/comfyTitleTooltip.html +++ b/src/renderer/comfyTitleTooltip.html @@ -1,24 +1,15 @@ - + Comfy Desktop — Title Tooltip - - -
+ +
diff --git a/src/renderer/csp.test.ts b/src/renderer/csp.test.ts index ae6851c37..9c9e0d0a1 100644 --- a/src/renderer/csp.test.ts +++ b/src/renderer/csp.test.ts @@ -56,9 +56,6 @@ describe('Content-Security-Policy: panel.html', () => { }) it('allows GitHub-hosted starter-template thumbnails in img-src', () => { - // The template picker hydrates card previews from the live workflow_templates - // repo; without this the panel CSP would block them and every card would fall - // back to its modality glyph. expect(csp['img-src']).toContain('https://raw.githubusercontent.com') }) }) @@ -88,8 +85,6 @@ describe.each(NON_TELEMETRY_RENDERER_HTMLS)( (file) => { const csp = parseCSP(readHtml(file)) - // These transient popups don't initialise Datadog/PostHog; the narrow CSP enforces - // that, so adding a telemetry SDK here would also need a CSP change (a useful tripwire). it('does NOT include Datadog endpoints', () => { expect(csp['connect-src']).not.toContain('datadoghq.com') }) diff --git a/src/renderer/panel.html b/src/renderer/panel.html index 2c9d4a40f..f20a5f3b0 100644 --- a/src/renderer/panel.html +++ b/src/renderer/panel.html @@ -3,22 +3,11 @@ Comfy Desktop — Panel - - - +
diff --git a/src/renderer/src/assets/design-system-theme.css b/src/renderer/src/assets/design-system-theme.css new file mode 100644 index 000000000..1a60baf53 --- /dev/null +++ b/src/renderer/src/assets/design-system-theme.css @@ -0,0 +1,147 @@ +@import '@comfyorg/design-system/css/baseline.css'; + +:root { + --background: oklch(0.19 0.003 285); + --foreground: oklch(0.955 0.002 285); + --card: oklch(0.23 0.008 285); + --popover: oklch(0.23 0.008 285); + --primary: var(--foreground); + --secondary: oklch(1 0 0 / 0.06); + --muted: oklch(1 0 0 / 0.06); + --muted-foreground: oklch(0.76 0.006 285); + --accent: oklch(1 0 0 / 0.1); + --input: oklch(1 0 0 / 0.06); + --ring: oklch(1 0 0 / 0.45); + --destructive: oklch(0.62 0.19 25); +} + +@theme static { + --font-sans: 'Inter', system-ui, sans-serif; + --font-display: 'PP Formula', 'Inter', system-ui, sans-serif; + + --color-success: oklch(0.78 0.15 155); + --color-window-background: oklch(0.119 0.003 285); + --color-sidebar-background: oklch(0.196 0.003 285); + --color-content-background: oklch(0.14 0.005 285); + --color-card-hover: oklch(0.265 0.009 285); + --color-subtle-foreground: oklch(0.6 0.008 285); + --color-border-strong: oklch(1 0 0 / 0.14); + --color-media-overlay: oklch(0 0 0 / 0.55); + --color-snapshot-chip: #202020; + --color-snapshot-ring: #262729; + + --text-ui: 13px; + --text-ui--line-height: 20px; + --text-heading: 16px; + --text-heading--line-height: 24px; + --text-title: 22px; + --text-title--line-height: 28px; + --text-display: 34px; + --text-display--line-height: 40px; + + --radius-shell: 14px; + --radius-panel: 16px; + --radius-card: 12px; + --radius-control: 8px; + --radius-min: 4px; + + --shadow-elev: + inset 0 1px 0 oklch(1 0 0 / 0.07), 0 1px 2px oklch(0 0 0 / 0.35), 0 6px 18px oklch(0 0 0 / 0.28); + --shadow-elev-hover: + inset 0 1px 0 oklch(1 0 0 / 0.09), 0 2px 4px oklch(0 0 0 / 0.35), + 0 10px 26px oklch(0 0 0 / 0.34); + --shadow-popover: inset 0 1px 0 oklch(1 0 0 / 0.07), 0 12px 32px oklch(0 0 0 / 0.45); + --shadow-highlight: inset 0 1px 0 oklch(1 0 0 / 0.06); + + --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1); + --animate-pop-in: pop-in 160ms var(--ease-out-expo); + --animate-fade-in: fade-in 160ms ease-out; + --animate-status-pulse: status-pulse 2s ease-out infinite; + --animate-status-breathe: status-breathe 1.6s ease-in-out infinite; + --animate-shimmer: shimmer 1.6s ease-in-out infinite; + --animate-brand-takeover: brand-takeover-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both; + --animate-gs-field-flash: gs-field-flash 2.2s ease-out; + + @keyframes pop-in { + from { + opacity: 0; + transform: translateY(4px) scale(0.98); + } + } + @keyframes fade-in { + from { + opacity: 0; + } + } + @keyframes status-pulse { + 0% { + box-shadow: 0 0 0 0 color-mix(in oklch, currentColor 55%, transparent); + } + 70%, + 100% { + box-shadow: 0 0 0 5px transparent; + } + } + @keyframes status-breathe { + 50% { + opacity: 0.35; + } + } + @keyframes shimmer { + from { + background-position: 150% 0; + } + to { + background-position: -50% 0; + } + } + @keyframes gs-field-flash { + 0%, + 55% { + box-shadow: 0 0 0 2px var(--action); + background: color-mix(in srgb, var(--action) 12%, transparent); + } + 100% { + box-shadow: 0 0 0 2px transparent; + background: transparent; + } + } + @keyframes brand-takeover-in { + from { + opacity: 0; + transform: translateY(8px); + } + to { + opacity: 1; + transform: translateY(0); + } + } +} + +@theme inline { + --color-bg: var(--bg); + --color-text: var(--text); + --color-text-muted: var(--text-muted); + --color-accent-hover: var(--accent-hover); + --color-selected: var(--selected); + --color-surface: var(--surface); + --color-border-hover: var(--border-hover); + --color-danger: var(--danger); + --color-danger-hover: var(--danger-hover); + --color-terminal-bg: var(--terminal-bg); + + --color-neutral-50: var(--neutral-50); + --color-neutral-100: var(--neutral-100); + --color-neutral-200: var(--neutral-200); + --color-neutral-300: var(--neutral-300); + --color-neutral-400: var(--neutral-400); + --color-neutral-500: var(--neutral-500); + --color-neutral-600: var(--neutral-600); + --color-neutral-700: var(--neutral-700); + --color-neutral-800: var(--neutral-800); + --color-neutral-900: var(--neutral-900); + --color-neutral-950: var(--neutral-950); + + --color-comfy-yellow: var(--comfy-yellow); + --color-focus-ring: var(--focus-ring); +} diff --git a/src/renderer/src/assets/lighting/beam.svg b/src/renderer/src/assets/lighting/beam.svg deleted file mode 100644 index d59a0fb68..000000000 --- a/src/renderer/src/assets/lighting/beam.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/renderer/src/assets/lighting/beam_2.svg b/src/renderer/src/assets/lighting/beam_2.svg deleted file mode 100644 index 3f981e561..000000000 --- a/src/renderer/src/assets/lighting/beam_2.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/renderer/src/assets/lighting/film-grain.svg b/src/renderer/src/assets/lighting/film-grain.svg new file mode 100644 index 000000000..05754bc1d --- /dev/null +++ b/src/renderer/src/assets/lighting/film-grain.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index 82e5f83bb..37a664a61 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -1,12 +1,7 @@ @import 'tailwindcss'; @import '@comfyorg/design-system/components.css'; +@import './design-system-theme.css'; -/* Shared components from @comfyorg/design-system: generate the utilities they - * use and load their scoped styles. Its base.css is not imported: its fonts use - * root-relative URLs that break under file://, and Desktop declares Inter below. */ -@source '../../../../node_modules/@comfyorg/design-system/dist'; - -/* Inter Font Family — matches ComfyUI frontend design system */ @font-face { font-family: 'Inter'; src: url('./fonts/inter-latin-normal.woff2') format('woff2'); @@ -23,74 +18,22 @@ font-display: block; } -/* PP Formula — display face for brand-refreshed takeover headings. - * Single weight (Extrabold 800); body/lead text stays Inter. - * - * PP Formula is a proprietary, license-restricted font (Pangram Pangram) and - * must NOT be committed to this public repo, so it is NOT declared with a CSS - * @font-face here. Instead it is registered at runtime by - * src/renderer/src/assets/proprietaryFonts.ts via the FontFace API. That keeps - * the binary out of the bundle (the build never depends on the file existing, - * which would break OSS/CI builds), and a relative URL resolves under file://. - * When the font is absent the --font-display stack falls back to Inter. The - * file is fetched at build time from a private bucket (scripts/fetch-font.mjs). */ - -/* - * Design tokens from renderer/styles.css — extracted into CSS custom properties - * and Tailwind @theme for the Vue rework. These bridge the old CSS class names - * used by components until full Tailwind utility class migration. - */ - -@theme { - --font-sans: 'Inter', system-ui, sans-serif; - --font-display: 'PP Formula', 'Inter', system-ui, sans-serif; - --color-bg: #202020; - --color-text: #ffffff; - --color-text-muted: #8a8a8a; - --color-accent: #60a5fa; - --color-accent-hover: #93c5fd; - --color-selected: rgba(255, 255, 255, 0.85); - --color-surface: #262729; - --color-border: #494a50; - --color-border-hover: #3c3d42; - --color-danger: #e05858; - --color-danger-hover: #ef6b6b; - --color-terminal-bg: #111112; - - /* Comfy brand neutral ramp — single canonical scale. Yellow at 50, - * warm grays through deep ink at 950. Earlier brand-* / gray-* / gv-* - * ramps are retired; reference --color-neutral-* (or the semantic - * aliases below) from here on out. */ - --color-neutral-50: #f2ff59; - --color-neutral-100: #c2bfb9; - --color-neutral-200: #a6a2a1; - --color-neutral-300: #8a8688; - --color-neutral-400: #6f6970; - --color-neutral-500: #534d57; - --color-neutral-600: #37303f; - --color-neutral-700: #2c2533; - --color-neutral-800: #211927; - --color-neutral-900: #19131d; - --color-neutral-950: #100c13; - - /* Semantic aliases — what the role IS, not what the value is. Lets us - * recolor by re-pointing the alias instead of grepping every site. */ - --color-comfy-yellow: var(--color-neutral-50); - --color-focus-ring: var(--color-neutral-100); +:root { + --legacy-color-text: #ffffff; + --legacy-color-text-muted: #8a8a8a; } -/* Theme definitions — matched to ComfyUI frontend design system */ [data-theme='dark'] { --bg: #202020; --text: #ffffff; --text-muted: #8a8a8a; --text-faint: #55565e; - --accent: #60a5fa; + --action: #60a5fa; --accent-hover: #93c5fd; --selected: rgba(255, 255, 255, 0.85); --surface: #29252c; --titlebar-bg: var(--neutral-800); - --titlebar-icon: var(--color-text-muted); + --titlebar-icon: var(--legacy-color-text-muted); --border: #494a50; --border-hover: #3c3d42; --danger: #e05858; @@ -101,18 +44,11 @@ --info: #58a6ff; --terminal-bg: #111112; --overlay-bg: rgba(0, 0, 0, 0.55); - /* Heavier dim used on Comfy-Instance modals. */ + --overlay-bg-heavy: rgba(0, 0, 0, 0.75); - /* Fully opaque backdrop used on binding modals (install wizards, - first-use, update-while-running) — visually differentiates them - from non-binding modals and signals the lack of click-outside / ✕ - dismiss. */ + --overlay-bg-opaque: var(--bg); - /* Comfy brand neutral ramp — single canonical scale. Yellow at 50, - * warm grays through deep ink at 950. See @theme block for usage - * notes. Mirrored here as raw values so scoped CSS can read them via - * var(--neutral-*) without going through Tailwind. */ --neutral-50: #f2ff59; --neutral-100: #c2bfb9; --neutral-200: #a6a2a1; @@ -125,7 +61,6 @@ --neutral-900: #19131d; --neutral-950: #100c13; - /* Semantic aliases. */ --comfy-yellow: var(--neutral-50); --focus-ring: var(--neutral-100); --accent-plum: #afa3db; @@ -135,50 +70,40 @@ --surface-recessed: var(--neutral-900); - /* Brand-surface frosted-glass recipe — shared across brand takeover - * screens (ChoiceCard, config card, brand form fields). One source of - * truth so palette tweaks land in one place. */ --brand-surface-bg: rgba(137, 137, 137, 0.05); --brand-surface-bg-hover: rgba(137, 137, 137, 0.09); --brand-surface-border: rgba(255, 255, 255, 0.09); --brand-surface-border-hover: rgba(255, 255, 255, 0.18); --brand-surface-blur: 75px; - /* Chooser-surface — neutral white-glass recipe used by the chooser - * dashboard tiles + search input. Hover lifts both bg and border one - * step so the tile reads as interactive without leaving the white- - * glass family. Transition is declared on .chooser-tile. */ --chooser-surface-bg: rgba(255, 255, 255, 0.04); --chooser-surface-bg-hover: rgba(255, 255, 255, 0.07); --chooser-surface-border: rgba(255, 255, 255, 0.05); --chooser-surface-border-hover: rgba(255, 255, 255, 0.1); - /* Modal / alert surface */ --modal-surface-bg: #27202d; --modal-surface-border: var(--chooser-surface-border); --modal-surface-shadow: 0 20px 24px -4px rgba(10, 13, 18, 0.4), 0 8px 8px -4px rgba(10, 13, 18, 0.25), 0 3px 3px -1.5px rgba(10, 13, 18, 0.2); - /* Tooltip primitive */ --tooltip-bg: #211927; --tooltip-border: #38303d; --tooltip-fg: #ffffff; --z-tooltip: 10001; - /* Takeover fluid type + spacing — Utopia clamp, anchored 1024px → 1920px. */ - --takeover-fs-caption: clamp(0.75rem, 0.6071rem + 0.2232vw, 0.875rem); /* 12→14px */ - --takeover-fs-body: clamp(0.875rem, 0.7321rem + 0.2232vw, 1rem); /* 14→16px */ - --takeover-fs-lead: clamp(1.0625rem, 0.8482rem + 0.3348vw, 1.25rem); /* 17→20px */ - --takeover-fs-h3: clamp(1.3125rem, 0.9554rem + 0.558vw, 1.625rem); /* 21→26px */ - --takeover-fs-h2: clamp(1.375rem, 0.6607rem + 1.1161vw, 2rem); /* 22→32px */ - --takeover-fs-title: clamp(1.625rem, 0.3393rem + 2.0089vw, 2.75rem); /* 26→44px */ - --takeover-fs-display: clamp(2rem, 0.2857rem + 2.6786vw, 3.5rem); /* 32→56px */ + --takeover-fs-caption: clamp(0.75rem, 0.6071rem + 0.2232vw, 0.875rem); + --takeover-fs-body: clamp(0.875rem, 0.7321rem + 0.2232vw, 1rem); + --takeover-fs-lead: clamp(1.0625rem, 0.8482rem + 0.3348vw, 1.25rem); + --takeover-fs-h3: clamp(1.3125rem, 0.9554rem + 0.558vw, 1.625rem); + --takeover-fs-h2: clamp(1.375rem, 0.6607rem + 1.1161vw, 2rem); + --takeover-fs-title: clamp(1.625rem, 0.3393rem + 2.0089vw, 2.75rem); + --takeover-fs-display: clamp(2rem, 0.2857rem + 2.6786vw, 3.5rem); - --takeover-logo-size: clamp(1.5rem, 0.9286rem + 0.8929vw, 2.5rem); /* 24→32px */ - --takeover-gap-sm: clamp(0.5rem, 0.1786rem + 0.4464vw, 0.75rem); /* 8→12px */ - --takeover-gap-md: clamp(0.75rem, 0.1071rem + 0.8929vw, 1.25rem); /* 12→20px */ - --takeover-gap-lg: clamp(3rem, 1.8571rem + 1.7857vw, 4rem); /* 48→64px */ + --takeover-logo-size: clamp(1.5rem, 0.9286rem + 0.8929vw, 2.5rem); + --takeover-gap-sm: clamp(0.5rem, 0.1786rem + 0.4464vw, 0.75rem); + --takeover-gap-md: clamp(0.75rem, 0.1071rem + 0.8929vw, 1.25rem); + --takeover-gap-lg: clamp(3rem, 1.8571rem + 1.7857vw, 4rem); } [data-theme='light'] { @@ -186,12 +111,12 @@ --text: #202121; --text-muted: #a0a0a0; --text-faint: #b4b4b4; - --accent: #3b82f6; + --action: #3b82f6; --accent-hover: #2563eb; --selected: rgba(0, 0, 0, 0.7); --surface: #e9e9e9; --titlebar-bg: #171718; - --titlebar-icon: var(--color-text-muted); + --titlebar-icon: var(--legacy-color-text-muted); --border: #b4b4b4; --border-hover: #d9d9d9; --danger: #f75951; @@ -205,8 +130,6 @@ --overlay-bg-heavy: rgba(0, 0, 0, 0.55); --overlay-bg-opaque: var(--bg); - /* Brand neutral ramp — placeholders mirrored from dark. - * TODO(light-brand-parity): remap when light brand lands. */ --neutral-50: #f2ff59; --neutral-100: #c2bfb9; --neutral-200: #a6a2a1; @@ -226,34 +149,25 @@ --surface-recessed: var(--neutral-900); - /* Brand-surface tokens — mirror of dark-theme block. Light-mode - * brand chrome isn't shipping yet; keep the variable surface so - * consumers don't have to re-thread later. */ --brand-surface-bg: rgba(137, 137, 137, 0.05); --brand-surface-bg-hover: rgba(137, 137, 137, 0.09); --brand-surface-border: rgba(255, 255, 255, 0.09); --brand-surface-border-hover: rgba(255, 255, 255, 0.18); --brand-surface-blur: 75px; - /* Chooser-surface — mirror of dark-theme block. Light-mode chooser - * chrome isn't shipping yet; placeholder until light brand parity. */ --chooser-surface-bg: rgba(255, 255, 255, 0.04); --chooser-surface-bg-hover: rgba(255, 255, 255, 0.07); --chooser-surface-border: rgba(255, 255, 255, 0.05); --chooser-surface-border-hover: rgba(255, 255, 255, 0.1); - /* Modal / alert surface — light-theme placeholder mirrors dark-theme - * value until light brand parity ships. */ --modal-surface-bg: #27202d; --modal-surface-border: var(--chooser-surface-border); - /* Tooltip primitive — mirror of dark-theme block until light parity. */ --tooltip-bg: #211927; --tooltip-border: #38303d; --tooltip-fg: #ffffff; --z-tooltip: 10001; - /* Takeover fluid type + spacing — mirror of dark-theme block. */ --takeover-fs-caption: clamp(0.75rem, 0.6071rem + 0.2232vw, 0.875rem); --takeover-fs-body: clamp(0.875rem, 0.7321rem + 0.2232vw, 1rem); --takeover-fs-lead: clamp(1.0625rem, 0.8482rem + 0.3348vw, 1.25rem); @@ -268,30 +182,109 @@ --takeover-gap-lg: clamp(3rem, 1.8571rem + 1.7857vw, 4rem); } -/* ================================================================ - * Base styles from renderer/styles.css - * Ported verbatim to bridge old CSS class names used by Vue components. - * These will be incrementally replaced with Tailwind utility classes. - * ================================================================ */ +:root[data-theme='dark'], +:root.desktop-panel, +:root [data-theme='dark'] { + --neutral-950: oklch(0.13 0.004 285); + --neutral-900: oklch(0.165 0.005 285); + --neutral-800: oklch(0.2 0.006 285); + --neutral-700: oklch(0.23 0.008 285); + --neutral-600: oklch(0.23 0.008 285); + --neutral-500: oklch(0.36 0.008 285); + --neutral-400: oklch(0.48 0.008 285); + --neutral-300: oklch(0.6 0.008 285); + --neutral-200: oklch(0.76 0.006 285); + --neutral-100: oklch(0.9 0.003 285); + + --neutral-50: oklch(0.96 0.002 285); + --comfy-yellow: var(--neutral-50); + --surface-recessed: var(--neutral-900); -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} + --bg: var(--color-content-background); + --overlay-bg-opaque: var(--bg); -::-webkit-scrollbar { - width: 0px; -} -::-webkit-scrollbar-track { - background: transparent; -} -::-webkit-scrollbar-thumb { - background: var(--border); - border-radius: 4px; -} -::-webkit-scrollbar-thumb:hover { - background: var(--border-hover); + --titlebar-bg: var(--color-window-background); + --titlebar-icon: var(--color-muted-foreground); + --surface: var(--color-card); + --secondary-background: var(--color-secondary); + --terminal-bg: oklch(0.1 0.004 285); + + --text: var(--color-foreground); + --text-muted: var(--color-muted-foreground); + --text-faint: var(--color-subtle-foreground); + --accent-label: var(--color-subtle-foreground); + + --action: var(--color-foreground); + --accent-hover: oklch(0.995 0 0); + --accent-primary: var(--color-foreground); + --brand-accent: var(--color-foreground); + --accent-plum: oklch(0.82 0.04 300); + --selected: oklch(1 0 0 / 0.85); + --focus-ring: var(--color-ring); + + --border: oklch(1 0 0 / 0.08); + --border-hover: var(--color-border-strong); + + --danger: var(--color-destructive); + --danger-hover: oklch(0.68 0.19 25); + --warning: oklch(0.82 0.14 85); + --success: var(--color-success); + --semantic-danger: var(--color-destructive); + --semantic-warning: var(--color-warning); + --semantic-success: var(--color-success); + + --brand-surface-bg: oklch(1 0 0 / 0.04); + --brand-surface-bg-hover: oklch(1 0 0 / 0.07); + --brand-surface-border: var(--color-border); + --brand-surface-border-hover: var(--color-border-strong); + + --chooser-surface-bg: oklch(1 0 0 / 0.04); + --chooser-surface-bg-hover: oklch(1 0 0 / 0.07); + --chooser-surface-border: var(--color-border); + --chooser-surface-border-hover: var(--color-border-strong); + + --modal-surface-bg: var(--neutral-800); + --modal-surface-border: var(--color-border); + --modal-surface-shadow: inset 0 1px 0 oklch(1 0 0 / 0.07); + + --tooltip-bg: rgb(42 42 42 / 0.94); + --tooltip-border: rgb(241 241 241 / 0.07); + --tooltip-fg: var(--color-foreground); +} + +@layer base { + * { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + ::-webkit-scrollbar { + width: 0px; + } + ::-webkit-scrollbar-track { + background: transparent; + } + ::-webkit-scrollbar-thumb { + background: var(--border); + border-radius: 4px; + } + ::-webkit-scrollbar-thumb:hover { + background: var(--border-hover); + } + + body { + font-family: 'Inter', system-ui, sans-serif; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + background: var(--bg); + color: var(--text); + user-select: none; + height: 100vh; + overflow: hidden; + margin: 0; + } } .scroll-visible { @@ -315,2954 +308,6 @@ background-color: var(--border-hover); } -body { - font-family: 'Inter', system-ui, sans-serif; - /* Tailwind `antialiased` — macOS WebKit/Chromium only; ignored on - * Windows/Linux where the engine handles ClearType/DirectWrite. */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - background: var(--bg); - color: var(--text); - user-select: none; - height: 100vh; - overflow: hidden; - margin: 0; -} - -/* App shell */ :root { --titlebar-height: 37px; - --sidebar-width: 200px; -} -.app-layout { - display: flex; - height: calc(100vh - var(--titlebar-height)); -} - -.sidebar { - width: var(--sidebar-width); - flex-shrink: 0; - background: var(--surface); - border-right: 1px solid var(--border); - display: flex; - flex-direction: column; - padding: 16px 0; -} -.sidebar-brand { - padding: 12px 20px 24px; - font-size: 16px; - font-weight: 700; - color: var(--text); - letter-spacing: -0.2px; -} -.sidebar-nav { - display: flex; - flex-direction: column; - gap: 2px; - padding: 0 8px; - flex: 1; -} -.sidebar-item { - display: flex; - align-items: center; - gap: 10px; - padding: 8px 12px; - border: none; - border-radius: 6px; - background: none; - color: var(--text-muted); - font-size: 14px; - font-weight: 500; - cursor: pointer; - text-align: left; - width: 100%; -} -.sidebar-item:hover { - background: var(--border); - color: var(--text); -} -.sidebar-item.active { - background: var(--border); - color: var(--text); - font-weight: 600; -} -.sidebar-item svg { - flex-shrink: 0; - opacity: 0.6; -} -.sidebar-item.active svg { - opacity: 1; -} -.sidebar-error-dot { - width: 8px; - height: 8px; - border-radius: 50%; - background: var(--danger); - flex-shrink: 0; - margin-left: auto; -} -.sidebar-error-dot + .sidebar-count { - margin-left: 6px; -} -.sidebar-count { - margin-left: auto; - font-size: 12px; - font-weight: 600; - background: var(--accent); - color: var(--bg); - width: 18px; - height: 18px; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; -} -.sidebar-version { - padding: 8px 20px; - font-size: 11px; - color: var(--text-muted); - opacity: 0.6; -} -.content { - flex: 1; - min-width: 0; - display: flex; - flex-direction: column; - padding: 24px 28px; - overflow: hidden; -} - -/* Buttons */ -button { - padding: 8px 16px; - border: 1px solid var(--border); - border-radius: 8px; - background: var(--surface); - color: var(--text); - font-size: 14px; - cursor: pointer; -} -button:hover { - background: var(--border); -} -button.primary { - background: var(--accent-primary); - color: var(--text); - border-color: var(--accent-primary); - font-weight: 500; -} -button.primary:hover { - background: color-mix(in srgb, var(--accent-primary) 85%, #000); - border-color: color-mix(in srgb, var(--accent-primary) 85%, #000); - transition: - background 120ms ease, - border-color 120ms ease; -} -button.accent { - color: var(--accent); - border-color: var(--accent); - font-weight: 600; -} -button.accent:hover { - background: var(--accent); - color: var(--bg); -} -button.danger { - color: var(--danger); - border-color: var(--danger); -} -button.danger:hover { - background: var(--danger); - color: var(--bg); -} -button.danger-solid { - background: var(--danger); - color: var(--bg); - border-color: var(--danger); -} -button.danger-solid:hover { - background: color-mix(in srgb, var(--danger) 85%, #000); -} -button:disabled, -button.looks-disabled { - opacity: 0.4; - cursor: default; -} - -/* ================================================================ - * Brand takeover primitives — shared across brand-wrapped screens - * (cloud-vs-local pick, Configure Comfy Desktop, future migrate / - * progress screens). All rules consume --brand-surface-* tokens so - * palette tweaks land in one place. - * ================================================================ */ - -.brand-hero { - position: relative; - z-index: 1; - width: 100%; - max-width: 960px; - display: flex; - flex-direction: column; - align-items: center; - text-align: center; -} - -.brand-title { - margin: 0; - font-family: var(--font-display); - font-weight: 800; - font-size: var(--takeover-fs-title); - line-height: 1.15; - letter-spacing: 0; - color: var(--color-text); - opacity: 0.85; - text-align: center; -} - -.brand-lead { - margin: var(--takeover-gap-md) 0 var(--takeover-gap-lg); - font-family: var(--font-sans); - font-size: var(--takeover-fs-lead); - font-weight: 400; - line-height: normal; - color: var(--neutral-200); - text-align: center; -} - -.brand-input { - display: flex; - align-items: center; - gap: 10px; - width: 100%; - padding: 10px 14px; - border: 1px solid var(--brand-surface-border); - border-radius: 6px; - background: var(--brand-surface-bg); - color: var(--neutral-100); - font: inherit; - font-size: var(--takeover-fs-body); - transition: - border-color 120ms ease, - background 120ms ease; -} -.brand-input:hover { - border-color: var(--brand-surface-border-hover); - background: var(--brand-surface-bg-hover); -} -.brand-input:focus-within { - border-color: var(--brand-surface-border-hover); -} -.brand-input:has(input:focus-visible) { - border-color: var(--accent); - box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); -} -.brand-input input[type='text'], -.brand-input input[type='number'], -.brand-input input:not([type]) { - all: unset; - -webkit-appearance: none; - appearance: none; - flex: 1 1 auto; - min-width: 0; - width: auto; - margin: 0; - padding: 0; - border: 0; - background: transparent; - color: inherit; - font: inherit; - cursor: text; - outline: 0; -} -.brand-input input::placeholder { - color: var(--neutral-400); -} -/* Invalid state — paired with an adjacent .field-error message. - * Overrides hover/focus border so the danger cue stays visible. */ -.brand-input--invalid, -.brand-input--invalid:hover, -.brand-input--invalid:focus-within { - border-color: var(--danger); -} -.brand-input--invalid:has(input:focus-visible) { - border-color: var(--danger); - box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 35%, transparent); -} - -.brand-tag-recommended { - display: inline-block; - margin-left: 8px; - font-size: 10px; - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.08em; - color: var(--neutral-400); -} - -.brand-pill { - display: inline-flex; - align-items: center; - gap: 6px; - padding: 8px 14px; - border: 1px solid var(--brand-surface-border); - border-radius: 6px; - background: var(--brand-surface-bg); - color: var(--neutral-200); - font: inherit; - font-size: 13px; - cursor: pointer; - transition: - border-color 160ms ease, - background 160ms ease, - color 160ms ease; -} -.brand-pill:hover { - border-color: var(--brand-surface-border-hover); - background: var(--brand-surface-bg-hover); -} -.brand-pill:focus-visible { - outline: 2px solid var(--focus-ring); - outline-offset: 2px; -} -.brand-pill--selected { - border-color: var(--accent); - background: color-mix(in srgb, var(--accent) 14%, transparent); - color: var(--neutral-100); -} - -/* Brand card — frosted-glass content container used by takeover screens - * to host fields + a pinned-footer action bar. Mirrors the macOS sheet - * pattern: body scrolls, footer stays. Consumers own the outer shell - * sizing (max-width, padding-block) so different takeovers can pick - * their own column width without the card changing. */ -.brand-card { - width: 100%; - max-height: 100%; - display: flex; - flex-direction: column; - border: 1px solid var(--brand-surface-border); - border-radius: 8px; - background: var(--brand-surface-bg); - backdrop-filter: blur(var(--brand-surface-blur)); - overflow: hidden; - text-align: left; -} -.brand-card__body { - flex: 1 1 auto; - min-height: 0; - overflow-y: auto; - padding: 20px; - display: flex; - flex-direction: column; - gap: 16px; - /* Hide scrollbar — overflow only shows when disclosures expand past - * viewport. Brand chrome stays clean, scroll affordance lives in the - * interaction itself. */ - scrollbar-width: none; -} -.brand-card__body::-webkit-scrollbar { - display: none; -} -.brand-card__footer { - flex: 0 0 auto; - padding: 14px 20px; - border-top: 1px solid var(--brand-surface-border); - background: var(--brand-surface-bg); - display: flex; - justify-content: flex-end; - align-items: center; - gap: 12px; -} - -/* Brand summary — flat key/value rows for read-only confirmation panels - * (snapshot preview, install probe details, migration summary). Sits - * inside .brand-card__body as a self-contained recessed group. */ -.brand-summary { - display: flex; - flex-direction: column; - gap: 2px; - padding: 14px 16px; - border: 1px solid var(--brand-surface-border); - border-radius: 8px; - background: var(--brand-surface-bg); -} -.brand-summary__row { - display: flex; - align-items: baseline; - justify-content: space-between; - padding: 6px 0; - gap: 12px; - font-size: var(--takeover-fs-body); -} -.brand-summary__row + .brand-summary__row { - border-top: 1px solid color-mix(in oklab, var(--neutral-100) 6%, transparent); -} -.brand-summary__label { - color: var(--neutral-300); - flex: 0 0 auto; -} -.brand-summary__value { - color: var(--neutral-100); - font-weight: 500; - max-width: 60%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -/* Canonical brand button system. Four classes cover every CTA in the - * brand takeover surfaces (install flow, brand-wrapped modals): - * - primary : high-emphasis (yellow). The action. - * - secondary : medium-emphasis (blue solid). Supporting action. - * - tertiary : low-emphasis (frosted glass). Field-adjacent helper - * actions like Browse / Action — sits next to an input - * inside a frosted card without competing. - * - ghost : zero-emphasis (transparent). Cancel, Back, Skip. - * Inside Comfy proper (dashboard) buttons still use the legacy - * `primary` / `danger` / `accent` classes above. When dashboard gets - * its refresh, those callsites migrate here too — one source of truth. */ -button.brand-primary, -button.brand-secondary, -button.brand-tertiary, -button.brand-ghost { - display: inline-flex; - align-items: center; - justify-content: center; - padding: 10px 16px; - border-radius: 6px; - border: 1px solid transparent; - font: inherit; - font-size: var(--takeover-fs-body); - font-weight: 500; - cursor: pointer; - transition: - background 120ms ease, - border-color 120ms ease, - color 120ms ease; -} -button.brand-primary:focus-visible, -button.brand-secondary:focus-visible, -button.brand-tertiary:focus-visible, -button.brand-ghost:focus-visible { - outline: 2px solid var(--focus-ring); - outline-offset: 2px; -} -button.brand-primary[disabled], -button.brand-secondary[disabled], -button.brand-tertiary[disabled], -button.brand-ghost[disabled] { - cursor: not-allowed; - opacity: 0.55; -} - -/* Yellow primary — install-flow CTAs (Get Started, Continue, Try Cloud). */ -button.brand-primary { - background: var(--comfy-yellow); - border-color: var(--comfy-yellow); - color: var(--neutral-900); -} -button.brand-primary:hover:not([disabled]) { - background: color-mix(in srgb, var(--comfy-yellow) 88%, #000); - border-color: color-mix(in srgb, var(--comfy-yellow) 88%, #000); -} -button.brand-primary:focus-visible { - outline-color: color-mix(in srgb, var(--comfy-yellow) 80%, var(--neutral-100)); -} - -/* Blue secondary — supporting action next to a primary (Browse, etc.). */ -button.brand-secondary { - background: var(--accent-primary); - border-color: var(--accent-primary); - color: #fff; -} -button.brand-secondary:hover:not([disabled]) { - background: color-mix(in srgb, var(--accent-primary) 88%, #000); - border-color: color-mix(in srgb, var(--accent-primary) 88%, #000); -} - -/* Frosted-glass tertiary — sits next to inputs inside brand-surface - * cards (Browse, source-field actions). Low-emphasis so it doesn't - * compete with the primary CTA, but still reads as a button. */ -button.brand-tertiary { - background: var(--brand-surface-bg); - border-color: var(--brand-surface-border); - color: var(--neutral-100); -} -button.brand-tertiary:hover:not([disabled]) { - background: var(--brand-surface-bg-hover); - border-color: var(--brand-surface-border-hover); -} - -/* Ghost — low-importance escape hatches (Cancel, Back, Skip). */ -button.brand-ghost { - background: transparent; - border-color: transparent; - color: var(--neutral-300); -} -button.brand-ghost:hover:not([disabled]) { - color: var(--neutral-100); - background: var(--brand-surface-bg); -} - -.brand-checkbox { - display: flex; - align-items: flex-start; - gap: 10px; - cursor: pointer; -} -.brand-checkbox input[type='checkbox'] { - appearance: none; - flex: 0 0 auto; - width: 14px; - height: 14px; - margin: 4px 0 0 0; - border: 1px solid var(--brand-surface-border-hover); - border-radius: 4px; - background-color: var(--brand-surface-bg); - background-repeat: no-repeat; - background-position: center; - background-size: 14px 14px; - position: relative; - cursor: pointer; - transition: - background-color 180ms cubic-bezier(0.22, 1, 0.36, 1), - border-color 180ms cubic-bezier(0.22, 1, 0.36, 1); -} -.brand-checkbox input[type='checkbox']:hover { - border-color: var(--text); -} -.brand-checkbox input[type='checkbox']::after { - content: ''; - display: none; -} -.brand-checkbox input[type='checkbox']:checked { - background-color: var(--accent); - background-image: url("data:image/svg+xml;utf8,"); - border-color: var(--accent); -} -.brand-checkbox input[type='checkbox']:checked::after { - display: none; -} -.brand-checkbox input[type='checkbox']:focus-visible { - outline: 2px solid var(--focus-ring); - outline-offset: 2px; -} -.brand-checkbox__text { - display: flex; - flex-direction: column; - gap: 2px; -} -.brand-checkbox__title { - font-size: var(--takeover-fs-body); - font-weight: 600; - color: var(--neutral-100); -} -.brand-checkbox__hint { - font-size: var(--takeover-fs-body); - color: var(--neutral-300); - line-height: normal; -} -.brand-checkbox__link, -button.brand-checkbox__link { - color: var(--neutral-100); - text-decoration: underline; - cursor: pointer; - background: transparent; - border: 0; - padding: 0; - font: inherit; - border-radius: 2px; -} -.brand-checkbox__link:hover, -button.brand-checkbox__link:hover { - color: var(--comfy-yellow); - background: transparent; -} -.brand-checkbox__link:focus-visible, -button.brand-checkbox__link:focus-visible { - outline: 2px solid var(--focus-ring); - outline-offset: 2px; -} - -button.loading { - opacity: 0.7; - pointer-events: none; -} -button.loading::after { - content: ''; - display: inline-block; - width: 12px; - height: 12px; - margin-left: 6px; - border: 2px solid var(--text-faint); - border-top-color: var(--accent); - border-radius: 50%; - animation: btn-spin 0.6s linear infinite; - vertical-align: middle; -} -@keyframes btn-spin { - to { - transform: rotate(360deg); - } -} -button.add-btn { - display: inline-flex; - align-items: center; - gap: 4px; -} - -/* Forms */ -label { - font-size: 14px; - color: var(--text-muted); -} -select, -input[type='text'], -input[type='number'] { - width: 100%; - padding: 8px 10px; - margin-top: 6px; - border: 1px solid var(--border); - border-radius: 6px; - background: var(--surface); - color: var(--text); - font-size: 14px; - outline: none; -} -select:focus, -input[type='text']:focus, -input[type='number']:focus { - border-color: var(--accent); -} -select:disabled, -input:disabled { - opacity: 0.4; -} -input[type='checkbox'] { - appearance: none; - width: 36px; - height: 20px; - background: var(--border); - border-radius: 10px; - position: relative; - cursor: pointer; - margin-top: 8px; - transition: background 0.2s; - flex-shrink: 0; -} -input[type='checkbox']::after { - content: ''; - position: absolute; - top: 2px; - left: 2px; - width: 16px; - height: 16px; - background: var(--text); - border-radius: 50%; - transition: transform 0.2s; -} -input[type='checkbox']:checked { - background: var(--accent); -} -input[type='checkbox']:checked::after { - transform: translateX(16px); -} -.field { - display: flex; - flex-direction: column; - margin-top: 16px; -} -.path-input { - display: flex; - gap: 8px; - margin-top: 6px; -} -.path-input input[type='text'] { - flex: 1; - margin-top: 0; -} -.path-input button { - flex-shrink: 0; -} -.field-error { - font-size: 13px; - color: var(--danger); - margin-top: 4px; - min-height: 0; -} -.disk-space-info { - font-size: 13px; - color: var(--text-muted); - margin-top: 4px; - min-height: 18px; -} - -/* Filter tabs */ -.filter-tabs { - display: flex; - gap: 4px; - margin-bottom: 12px; - border-bottom: 1px solid var(--border); - flex-shrink: 0; -} -.filter-tab { - padding: 6px 16px; - border: none; - border-radius: 0; - background: none; - color: var(--text-muted); - font-size: 14px; - font-weight: 500; - cursor: pointer; - position: relative; - display: flex; - align-items: center; - gap: 10px; -} -.filter-count { - font-size: 11px; - font-weight: 600; - color: var(--text-muted); - border: 1px solid var(--border); - min-width: 18px; - height: 18px; - border-radius: 8px; - display: inline-flex; - align-items: center; - justify-content: center; - padding: 0 5px; -} -.filter-count.has-new { - color: var(--accent); - border-color: var(--accent); -} -.filter-tab:hover { - color: var(--text); - background: none; -} -.filter-tab.active { - color: var(--text); - font-weight: 600; -} -.filter-tab.active::after { - content: ''; - position: absolute; - bottom: -1px; - left: 4px; - right: 4px; - height: 2px; - background: var(--accent); - border-radius: 1px; -} - -/* Filter pills — independent rounded chips with their own border, - * separated by gap. Used by the chooser-view filter row and the - * Settings → Downloads tab status filter; same chip shape and active - * treatment so the two surfaces read consistently. */ -.filter-pill-group { - display: inline-flex; - flex-wrap: wrap; - gap: 8px; -} -.filter-pill { - background: transparent; - color: inherit; - border: 1px solid var(--border, rgba(127, 127, 127, 0.25)); - padding: 4px 12px; - font: inherit; - font-size: 12px; - border-radius: 999px; - cursor: pointer; - opacity: 0.8; - transition: - background-color 100ms ease, - opacity 100ms ease, - border-color 100ms ease; -} -.filter-pill:hover { - opacity: 1; -} -.filter-pill.active { - background: var(--bg-elev-2, rgba(127, 127, 127, 0.16)); - border-color: var(--border-strong, rgba(127, 127, 127, 0.4)); - opacity: 1; -} - -/* Instance list */ -.instance-list { - display: flex; - flex-direction: column; - gap: 10px; -} -.instance-card { - --card-pad-y: 14px; - --card-pad-x: 16px; - background: var(--surface); - border: 1px solid var(--border); - border-radius: 8px; - padding: var(--card-pad-y) var(--card-pad-x); - display: flex; - justify-content: space-between; - align-items: center; -} -.instance-card.is-idle { - transition: transform 0.12s ease; -} -.instance-card.is-draggable { - z-index: 10; - user-select: none; -} -.drag-handle { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - gap: 3px; - align-self: stretch; - padding: 0 18px; - margin: calc(-1 * var(--card-pad-y)) 0 calc(-1 * var(--card-pad-y)) calc(-1 * var(--card-pad-x)); - border-radius: 8px 0 0 8px; - cursor: grab; - opacity: 0.35; - transition: - opacity 0.15s, - background-color 0.15s; -} -.drag-handle:hover { - opacity: 0.7; - background: rgba(255, 255, 255, 0.04); -} -.is-draggable .drag-handle { - cursor: grabbing; - opacity: 0.7; - background: rgba(255, 255, 255, 0.06); -} -.drag-handle span { - display: block; - width: 16px; - height: 2px; - background: var(--text); - border-radius: 1px; -} -.instance-info { - display: flex; - flex-direction: column; - gap: 3px; - min-width: 0; - flex: 1; -} -.instance-name { - font-size: 16px; - font-weight: 600; -} -.instance-meta { - font-size: 13px; - color: var(--text-muted); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.status-danger { - color: var(--danger); - font-weight: 600; -} -.status-running { - color: var(--accent); - font-weight: 600; -} -.status-new { - color: var(--accent); - font-weight: 600; -} -.status-update { - color: var(--warning); - font-weight: 600; -} -.update-pill { - display: inline-flex; - align-items: center; - font-size: 11px; - font-weight: 600; - line-height: 1; - padding: 2px 8px; - border-radius: 10px; - background: var(--warning); - color: #1a1a1a; - border: 1px solid var(--warning); - cursor: pointer; - user-select: none; - transition: - background 0.15s, - border-color 0.15s; -} -.update-pill:hover { - background: color-mix(in srgb, var(--warning) 80%, #fff); - border-color: color-mix(in srgb, var(--warning) 80%, #fff); -} -.migrate-pill { - display: inline-flex; - align-items: center; - font-size: 11px; - font-weight: 600; - line-height: 1; - padding: 2px 8px; - border-radius: 10px; - background: var(--accent); - color: #1a1a1a; - border: 1px solid var(--accent); - cursor: pointer; - user-select: none; - transition: - background 0.15s, - border-color 0.15s; -} -.migrate-pill:hover { - background: color-mix(in srgb, var(--accent) 80%, #fff); - border-color: color-mix(in srgb, var(--accent) 80%, #fff); -} -.status-in-progress { - color: var(--accent); - font-weight: 600; -} -.instance-card.card-running { - border-color: var(--accent); -} -.instance-card.card-stopping { - border-color: var(--accent); - animation: card-breathe 2s ease-in-out infinite; -} -.instance-card.card-in-progress { - border-color: var(--accent); - animation: card-breathe 2s ease-in-out infinite; -} -.instance-actions { - display: flex; - gap: 8px; -} - -.empty-state { - text-align: center; - padding: 40px 20px; - color: var(--text-muted); - font-size: 14px; -} -.empty-state-title { - font-weight: 700; - color: var(--text-muted); -} -.empty-state-hint { - margin-top: 4px; -} -.empty-state-action { - margin-top: 8px; -} - -.toolbar { - display: flex; - justify-content: space-between; - align-items: center; - min-height: 34px; - margin-bottom: 16px; -} -.toolbar-actions { - display: flex; - gap: 8px; -} - -.breadcrumb { - display: flex; - align-items: center; - gap: 8px; - min-width: 0; -} -.breadcrumb-current { - font-size: 24px; - font-weight: 600; - color: var(--text-muted); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -/* In-view page close button (X) shown next to the breadcrumb on root - panel pages such as Settings and Directories. Resets the host - window's panel-history stack via `closeCurrentPanel`. */ -.view-page-close { - display: inline-flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - width: 28px; - height: 28px; - padding: 0; - background: none; - border: none; - border-radius: 6px; - color: var(--text-muted); - cursor: pointer; - line-height: 1; - transition: - background 0.15s, - color 0.15s; -} -.view-page-close:hover { - background: var(--surface); - color: var(--text); -} -.view-page-close:focus-visible { - outline: 2px solid var(--accent); - outline-offset: 2px; -} - -.detected-hardware { - font-size: 13px; - color: var(--text-muted); - background: var(--surface); - border: 1px solid var(--border); - border-radius: 6px; - padding: 8px 12px; - margin-bottom: 16px; -} -.detected-hardware:empty { - display: none; -} - -.view { - display: none; -} -.view.active { - display: flex; - flex-direction: column; - flex: 1; - min-height: 0; - overflow: hidden; -} -.view-scroll { - flex: 1; - min-height: 0; - overflow-y: auto; - padding-right: 8px; -} -.view-bottom { - flex-shrink: 0; - display: flex; - justify-content: flex-end; - gap: 10px; - padding-top: 12px; -} -.view-list-scroll { - flex: 1; - min-height: 0; - overflow-y: auto; - overflow-x: hidden; - padding-right: 8px; -} - -/* Detail tabs — brand-redesign parity with `.settings-v2-tabs` in - * `ComfyUISettingsPanel.vue`. Pill-shaped active state (background fill, - * no underline indicator), `--border-hover` hairline between tab strip - * and body, fluid `--takeover-fs-body` font sizing. */ -.detail-tabs { - display: flex; - gap: 2px; - margin-bottom: 16px; - padding-bottom: 8px; - border-bottom: 1px solid var(--border-hover); - flex-shrink: 0; -} -.detail-tab { - padding: 6px 12px; - border: 1px solid transparent; - border-radius: 6px; - background: transparent; - color: var(--text-muted); - font-size: var(--takeover-fs-body); - font-weight: 500; - cursor: pointer; - transition: - color 120ms ease, - background-color 120ms ease; -} -.detail-tab:hover { - color: var(--text); - background: color-mix(in srgb, var(--text) 4%, transparent); -} -.detail-tab:focus-visible { - outline: 2px solid var(--accent-primary); - outline-offset: 2px; -} -.detail-tab.active { - color: var(--text); - font-weight: 500; - background: var(--surface); -} - -/* Detail sections */ -.detail-section { - margin-bottom: 16px; -} -.detail-section-title.spaced { - margin-top: 16px; -} -.detail-section-title { - font-size: 13px; - font-weight: 600; - color: var(--text-muted); - text-transform: uppercase; - letter-spacing: 0.5px; - margin-bottom: 8px; -} -.detail-section-title.collapsible { - display: inline-block; - cursor: pointer; - user-select: none; -} -.detail-section-title.collapsible::before { - content: '▸'; - display: inline-block; - margin-right: 4px; - transition: transform 0.15s; -} -.detail-section-title.collapsible[data-collapsed='false']::before { - transform: rotate(90deg); -} -.detail-fields { - background: var(--surface); - border: 1px solid var(--border); - border-radius: 8px; - padding: 12px 16px; - display: flex; - flex-direction: column; - gap: 10px; -} -.detail-field-label { - font-size: 13px; - color: var(--text-muted); -} -.detail-field-value { - font-size: 14px; - margin-top: 1px; -} -.detail-field-input { - width: 100%; - margin-top: 4px; - padding: 6px 8px; - font-size: 14px; -} -/* Inline filesystem path rendered as a button that opens the folder in the OS - * file manager. Resets the button chrome to plain text, truncates with an - * ellipsis on one line, and underlines in the accent color on hover/focus. - * Components add only their own sizing (e.g. `max-width` vs `flex`) or override - * `color`/`font` where they must inherit a surrounding scale. Reused by every - * clickable path display so they cannot drift apart. */ -.open-folder-link { - min-width: 0; - padding: 0; - border: none; - background: transparent; - color: var(--text); - font-size: 14px; - text-align: left; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - cursor: pointer; -} -.open-folder-link:hover, -.open-folder-link:focus-visible { - /* background stays transparent against the global `button:hover` reset - * (specificity 0,1,1) — only the text underlines in the accent color. */ - background: transparent; - color: var(--accent); - text-decoration: underline; - outline: none; -} - -/* Browse-only path: boxed row whose text opens the folder in the OS file - * manager (replaces the old readonly ). Only the text is clickable. */ -.detail-path-open-wrap { - display: flex; - align-items: center; - flex: 1; - min-width: 0; - margin-top: 4px; - padding: 6px 8px; - border: 1px solid var(--border); - border-radius: 6px; - background: var(--surface); -} -.detail-path-open { - max-width: 100%; -} -/* Clickable non-editable path value (wraps instead of truncating). */ -.detail-field-value-open { - margin-top: 1px; - padding: 0; - border: none; - background: transparent; - color: var(--text); - font: inherit; - font-size: 14px; - text-align: left; - cursor: pointer; -} -.detail-field-value-open:hover, -.detail-field-value-open:focus-visible { - background: transparent; - color: var(--accent); - text-decoration: underline; - outline: none; -} -.detail-section-desc { - font-size: 14px; - color: var(--text-muted); - margin-bottom: 8px; -} - -/* Channel cards */ -.channel-select { - max-width: 360px; -} -.channel-select-desc { - font-size: 12px; - color: var(--text-muted); - margin-top: 6px; -} -.channel-preview { - margin-top: 10px; - padding: 10px 14px; - background: var(--surface); - border: 1px solid var(--border); - border-radius: 8px; -} -.channel-preview-empty { - font-size: 13px; - color: var(--text-muted); -} -.channel-preview-row { - display: flex; - justify-content: space-between; - padding: 3px 0; -} -.channel-preview-label { - font-size: 13px; - color: var(--text-muted); -} -.channel-preview-value { - font-size: 13px; - color: var(--text); -} -.channel-actions { - display: flex; - align-items: center; - gap: 8px; - margin-top: 10px; -} -.channel-switch-hint { - font-size: 13px; - color: var(--text-muted); - margin-right: 4px; -} -.dashboard-empty-hint { - font-size: 14px; - color: var(--text-muted); - padding: 12px 0; -} -.detail-item-list { - background: var(--surface); - border: 1px solid var(--border); - border-radius: 8px; - margin-bottom: 8px; -} -.detail-item { - display: flex; - align-items: center; - justify-content: space-between; - padding: 8px 16px; -} -.detail-item + .detail-item { - border-top: 1px solid var(--border); -} -.detail-item.active .detail-item-label { - font-weight: 600; -} -.detail-item-label { - font-size: 14px; - display: flex; - align-items: center; - gap: 8px; - min-width: 0; -} -.detail-item-tag { - font-size: 11px; - font-weight: 600; - padding: 2px 8px; - border-radius: 3px; - color: var(--accent); - flex-shrink: 0; -} -.detail-item-actions { - display: flex; - gap: 6px; -} -.detail-item-actions button { - font-size: 13px; - padding: 3px 10px; -} -.detail-actions { - display: flex; - gap: 8px; - flex-wrap: wrap; - margin-top: 8px; -} -#detail-bottom-actions { - flex-shrink: 0; - padding-top: 12px; - margin: 0 -20px; - padding-left: 20px; - padding-right: 20px; - border-top: 1px solid var(--border); -} - -/* Settings */ -.settings-section { - margin-bottom: 16px; -} -.settings-section .field { - margin-bottom: 12px; -} -.settings-section .field:last-child { - margin-bottom: 0; -} -.path-list { - display: flex; - flex-direction: column; - gap: 6px; - margin-top: 6px; -} -.path-primary-tag { - font-size: 12px; - color: var(--text-muted); - background: var(--surface); - padding: 2px 8px; - border-radius: 3px; - flex-shrink: 0; - align-self: center; -} - -/* Progress */ -.progress-status { - font-size: 14px; - color: var(--text-muted); - margin-bottom: 4px; - user-select: text; -} -.progress-substatus { - font-size: 12px; - color: var(--text-muted); - opacity: 0.7; - margin-bottom: 12px; - user-select: text; -} -.progress-error-message { - color: var(--danger); - margin-bottom: 12px; -} -.progress-bar-wrap { - display: flex; - align-items: center; - gap: 10px; - margin-bottom: 16px; -} -.progress-bar-wrap .progress-bar-track { - flex: 1 1 auto; - margin-bottom: 0; -} -.progress-bar-percent { - flex: 0 0 auto; - font-size: 12px; - color: var(--text-muted); - font-variant-numeric: tabular-nums; - min-width: 3ch; - text-align: right; -} -.progress-bar-track { - width: 100%; - height: 8px; - background: var(--border); - border-radius: 4px; - overflow: hidden; - margin-bottom: 16px; -} -.progress-bar-fill { - height: 100%; - background: var(--accent); - border-radius: 4px; - width: 0%; - transition: width 0.3s ease; -} -.progress-bar-track.indeterminate { - animation: indeterminate 1.5s ease-in-out infinite; - background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 50%, var(--accent) 100%); - background-size: 200% 100%; -} -@keyframes indeterminate { - 0% { - background-position: 200% 0; - } - 100% { - background-position: -200% 0; - } -} -@keyframes card-breathe { - 0%, - 100% { - border-color: var(--accent); - } - 50% { - border-color: color-mix(in srgb, var(--accent) 40%, transparent); - } -} - -.progress-steps { - display: flex; - flex-direction: column; - gap: 2px; - margin-bottom: 16px; -} -.progress-step { - display: flex; - flex-direction: column; - padding: 8px 12px; - border-radius: 6px; - opacity: 0.4; -} -.progress-step.active { - opacity: 1; - background: var(--surface); -} -.progress-step.done { - opacity: 0.7; -} -.progress-step-header { - display: flex; - align-items: center; - gap: 10px; -} -.progress-step-indicator { - width: 22px; - height: 22px; - border-radius: 50%; - border: 2px solid var(--border); - display: flex; - align-items: center; - justify-content: center; - font-size: 12px; - font-weight: 600; - color: var(--text-muted); - flex-shrink: 0; -} -.progress-step.active .progress-step-indicator { - border-color: var(--accent); - color: var(--accent); -} -.progress-step.done .progress-step-indicator { - border-color: var(--accent); - background: var(--accent); - color: var(--bg); -} -.progress-step-label { - font-size: 14px; - font-weight: 500; - color: var(--text-muted); -} -.progress-step.active .progress-step-label { - color: var(--text); -} -.progress-step.done .progress-step-label { - color: var(--text-muted); -} -.progress-step-detail { - margin-left: 32px; - margin-top: 6px; -} -.progress-step-status { - font-size: 13px; - color: var(--text-muted); - margin-bottom: 6px; - user-select: text; - max-height: 50vh; - overflow-y: auto; - white-space: pre-wrap; -} -.progress-step.error { - opacity: 1; - background: var(--surface); -} -.progress-step.error .progress-step-indicator { - border-color: var(--danger); - background: var(--danger); - color: var(--bg); -} -.progress-step.error .progress-step-label { - color: var(--text); -} -.progress-step.cancelled { - opacity: 1; - background: var(--surface); -} -.progress-step.cancelled .progress-step-indicator { - border-color: var(--warning); - background: var(--warning); - color: var(--bg); -} -.progress-step.cancelled .progress-step-label { - color: var(--text); -} -.progress-step-summary { - margin-left: 32px; - margin-top: 2px; - font-size: 13px; - color: var(--text-muted); - user-select: text; -} - -.progress-banner { - display: flex; - align-items: center; - gap: 8px; - padding: 10px 14px; - border-radius: 8px; - font-size: 14px; - font-weight: 500; - margin-bottom: 16px; -} -.progress-banner-success { - background: color-mix(in srgb, var(--success) 12%, transparent); - color: var(--success); -} -.progress-banner-error { - background: color-mix(in srgb, var(--danger) 12%, transparent); - color: var(--danger); -} -.progress-banner-cancelled { - background: color-mix(in srgb, var(--warning) 12%, transparent); - color: var(--warning); -} - -.progress-conflict-actions { - margin-bottom: 16px; - display: flex; - gap: 8px; -} - -/* Terminal output */ -.terminal-output { - background: var(--terminal-bg); - border: 1px solid var(--border); - border-radius: 6px; - padding: 10px 12px; - font-family: 'Cascadia Mono', 'Consolas', monospace; - font-size: 13px; - color: var(--text-muted); - white-space: pre-wrap; - word-break: break-all; - overflow-y: auto; - max-height: 300px; - user-select: text; -} -#console-terminal, -#progress-terminal { - max-height: none; - flex: 1; - min-height: 0; -} -.console-error-message { - color: var(--danger); - font-size: 14px; - padding: 10px 12px; - white-space: pre-wrap; - user-select: text; - max-height: 50%; - overflow-y: auto; - flex-shrink: 0; -} -.progress-status.progress-error-message { - max-height: 50%; - overflow-y: auto; - flex-shrink: 0; - white-space: pre-wrap; -} -.terminal-toggle { - display: flex; - align-items: center; - gap: 6px; - font-size: 14px; - color: var(--text-muted); - cursor: pointer; - padding: 6px 6px; - user-select: none; - flex-shrink: 0; - background: none; - border: none; -} -.terminal-toggle:hover { - color: var(--text); -} -.terminal-toggle-icon { - font-size: 18px; -} - -/* View modals */ -.view-modal { - position: fixed; - inset: 0; - background: var(--overlay-bg); - display: none; - align-items: center; - justify-content: center; - z-index: 50; -} -.view-modal.active { - display: flex; -} -/* Backdrop variants. `--heavy-dim` used on Comfy-Instance modals; - * `--opaque` used on binding modals (install wizards, first-use, - * update-while-running). */ -.view-modal--heavy-dim { - background: var(--overlay-bg-heavy); -} -.view-modal--opaque { - background: var(--overlay-bg-opaque); -} - -/* Shared modal open/close transition. Apply via - * `` around any teleported overlay. - * The overlay fades; an inner `.modal-fade-panel` (if present) also - * scales in slightly for a polished feel. */ -.modal-fade-enter-active, -.modal-fade-leave-active { - transition: opacity 180ms ease; -} -.modal-fade-enter-active .modal-fade-panel, -.modal-fade-leave-active .modal-fade-panel { - transition: - opacity 180ms ease, - transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1); -} -.modal-fade-enter-from, -.modal-fade-leave-to { - opacity: 0; -} -.modal-fade-enter-from .modal-fade-panel, -.modal-fade-leave-to .modal-fade-panel { - opacity: 0; - transform: scale(0.98); -} - -/* Settings drawer (v2) — paired transitions for the right-anchored - * slide-in panel. Global (not scoped) for the same reason `.modal-fade-*` - * is: the elements are teleported to , and Vue's scoped data-v - * attribute matching doesn't reliably apply transient transition - * classes added to teleported nodes. Apply via: - * for the backdrop - * for the panel - */ -.settings-drawer-fade-enter-active, -.settings-drawer-fade-leave-active { - transition: opacity 220ms ease; -} -.settings-drawer-fade-enter-from, -.settings-drawer-fade-leave-to { - opacity: 0; -} - -.settings-drawer-slide-enter-active, -.settings-drawer-slide-leave-active { - transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1); -} -.settings-drawer-slide-enter-from, -.settings-drawer-slide-leave-to { - transform: translateX(100%); -} - -@media (prefers-reduced-motion: reduce) { - .settings-drawer-slide-enter-active, - .settings-drawer-slide-leave-active { - transition: opacity 120ms ease; - } - .settings-drawer-slide-enter-from, - .settings-drawer-slide-leave-to { - opacity: 0; - transform: none; - } -} - -/* Settings drawer sub-page push/pop transition. Mirrors iOS / macOS - * Settings sub-page navigation: forward (push) slides in from the right - * while the outgoing root slides left; back (pop) reverses. Used by - * `ComfyUISettingsPanel.vue` when toggling `subPage` between the args - * editor and the tab root. */ -.subpage-push-enter-active, -.subpage-push-leave-active, -.subpage-pop-enter-active, -.subpage-pop-leave-active { - transition: - transform 110ms cubic-bezier(0.32, 0.72, 0, 1), - opacity 90ms ease; -} -.subpage-push-enter-from { - transform: translateX(24px); - opacity: 0; -} -.subpage-push-leave-to { - transform: translateX(-12px); - opacity: 0; -} -.subpage-pop-enter-from { - transform: translateX(-12px); - opacity: 0; -} -.subpage-pop-leave-to { - transform: translateX(24px); - opacity: 0; -} - -@media (prefers-reduced-motion: reduce) { - .subpage-push-enter-active, - .subpage-push-leave-active, - .subpage-pop-enter-active, - .subpage-pop-leave-active { - transition: opacity 70ms ease; - } - .subpage-push-enter-from, - .subpage-push-leave-to, - .subpage-pop-enter-from, - .subpage-pop-leave-to { - transform: none; - } -} - -.view-fullscreen { - position: fixed; - top: var(--titlebar-height); - bottom: 0; - right: 0; - left: var(--sidebar-width); - display: flex; - z-index: 40; - background: var(--bg); -} -.view-fullscreen .view-modal-content { - width: 100%; - height: 100%; - max-width: none; - border-radius: 0; - border: none; -} - -.view-modal-content { - background: var(--bg); - border: 1px solid var(--border); - border-radius: 12px; - width: 100%; - max-width: 900px; - height: calc(100vh - 60px); - margin: 0 30px; - display: flex; - flex-direction: column; - overflow: hidden; -} -/* Width variant — narrower for per-install Manage / Preferences / confirms. */ -.view-modal-content--regular { - max-width: 600px; -} -/* Inline mode (used by the embedded install-settings panel inside ComfyUI windows). */ -.view-modal-content.view-modal-inline { - width: 100%; - height: 100%; - max-width: none; - border: none; - border-radius: 0; -} -.view-modal-header { - display: flex; - align-items: center; - padding: 16px 20px; - border-bottom: 1px solid var(--border); - flex-shrink: 0; - gap: 12px; -} -.view-modal-title { - font-size: 18px; - font-weight: 600; - color: var(--text); - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - display: flex; - align-items: center; - gap: 6px; -} -.edit-name-hint { - flex-shrink: 0; - opacity: 0.25; - transition: opacity 0.15s; - pointer-events: none; - user-select: none; - /* Keep the pencil glyph baseline-aligned with the surrounding name - * text rather than letting the SVG sit on the bottom edge of the - * line box (which would push it out from under the name text and - * onto the next line in narrow / contenteditable contexts). */ - vertical-align: middle; -} -.view-modal-title:hover .edit-name-hint { - opacity: 0.6; -} -.view-modal-title:focus .edit-name-hint { - opacity: 0; -} - -/* Embedded DetailModal title — same flex row treatment as the wrapped - * mode's `.view-modal-title` so the contenteditable name + pencil glyph - * stay on one line. The wrapping element is a plain `
` so without - * this it inherits block layout and the `.edit-name-hint` SVG falls to - * the next line. */ -.detail-embedded-title { - font-size: 18px; - font-weight: 600; - color: var(--text); - margin-bottom: 16px; -} -.detail-embedded-title > [contenteditable] { - display: inline-flex; - align-items: center; - gap: 6px; - min-width: 0; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - outline: none; -} -.detail-embedded-title:hover .edit-name-hint { - opacity: 0.6; -} -.detail-embedded-title > [contenteditable]:focus .edit-name-hint { - opacity: 0; -} -.view-modal-header-actions { - display: flex; - gap: 8px; - flex-shrink: 0; -} -/* Stack the optional back chevron above the grand title in Tier 3 - takeover modals (NewInstall / Track / LoadSnapshot / QuickInstall). - Without the wrapper the back button sits in the same row as the - title and shoves it right because both are flex children of - .view-modal-header. */ -.takeover-stacked-header { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 12px; - flex: 1 1 auto; - min-width: 0; -} -.takeover-stacked-header > .takeover-header { - width: 100%; -} -.view-modal-close { - background: none; - border: none; - font-size: 18px; - color: var(--text-muted); - cursor: pointer; - padding: 4px 8px; - flex-shrink: 0; - line-height: 1; -} -.view-modal-close:hover { - color: var(--text); - background: none; -} -.view-modal-body { - flex: 1; - min-height: 0; - display: flex; - flex-direction: column; - padding: 20px; - overflow-y: auto; -} -.view-modal-footer { - flex-shrink: 0; - padding: 12px 20px; - border-top: 1px solid var(--border); -} -.view-modal-footer .view-bottom { - padding-top: 0; -} - -/* Modal dialog */ -.modal-overlay { - position: fixed; - inset: 0; - backdrop-filter: blur(2px); - -webkit-backdrop-filter: blur(2px); - display: flex; - align-items: center; - justify-content: center; - z-index: 100; -} -.modal-box { - background: var(--neutral-800); - border: 1px solid var(--border); - border-radius: 12px; - padding: 16px 24px; - min-width: 320px; - max-width: 400px; -} -.modal-title { - font-size: 16px; - font-weight: 600; - padding-bottom: 12px; - margin: 0 -24px 12px; - padding-left: 24px; - padding-right: 24px; - border-bottom: 1px solid var(--border); -} -.modal-message { - font-size: 14px; - color: var(--text-muted); - margin-bottom: 20px; - white-space: pre-line; - user-select: text; - max-height: 50vh; - overflow-y: auto; -} -.modal-message a { - color: var(--accent); - text-decoration: underline; - cursor: pointer; -} -.modal-body { - max-height: 50vh; - overflow-y: auto; - margin-bottom: 0; -} -.modal-box-wide { - max-width: 720px; - width: 720px; -} -.modal-box-wide .modal-body { - max-height: 70vh; -} -.modal-details { - margin-bottom: 0; - margin-top: 12px; -} -.modal-detail-group { - margin-bottom: 6px; -} -.modal-detail-label { - font-weight: 600; - color: var(--text); - font-size: 13px; - text-transform: uppercase; - margin-bottom: 6px; - display: block; -} -.modal-detail-recessed { - background: var(--surface); - border: 1px solid var(--border); - border-radius: 6px; - padding: 8px 12px; - max-height: 200px; - overflow-y: auto; -} -.modal-detail-item { - font-size: 14px; - color: var(--text-muted); - line-height: 1.6; - white-space: pre-line; -} -.modal-detail-item a, -.modal-detail-item .modal-link { - color: var(--accent); - text-decoration: underline; - cursor: pointer; -} - -/* Snapshot detail layout (ls- prefix) — used by LoadSnapshotModal, ImportPreviewModal, ModalDialog, SnapshotTab */ -.ls-section { - margin-bottom: 16px; -} -.ls-section:last-child { - margin-bottom: 0; -} -.ls-section-title { - font-size: 12px; - font-weight: 600; - color: var(--text-muted); - text-transform: uppercase; - letter-spacing: 0.3px; - margin-bottom: 8px; -} -.ls-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 6px 16px; - margin-bottom: 10px; -} -.ls-field { - display: flex; - flex-direction: column; - gap: 2px; - margin-bottom: 4px; -} -.ls-label { - font-size: 13px; - color: var(--text-muted); -} -.ls-value { - font-size: 14px; - color: var(--text); - user-select: text; -} -.ls-value-loading { - color: var(--text-muted); -} -.ls-timeline { - display: flex; - flex-direction: column; - gap: 4px; - max-height: 200px; - overflow-y: auto; - background: var(--surface); - border: 1px solid var(--border); - border-radius: 6px; - padding: 6px; -} -.ls-timeline-item { - display: flex; - align-items: center; - gap: 8px; - font-size: 13px; - padding: 6px 10px; - background: var(--bg); - border-radius: 5px; -} -.ls-trigger { - font-size: 11px; - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.3px; - padding: 1px 6px; - border-radius: 3px; - flex-shrink: 0; - color: var(--text-muted); - background: var(--surface); -} -.ls-trigger-boot { - color: var(--text-muted); -} -.ls-trigger-restart { - color: var(--info); -} -.ls-trigger-manual { - color: var(--success); -} -.ls-trigger-pre-update { - color: var(--success); -} -.ls-trigger-post-update { - color: var(--warning); -} -.ls-trigger-post-restore { - color: var(--warning); -} -.ls-current-tag { - font-size: 11px; - font-weight: 600; - color: var(--accent); - flex-shrink: 0; -} -.ls-meta { - color: var(--text-muted); - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.ls-time { - color: var(--text-muted); - font-size: 13px; - flex-shrink: 0; -} -.ls-subsection { - margin-top: 10px; -} -.ls-subsection-title { - font-size: 13px; - font-weight: 600; - color: var(--text-muted); - cursor: pointer; - display: flex; - align-items: center; - justify-content: space-between; - user-select: none; - margin-bottom: 6px; -} -.ls-collapse { - font-size: 14px; -} -.ls-node-row { - display: flex; - align-items: center; - gap: 8px; - font-size: 13px; - padding: 2px 0; -} -.ls-node-status { - width: 7px; - height: 7px; - border-radius: 50%; - flex-shrink: 0; -} -.ls-node-enabled { - background: var(--info); -} -.ls-node-disabled { - background: var(--text-muted); -} -.ls-node-name { - color: var(--text); - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - user-select: text; -} -.ls-node-type { - font-size: 11px; - font-weight: 600; - text-transform: uppercase; - color: var(--text-muted); - padding: 1px 5px; - border: 1px solid var(--border); - border-radius: 3px; - flex-shrink: 0; -} -.ls-node-version { - font-size: 13px; - color: var(--text-muted); - font-family: monospace; - flex-shrink: 0; - user-select: text; -} -.ls-empty { - font-size: 14px; - color: var(--text-muted); -} -.ls-pip-row { - display: flex; - justify-content: space-between; - align-items: center; - padding: 2px 0; - font-size: 13px; -} -.ls-pip-name { - color: var(--text); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - flex: 1; - min-width: 0; - user-select: text; -} -.ls-pip-version { - color: var(--text-muted); - font-family: monospace; - margin-left: 12px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - max-width: 50%; - user-select: text; -} - -.modal-prompt-card { - background: var(--bg); - border: 1px solid var(--border); - border-radius: 6px; - padding: 10px 14px; - margin: 0 0 12px; - font-size: 14px; - color: var(--text-muted); - line-height: 1.6; - white-space: pre-line; -} -.modal-prompt-card strong { - color: var(--text); - font-weight: 600; -} -.modal-body > .modal-prompt-card:first-child { - margin-top: 0; -} - -/* Brand-styled confirm modal — generic modifier for any confirm that - * needs to feel continuous with the brand chrome it sits on top of. - * Currently only the Migrate to Standalone flow opts in. Migrate- - * specific layout (`.mig-*`) lives scoped in ModalDialog.vue. */ -.modal-box.modal-box--brand { - background: var(--neutral-800); - border: 1px solid var(--brand-surface-border); - border-radius: 12px; - padding: 20px 24px 18px; - width: min(100%, 600px); - max-width: 600px; - box-shadow: 0 24px 64px 0 rgba(0, 0, 0, 0.35); -} -.modal-box--brand .modal-title { - font-size: var(--takeover-fs-h3); - font-weight: 500; - color: var(--text); - border-bottom: 1px solid color-mix(in oklab, var(--neutral-100) 8%, transparent); - margin: 0 -24px 16px; - padding: 0 24px 14px; -} -.modal-box--brand .modal-body { - display: flex; - flex-direction: column; - gap: 14px; - max-height: 70vh; -} -.modal-box--brand .modal-actions { - margin-top: 16px; - padding-top: 14px; - border-top: 1px solid color-mix(in oklab, var(--neutral-100) 8%, transparent); -} -.modal-input-label { - display: block; - font-size: 13px; - font-weight: 600; - color: var(--text); - margin-bottom: 4px; -} -.modal-input-wrap { - margin-bottom: 12px; -} -.modal-error { - font-size: 13px; - color: var(--danger); - min-height: 12px; - margin-bottom: 0; -} -.modal-input { - width: 100%; - padding: 6px 8px; - font-size: 14px; -} -.modal-actions { - display: flex; - justify-content: flex-end; - gap: 8px; - padding-top: 12px; - margin: 0 -24px; - padding-left: 24px; - padding-right: 24px; - border-top: 1px solid var(--border); -} - -.modal-options { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 6px; - margin-bottom: 16px; - border-top: 1px solid var(--border); - padding-top: 12px; - margin-top: 12px; -} -.modal-option { - display: inline-flex; - align-items: center; - gap: 8px; - font-size: 14px; - cursor: pointer; - user-select: none; -} -.modal-option input[type='checkbox'] { - appearance: auto; - width: 16px; - height: 16px; - margin-top: 0; - background: none; - border-radius: 3px; - accent-color: var(--accent); - cursor: pointer; -} -.modal-option input[type='checkbox']::after { - content: none; -} - -.modal-loading { - display: flex; - align-items: center; - gap: 10px; - padding: 24px 0; - justify-content: center; - color: var(--text-muted); - font-size: 14px; -} -.modal-loading-spinner { - width: 20px; - height: 20px; - border: 2px solid var(--border); - border-top-color: var(--accent); - border-radius: 50%; - animation: btn-spin 0.6s linear infinite; -} -.with-spinner { - display: flex; - align-items: center; - gap: 10px; -} -.with-spinner::before { - content: ''; - display: inline-block; - width: 16px; - height: 16px; - border: 2px solid var(--border); - border-top-color: var(--accent); - border-radius: 50%; - animation: btn-spin 0.6s linear infinite; - flex-shrink: 0; -} - -.modal-select-box { - min-width: 340px; - max-width: 440px; -} -.modal-select-list { - display: flex; - flex-direction: column; - gap: 4px; - margin-bottom: 16px; - max-height: 40vh; - overflow-y: auto; - color: var(--neutral-100); -} -.modal-select-item { - display: flex; - align-items: center; - gap: 8px; - width: 100%; - padding: 10px 12px; - border: 1px solid var(--border); - border-radius: 6px; - background: var(--bg); - cursor: pointer; - text-align: left; - font-size: 14px; - color: var(--text); -} -.modal-select-item:hover { - border-color: var(--accent); - background: var(--surface); -} -.modal-select-item-label { - flex: 1; - font-weight: 500; -} -.modal-select-item-desc { - color: var(--text-muted); - font-size: 12px; -} - -/* Update banner */ -.update-banner { - display: flex; - align-items: center; - gap: 12px; - padding: 10px 14px; - margin-bottom: 16px; - border: 1px solid var(--accent); - border-radius: 8px; - background: var(--surface); - font-size: 14px; -} -.update-banner .update-text { - flex: 1; - color: var(--text); -} -.update-banner .update-text strong { - color: var(--accent); -} -.update-banner-actions { - display: flex; - gap: 8px; -} -.update-banner button { - flex-shrink: 0; -} - -/* Zoom banner */ -.zoom-banner { - display: flex; - align-items: center; - gap: 12px; - padding: 10px 14px; - border: 1px solid var(--border); - border-radius: 8px; - background: var(--surface); - font-size: 14px; - color: var(--text-muted); -} -.zoom-banner-actions { - display: flex; - gap: 8px; - margin-left: auto; -} -.zoom-banner-actions button { - flex-shrink: 0; -} - -/* Recessed list pattern — scrollable/nested containers with inset look */ -.recessed-list { - display: flex; - flex-direction: column; - gap: 3px; - max-height: 240px; - overflow-y: auto; - background: var(--surface); - border: 1px solid var(--border); - border-radius: 6px; - padding: 6px; -} -.recessed-search { - width: 100%; - padding: 6px 8px; - margin-bottom: 4px; - border: none; - border-bottom: 1px solid var(--border); - border-radius: 0; - background: transparent; - color: var(--text); - font-size: 13px; - outline: none; -} - -/* Card progress bar */ -.card-progress { - flex: 1; - min-width: 0; - margin-top: 4px; -} -.card-progress-status { - font-size: 12px; - color: var(--text-muted); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - margin-bottom: 4px; -} -.card-progress-track { - width: 100%; - height: 4px; - background: var(--border); - border-radius: 2px; - overflow: hidden; -} -.card-progress-fill { - height: 100%; - background: var(--accent); - border-radius: 2px; - width: 0%; - transition: width 0.3s ease; -} -.card-progress-fill.paused { - background: var(--warning); -} -.card-progress-fill.error { - background: var(--danger); -} -.card-progress-fill.success { - background: var(--success); -} -.card-progress-fill.indeterminate { - animation: indeterminate 1.5s ease-in-out infinite; - background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 50%, var(--accent) 100%); - background-size: 200% 100%; -} - -/* Dashboard */ -.dashboard-welcome { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - text-align: center; - padding: 80px 20px; -} -.dashboard-welcome-icon { - color: var(--text-muted); - margin-bottom: 20px; -} -.dashboard-welcome-title { - font-size: 28px; - font-weight: 700; - color: var(--text); - margin-bottom: 8px; -} -.dashboard-welcome-desc { - font-size: 16px; - color: var(--text-muted); - margin-bottom: 28px; - max-width: 400px; -} -.dashboard-cta-btn { - display: inline-flex; - align-items: center; - gap: 8px; - padding: 10px 24px; - font-size: 14px; -} -.dashboard-telemetry-notice { - margin-top: 28px; - max-width: 460px; - font-size: 13px; - color: var(--text-muted); - line-height: 1.4; -} -.dashboard-telemetry-link { - margin-left: 6px; - border: none; - background: none; - color: var(--accent); - cursor: pointer; - padding: 0; - font-size: 13px; - text-decoration: underline; -} -.dashboard-telemetry-link:hover { - color: var(--accent-hover); -} -.dashboard-section { - margin-bottom: 24px; -} -.dashboard-section-label { - font-size: 13px; - font-weight: 600; - color: var(--text-muted); - text-transform: uppercase; - letter-spacing: 0.5px; - margin-bottom: 10px; - display: flex; - align-items: center; - gap: 4px; -} - -/* Quick Launch cards */ -.dashboard-quick-launch { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); - gap: 12px; -} -.dashboard-card { - background: var(--surface); - border: 1px solid var(--border); - border-radius: 8px; - padding: 16px 20px; - display: flex; - flex-direction: column; - gap: 12px; -} -.dashboard-card.card-running, -.dashboard-cloud-card.card-running { - border-color: var(--accent); -} -.dashboard-card.card-stopping, -.dashboard-cloud-card.card-stopping { - border-color: var(--accent); - animation: card-breathe 2s ease-in-out infinite; -} -.dashboard-card.card-in-progress, -.dashboard-cloud-card.card-in-progress { - border-color: var(--accent); - animation: card-breathe 2s ease-in-out infinite; -} -.dashboard-card-badge { - display: flex; - align-items: center; - gap: 6px; - font-size: 12px; - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.5px; - color: var(--text-muted); -} -.dashboard-card-badge-primary { - color: var(--accent); -} -.dashboard-card-info { - display: flex; - flex-direction: column; - gap: 3px; - min-width: 0; - flex: 1; -} -.dashboard-card-name { - font-size: 16px; - font-weight: 600; -} -.dashboard-card-meta { - font-size: 13px; - color: var(--text-muted); -} -.dashboard-card-detail { - font-size: 12px; - color: var(--text-muted); -} -.dashboard-card-actions { - display: flex; - gap: 8px; - flex-wrap: wrap; -} -.dashboard-change-btn { - margin-left: auto; - padding: 2px 8px; - font-size: 11px; - border: 1px solid var(--border); - border-radius: 6px; - background: none; - color: var(--text-muted); - cursor: pointer; - text-transform: none; - letter-spacing: 0; - font-weight: 500; -} -.dashboard-change-btn:hover { - color: var(--text); - border-color: var(--border-hover); - background: none; -} -/* Primary card indicator */ -.card-indicator { - display: inline-block; - vertical-align: -2px; - margin-left: 4px; -} -.card-indicator-primary { - color: var(--accent); -} - -/* Cloud card */ -.dashboard-cloud-card { - background: var(--surface); - border: 1px solid var(--border); - border-radius: 8px; - padding: 16px 20px; - display: flex; - justify-content: space-between; - align-items: center; -} - -/* Install wizard */ -.wizard-step { - display: flex; - flex-direction: column; - gap: 12px; -} -.wizard-loading { - font-size: 14px; - color: var(--text-muted); - padding: 12px 0; -} -.wizard-error { - font-size: 14px; - color: var(--danger); - padding: 12px 0; -} -/* Non-blocking hardware warning under the detected-GPU field (e.g. Linux - * AMD /dev/kfd inaccessible): install may proceed, so warning, not danger. */ -.config-gpu-warning { - font-size: 12px; - line-height: 1.4; - color: var(--warning); - margin-top: 6px; -} -.track-probing { - font-size: 14px; - color: var(--text-muted); - padding: 8px 0; - margin-top: 6px; -} - -/* Source cards (Step 1) */ -.source-card { - display: flex; - flex-direction: column; - padding: 16px 20px; - background: var(--surface); - border: 2px solid var(--border); - border-radius: 8px; - cursor: pointer; - text-align: left; - transition: border-color 0.15s; -} -.source-card:hover { - border-color: var(--border-hover); -} -.source-card.selected { - border-color: var(--selected); -} - -.source-card-hero { - padding: 24px; - min-height: 260px; - justify-content: center; -} -.source-card-hero .source-card-label { - font-size: 18px; -} - -.source-card-header { - display: flex; - align-items: center; - gap: 10px; -} - -.source-card-label { - font-size: 16px; - font-weight: 600; - color: var(--text); -} -.source-card-desc { - font-size: 13px; - color: var(--text-muted); - margin-top: 4px; -} - -.source-card-badge { - font-size: 11px; - font-weight: 600; - text-transform: uppercase; - color: var(--accent); - letter-spacing: 0.5px; -} - -.source-cards-row { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); - gap: 10px; -} - -/* Variant / GPU cards (Step 2) */ -.variant-cards { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); - gap: 10px; - margin-top: 4px; -} -.variant-card { - padding: 14px 12px; - background: var(--surface); - border: 2px solid var(--border); - border-radius: 8px; - cursor: pointer; - text-align: center; - transition: border-color 0.15s; -} -.variant-card:hover { - border-color: var(--border-hover); -} -.variant-card.selected { - border-color: var(--selected); -} - -.variant-card-icon { - width: 96px; - height: 96px; - border-radius: 12px; - background: var(--bg); - margin: 0 auto 10px; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -} -.variant-card-icon img { - width: 100%; - height: 100%; - object-fit: cover; -} -.variant-card-icon-text { - font-size: 13px; - font-weight: 600; - color: var(--text-muted); -} - -.variant-card-label { - font-size: 16px; - font-weight: 600; - color: var(--text); -} -.variant-card-badge { - font-size: 11px; - font-weight: 600; - text-transform: uppercase; - color: var(--accent); - margin-top: 6px; - letter-spacing: 0.5px; - display: inline-block; - padding: 1px 6px; - border-radius: 3px; - background: color-mix(in srgb, var(--accent) 15%, transparent); -} -.variant-card-desc { - font-size: 11px; - color: var(--text-muted); - margin-top: 6px; -} - -/* Quick install modal */ -.quick-install-modal { - max-width: 620px; -} -.quick-install-desc { - font-size: 14px; - color: var(--text-muted); - margin-bottom: 16px; -} -.quick-install-btn { - padding: 10px 32px; - font-size: 14px; -} - -/* Wizard footer */ -.wizard-footer { - flex-shrink: 0; - display: grid; - grid-template-columns: 1fr auto 1fr; - align-items: center; - padding-top: 16px; - gap: 16px; -} -.wizard-back { - justify-self: start; - background: none; - border: 1px solid var(--border); - border-radius: 6px; - color: var(--text-muted); - font-size: 14px; - padding: 6px 16px; - cursor: pointer; - transition: - color 0.15s, - border-color 0.15s; -} -.wizard-back:hover { - color: var(--text); - border-color: var(--border-hover); -} -.wizard-dots { - display: flex; - gap: 6px; - align-items: center; - justify-self: center; -} -.wizard-dot { - width: 8px; - height: 8px; - border-radius: 50%; - background: var(--border); - transition: all 0.2s; -} -.wizard-dot.active { - width: 24px; - border-radius: 4px; - background: var(--accent); -} -.wizard-dot.completed { - background: var(--accent); -} -.wizard-footer > :last-child { - justify-self: end; -} - -.context-menu { - position: fixed; - z-index: 10000; - background: var(--modal-surface-bg); - border: 1px solid var(--chooser-surface-border); - border-radius: 10px; - padding: 6px; - min-width: 200px; - box-shadow: var(--modal-surface-shadow); -} -.context-menu-item { - display: flex; - align-items: center; - width: 100%; - font-size: 13px; - color: var(--neutral-100); - background: none; - border-radius: 6px; - transition: - background-color 100ms ease, - opacity 100ms ease; -} -.context-menu-item-action { - flex: 1; - padding: 8px 0 8px 14px; - color: inherit; - font: inherit; - background: none; - border: none; - text-align: left; - cursor: pointer; - white-space: nowrap; -} -.context-menu-item-action:hover { - background: none; -} -.context-menu-item-info { - margin-left: auto; - padding: 8px 14px 8px 12px; -} -.context-menu-item:hover:not(.disabled), -.context-menu-item:focus-within:not(.disabled) { - background: var(--brand-surface-bg-hover); - color: var(--text); -} -.context-menu-item-action:focus-visible { - outline: none; -} -/* Disabled via the `.disabled` class + `aria-disabled` (not the native - `disabled` attribute) so the hover title tooltip — which Chromium - suppresses on natively-disabled buttons — still surfaces the reason. */ -.context-menu-item.disabled { - color: var(--text-muted); - opacity: 0.5; -} -.context-menu-item.disabled .context-menu-item-action { - cursor: default; -} -.context-menu-item.is-danger { - color: var(--danger); -} -.context-menu-item.is-danger:hover:not(.disabled), -.context-menu-item.is-danger:focus-within:not(.disabled) { - color: var(--danger-hover); -} -.context-menu-separator { - height: 1px; - background: color-mix(in oklab, var(--neutral-100) 8%, transparent); - margin: 4px 6px; } diff --git a/src/renderer/src/assets/proprietaryFonts.ts b/src/renderer/src/assets/proprietaryFonts.ts index 392ed416d..afee17bd2 100644 --- a/src/renderer/src/assets/proprietaryFonts.ts +++ b/src/renderer/src/assets/proprietaryFonts.ts @@ -1,11 +1,3 @@ -/** - * Registers the proprietary, license-restricted PP Formula display face at runtime. - * It must never be committed (fetched at build time into `public/fonts/`) and is - * absent in OSS/dev/CI builds. Uses the FontFace API rather than CSS `@font-face` so - * the build doesn't depend on the binary existing and a document-relative - * `./fonts/...` URL resolves under the production `file://` origin; a missing file - * simply rejects the load and falls back to Inter. - */ export function loadProprietaryFonts(): void { if (typeof document === 'undefined' || !('fonts' in document)) return @@ -20,7 +12,5 @@ export function loadProprietaryFonts(): void { .then((loaded) => { document.fonts.add(loaded) }) - .catch(() => { - // Font not present (OSS / dev / CI); fall back to Inter. - }) + .catch(() => {}) } diff --git a/src/renderer/src/assets/sidebar/hills-sunset.jpg b/src/renderer/src/assets/sidebar/hills-sunset.jpg new file mode 100644 index 000000000..3c10f271c Binary files /dev/null and b/src/renderer/src/assets/sidebar/hills-sunset.jpg differ diff --git a/src/renderer/src/assets/sidebar/portrait-garden.jpg b/src/renderer/src/assets/sidebar/portrait-garden.jpg new file mode 100644 index 000000000..ea3fe5497 Binary files /dev/null and b/src/renderer/src/assets/sidebar/portrait-garden.jpg differ diff --git a/src/renderer/src/assets/sidebar/portrait-sun.jpg b/src/renderer/src/assets/sidebar/portrait-sun.jpg new file mode 100644 index 000000000..582b170ff Binary files /dev/null and b/src/renderer/src/assets/sidebar/portrait-sun.jpg differ diff --git a/src/renderer/src/comfySystemModal/SystemModalApp.vue b/src/renderer/src/comfySystemModal/SystemModalApp.vue index 62defb144..b6e10ddd5 100644 --- a/src/renderer/src/comfySystemModal/SystemModalApp.vue +++ b/src/renderer/src/comfySystemModal/SystemModalApp.vue @@ -2,14 +2,6 @@ import { computed, onMounted, onUnmounted, ref, nextTick } from 'vue' import BaseAlert from '../components/ui/BaseAlert.vue' -/** - * System-modal popup shell. Renders a confirm dialog via the shared `BaseAlert` so - * chrome matches the rest of the app's confirms. The spec arrives via - * `comfy-systemmodal:set-modal` on each open; the webContents persists between opens, - * so the bridge listener is registered once at mount. `spec.theme` is kept for IPC - * contract stability but ignored here. - */ - type SystemModalConfirmStyle = 'primary' | 'danger' type SystemModalSecondaryStyle = 'primary' | 'danger' | 'default' type SystemModalAction = 'confirm' | 'cancel' | 'secondary' @@ -55,7 +47,6 @@ function ack(action: SystemModalAction): void { let unsubModal: (() => void) | undefined -/** Only the most recent modal's tick fires `notifyRendered`, suppressing stale acks. */ let renderSeq = 0 onMounted(() => { @@ -90,59 +81,24 @@ onUnmounted(() => { @cancel="ack('cancel')" @secondary="ack('secondary')" > - - - diff --git a/src/renderer/src/comfySystemModal/main.ts b/src/renderer/src/comfySystemModal/main.ts index a2a3e5fef..7fd183f48 100644 --- a/src/renderer/src/comfySystemModal/main.ts +++ b/src/renderer/src/comfySystemModal/main.ts @@ -1,16 +1,11 @@ -// Same font + design tokens as the other renderers, for visual consistency. import '../assets/main.css' import { loadProprietaryFonts } from '../assets/proprietaryFonts' import { createApp } from 'vue' import SystemModalApp from './SystemModalApp.vue' -// This transient popup would mint a fresh telemetry session per open, so capture -// happens main-side. Default to dark; `data-theme` drives fallback CSS variables not -// overridden by the inline theme main pushes. document.documentElement.setAttribute('data-theme', 'dark') -// No vue-i18n: main composes the localized strings and pushes them with the spec. loadProprietaryFonts() createApp(SystemModalApp).mount('#app') diff --git a/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts b/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts index 15785b3cd..c256af797 100644 --- a/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts +++ b/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts @@ -270,14 +270,12 @@ describe('TitleBarApp', () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp) await flushPromises() - // Icon-only so the host-app menu doesn't clash with ComfyUI's own File menu. const fileBtn = wrapper.find('.title-menu-button') expect(fileBtn.exists()).toBe(true) expect(fileBtn.attributes('aria-label')).toBe('Menu') expect(fileBtn.classes()).toContain('title-menu-button--icon') const pill = wrapper.find('.title-install-pill') expect(pill.exists()).toBe(true) - // role=button div (not native