mirror of
https://github.com/getpaseo/paseo.git
synced 2026-12-06 15:16:03 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eba7d0ca14 |
@@ -1,2 +0,0 @@
|
||||
packages/app/gpui/package-lock.json linguist-generated
|
||||
packages/app/gpui/desktop/Cargo.lock linguist-generated
|
||||
@@ -62,13 +62,6 @@ sdk:
|
||||
- "packages/protocol/**"
|
||||
- "packages/workflows/**"
|
||||
|
||||
nix_hash:
|
||||
- "package-lock.json"
|
||||
- "nix/**"
|
||||
- "flake.lock"
|
||||
- "scripts/fix-lockfile.mjs"
|
||||
- "scripts/update-nix.sh"
|
||||
|
||||
browser:
|
||||
- "packages/server/src/server/agent/provider-snapshot-manager.ts"
|
||||
- "packages/server/src/server/session/provider/provider-catalog-session.ts"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
cooldown:
|
||||
default-days: 7
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
cooldown:
|
||||
default-days: 7
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: scripts
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
|
||||
@@ -67,12 +67,10 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
packages: read
|
||||
id-token: write
|
||||
attestations: write
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
|
||||
@@ -81,16 +79,8 @@ jobs:
|
||||
shell: bash
|
||||
run: node scripts/emit-release-env.mjs --source-tag "$SOURCE_TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Verify attestation source
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "$(git rev-parse HEAD)" != "$GITHUB_SHA" ]]; then
|
||||
echo "::error::Run this workflow from the release tag so provenance names the checked-out commit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -103,7 +93,7 @@ jobs:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Expo and EAS
|
||||
uses: expo/expo-github-action@c7b66a9c327a43a8fa7c0158e7f30d6040d2481e # v8
|
||||
uses: expo/expo-github-action@v8
|
||||
with:
|
||||
eas-version: latest
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
@@ -152,18 +142,9 @@ jobs:
|
||||
echo "asset_name=$asset_name" >> "$GITHUB_OUTPUT"
|
||||
echo "asset_path=$asset_path" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Attest Android APK
|
||||
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
|
||||
with:
|
||||
subject-path: ${{ steps.artifact.outputs.asset_path }}
|
||||
|
||||
- name: Generate Android checksum
|
||||
working-directory: ${{ runner.temp }}
|
||||
run: sha256sum "${{ steps.artifact.outputs.asset_name }}" > SHA256SUMS-android.txt
|
||||
|
||||
- name: Upload APK to GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
release_lookup="$(node scripts/github-release.mjs --repo "${{ github.repository }}" --tag "$RELEASE_TAG")"
|
||||
gh release upload "$release_lookup" "${{ steps.artifact.outputs.asset_path }}" "${{ runner.temp }}/SHA256SUMS-android.txt" --clobber --repo "${{ github.repository }}"
|
||||
gh release upload "$release_lookup" "${{ steps.artifact.outputs.asset_path }}" --clobber --repo "${{ github.repository }}"
|
||||
|
||||
+29
-50
@@ -24,9 +24,6 @@ env:
|
||||
NPM_CONFIG_AUDIT: "false"
|
||||
NPM_CONFIG_FUND: "false"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
name: changes
|
||||
@@ -47,13 +44,12 @@ jobs:
|
||||
relay: ${{ steps.filter.outputs.relay }}
|
||||
cli: ${{ steps.filter.outputs.cli }}
|
||||
website: ${{ steps.filter.outputs.website }}
|
||||
nix_hash: ${{ steps.filter.outputs.nix_hash }}
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
|
||||
@@ -64,17 +60,17 @@ jobs:
|
||||
filters: .github/ci-paths.yml
|
||||
|
||||
- name: Validate CI contracts
|
||||
run: node --test packages/react-native-enriched-markdown/vendor-grammars.test.mjs scripts/ci-workflow.test.mjs scripts/daemon-launch-contract.test.mjs scripts/changelog-utils.test.mjs scripts/release-version-utils.test.mjs scripts/publish-release-packages.test.mjs scripts/push-current-release-tag.test.mjs scripts/reconcile-release.test.mjs scripts/sync-fdroid-changelogs.test.mjs scripts/sync-release-notes-from-changelog.test.mjs scripts/upload-release-assets.test.mjs scripts/release-checksums.test.mjs scripts/precompress-assets.test.mjs scripts/check-web-export-size.test.mjs
|
||||
run: node --test scripts/ci-workflow.test.mjs scripts/daemon-launch-contract.test.mjs scripts/changelog-utils.test.mjs scripts/release-version-utils.test.mjs scripts/publish-release-packages.test.mjs scripts/push-current-release-tag.test.mjs scripts/reconcile-release.test.mjs scripts/sync-fdroid-changelogs.test.mjs scripts/sync-release-notes-from-changelog.test.mjs scripts/upload-release-assets.test.mjs scripts/precompress-assets.test.mjs
|
||||
|
||||
quality:
|
||||
name: quality
|
||||
needs: changes
|
||||
if: ${{ !cancelled() && (needs.changes.outputs.full != 'false' || needs.changes.outputs.format != 'false' || needs.changes.outputs.quality != 'false' || needs.changes.outputs.relay != 'false' || needs.changes.outputs.sdk != 'false' || needs.changes.outputs.nix_hash != 'false') }}
|
||||
if: ${{ !cancelled() && (needs.changes.outputs.full != 'false' || needs.changes.outputs.format != 'false' || needs.changes.outputs.quality != 'false' || needs.changes.outputs.relay != 'false' || needs.changes.outputs.sdk != 'false') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -91,7 +87,7 @@ jobs:
|
||||
|
||||
- name: Lint lockfile
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' && (needs.changes.outputs.full != 'false' || needs.changes.outputs.quality != 'false') }}
|
||||
run: npm exec --no -- lockfile-lint --path package-lock.json --type npm --allowed-hosts npm --validate-https --validate-integrity
|
||||
run: npx --yes lockfile-lint --path package-lock.json --type npm --allowed-hosts npm --validate-https --validate-integrity
|
||||
|
||||
- name: Lint
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' && (needs.changes.outputs.full != 'false' || needs.changes.outputs.quality != 'false') }}
|
||||
@@ -145,16 +141,6 @@ jobs:
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' && (needs.changes.outputs.full != 'false' || needs.changes.outputs.sdk != 'false') }}
|
||||
run: npm run typecheck:examples --workspace=@getpaseo/client
|
||||
|
||||
- name: Install Nix
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' && (needs.changes.outputs.full != 'false' || needs.changes.outputs.nix_hash != 'false') }}
|
||||
uses: cachix/install-nix-action@3dc140bfc76c49fbd4dd958429132e3746bcb086 # v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Verify Nix npm-deps hash
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' && (needs.changes.outputs.full != 'false' || needs.changes.outputs.nix_hash != 'false') }}
|
||||
run: ./scripts/update-nix.sh --check
|
||||
|
||||
# Plugin process launches and launch wraps quote for cmd.exe, which only real Windows checks.
|
||||
sdk-tests-windows:
|
||||
name: sdk-tests (windows-latest)
|
||||
@@ -162,9 +148,9 @@ jobs:
|
||||
if: ${{ !cancelled() && (needs.changes.outputs.full != 'false' || needs.changes.outputs.sdk != 'false') }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -184,9 +170,9 @@ jobs:
|
||||
if: ${{ !cancelled() && (needs.changes.outputs.full != 'false' || needs.changes.outputs.quality != 'false') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -222,9 +208,9 @@ jobs:
|
||||
if: ${{ !cancelled() && (needs.changes.outputs.full != 'false' || needs.changes.outputs.website != 'false') }}
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -242,7 +228,7 @@ jobs:
|
||||
# sometimes serves them at under 100 kB/s, which turns a 1-minute step into 25 minutes.
|
||||
# Keep the downloaded .deb files in the Actions cache so apt installs them without the mirror.
|
||||
- name: Restore website browser system packages
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/website-browser-debs
|
||||
key: website-browser-debs-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
|
||||
@@ -266,7 +252,7 @@ jobs:
|
||||
run: npm run test:e2e --workspace=@getpaseo/website
|
||||
|
||||
- name: Upload website test artifacts
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: website-playwright-results
|
||||
@@ -288,12 +274,12 @@ jobs:
|
||||
node -e "const os = require('node:os'); console.log(JSON.stringify({cpus: os.cpus().length, model: os.cpus()[0].model, ramGiB: os.totalmem() / 2 ** 30}))"
|
||||
|
||||
- &server_checkout
|
||||
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- &server_node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -382,9 +368,9 @@ jobs:
|
||||
if: ${{ !cancelled() && (needs.changes.outputs.full != 'false' || needs.changes.outputs.server != 'false') }}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -432,9 +418,9 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps: &desktop_test_steps
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -467,7 +453,7 @@ jobs:
|
||||
PASEO_DESKTOP_LIFECYCLE_ARTIFACT_DIR: ${{ runner.temp }}/desktop-lifecycle
|
||||
|
||||
- name: Upload desktop lifecycle screenshots
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() && runner.os == 'Linux' }}
|
||||
with:
|
||||
name: desktop-lifecycle
|
||||
@@ -490,7 +476,7 @@ jobs:
|
||||
PASEO_DESKTOP_BROWSER_E2E_ARTIFACT_DIR: ${{ runner.temp }}/desktop-browser-e2e
|
||||
|
||||
- name: Upload desktop browser diagnostics
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ failure() && runner.os == 'Linux' }}
|
||||
with:
|
||||
name: desktop-browser-e2e
|
||||
@@ -514,9 +500,9 @@ jobs:
|
||||
if: ${{ !cancelled() && (needs.changes.outputs.full != 'false' || needs.changes.outputs.app != 'false') }}
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -534,13 +520,6 @@ jobs:
|
||||
- name: Run app unit tests
|
||||
run: npm run test --workspace=@getpaseo/app
|
||||
|
||||
# Cloudflare Pages rejects files over 25 MiB; fail here, not at release-tag deploy.
|
||||
- name: Export web app and check file sizes
|
||||
working-directory: packages/app
|
||||
run: |
|
||||
npx expo export --platform web
|
||||
npm run check:web-size
|
||||
|
||||
playwright-1:
|
||||
name: playwright (shard 1/8)
|
||||
needs: changes
|
||||
@@ -554,9 +533,9 @@ jobs:
|
||||
run: |
|
||||
node -e "const os = require('node:os'); console.log(JSON.stringify({cpus: os.cpus().length, model: os.cpus()[0].model, ramGiB: os.totalmem() / 2 ** 30}))"
|
||||
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -588,7 +567,7 @@ jobs:
|
||||
PWTEST_SHARD_WEIGHTS: "90:114:100:104:108:112:112:90"
|
||||
|
||||
- name: Upload test artifacts
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: playwright-results-${{ env.PLAYWRIGHT_ARTIFACT }}
|
||||
@@ -679,9 +658,9 @@ jobs:
|
||||
PASEO_CLI_TEST_SHARD: "1"
|
||||
PASEO_CLI_TEST_SHARD_TOTAL: "3"
|
||||
steps: &cli_test_steps
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
@@ -14,9 +14,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
@@ -10,9 +10,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
@@ -22,9 +22,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: scripts
|
||||
ref: ${{ env.CHECKOUT_REF }}
|
||||
@@ -110,12 +110,10 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
packages: read
|
||||
id-token: write
|
||||
attestations: write
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ env.CHECKOUT_REF }}
|
||||
@@ -124,17 +122,8 @@ jobs:
|
||||
shell: bash
|
||||
run: node scripts/emit-release-env.mjs --source-tag "$SOURCE_TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Verify attestation source
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "$(git rev-parse HEAD)" != "$GITHUB_SHA" || "$(git rev-parse "refs/tags/${SOURCE_TAG#refs/tags/}^{commit}")" != "$GITHUB_SHA" ]]; then
|
||||
echo "::error::Run this workflow from the checked-out release ref so provenance names the built commit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -194,17 +183,13 @@ jobs:
|
||||
|
||||
- name: Upload packaged smoke diagnostics
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-smoke-macos-${{ matrix.electron_arch }}
|
||||
path: ${{ runner.temp }}/desktop-smoke
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
|
||||
- name: Generate desktop checksums
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
run: node scripts/release-checksums.mjs "${{ env.DESKTOP_PACKAGE_PATH }}/release" "SHA256SUMS-desktop-macos-${{ matrix.electron_arch }}.txt"
|
||||
|
||||
- name: Upload desktop artifacts to release
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
env:
|
||||
@@ -216,22 +201,9 @@ jobs:
|
||||
release_lookup="$(node scripts/github-release.mjs --repo "${{ github.repository }}" --tag "$RELEASE_TAG")"
|
||||
node scripts/upload-release-assets.mjs "$release_lookup" "$release_dir" "${{ github.repository }}"
|
||||
|
||||
- name: Attest desktop binaries
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
|
||||
with:
|
||||
subject-path: |
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.dmg
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.zip
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.exe
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.AppImage
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.deb
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.rpm
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.tar.gz
|
||||
|
||||
- name: Upload desktop artifacts to workflow
|
||||
if: env.SHOULD_PUBLISH != 'true'
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-macos-${{ matrix.electron_arch }}
|
||||
path: ${{ env.DESKTOP_PACKAGE_PATH }}/release/*.dmg
|
||||
@@ -239,7 +211,7 @@ jobs:
|
||||
|
||||
- name: Upload manifest artifact
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mac-manifest-${{ matrix.electron_arch }}
|
||||
path: ${{ env.DESKTOP_PACKAGE_PATH }}/release/${{ env.RELEASE_CHANNEL }}-mac.yml
|
||||
@@ -251,12 +223,10 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
packages: read
|
||||
id-token: write
|
||||
attestations: write
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ env.CHECKOUT_REF }}
|
||||
@@ -265,17 +235,8 @@ jobs:
|
||||
shell: bash
|
||||
run: node scripts/emit-release-env.mjs --source-tag "$SOURCE_TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Verify attestation source
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "$(git rev-parse HEAD)" != "$GITHUB_SHA" || "$(git rev-parse "refs/tags/${SOURCE_TAG#refs/tags/}^{commit}")" != "$GITHUB_SHA" ]]; then
|
||||
echo "::error::Run this workflow from the checked-out release ref so provenance names the built commit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -323,17 +284,13 @@ jobs:
|
||||
|
||||
- name: Upload packaged smoke diagnostics
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-smoke-linux-x64
|
||||
path: ${{ runner.temp }}/desktop-smoke
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
|
||||
- name: Generate desktop checksums
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
run: node scripts/release-checksums.mjs "${{ env.DESKTOP_PACKAGE_PATH }}/release" "SHA256SUMS-desktop-linux.txt"
|
||||
|
||||
- name: Upload desktop artifacts to release
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
env:
|
||||
@@ -345,22 +302,9 @@ jobs:
|
||||
release_lookup="$(node scripts/github-release.mjs --repo "${{ github.repository }}" --tag "$RELEASE_TAG")"
|
||||
node scripts/upload-release-assets.mjs "$release_lookup" "$release_dir" "${{ github.repository }}"
|
||||
|
||||
- name: Attest desktop binaries
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
|
||||
with:
|
||||
subject-path: |
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.dmg
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.zip
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.exe
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.AppImage
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.deb
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.rpm
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.tar.gz
|
||||
|
||||
- name: Upload desktop artifacts to workflow
|
||||
if: env.SHOULD_PUBLISH != 'true'
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-linux
|
||||
path: ${{ env.DESKTOP_PACKAGE_PATH }}/release/*
|
||||
@@ -368,7 +312,7 @@ jobs:
|
||||
|
||||
- name: Upload manifest artifact
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-manifest
|
||||
path: ${{ env.DESKTOP_PACKAGE_PATH }}/release/${{ env.RELEASE_CHANNEL }}-linux.yml
|
||||
@@ -380,12 +324,10 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
packages: read
|
||||
id-token: write
|
||||
attestations: write
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ env.CHECKOUT_REF }}
|
||||
@@ -394,17 +336,8 @@ jobs:
|
||||
shell: bash
|
||||
run: node scripts/emit-release-env.mjs --source-tag "$SOURCE_TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Verify attestation source
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "$(git rev-parse HEAD)" != "$GITHUB_SHA" || "$(git rev-parse "refs/tags/${SOURCE_TAG#refs/tags/}^{commit}")" != "$GITHUB_SHA" ]]; then
|
||||
echo "::error::Run this workflow from the checked-out release ref so provenance names the built commit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -449,17 +382,13 @@ jobs:
|
||||
|
||||
- name: Upload packaged smoke diagnostics
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-smoke-windows-x64
|
||||
path: ${{ runner.temp }}/desktop-smoke
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
|
||||
- name: Generate desktop checksums
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
run: node scripts/release-checksums.mjs "${{ env.DESKTOP_PACKAGE_PATH }}/release" "SHA256SUMS-desktop-windows.txt"
|
||||
|
||||
- name: Upload desktop artifacts to release
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
env:
|
||||
@@ -471,22 +400,9 @@ jobs:
|
||||
release_lookup="$(node scripts/github-release.mjs --repo "${{ github.repository }}" --tag "$RELEASE_TAG")"
|
||||
node scripts/upload-release-assets.mjs "$release_lookup" "$release_dir" "${{ github.repository }}"
|
||||
|
||||
- name: Attest desktop binaries
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
|
||||
with:
|
||||
subject-path: |
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.dmg
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.zip
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.exe
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.AppImage
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.deb
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.rpm
|
||||
${{ env.DESKTOP_PACKAGE_PATH }}/release/*.tar.gz
|
||||
|
||||
- name: Upload desktop artifacts to workflow
|
||||
if: env.SHOULD_PUBLISH != 'true'
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-windows
|
||||
path: ${{ env.DESKTOP_PACKAGE_PATH }}/release/*
|
||||
@@ -494,7 +410,7 @@ jobs:
|
||||
|
||||
- name: Upload manifest artifact
|
||||
if: env.SHOULD_PUBLISH == 'true' && env.IS_SMOKE_TAG != 'true'
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-manifest
|
||||
path: ${{ env.DESKTOP_PACKAGE_PATH }}/release/${{ env.RELEASE_CHANNEL }}.yml
|
||||
@@ -511,30 +427,20 @@ jobs:
|
||||
cancel-in-progress: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
package.json
|
||||
package-lock.json
|
||||
scripts
|
||||
ref: ${{ env.CHECKOUT_REF }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Resolve release tag
|
||||
shell: bash
|
||||
run: node scripts/emit-release-env.mjs --source-tag "$SOURCE_TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Verify release source
|
||||
if: env.IS_SMOKE_TAG != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "$(git rev-parse HEAD)" != "$GITHUB_SHA" || "$(git rev-parse "refs/tags/${SOURCE_TAG#refs/tags/}^{commit}")" != "$GITHUB_SHA" ]]; then
|
||||
echo "::error::Run this workflow from the release tag so provenance names the built commit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
@@ -549,21 +455,21 @@ jobs:
|
||||
|
||||
- name: Download mac manifest artifacts
|
||||
if: env.IS_SMOKE_TAG != 'true' && needs.publish-macos.result == 'success'
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: mac-manifest-*
|
||||
path: release-manifests
|
||||
|
||||
- name: Download Linux manifest artifact
|
||||
if: env.IS_SMOKE_TAG != 'true' && needs.publish-linux.result == 'success'
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: linux-manifest
|
||||
path: release-manifests/linux-manifest
|
||||
|
||||
- name: Download Windows manifest artifact
|
||||
if: env.IS_SMOKE_TAG != 'true' && needs.publish-windows.result == 'success'
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows-manifest
|
||||
path: release-manifests/windows-manifest
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
package.json
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
run: node scripts/emit-release-env.mjs --source-tag "$SOURCE_TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
check_tag: ${{ steps.values.outputs.check_tag }}
|
||||
publish_tags: ${{ steps.values.outputs.publish_tags }}
|
||||
steps:
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- id: values
|
||||
env:
|
||||
@@ -119,12 +119,12 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4
|
||||
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
|
||||
- uses: docker/setup-qemu-action@v4
|
||||
- uses: docker/setup-buildx-action@v4
|
||||
|
||||
- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
|
||||
- uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: docker/base/Dockerfile
|
||||
@@ -133,8 +133,7 @@ jobs:
|
||||
PASEO_VERSION=${{ needs.setup.outputs.install_version }}
|
||||
tags: ${{ needs.setup.outputs.check_tag }}
|
||||
push: false
|
||||
# The check build does not export an image to attach attestations to.
|
||||
provenance: mode=max
|
||||
provenance: false
|
||||
cache-from: type=gha,scope=paseo
|
||||
cache-to: type=gha,scope=paseo,mode=max
|
||||
|
||||
@@ -146,19 +145,19 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4
|
||||
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
|
||||
- uses: docker/setup-qemu-action@v4
|
||||
- uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
|
||||
- uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: docker/base/Dockerfile
|
||||
@@ -167,6 +166,6 @@ jobs:
|
||||
PASEO_VERSION=${{ needs.setup.outputs.install_version }}
|
||||
tags: ${{ needs.setup.outputs.publish_tags }}
|
||||
push: true
|
||||
provenance: mode=max
|
||||
provenance: false
|
||||
cache-from: type=gha,scope=paseo
|
||||
cache-to: type=gha,scope=paseo,mode=max
|
||||
|
||||
@@ -1,479 +0,0 @@
|
||||
name: GPUI Nightly
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 6 * * *"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platform:
|
||||
description: "Platform(s) to build."
|
||||
required: false
|
||||
default: "all"
|
||||
type: choice
|
||||
options:
|
||||
- all
|
||||
- macos
|
||||
- linux
|
||||
publish:
|
||||
description: "Publish built artifacts to the rolling gpui-nightly prerelease."
|
||||
required: false
|
||||
default: "true"
|
||||
type: choice
|
||||
options:
|
||||
- "true"
|
||||
- "false"
|
||||
|
||||
concurrency:
|
||||
group: gpui-nightly-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ONNXRUNTIME_NODE_INSTALL: skip
|
||||
NPM_CONFIG_AUDIT: "false"
|
||||
NPM_CONFIG_FUND: "false"
|
||||
RN_GPUI_JS_ENGINE: v8
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
name: gpui-nightly (macos-latest, arm64)
|
||||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }}
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
run: |
|
||||
rustup toolchain install stable --profile minimal --no-self-update
|
||||
rustup default stable
|
||||
|
||||
- name: Cache Cargo and GPUI target
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
.artifacts/gpui/macos/target
|
||||
key: gpui-nightly-cargo-macos26-arm64-${{ hashFiles('packages/app/gpui/desktop/Cargo.lock', 'packages/app/gpui/package-lock.json') }}
|
||||
restore-keys: |
|
||||
gpui-nightly-cargo-macos26-arm64-
|
||||
|
||||
- name: Install macOS build tools
|
||||
run: command -v ninja >/dev/null || brew install ninja
|
||||
|
||||
- name: Install JS dependencies and build app dependencies
|
||||
run: |
|
||||
node scripts/npm-retry.mjs ci
|
||||
npm run build:app-deps
|
||||
|
||||
- name: Install GPUI dependencies and verify V8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
npm run gpui:install
|
||||
node packages/app/gpui/node_modules/@react-native-gpui/v8/scripts/fetch-binaries.mjs --verify
|
||||
|
||||
- name: Build macOS GPUI app bundle
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: "15.0"
|
||||
NODE_OPTIONS: --max-old-space-size=6144
|
||||
CARGO_BUILD_JOBS: "4"
|
||||
PASEO_RENDERER: gpui
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
repo_root="$PWD"
|
||||
# Drop restored CMake state because native-deps is not cached across runners.
|
||||
rm -rf "$repo_root/.artifacts/gpui/macos/target/rn-gpui-cmake"
|
||||
cd packages/app/gpui
|
||||
CARGO_TARGET_DIR="$repo_root/.artifacts/gpui/macos/target" \
|
||||
node node_modules/react-native/cli.js package-desktop \
|
||||
--target app --out "$repo_root/.artifacts/gpui/macos/dist"
|
||||
|
||||
- name: Check Apple signing secrets
|
||||
id: signing_secrets
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: |
|
||||
if [[ -n "$APPLE_CERTIFICATE" && -n "$APPLE_CERTIFICATE_PASSWORD" && -n "$APPLE_ID" && -n "$APPLE_PASSWORD" && -n "$APPLE_TEAM_ID" ]]; then
|
||||
echo "enabled=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "enabled=false" >> "$GITHUB_OUTPUT"
|
||||
echo "::notice::Apple signing secrets are not configured; packaging ad-hoc signed macOS build without notarization."
|
||||
fi
|
||||
|
||||
- name: Sign, verify, notarize, and package macOS DMG
|
||||
if: steps.signing_secrets.outputs.enabled == 'true'
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
repo_root="$PWD"
|
||||
app_path="$repo_root/.artifacts/gpui/macos/dist/Paseo GPUI.app"
|
||||
test -d "$app_path"
|
||||
|
||||
node scripts/gpui.mjs apply-macos-icon "$app_path"
|
||||
|
||||
keychain_path="$RUNNER_TEMP/gpui-signing.keychain-db"
|
||||
keychain_password="$(openssl rand -hex 24)"
|
||||
cert_path="$RUNNER_TEMP/apple-cert.p12"
|
||||
|
||||
node -e '
|
||||
const fs = require("node:fs");
|
||||
const raw = (process.env.APPLE_CERTIFICATE || "").trim().replace(/^data:[^,]*,/, "");
|
||||
fs.writeFileSync(process.argv[1], Buffer.from(raw, "base64"));
|
||||
' "$cert_path"
|
||||
|
||||
security create-keychain -p "$keychain_password" "$keychain_path"
|
||||
security set-keychain-settings -lut 21600 "$keychain_path"
|
||||
security unlock-keychain -p "$keychain_password" "$keychain_path"
|
||||
security import "$cert_path" -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$keychain_path"
|
||||
rm -f "$cert_path"
|
||||
security list-keychains -d user -s "$keychain_path" login.keychain-db
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$keychain_password" "$keychain_path"
|
||||
|
||||
sign_identity="$(security find-identity -v -p codesigning "$keychain_path" | sed -n 's/.*"\(Developer ID Application:[^"]*\)".*/\1/p' | head -n 1)"
|
||||
if [[ -z "$sign_identity" ]]; then
|
||||
echo "::error::No Developer ID Application certificate found in imported keychain."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while IFS= read -r -d '' bin; do
|
||||
codesign --force --sign "$sign_identity" --timestamp --options runtime "$bin"
|
||||
done < <(find "$app_path/Contents" -type f \( -name '*.dylib' -o -name '*.so' -o -name '*.node' \) -print0)
|
||||
|
||||
codesign --force --sign "$sign_identity" --timestamp --options runtime \
|
||||
--entitlements packages/app/gpui/desktop/entitlements.mac.plist \
|
||||
"$app_path"
|
||||
|
||||
node --test packages/app/gpui/verify-macos-package.test.mjs
|
||||
node packages/app/gpui/verify-macos-package.mjs "$app_path" --require-asset-catalog
|
||||
codesign -d --entitlements :- "$app_path" 2>&1 | grep -q "com.apple.security.cs.allow-jit"
|
||||
|
||||
export PASEO_REAL_XCRUN="$(command -v xcrun)"
|
||||
xcrun_bin="$(mktemp -d)"
|
||||
trap 'rm -rf "$xcrun_bin"' EXIT
|
||||
cp scripts/macos-xcrun-retry.sh "$xcrun_bin/xcrun"
|
||||
chmod +x "$xcrun_bin/xcrun"
|
||||
export PATH="$xcrun_bin:$PATH"
|
||||
|
||||
app_notarize_zip="$RUNNER_TEMP/paseo-gpui-app-notarize.zip"
|
||||
ditto -c -k --keepParent "$app_path" "$app_notarize_zip"
|
||||
xcrun notarytool submit "$app_notarize_zip" \
|
||||
--apple-id "$APPLE_ID" \
|
||||
--password "$APPLE_PASSWORD" \
|
||||
--team-id "$APPLE_TEAM_ID" \
|
||||
--wait
|
||||
rm -f "$app_notarize_zip"
|
||||
xcrun stapler staple "$app_path"
|
||||
spctl --assess --type execute -v "$app_path"
|
||||
|
||||
out_dir="$RUNNER_TEMP/gpui-nightly-macos-arm64"
|
||||
rm -rf "$out_dir"
|
||||
node scripts/gpui.mjs package-macos-dmg "$app_path" "$out_dir"
|
||||
|
||||
dmg_path="$out_dir/Paseo-GPUI-nightly-macos-arm64.dmg"
|
||||
codesign --force --sign "$sign_identity" --timestamp "$dmg_path"
|
||||
xcrun notarytool submit "$dmg_path" \
|
||||
--apple-id "$APPLE_ID" \
|
||||
--password "$APPLE_PASSWORD" \
|
||||
--team-id "$APPLE_TEAM_ID" \
|
||||
--wait
|
||||
xcrun stapler staple "$dmg_path"
|
||||
xcrun stapler validate "$dmg_path"
|
||||
|
||||
- name: Verify and package unsigned macOS DMG (fork fallback)
|
||||
if: steps.signing_secrets.outputs.enabled != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
repo_root="$PWD"
|
||||
app_path="$repo_root/.artifacts/gpui/macos/dist/Paseo GPUI.app"
|
||||
test -d "$app_path"
|
||||
node scripts/gpui.mjs apply-macos-icon "$app_path" --adhoc-resign
|
||||
node --test packages/app/gpui/verify-macos-package.test.mjs
|
||||
node packages/app/gpui/verify-macos-package.mjs "$app_path" --require-asset-catalog
|
||||
codesign -d --entitlements :- "$app_path" 2>&1 | grep -q "com.apple.security.cs.allow-jit"
|
||||
|
||||
out_dir="$RUNNER_TEMP/gpui-nightly-macos-arm64"
|
||||
rm -rf "$out_dir"
|
||||
node scripts/gpui.mjs package-macos-dmg "$app_path" "$out_dir"
|
||||
|
||||
- name: Clean up temporary Apple signing keychain
|
||||
if: always()
|
||||
run: |
|
||||
rm -f "$RUNNER_TEMP/apple-cert.p12" "$RUNNER_TEMP/paseo-gpui-app-notarize.zip"
|
||||
if [[ -f "$RUNNER_TEMP/gpui-signing.keychain-db" ]]; then
|
||||
security delete-keychain "$RUNNER_TEMP/gpui-signing.keychain-db" || true
|
||||
fi
|
||||
|
||||
- name: Generate macOS checksums
|
||||
run: node scripts/release-checksums.mjs "${{ runner.temp }}/gpui-nightly-macos-arm64" "SHA256SUMS-gpui-nightly-macos-arm64.txt"
|
||||
|
||||
- name: Upload macOS nightly artifact
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: gpui-nightly-macos-arm64
|
||||
path: ${{ runner.temp }}/gpui-nightly-macos-arm64
|
||||
retention-days: 7
|
||||
|
||||
build-linux:
|
||||
name: gpui-nightly (ubuntu-24.04, x64)
|
||||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
run: |
|
||||
rustup toolchain install stable --profile minimal --no-self-update
|
||||
rustup default stable
|
||||
|
||||
- name: Cache Cargo and GPUI target
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
.artifacts/gpui/linux/target
|
||||
key: gpui-nightly-cargo-linux-x64-${{ hashFiles('packages/app/gpui/desktop/Cargo.lock', 'packages/app/gpui/package-lock.json') }}
|
||||
restore-keys: |
|
||||
gpui-nightly-cargo-linux-x64-
|
||||
|
||||
- name: Install Linux GPUI build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
build-essential \
|
||||
clang \
|
||||
cmake \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
libvulkan-dev \
|
||||
libwayland-dev \
|
||||
libx11-xcb-dev \
|
||||
libxcb1-dev \
|
||||
libxcb-render0-dev \
|
||||
libxcb-shape0-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxkbcommon-dev \
|
||||
libxkbcommon-x11-dev
|
||||
|
||||
- name: Install JS dependencies and build app dependencies
|
||||
run: |
|
||||
node scripts/npm-retry.mjs ci
|
||||
npm run build:app-deps
|
||||
|
||||
- name: Install GPUI dependencies and verify V8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
npm run gpui:install
|
||||
node packages/app/gpui/node_modules/@react-native-gpui/v8/scripts/fetch-binaries.mjs --verify
|
||||
|
||||
- name: Verify icon packaging helpers
|
||||
run: node --test packages/app/gpui/verify-macos-package.test.mjs
|
||||
|
||||
- name: Build, package, and smoke-check Linux x64 GPUI archive
|
||||
env:
|
||||
CARGO_BUILD_JOBS: "4"
|
||||
CARGO_TARGET_DIR: ${{ github.workspace }}/.artifacts/gpui/linux/target
|
||||
PASEO_RENDERER: gpui
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: node scripts/gpui.mjs package-linux --out "${{ runner.temp }}/gpui-nightly-linux-x64"
|
||||
|
||||
- name: Generate Linux checksums
|
||||
run: node scripts/release-checksums.mjs "${{ runner.temp }}/gpui-nightly-linux-x64" "SHA256SUMS-gpui-nightly-linux-x64.txt"
|
||||
|
||||
- name: Upload Linux nightly artifact
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: gpui-nightly-linux-x64
|
||||
path: ${{ runner.temp }}/gpui-nightly-linux-x64
|
||||
retention-days: 7
|
||||
|
||||
publish:
|
||||
name: Publish gpui-nightly prerelease
|
||||
needs: [build-macos, build-linux]
|
||||
if: ${{ !cancelled() && (github.event_name != 'workflow_dispatch' || github.event.inputs.publish != 'false') && needs.build-macos.result == 'success' && needs.build-linux.result == 'success' }}
|
||||
concurrency:
|
||||
group: gpui-nightly-release
|
||||
cancel-in-progress: false
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
with:
|
||||
sparse-checkout: scripts
|
||||
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "22"
|
||||
|
||||
- name: Download built nightly artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
with:
|
||||
pattern: gpui-nightly-*
|
||||
path: ${{ runner.temp }}/nightly-assets
|
||||
merge-multiple: true
|
||||
|
||||
- name: Publish rolling gpui-nightly prerelease
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
assets_dir="${RUNNER_TEMP}/nightly-assets"
|
||||
notes_file="${RUNNER_TEMP}/gpui-nightly-notes.md"
|
||||
build_date="$(date -u +"%Y-%m-%d %H:%M UTC")"
|
||||
short_sha="$(printf '%s' "${GITHUB_SHA}" | cut -c1-9)"
|
||||
|
||||
cat > "${assets_dir}/SHA256SUMS-gpui-nightly.txt" <<'EOF'
|
||||
EOF
|
||||
rm -f "${assets_dir}/SHA256SUMS-gpui-nightly.txt"
|
||||
if compgen -G "${assets_dir}/SHA256SUMS-gpui-nightly-*.txt" > /dev/null; then
|
||||
cat "${assets_dir}"/SHA256SUMS-gpui-nightly-*.txt > "${assets_dir}/SHA256SUMS-gpui-nightly.txt"
|
||||
rm -f "${assets_dir}"/SHA256SUMS-gpui-nightly-*.txt
|
||||
fi
|
||||
|
||||
{
|
||||
echo "## Paseo GPUI Nightly Preview"
|
||||
echo ""
|
||||
echo "- **Build date:** ${build_date}"
|
||||
echo "- **Commit:** \`${GITHUB_SHA}\` (\`${short_sha}\`)"
|
||||
echo "- **JS engine:** V8 14.6 (\`@react-native-gpui/v8\`)"
|
||||
echo "- **Targets:** macOS arm64 (\`.dmg\`, \`.zip\`), Linux x64 (\`.tar.gz\`)"
|
||||
echo ""
|
||||
echo "### Preview Limitations"
|
||||
echo ""
|
||||
echo "- Connects to a separately running Paseo daemon (defaults to \`localhost:6767\` or remote hosts); does not bundle the daemon."
|
||||
echo "- \`HtmlFrame\` / HTML previews and Mermaid diagrams render placeholders / source fallback (no embedded WebView backend)."
|
||||
echo "- Embedded terminal and Skia diff views are not yet ported to GPUI."
|
||||
echo ""
|
||||
echo "### SHA-256 Checksums"
|
||||
echo ""
|
||||
echo '```'
|
||||
if [[ -f "${assets_dir}/SHA256SUMS-gpui-nightly.txt" ]]; then
|
||||
cat "${assets_dir}/SHA256SUMS-gpui-nightly.txt"
|
||||
else
|
||||
echo "(no checksums generated)"
|
||||
fi
|
||||
echo '```'
|
||||
} > "${notes_file}"
|
||||
|
||||
tag="gpui-nightly"
|
||||
staging_tag="gpui-nightly-stage-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
|
||||
staging_id=""
|
||||
old_id=""
|
||||
old_sha=""
|
||||
swapping="false"
|
||||
cleanup_staging() {
|
||||
local ec=$?
|
||||
set +e
|
||||
if [[ "$swapping" == "true" && $ec -ne 0 && -n "$old_id" && -n "$old_sha" ]]; then
|
||||
gh api "repos/${{ github.repository }}/git/refs/tags/${tag}" \
|
||||
-X PATCH -f sha="${old_sha}" -F force=true > /dev/null 2>&1 || true
|
||||
gh api "repos/${{ github.repository }}/releases/${old_id}" \
|
||||
-X PATCH -f tag_name="$tag" -F draft=false -F prerelease=true -f make_latest="false" > /dev/null 2>&1 || true
|
||||
return 0
|
||||
fi
|
||||
if [[ -n "$staging_id" && "$swapping" != "true" ]]; then
|
||||
gh api "repos/${{ github.repository }}/releases/${staging_id}" -X DELETE > /dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
trap cleanup_staging EXIT
|
||||
|
||||
# Stage and verify the full asset set on a draft first so upload failures never touch
|
||||
# the public gpui-nightly release or its downloads.
|
||||
gh release create "$staging_tag" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--title "Paseo GPUI Nightly (${short_sha})" \
|
||||
--notes-file "${notes_file}" \
|
||||
--draft \
|
||||
--prerelease \
|
||||
--latest=false \
|
||||
--target "${GITHUB_SHA}"
|
||||
|
||||
staging_id="$(gh release view "$staging_tag" --repo "${{ github.repository }}" --json databaseId --jq '.databaseId')"
|
||||
node scripts/upload-release-assets.mjs "$staging_tag" "${assets_dir}" "${{ github.repository }}"
|
||||
|
||||
uploaded_assets="$(gh release view "$staging_tag" --repo "${{ github.repository }}" --json assets --jq '.assets[].name')"
|
||||
for file in "${assets_dir}"/*; do
|
||||
[[ -f "$file" ]] || continue
|
||||
name="$(basename "$file")"
|
||||
if ! grep -Fxq "$name" <<< "$uploaded_assets"; then
|
||||
echo "::error::Missing staged release asset: ${name}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if old_id="$(gh release view "$tag" --repo "${{ github.repository }}" --json databaseId --jq '.databaseId' 2>/dev/null)"; then
|
||||
old_sha="$(gh api "repos/${{ github.repository }}/git/refs/tags/${tag}" --jq '.object.sha' 2>/dev/null || true)"
|
||||
swapping="true"
|
||||
# Hold the prior release as a draft rather than deleting it before promotion completes.
|
||||
gh api "repos/${{ github.repository }}/releases/${old_id}" \
|
||||
-X PATCH \
|
||||
-F draft=true > /dev/null
|
||||
else
|
||||
old_id=""
|
||||
swapping="true"
|
||||
fi
|
||||
|
||||
if gh api "repos/${{ github.repository }}/git/refs/tags/${tag}" > /dev/null 2>&1; then
|
||||
gh api "repos/${{ github.repository }}/git/refs/tags/${tag}" \
|
||||
-X PATCH \
|
||||
-f sha="${GITHUB_SHA}" \
|
||||
-F force=true
|
||||
else
|
||||
gh api "repos/${{ github.repository }}/git/refs" \
|
||||
-X POST \
|
||||
-f ref="refs/tags/${tag}" \
|
||||
-f sha="${GITHUB_SHA}"
|
||||
fi
|
||||
|
||||
promoted_draft="$(gh api "repos/${{ github.repository }}/releases/${staging_id}" \
|
||||
-X PATCH \
|
||||
-f tag_name="$tag" \
|
||||
-f target_commitish="${GITHUB_SHA}" \
|
||||
-F draft=false \
|
||||
-F prerelease=true \
|
||||
-f make_latest="false" \
|
||||
--jq '.draft')"
|
||||
|
||||
if [[ "$promoted_draft" != "false" ]]; then
|
||||
echo "::error::Promoted release is still a draft"
|
||||
exit 1
|
||||
fi
|
||||
swapping="false"
|
||||
staging_id=""
|
||||
|
||||
if [[ -n "$old_id" ]]; then
|
||||
gh api "repos/${{ github.repository }}/releases/${old_id}" -X DELETE > /dev/null 2>&1 || true
|
||||
fi
|
||||
@@ -0,0 +1,61 @@
|
||||
name: Nix Update Hash
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "nix/**"
|
||||
- "flake.nix"
|
||||
- "flake.lock"
|
||||
- "package.json"
|
||||
- "package-lock.json"
|
||||
- "packages/highlight/**"
|
||||
- "packages/plugin/**"
|
||||
- "packages/server/**"
|
||||
- "packages/relay/**"
|
||||
- "packages/cli/**"
|
||||
- "scripts/update-nix.sh"
|
||||
- "scripts/fix-lockfile.mjs"
|
||||
- ".github/workflows/nix-update-hash.yml"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update-hash:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.PASEO_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.PASEO_BOT_APP_PRIVATE_KEY }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Update lockfile + Nix hash if stale
|
||||
run: ./scripts/update-nix.sh
|
||||
|
||||
- name: Build Nix package
|
||||
run: nix build .#default -o result
|
||||
|
||||
- name: Commit hash/lockfile updates
|
||||
run: |
|
||||
git diff --quiet package-lock.json nix/npm-deps.hash && exit 0
|
||||
git config user.name "paseo-ai[bot]"
|
||||
git config user.email "266920839+paseo-ai[bot]@users.noreply.github.com"
|
||||
git add package-lock.json nix/npm-deps.hash
|
||||
git commit -m "fix: update lockfile signatures and Nix hash [skip ci]"
|
||||
git push
|
||||
@@ -22,11 +22,11 @@ on:
|
||||
- "packages/desktop/**"
|
||||
- "plugins/**"
|
||||
- "skills/**"
|
||||
- "patches/**"
|
||||
- "scripts/postinstall-patches.mjs"
|
||||
- "scripts/trace-daemon.mjs"
|
||||
- "scripts/is-main-module.mjs"
|
||||
- "scripts/build-daemon-web-ui.mjs"
|
||||
- "scripts/update-nix.sh"
|
||||
- "scripts/fix-lockfile.mjs"
|
||||
- ".github/workflows/nix.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -41,12 +41,20 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: cachix/install-nix-action@3dc140bfc76c49fbd4dd958429132e3746bcb086 # v31
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Update lockfile + Nix hash if stale
|
||||
run: ./scripts/update-nix.sh
|
||||
|
||||
- name: Build Nix package
|
||||
run: nix build .#default -o result
|
||||
|
||||
@@ -126,9 +134,9 @@ jobs:
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: cachix/install-nix-action@3dc140bfc76c49fbd4dd958429132e3746bcb086 # v31
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
name: NPM Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
package:
|
||||
description: Package to publish
|
||||
type: choice
|
||||
default: "@getpaseo/highlight"
|
||||
options:
|
||||
- "@getpaseo/highlight"
|
||||
- all
|
||||
canary_suffix:
|
||||
description: "Canary suffix (default: canary.<run_id>.<run_attempt>)"
|
||||
type: string
|
||||
required: false
|
||||
dry_run:
|
||||
description: Preview publication without publishing
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: npm-release
|
||||
queue: max
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Require main for manual runs
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
REF: ${{ github.ref }}
|
||||
run: test "$REF" = refs/heads/main
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
||||
with:
|
||||
node-version: "22.20.0"
|
||||
package-manager-cache: false
|
||||
- name: Install npm with trusted publishing support
|
||||
run: npm install --global npm@11.21.0
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Stamp canary versions
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
CANARY_SUFFIX: ${{ inputs.canary_suffix }}
|
||||
PACKAGE: ${{ inputs.package }}
|
||||
run: node scripts/publish-release-packages.mjs --prepare-canary --canary-suffix "${CANARY_SUFFIX:-canary.$GITHUB_RUN_ID.$GITHUB_RUN_ATTEMPT}" --package "$PACKAGE"
|
||||
- name: Build packages
|
||||
run: npm run build:server
|
||||
- name: Publish canary packages
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
CANARY_SUFFIX: ${{ inputs.canary_suffix }}
|
||||
PACKAGE: ${{ inputs.package }}
|
||||
DRY_RUN: ${{ inputs.dry_run }}
|
||||
run: |
|
||||
args=(--canary-suffix "${CANARY_SUFFIX:-canary.$GITHUB_RUN_ID.$GITHUB_RUN_ATTEMPT}" --package "$PACKAGE" --tag canary)
|
||||
if [ "$DRY_RUN" = true ]; then args+=(--dry-run); fi
|
||||
node scripts/publish-release-packages.mjs "${args[@]}"
|
||||
- name: Publish packages
|
||||
if: github.event_name == 'push'
|
||||
run: node scripts/publish-release-packages.mjs --tag "$GITHUB_REF_NAME"
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
@@ -99,5 +99,3 @@ app.json
|
||||
|
||||
# Project-local Serena configuration and memories.
|
||||
.serena/
|
||||
|
||||
!packages/app/gpui/app.json
|
||||
|
||||
+12
-98
@@ -184,13 +184,15 @@
|
||||
"server/session/daemon/install-origin.ts": ["existsSync", "readFileSync"],
|
||||
// TODO: npm self-update inspection probes the reported install path; move the probe into bounded async installation inspection.
|
||||
"server/session/daemon/npm-global-cli.ts": ["lstatSync"],
|
||||
// Speech child process: model-file validation runs in the worker-backed local speech provider.
|
||||
"server/speech/providers/local/sherpa/sherpa-offline-recognizer.ts": ["existsSync"],
|
||||
// Speech child process: native addon discovery and patchelf run outside the daemon.
|
||||
"server/speech/providers/local/sherpa/sherpa-onnx-node-loader.ts": [
|
||||
"existsSync",
|
||||
"spawnSync"
|
||||
],
|
||||
// Speech child process: modelsDir directory creation and model-file validation run outside the daemon.
|
||||
"server/speech/providers/local/worker-paths.ts": ["existsSync", "mkdirSync"],
|
||||
// Speech child process: model-file validation runs in the worker-backed local speech provider.
|
||||
"server/speech/providers/local/sherpa/sherpa-tts.ts": ["existsSync"],
|
||||
// TODO: static request selection and index injection need bounded async serving with response/error ownership; keep this as a separate request-path conversion.
|
||||
"server/web-ui.ts": ["readFileSync", "statSync"],
|
||||
// Startup registry hydration: check persisted workspace directories before the runtime reconciliation service starts.
|
||||
@@ -302,19 +304,10 @@
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "lucide-react-native",
|
||||
"allowTypeImports": true,
|
||||
"message": "Import one icon from lucide-react-native/icons/<file> and LucideProvider from lucide-react-native/context. The barrel evaluates all 1,858 icons at startup. Plugin-named icons load through @/plugins/lucide-catalog."
|
||||
},
|
||||
{
|
||||
"name": "lucide-react-native/icons",
|
||||
"message": "Import one icon from lucide-react-native/icons/<file>. The icons index evaluates all 1,858 icons."
|
||||
},
|
||||
{
|
||||
"name": "react-native",
|
||||
"importNames": ["TextInput"],
|
||||
"message": "Use FormTextInput from @/components/ui/form-field (or SearchField from @/components/ui/search-field). Raw TextInput bypasses form chrome, editing-surface authority, and IME safety."
|
||||
"message": "Use EditingTextInput from @/components/ui/text-input. Raw TextInput bypasses editing-surface authority and IME safety."
|
||||
},
|
||||
{
|
||||
"name": "@tanstack/react-query",
|
||||
@@ -342,19 +335,10 @@
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "lucide-react-native",
|
||||
"allowTypeImports": true,
|
||||
"message": "Import one icon from lucide-react-native/icons/<file> and LucideProvider from lucide-react-native/context. The barrel evaluates all 1,858 icons at startup. Plugin-named icons load through @/plugins/lucide-catalog."
|
||||
},
|
||||
{
|
||||
"name": "lucide-react-native/icons",
|
||||
"message": "Import one icon from lucide-react-native/icons/<file>. The icons index evaluates all 1,858 icons."
|
||||
},
|
||||
{
|
||||
"name": "react-native",
|
||||
"importNames": ["TextInput"],
|
||||
"message": "Use FormTextInput from @/components/ui/form-field (or SearchField from @/components/ui/search-field). Raw TextInput bypasses form chrome, editing-surface authority, and IME safety."
|
||||
"message": "Use EditingTextInput from @/components/ui/text-input. Raw TextInput bypasses editing-surface authority and IME safety."
|
||||
},
|
||||
{
|
||||
"name": "react-native-unistyles",
|
||||
@@ -403,19 +387,10 @@
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "lucide-react-native",
|
||||
"allowTypeImports": true,
|
||||
"message": "Import one icon from lucide-react-native/icons/<file> and LucideProvider from lucide-react-native/context. The barrel evaluates all 1,858 icons at startup. Plugin-named icons load through @/plugins/lucide-catalog."
|
||||
},
|
||||
{
|
||||
"name": "lucide-react-native/icons",
|
||||
"message": "Import one icon from lucide-react-native/icons/<file>. The icons index evaluates all 1,858 icons."
|
||||
},
|
||||
{
|
||||
"name": "react-native",
|
||||
"importNames": ["TextInput"],
|
||||
"message": "Use FormTextInput from @/components/ui/form-field (or SearchField from @/components/ui/search-field). Raw TextInput bypasses form chrome, editing-surface authority, and IME safety."
|
||||
"message": "Use EditingTextInput from @/components/ui/text-input. Raw TextInput bypasses editing-surface authority and IME safety."
|
||||
},
|
||||
{
|
||||
"name": "react-native-unistyles",
|
||||
@@ -456,6 +431,7 @@
|
||||
"packages/app/src/components/realtime-voice-overlay.tsx",
|
||||
"packages/app/src/components/resize-handle.tsx",
|
||||
"packages/app/src/components/rewind/rewind-menu.tsx",
|
||||
"packages/app/src/components/settings-textarea.tsx",
|
||||
"packages/app/src/components/sidebar-callout.tsx",
|
||||
"packages/app/src/components/split-container.tsx",
|
||||
"packages/app/src/components/split-drop-zone.tsx",
|
||||
@@ -481,6 +457,7 @@
|
||||
"packages/app/src/desktop/updates/update-callout-source.tsx",
|
||||
"packages/app/src/git/actions-split-button.tsx",
|
||||
"packages/app/src/hooks/use-web-scrollbar-style.web.ts",
|
||||
"packages/app/src/hosts/host-chooser.tsx",
|
||||
"packages/app/src/screens/open-project-screen.tsx",
|
||||
"packages/app/src/screens/projects-screen.tsx",
|
||||
"packages/app/src/screens/sessions-screen.tsx",
|
||||
@@ -496,19 +473,10 @@
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "lucide-react-native",
|
||||
"allowTypeImports": true,
|
||||
"message": "Import one icon from lucide-react-native/icons/<file> and LucideProvider from lucide-react-native/context. The barrel evaluates all 1,858 icons at startup. Plugin-named icons load through @/plugins/lucide-catalog."
|
||||
},
|
||||
{
|
||||
"name": "lucide-react-native/icons",
|
||||
"message": "Import one icon from lucide-react-native/icons/<file>. The icons index evaluates all 1,858 icons."
|
||||
},
|
||||
{
|
||||
"name": "react-native",
|
||||
"importNames": ["TextInput"],
|
||||
"message": "Use FormTextInput from @/components/ui/form-field (or SearchField from @/components/ui/search-field). Raw TextInput bypasses form chrome, editing-surface authority, and IME safety."
|
||||
"message": "Use EditingTextInput from @/components/ui/text-input. Raw TextInput bypasses editing-surface authority and IME safety."
|
||||
},
|
||||
{
|
||||
"name": "@tanstack/react-query",
|
||||
@@ -535,19 +503,10 @@
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "lucide-react-native",
|
||||
"allowTypeImports": true,
|
||||
"message": "Import one icon from lucide-react-native/icons/<file> and LucideProvider from lucide-react-native/context. The barrel evaluates all 1,858 icons at startup. Plugin-named icons load through @/plugins/lucide-catalog."
|
||||
},
|
||||
{
|
||||
"name": "lucide-react-native/icons",
|
||||
"message": "Import one icon from lucide-react-native/icons/<file>. The icons index evaluates all 1,858 icons."
|
||||
},
|
||||
{
|
||||
"name": "react-native",
|
||||
"importNames": ["TextInput"],
|
||||
"message": "Use FormTextInput from @/components/ui/form-field (or SearchField from @/components/ui/search-field). Raw TextInput bypasses form chrome, editing-surface authority, and IME safety."
|
||||
"message": "Use EditingTextInput from @/components/ui/text-input. Raw TextInput bypasses editing-surface authority and IME safety."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -559,29 +518,6 @@
|
||||
"packages/app/src/components/ui/text-input/**/*.{ts,tsx}",
|
||||
"packages/app/src/agent-stream/scroll-keyboard-dismiss/use-scroll-keyboard-dismiss.ts"
|
||||
],
|
||||
"rules": {
|
||||
// These files may import raw TextInput; the Lucide rule still applies.
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "lucide-react-native",
|
||||
"allowTypeImports": true,
|
||||
"message": "Import one icon from lucide-react-native/icons/<file> and LucideProvider from lucide-react-native/context. The barrel evaluates all 1,858 icons at startup. Plugin-named icons load through @/plugins/lucide-catalog."
|
||||
},
|
||||
{
|
||||
"name": "lucide-react-native/icons",
|
||||
"message": "Import one icon from lucide-react-native/icons/<file>. The icons index evaluates all 1,858 icons."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
// The one module that loads the whole Lucide barrel, on demand, for plugin-named icons.
|
||||
{
|
||||
"files": ["packages/app/src/plugins/lucide-catalog/catalog.ts"],
|
||||
"rules": {
|
||||
"no-restricted-imports": "off"
|
||||
}
|
||||
@@ -589,29 +525,7 @@
|
||||
{
|
||||
"files": ["packages/app/src/**/*.{ts,tsx}"],
|
||||
"rules": {
|
||||
"paseo/no-raw-pressable": "error",
|
||||
"paseo/no-raw-text-input": "error"
|
||||
}
|
||||
},
|
||||
// Styled input chrome and focus rings are owned by FormTextInput / SearchField in
|
||||
// components/ui. Only UI primitives, tests, and the small bespoke editor allowlist below may
|
||||
// import raw EditingTextInput directly.
|
||||
{
|
||||
"files": [
|
||||
"packages/app/src/components/ui/**/*.{ts,tsx}",
|
||||
"packages/app/src/**/*.{test,spec}.{ts,tsx}",
|
||||
"packages/app/src/command-center/command-center.tsx",
|
||||
"packages/app/src/components/adaptive-modal-sheet.tsx",
|
||||
"packages/app/src/components/file-explorer-pane.tsx",
|
||||
"packages/app/src/composer/input/input.tsx",
|
||||
"packages/app/src/desktop/browser/pane/index.electron.tsx",
|
||||
"packages/app/src/pane-find/index.tsx",
|
||||
"packages/app/src/plugins/react-native/text-input.tsx",
|
||||
"packages/app/src/terminal/native-renderer/terminal-input.native.tsx",
|
||||
"packages/app/src/workspace-rename/internal/inline-title-field.tsx"
|
||||
],
|
||||
"rules": {
|
||||
"paseo/no-raw-text-input": "off"
|
||||
"paseo/no-raw-pressable": "error"
|
||||
}
|
||||
},
|
||||
// Press feedback is owned by the primitives in components/ui. Raw pressable burn-down:
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 0.19.2 - 2026-12-05
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed OpenCode v2 skills picked inline, with attachments, or while a turn is running being sent as literal `/skill` text instead of loading the skill ([#12142](https://github.com/getpaseo/paseo/pull/12142))
|
||||
- Fixed Codex skills picked inline, with attachments, or while a turn is running not loading ([#12143](https://github.com/getpaseo/paseo/pull/12143))
|
||||
- Fixed Desktop image attachments disappearing across multiple windows, tab switches, and queued follow-up sends ([#12082](https://github.com/getpaseo/paseo/pull/12082))
|
||||
|
||||
## 0.19.1 - 2026-12-03
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 0.19.2 - 2026-12-05
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复 OpenCode v2 中在消息中间、带附件或运行中选择的 Skill 被当作字面 `/skill` 文本发送而未加载的问题 ([#12142](https://github.com/getpaseo/paseo/pull/12142))
|
||||
- 修复 Codex 中在消息中间、带附件或运行中选择的 Skill 未加载的问题 ([#12143](https://github.com/getpaseo/paseo/pull/12143))
|
||||
- 修复桌面端图片附件在多窗口、切换标签页和排队发送追问消息时丢失的问题 ([#12082](https://github.com/getpaseo/paseo/pull/12082))
|
||||
|
||||
## 0.19.1 - 2026-12-03
|
||||
|
||||
### 变更
|
||||
|
||||
@@ -21,60 +21,60 @@ This is an npm workspace monorepo:
|
||||
|
||||
At the start of non-trivial work, list `docs/` and skim anything relevant to the task.
|
||||
|
||||
| Doc | What's in it |
|
||||
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [docs/product.md](docs/product.md) | What Paseo is, who it's for, where it's going |
|
||||
| [docs/architecture.md](docs/architecture.md) | System design, package layering, WebSocket protocol, agent lifecycle, data flow |
|
||||
| [docs/agent-lifecycle.md](docs/agent-lifecycle.md) | Agent states, parent/child relationships, archive semantics, tabs vs archive, subagents track |
|
||||
| [docs/data-model.md](docs/data-model.md) | File-based JSON persistence, Zod schemas, atomic writes, no migrations |
|
||||
| [docs/glossary.md](docs/glossary.md) | Authoritative terminology — UI label wins, no synonyms |
|
||||
| [docs/coding-standards.md](docs/coding-standards.md) | Type hygiene, error handling, state design, React patterns, file organization |
|
||||
| [docs/design.md](docs/design.md) | Design system — tokens, buttons, hierarchy, density, alignment rails, states, what's forbidden |
|
||||
| [docs/forms.md](docs/forms.md) | Form architecture — non-React form model, form kit, load-state gating; the schedule form is the golden example |
|
||||
| [docs/hover.md](docs/hover.md) | Hover — the canonical pattern (plain View + onPointerEnter/Leave, separate inner Pressable) and the three ways agents break it |
|
||||
| [docs/unistyles.md](docs/unistyles.md) | Unistyles gotchas — `useUnistyles()` is forbidden, alternatives in order |
|
||||
| [docs/floating-panels.md](docs/floating-panels.md) | Anchored popovers — Portal/Modal escape for Android, lifecycle gates, keyboard-shared-value, status-bar offset, the flash |
|
||||
| [docs/keyboard-shortcuts.md](docs/keyboard-shortcuts.md) | Action and keybinding registries, action scopes, overlay covers, plugin actions, key sources, badges, iOS `UIKeyCommand` limits |
|
||||
| [docs/menus.md](docs/menus.md) | The menu engine — popover vs sheet, submenu pages, hover intent, when a decision earns a submenu |
|
||||
| [docs/drag-reorder.md](docs/drag-reorder.md) | Drag to reorder — `DraggableList` and its handle, the scroll view that must host the drag, grip placement, testing on a phone |
|
||||
| [docs/expo-router.md](docs/expo-router.md) | Expo Router route ownership, startup restore, and native blank-screen gotchas |
|
||||
| [docs/notifications.md](docs/notifications.md) | Notification tap ownership, native replay and acknowledgement, startup handoff, and payload QA |
|
||||
| [docs/file-icons.md](docs/file-icons.md) | Material icon theme integration for the file explorer |
|
||||
| [docs/providers.md](docs/providers.md) | Adding a new agent provider end-to-end |
|
||||
| [docs/forge-providers.md](docs/forge-providers.md) | Adding a git forge: registry/manifest, drop-in checklist, self-host/GHES, the two facts tiers |
|
||||
| [docs/custom-providers.md](docs/custom-providers.md) | Custom provider config: Z.AI, Alibaba/Qwen, ACP agents, profiles, custom binaries |
|
||||
| [docs/plugins.md](docs/plugins.md) | Local plugin manifest, directory source config, RPCs, native surfaces, and attachment sources |
|
||||
| [docs/website-i18n.md](docs/website-i18n.md) | Website languages: locale URLs, translated Markdown pairs, `{#id}` anchors, Chinese style |
|
||||
| [docs/relay-endpoint-security.md](docs/relay-endpoint-security.md) | Relay E2EE modes: Noise NK mapping, record framing, negotiation, the `requireProtectedSecurity` flag, close codes |
|
||||
| [docs/development.md](docs/development.md) | Dev server, build sync gotchas, CLI reference, agent state, Playwright MCP |
|
||||
| [docs/rpc-namespacing.md](docs/rpc-namespacing.md) | WebSocket RPC naming convention — dotted namespaces and `.request`/`.response` pairs |
|
||||
| [docs/protocol-compatibility.md](docs/protocol-compatibility.md) | Why app/daemon versions drift, protocol vs feature contract, capability gating, COMPAT tagging |
|
||||
| [docs/protocol-validation.md](docs/protocol-validation.md) | zod-aot generated inbound WebSocket validation, patched compiler regressions, schema-purity rules |
|
||||
| [docs/connected-hosts.md](docs/connected-hosts.md) | Daemon-owned host registrations, routed SDK scopes, identity and authority boundaries |
|
||||
| [docs/permissions.md](docs/permissions.md) | Semantic daemon permissions, principals, credentials, pairing invitations, and Hub authority |
|
||||
| [docs/terminal-performance.md](docs/terminal-performance.md) | Terminal latency pipeline, coalescing/backpressure invariants, benchmark + perf spec usage |
|
||||
| [docs/terminal-rendering.md](docs/terminal-rendering.md) | Native terminal view: xterm owns the grid, cluster placement, emoji widths, mixed-direction limits, render regression |
|
||||
| [docs/timeline-sync.md](docs/timeline-sync.md) | Owned agent history, rewind retirements, live stream vs authoritative fetch, paged catch-up, client replica |
|
||||
| [docs/agent-stream-performance.md](docs/agent-stream-performance.md) | Assistant text pipeline — coalescing window, paced reveal, why arrival lumps are smoothed at render |
|
||||
| [docs/agent-stream-disclosure.md](docs/agent-stream-disclosure.md) | Expand/collapse in the chat timeline — hold contract, native anchor sequence, frame spacing, render-window cost |
|
||||
| [docs/running-indicators.md](docs/running-indicators.md) | Loader, status ring, tool-call shimmer — motion policy, compositor loops on web, native-driver clock, why not CSS keyframes |
|
||||
| [docs/markdown-renderer.md](docs/markdown-renderer.md) | Shared Markdown engine, the vendored library fork, native selection, links, images and library constraints |
|
||||
| [docs/native-text-selection.md](docs/native-text-selection.md) | Native diagram grouping, selection boundaries and leading inline image limitations |
|
||||
| [docs/file-observation.md](docs/file-observation.md) | Recursive watcher ownership, Linux constraints, teardown invariants, and Parcel comparison |
|
||||
| [docs/testing.md](docs/testing.md) | TDD workflow, determinism, real dependencies over mocks, test organization |
|
||||
| [docs/qa.md](docs/qa.md) | QA evidence bar for pull requests — platform matrix, version drift, performance, UI proof |
|
||||
| [docs/mobile-testing.md](docs/mobile-testing.md) | Maestro and mobile test workflows |
|
||||
| [docs/mobile-panels.md](docs/mobile-panels.md) | Compact left/center/right panel ownership, worklet motion, gesture revisions, and Fabric constraints |
|
||||
| [docs/explorer-sidebar.md](docs/explorer-sidebar.md) | Explorer sidebar, side-pane, and compact workspace sheet host contracts, lifecycle, placement, routing preferences |
|
||||
| [docs/ad-hoc-daemon-testing.md](docs/ad-hoc-daemon-testing.md) | Isolated in-process daemon test harness |
|
||||
| [docs/browser-capture-harness.md](docs/browser-capture-harness.md) | Real-Electron browser screenshot harness and compositor-surface gotcha |
|
||||
| [docs/android.md](docs/android.md) | App variants, local/cloud builds, EAS workflows, version codes, F-Droid source builds and store metadata |
|
||||
| [docs/docker.md](docs/docker.md) | Running the daemon and bundled web UI in Docker, volumes, agent images, security |
|
||||
| [docs/release.md](docs/release.md) | Release playbook, draft releases, completion checklist |
|
||||
| [docs/terminal-worker.md](docs/terminal-worker.md) | Terminal worker process model, socket/record/secret, protocol-bump rule and draining, the worker's file copy, Windows desktop |
|
||||
| [docs/terminal-activity.md](docs/terminal-activity.md) | Terminal activity indicators — source-agnostic tracker, agent hook reporting, adding a new hook provider |
|
||||
| [SECURITY.md](SECURITY.md) | Relay threat model, E2E encryption, DNS rebinding, agent auth |
|
||||
| [public-docs/hub/security.md](public-docs/hub/security.md) | Public Hub guide — trust boundaries, untrusted triggers, provider controls, and output authority |
|
||||
| Doc | What's in it |
|
||||
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [docs/product.md](docs/product.md) | What Paseo is, who it's for, where it's going |
|
||||
| [docs/architecture.md](docs/architecture.md) | System design, package layering, WebSocket protocol, agent lifecycle, data flow |
|
||||
| [docs/agent-lifecycle.md](docs/agent-lifecycle.md) | Agent states, parent/child relationships, archive semantics, tabs vs archive, subagents track |
|
||||
| [docs/data-model.md](docs/data-model.md) | File-based JSON persistence, Zod schemas, atomic writes, no migrations |
|
||||
| [docs/glossary.md](docs/glossary.md) | Authoritative terminology — UI label wins, no synonyms |
|
||||
| [docs/coding-standards.md](docs/coding-standards.md) | Type hygiene, error handling, state design, React patterns, file organization |
|
||||
| [docs/design.md](docs/design.md) | Design system — tokens, buttons, hierarchy, density, alignment rails, states, what's forbidden |
|
||||
| [docs/forms.md](docs/forms.md) | Form architecture — non-React form model, form kit, load-state gating; the schedule form is the golden example |
|
||||
| [docs/hover.md](docs/hover.md) | Hover — the canonical pattern (plain View + onPointerEnter/Leave, separate inner Pressable) and the three ways agents break it |
|
||||
| [docs/unistyles.md](docs/unistyles.md) | Unistyles gotchas — `useUnistyles()` is forbidden, alternatives in order |
|
||||
| [docs/floating-panels.md](docs/floating-panels.md) | Anchored popovers — Portal/Modal escape for Android, lifecycle gates, keyboard-shared-value, status-bar offset, the flash |
|
||||
| [docs/keyboard-shortcuts.md](docs/keyboard-shortcuts.md) | The binding table, per-platform key sources, badges vs routing, iOS `UIKeyCommand` limits |
|
||||
| [docs/menus.md](docs/menus.md) | The menu engine — popover vs sheet, submenu pages, hover intent, when a decision earns a submenu |
|
||||
| [docs/drag-reorder.md](docs/drag-reorder.md) | Drag to reorder — `DraggableList` and its handle, the scroll view that must host the drag, grip placement, testing on a phone |
|
||||
| [docs/expo-router.md](docs/expo-router.md) | Expo Router route ownership, startup restore, and native blank-screen gotchas |
|
||||
| [docs/notifications.md](docs/notifications.md) | Notification tap ownership, native replay and acknowledgement, startup handoff, and payload QA |
|
||||
| [docs/file-icons.md](docs/file-icons.md) | Material icon theme integration for the file explorer |
|
||||
| [docs/providers.md](docs/providers.md) | Adding a new agent provider end-to-end |
|
||||
| [docs/forge-providers.md](docs/forge-providers.md) | Adding a git forge: registry/manifest, drop-in checklist, self-host/GHES, the two facts tiers |
|
||||
| [docs/custom-providers.md](docs/custom-providers.md) | Custom provider config: Z.AI, Alibaba/Qwen, ACP agents, profiles, custom binaries |
|
||||
| [docs/plugins.md](docs/plugins.md) | Local plugin manifest, directory source config, RPCs, native surfaces, and attachment sources |
|
||||
| [docs/website-i18n.md](docs/website-i18n.md) | Website languages: locale URLs, translated Markdown pairs, `{#id}` anchors, Chinese style |
|
||||
| [docs/relay-endpoint-security.md](docs/relay-endpoint-security.md) | Relay E2EE modes: Noise NK mapping, record framing, negotiation, the `requireProtectedSecurity` flag, close codes |
|
||||
| [docs/development.md](docs/development.md) | Dev server, build sync gotchas, CLI reference, agent state, Playwright MCP |
|
||||
| [docs/rpc-namespacing.md](docs/rpc-namespacing.md) | WebSocket RPC naming convention — dotted namespaces and `.request`/`.response` pairs |
|
||||
| [docs/protocol-compatibility.md](docs/protocol-compatibility.md) | Why app/daemon versions drift, protocol vs feature contract, capability gating, COMPAT tagging |
|
||||
| [docs/protocol-validation.md](docs/protocol-validation.md) | zod-aot generated inbound WebSocket validation, patched compiler regressions, schema-purity rules |
|
||||
| [docs/connected-hosts.md](docs/connected-hosts.md) | Daemon-owned host registrations, routed SDK scopes, identity and authority boundaries |
|
||||
| [docs/permissions.md](docs/permissions.md) | Semantic daemon permissions, principals, credentials, pairing invitations, and Hub authority |
|
||||
| [docs/terminal-performance.md](docs/terminal-performance.md) | Terminal latency pipeline, coalescing/backpressure invariants, benchmark + perf spec usage |
|
||||
| [docs/terminal-rendering.md](docs/terminal-rendering.md) | Native terminal view: xterm owns the grid, cluster placement, emoji widths, mixed-direction limits, render regression |
|
||||
| [docs/timeline-sync.md](docs/timeline-sync.md) | Owned agent history, rewind retirements, live stream vs authoritative fetch, paged catch-up, client replica |
|
||||
| [docs/agent-stream-performance.md](docs/agent-stream-performance.md) | Assistant text pipeline — coalescing window, paced reveal, why arrival lumps are smoothed at render |
|
||||
| [docs/agent-stream-disclosure.md](docs/agent-stream-disclosure.md) | Expand/collapse in the chat timeline — hold contract, native anchor sequence, frame spacing, render-window cost |
|
||||
| [docs/running-indicators.md](docs/running-indicators.md) | Loader, status ring, tool-call shimmer — motion policy, compositor loops on web, native-driver clock, why not CSS keyframes |
|
||||
| [docs/markdown-renderer.md](docs/markdown-renderer.md) | Shared Markdown engine, the vendored library fork, native selection, links, images and library constraints |
|
||||
| [docs/native-text-selection.md](docs/native-text-selection.md) | Native diagram grouping, selection boundaries and leading inline image limitations |
|
||||
| [docs/file-observation.md](docs/file-observation.md) | Recursive watcher ownership, Linux constraints, teardown invariants, and Parcel comparison |
|
||||
| [docs/testing.md](docs/testing.md) | TDD workflow, determinism, real dependencies over mocks, test organization |
|
||||
| [docs/qa.md](docs/qa.md) | QA evidence bar for pull requests — platform matrix, version drift, performance, UI proof |
|
||||
| [docs/mobile-testing.md](docs/mobile-testing.md) | Maestro and mobile test workflows |
|
||||
| [docs/mobile-panels.md](docs/mobile-panels.md) | Compact left/center/right panel ownership, worklet motion, gesture revisions, and Fabric constraints |
|
||||
| [docs/explorer-sidebar.md](docs/explorer-sidebar.md) | Explorer sidebar, side-pane, and compact workspace sheet host contracts, lifecycle, placement, routing preferences |
|
||||
| [docs/ad-hoc-daemon-testing.md](docs/ad-hoc-daemon-testing.md) | Isolated in-process daemon test harness |
|
||||
| [docs/browser-capture-harness.md](docs/browser-capture-harness.md) | Real-Electron browser screenshot harness and compositor-surface gotcha |
|
||||
| [docs/android.md](docs/android.md) | App variants, local/cloud builds, EAS workflows, version codes, F-Droid source builds and store metadata |
|
||||
| [docs/docker.md](docs/docker.md) | Running the daemon and bundled web UI in Docker, volumes, agent images, security |
|
||||
| [docs/release.md](docs/release.md) | Release playbook, draft releases, completion checklist |
|
||||
| [docs/terminal-worker.md](docs/terminal-worker.md) | Terminal worker process model, socket/record/secret, protocol-bump rule and draining, the worker's file copy, Windows desktop |
|
||||
| [docs/terminal-activity.md](docs/terminal-activity.md) | Terminal activity indicators — source-agnostic tracker, agent hook reporting, adding a new hook provider |
|
||||
| [SECURITY.md](SECURITY.md) | Relay threat model, E2E encryption, DNS rebinding, agent auth |
|
||||
| [public-docs/hub/security.md](public-docs/hub/security.md) | Public Hub guide — trust boundaries, untrusted triggers, provider controls, and output authority |
|
||||
|
||||
### Writing docs
|
||||
|
||||
@@ -175,7 +175,7 @@ The app runs on iOS, Android, web (browser), and web (Electron desktop). Code is
|
||||
| Use a native-only API (Haptics, push tokens, camera) | `if (isNative)` |
|
||||
| Use an Electron bridge (file dialog, titlebar, updates) | `if (getIsElectron())` |
|
||||
| Switch layout between phone and tablet/desktop | `useIsCompactFormFactor()` |
|
||||
| Show something on hover, always-visible on touch screens | `isHovered \|\| revealsWithoutHover` (see [docs/hover.md](docs/hover.md)) |
|
||||
| Show something on hover, always-visible on native | `isHovered \|\| isNative \|\| isCompact` (hover only works on web) |
|
||||
| Gate to iOS or Android specifically | `Platform.OS === "ios"` / `Platform.OS === "android"` (rare, keep inline) |
|
||||
|
||||
### Rules
|
||||
@@ -198,7 +198,7 @@ The app runs on iOS, Android, web (browser), and web (Electron desktop). Code is
|
||||
Import as `@/desktop/browser/pane` — Electron desktop gets the `.electron.tsx` file, browser web gets `.web.tsx`, and native gets the native/base implementation.
|
||||
- **NEVER use raw DOM APIs without `isWeb` guard.** DOM APIs crash native. Casting a RN ref to `HTMLElement` is a red flag — ensure the block is web-only.
|
||||
- **NEVER use `onPointerEnter`/`onPointerLeave`.** They don't fire on native iOS.
|
||||
- **Hover needs a mouse-like pointer.** React Native's `onHoverIn`/`onHoverOut` on `Pressable` does NOT fire on native iOS/iPad — the underlying W3C pointer events are behind disabled experimental flags. For hover-to-show UI (kebab menus, action buttons), call `useRevealsWithoutHover()` unconditionally, then use `isHovered || revealsWithoutHover` so the controls are always visible on touch screens and hover-to-show elsewhere. Don't use `isNative` for this: a native build is not the only touch-first surface, since a touch-first browser such as iPad Safari is `isWeb` but cannot hover.
|
||||
- **Hover only works on web.** React Native's `onHoverIn`/`onHoverOut` on `Pressable` does NOT fire on native iOS/iPad — the underlying W3C pointer events are behind disabled experimental flags. For hover-to-show UI (kebab menus, action buttons), use `isHovered || isNative || isCompact` so the controls are always visible on native and hover-to-show on web.
|
||||
- **Don't use Platform.OS as a proxy for layout capabilities.** Use breakpoints for layout decisions, not platform checks.
|
||||
- **Import `isWeb`/`isNative` from `@/constants/platform`.** Never write `const isWeb = Platform.OS === "web"` locally.
|
||||
|
||||
|
||||
+2
-4
@@ -22,11 +22,9 @@ The relay is designed to be untrusted. All traffic between your phone and daemon
|
||||
1. The daemon generates a persistent Curve25519 keypair on first run and stores it at `$PASEO_HOME/daemon-keypair.json` with mode `0600`
|
||||
2. The pairing URL (rendered as a QR code or opened directly) carries the daemon's public key in its URL fragment (`https://app.paseo.sh/#offer=...`). Fragments are not sent to the web server, so `app.paseo.sh` never sees the key.
|
||||
3. When the phone connects via the relay, it generates fresh ephemeral keys and sends an `e2ee_hello` message. The daemon will not process any application messages until this handshake completes.
|
||||
4. Updated peers run a Noise `NK` handshake (`Noise_NK_25519_ChaChaPoly_SHA256`) keyed to the daemon's static key: the `e2ee_hello` carries the first Noise message and the daemon's `e2ee_ready` carries the second. Every later frame is a counter-nonced ChaCha20-Poly1305 record. When either side predates this, the session falls back to the legacy construction: a Curve25519 ECDH shared key with XSalsa20-Poly1305 (NaCl `box`) and a random `[24-byte nonce][ciphertext]` bundle. Both modes negotiate `binaryCiphertext`. In protected mode every record then travels as a WebSocket binary frame, and an authenticated `kind` byte inside the record says whether the plaintext is text or binary. In legacy mode negotiated application text is carried as a base64 WebSocket text frame and application binary as a raw WebSocket binary frame. A peer that does not negotiate the capability uses base64 text frames for both kinds. [docs/relay-endpoint-security.md](docs/relay-endpoint-security.md) has the exact mapping.
|
||||
4. Updated peers run a Noise `NK` handshake (`Noise_NK_25519_ChaChaPoly_SHA256`) keyed to the daemon's static key: the `e2ee_hello` carries the first Noise message and the daemon's `e2ee_ready` carries the second. Every later frame is a counter-nonced ChaCha20-Poly1305 record. When either side predates this, the session falls back to the legacy construction: a Curve25519 ECDH shared key with XSalsa20-Poly1305 (NaCl `box`) and a random `[24-byte nonce][ciphertext]` bundle. Both modes negotiate `binaryCiphertext`: negotiated application text is carried as a base64 WebSocket text frame, while application binary is carried as a raw WebSocket binary frame. A peer that does not negotiate the capability uses base64 text frames for both kinds. [docs/relay-endpoint-security.md](docs/relay-endpoint-security.md) has the exact mapping.
|
||||
|
||||
After negotiation the receiver never guesses whether authenticated plaintext is text or binary from its byte contents: protected mode reads the authenticated `kind` byte and legacy mode reads the WebSocket opcode. The plaintext handshake remains WebSocket text and contains only public keys and capability declarations.
|
||||
|
||||
When both peers negotiate a frame codec (`frame_codecs`), frames of 1024 bytes or more are compressed statelessly per frame before encryption. Compression never shares dictionary state across frames and enforces the 100 MiB logical message limit as a hard decompression cap. `hello` and the `server_info` that answers it are never compressed: the client selects its codec from `server_info`, and the relay E2EE downgrade check reads `server_info` as text. Clients do not advertise codecs on loopback connections, where compression costs CPU and saves no bandwidth. As with any compression before encryption, compressed frame lengths remain observable to the relay.
|
||||
The WebSocket opcode is preserved end to end after negotiation; the receiver never guesses whether authenticated plaintext is text or binary from its byte contents. The plaintext handshake remains WebSocket text and contains only public keys and capability declarations.
|
||||
|
||||
The relay sees only: IP addresses, timing, message sizes, session IDs, and the plaintext `e2ee_hello` / `e2ee_ready` handshake frames (which contain only public keys). It cannot read message contents, forge messages, or derive encryption keys from observing the handshake.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_IMAGE=node:22-bookworm-slim@sha256:be979e5523c76fa4d5ca4ebd3099078f220aa47ec39c48ad5b5df9314debd6eb
|
||||
ARG NODE_IMAGE=node:22-bookworm-slim
|
||||
FROM --platform=$BUILDPLATFORM ${NODE_IMAGE} AS source-pack
|
||||
|
||||
ARG PASEO_VERSION
|
||||
|
||||
+2
-3
@@ -216,17 +216,16 @@ not change the shipped scroll view. Keep this behavior in the app's compiled nat
|
||||
|
||||
## F-Droid / source-only Android builds
|
||||
|
||||
F-Droid builds should set `PASEO_FDROID_BUILD=1` for `npm ci` (or `npm install`), Expo prebuild, and Gradle:
|
||||
F-Droid builds should set `PASEO_FDROID_BUILD=1` when running Expo prebuild:
|
||||
|
||||
```bash
|
||||
PASEO_FDROID_BUILD=1 npm ci
|
||||
cd packages/app
|
||||
PASEO_FDROID_BUILD=1 APP_VARIANT=production npx expo prebuild --platform android --clean --non-interactive
|
||||
cd android
|
||||
PASEO_FDROID_BUILD=1 ./gradlew assembleRelease --no-daemon --max-workers=1 -Dorg.gradle.parallel=false
|
||||
```
|
||||
|
||||
Setting `PASEO_FDROID_BUILD=1` during install makes `packages/react-native-enriched-markdown/postinstall.mjs` skip downloading the prebuilt iOS RaTeX XCFramework into the source tree. The flag must also be present for both prebuild and Gradle because Gradle starts Metro for the release bundle. Keep the source build serial and daemon-free as shown above: compiling every Expo module can exhaust memory when Gradle workers run in parallel. The profile enables source-built Expo modules, excludes the proprietary camera, Firebase notification, and Expo development-client native modules, disables Gradle dependency metadata, and substitutes JavaScript stubs for camera and notifications. The resulting app supports direct and pasted-link pairing but not QR scanning or push notifications. Setting `PASEO_FDROID_BUILD=1` also disables native RaTeX math in `react-native-enriched-markdown` and falls back to raw LaTeX text without requiring a Rust toolchain.
|
||||
The flag must be present for both prebuild and Gradle because Gradle starts Metro for the release bundle. Keep the source build serial and daemon-free as shown above: compiling every Expo module can exhaust memory when Gradle workers run in parallel. The profile enables source-built Expo modules, excludes the proprietary camera, Firebase notification, and Expo development-client native modules, disables Gradle dependency metadata, and substitutes JavaScript stubs for camera and notifications. The resulting app supports direct and pasted-link pairing but not QR scanning or push notifications.
|
||||
|
||||
For a single-ABI APK, pass React Native's architecture property to Gradle:
|
||||
|
||||
|
||||
@@ -74,12 +74,6 @@ For testing rules, see [testing.md](testing.md).
|
||||
- New features get a home before implementation. A feature smeared across 5 shared files is the same slop as a flat-peer namespace.
|
||||
- Don't drop new files at the nearest root just because placement is unclear — say so and ask.
|
||||
|
||||
## Lucide icons
|
||||
|
||||
Import one icon per statement from its file: `import Check from "lucide-react-native/icons/check"`. Import `LucideProvider` from `lucide-react-native/context`; the package does not export that path, so `patches/lucide-react-native+*.patch` adds it. The bare `lucide-react-native` barrel evaluates all 1,858 icons and puts them in the web entry chunk, so lint bans it (type imports such as `LucideIcon` are fine).
|
||||
|
||||
Plugins name icons as strings, so `plugins/lucide-catalog` answers "is this a Lucide name" from a generated name list and loads the barrel with `import()` when a plugin icon is first drawn. After upgrading `lucide-react-native`, run `npm run generate:lucide-icon-names --workspace=@getpaseo/app`; `names.test.ts` fails until you do.
|
||||
|
||||
## Refactoring is a bolt-on test
|
||||
|
||||
- A change should look like a thoughtful edit to existing code, not a new layer next to it. New coordinator wrapping a coordinator, new flag bypassing the normal path, new helper duplicating an existing selector — stop and reshape instead.
|
||||
|
||||
+5
-6
@@ -20,7 +20,7 @@ A semantic element used in three or more places is a primitive. One of a kind is
|
||||
|
||||
Primitives live in `packages/app/src/components/ui/` and `packages/app/src/components/headers/`. Card and row layout live in `packages/app/src/styles/settings.ts`. Section structure lives in `packages/app/src/screens/settings/settings-section.tsx`.
|
||||
|
||||
A pressable styled to look like a button is wrong; the button is `<Button>` (`packages/app/src/components/ui/button.tsx`). A hand-styled text input or textarea is wrong; form fields use `<Field>` and `<FormTextInput>` (`packages/app/src/components/ui/form-field.tsx`), and search inputs use `<SearchField>` (`packages/app/src/components/ui/search-field.tsx`). A pressable wrapping an icon is wrong; the icon action is `<ToolbarButton>` (`packages/app/src/components/ui/pane-content-toolbar.tsx`), which owns the hitbox, the rounded `interactionHighlight` fill on hover and press, the compact size, and the tooltip. Rows on a menu surface are `<MenuItem>`, or `<ComposerTrackRow>` in a track panel; other rows are `<PressHighlight>` (`packages/app/src/components/ui/press-highlight.tsx`), which owns the pressed feedback: pass the pressed fill as `highlightStyle` and never paint it in your own style. iOS and web paint that fill; Android draws the platform ripple over the content instead, clipped to the row's corners. On native, feedback waits for a short press delay so a scroll that claims the touch shows none. Content that knocks out of the row's surface, such as a badge ring, follows the fill through `onHighlightChange`. A bare `<Text>` styled to look like a section header is wrong; the section header is `<SettingsSection>` (`packages/app/src/components/settings/headings/settings-section.tsx`). A docs link in its header is its `link` prop, which renders `Label ↗` on the title's rail; a ghost button with an arrow is wrong. A custom `Modal` for a confirmation is wrong; the confirmation is `confirmDialog` (`packages/app/src/utils/confirm-dialog.ts`). A hand-rolled overflow menu is wrong; the menu is `<DropdownMenu>` (`packages/app/src/components/ui/dropdown-menu.tsx`). A hand-rolled status pill is wrong; the pill is `<StatusBadge>` (`packages/app/src/components/ui/status-badge.tsx`). A circle pinned over a scrolling surface is wrong; the floating action is `<FloatingActionButton>` (`packages/app/src/components/ui/floating-action-button.tsx`), one per surface, and the surface reserves `FLOATING_ACTION_BUTTON_CLEARANCE` below its content so the button never traps the last row.
|
||||
A pressable styled to look like a button is wrong; the button is `<Button>` (`packages/app/src/components/ui/button.tsx`). A pressable wrapping an icon is wrong; the icon action is `<ToolbarButton>` (`packages/app/src/components/ui/pane-content-toolbar.tsx`), which owns the hitbox, the rounded `interactionHighlight` fill on hover and press, the compact size, and the tooltip. Rows on a menu surface are `<MenuItem>`, or `<ComposerTrackRow>` in a track panel; other rows are `<PressHighlight>` (`packages/app/src/components/ui/press-highlight.tsx`), which owns the pressed feedback: pass the pressed fill as `highlightStyle` and never paint it in your own style. iOS and web paint that fill; Android draws the platform ripple over the content instead, clipped to the row's corners. On native, feedback waits for a short press delay so a scroll that claims the touch shows none. Content that knocks out of the row's surface, such as a badge ring, follows the fill through `onHighlightChange`. A bare `<Text>` styled to look like a section header is wrong; the section header is `<SettingsSection>` (`packages/app/src/components/settings/headings/settings-section.tsx`). A docs link in its header is its `link` prop, which renders `Label ↗` on the title's rail; a ghost button with an arrow is wrong. A custom `Modal` for a confirmation is wrong; the confirmation is `confirmDialog` (`packages/app/src/utils/confirm-dialog.ts`). A hand-rolled overflow menu is wrong; the menu is `<DropdownMenu>` (`packages/app/src/components/ui/dropdown-menu.tsx`). A hand-rolled status pill is wrong; the pill is `<StatusBadge>` (`packages/app/src/components/ui/status-badge.tsx`). A circle pinned over a scrolling surface is wrong; the floating action is `<FloatingActionButton>` (`packages/app/src/components/ui/floating-action-button.tsx`), one per surface, and the surface reserves `FLOATING_ACTION_BUTTON_CLEARANCE` below its content so the button never traps the last row.
|
||||
|
||||
Before adding a new component, read `components/ui/`. The primitive usually exists.
|
||||
|
||||
@@ -35,7 +35,7 @@ The authored interface ramp uses a 14px base. New native installs default to 15p
|
||||
Weight has three tiers, applied by role:
|
||||
|
||||
- **Screen titles** — the title in app chrome — use `<ScreenTitle>` (`packages/app/src/components/headers/screen-title.tsx`), which renders `fontSize.base` at weight `400` on compact and `300` on desktop. The New workspace hero is the only larger product title; it uses `fontSize["2xl"]` (`packages/app/src/screens/new-workspace-screen.tsx`).
|
||||
- **Structural labels** use `fontWeight.medium`. This applies to section labels above a stack of rows (`packages/app/src/components/agent-list.tsx:519-523`, `packages/app/src/components/keyboard-shortcuts-dialog.tsx:63-67`), the title at the top of a modal/sheet/dialog (`packages/app/src/components/adaptive-modal-sheet.tsx:90-94`, `packages/app/src/components/ui/combobox.tsx:1607-1611`, `packages/app/src/components/welcome-screen.tsx:48-53`), action button labels in tight components such as the sidebar callout actions (`packages/app/src/components/sidebar-callout.tsx:218-221`), and inline data emphasis on dense metadata rows (`packages/app/src/components/git-diff-pane.tsx:2322-2327`, `packages/app/src/components/file-explorer-pane.tsx:1115-1122`). Form field labels live in `<Field>` (`packages/app/src/components/ui/form-field.tsx`) and use `fontWeight.normal` in `foregroundMuted`.
|
||||
- **Structural labels** use `fontWeight.medium`. This applies to section labels above a stack of rows (`packages/app/src/components/agent-list.tsx:519-523`, `packages/app/src/components/keyboard-shortcuts-dialog.tsx:63-67`), form field labels above an input inside a modal (`packages/app/src/hosts/add-host/internal/add-host-modal.tsx:19-23`, `packages/app/src/hosts/add-host/internal/pair-link-modal.tsx:24-28`), the title at the top of a modal/sheet/dialog (`packages/app/src/components/adaptive-modal-sheet.tsx:90-94`, `packages/app/src/components/ui/combobox.tsx:1607-1611`, `packages/app/src/components/welcome-screen.tsx:48-53`), action button labels in tight components such as the sidebar callout actions (`packages/app/src/components/sidebar-callout.tsx:218-221`), and inline data emphasis on dense metadata rows (`packages/app/src/components/git-diff-pane.tsx:2322-2327`, `packages/app/src/components/file-explorer-pane.tsx:1115-1122`).
|
||||
- **Content** uses `fontWeight.normal`. This applies to settings rows (`packages/app/src/styles/settings.ts`), sidebar primary list-item titles (`packages/app/src/components/sidebar-workspace-list.tsx:2680-2686`, `packages/app/src/components/agent-list.tsx:572-578`), `<StatusBadge>` text (`packages/app/src/components/ui/status-badge.tsx:56-60`), and `<SidebarCallout>` titles (`packages/app/src/components/sidebar-callout.tsx:175-180`).
|
||||
|
||||
The rule, condensed: text that _names_ a surface or a group is `medium`. Text that lives _inside_ a surface or a group is `normal`. Top-of-screen titles are `<ScreenTitle>`, which is lighter still.
|
||||
@@ -78,7 +78,7 @@ In the composer, the first glyph's ink starts on the text column's edge, and the
|
||||
|
||||
One gate, `resolveControlSizing`, picks touch or pointer sizing: touch when the layout is compact or touch is the primary input. An iPad with the sidebar docked is wide and touch-sized; a desktop is pointer-sized; a phone is both compact and touch. The primary input comes from `(pointer: coarse)` (`hasTouchPrimaryPointer` in `hooks/pointer-capabilities.ts`), not from whether a touch screen exists: WebKit keeps touch primary on an iPad with a trackpad attached, and Chromium reports a fine primary pointer for a laptop with a touch screen that its trackpad drives. The fact is read once at startup: attaching a pointer to a tablet does not shrink its controls, and a 2-in-1 launched with a pointer keeps pointer sizes after it switches to tablet mode until the app reloads. Stylesheets take sizes from `bySizing({ touch, pointer })`, which resolves to a breakpoint value, so a caller never sees which sizing it got. Rows, icon buttons and icon slots take theirs from `styles/density.ts`, which uses the same gate. An `{ xs, md }` literal for a hit target or glyph is wrong: on an iPad it yields the pointer size.
|
||||
|
||||
Buttons are pills (`borderRadius.full`) with medium-weight labels; an icon-only button is a circle. `<Switch>` follows the same two sizes: a 34×20 track by default and in `sm`, 44×26 where controls are touch-sized, and it takes presses over its size's control height without adding that height to its row. Buttons, text fields, dropdown triggers, and `<SegmentedControl>` (`packages/app/src/components/ui/segmented-control.tsx`) share the size contract — the same size name means the same height and label size on every control kind, so controls in one row line up. Segments run tighter than a button, because the gap between segments already reads as padding. `<SegmentedControl>` sits in a recessed `surface2` pill track with an elevated active thumb (`surface3` on dark themes, `surface0` with a subtle shadow on light themes) and `foreground` text, never an inverted fill inside thin chrome. A settings row sizes the controls in its trailing slot itself, default in a card and `sm` when nested (`packages/app/src/components/ui/control-size.tsx`), so don't pass a size to a button, dropdown or field placed in a row. Code that computes with a control's height outside a stylesheet uses `controlHeightForLayout`. Never shrink a control's font or padding locally to fit a context — if the context needs a smaller control, the size tier is missing or the wrong one is in use.
|
||||
Buttons are pills (`borderRadius.full`) with medium-weight labels; an icon-only button is a circle. `<Switch>` follows the same two sizes: a 34×20 track by default and in `sm`, 44×26 where controls are touch-sized, and it takes presses over its size's control height without adding that height to its row. Buttons, text fields, dropdown triggers, and `<SegmentedControl>` (`packages/app/src/components/ui/segmented-control.tsx`) share the size contract — the same size name means the same height and label size on every control kind, so controls in one row line up. Segments run tighter than a button, because the gap between segments already reads as padding. The selected segment is a `surface3` fill with `foreground` text, not an inverted one — inverting it inside thin chrome puts a white slab in the toolbar. A settings row sizes the controls in its trailing slot itself, default in a card and `sm` when nested (`packages/app/src/components/ui/control-size.tsx`), so don't pass a size to a button, dropdown or field placed in a row. Code that computes with a control's height outside a stylesheet uses `controlHeightForLayout`. Never shrink a control's font or padding locally to fit a context — if the context needs a smaller control, the size tier is missing or the wrong one is in use.
|
||||
|
||||
A `<Pressable>` wrapping a `<Text>` is a sixth variant. It is wrong. `<Button>` accepts `style`, `textStyle`, `leftIcon`, `disabled`, `size`, and `variant`.
|
||||
|
||||
@@ -96,7 +96,7 @@ A list that is itself the page content — sidebar items in `sidebar-workspace-l
|
||||
|
||||
Pane chrome — the workspace pane header, the file-explorer header, the diff pane header — uses a single bottom border to separate the header from the content (`packages/app/src/components/git-diff-pane.tsx:2328-2331`). One border, no shadow.
|
||||
|
||||
`borderAccent` is reserved for the outline button, hovered control borders, and resting frames like the composer. Cards and containers use `border`. Bordered inputs (like `MenuTextField` and the composer) step to `borderFocus` on focus; filled `surface2` form controls (`FormTextInput`, `SearchField`, `SelectField`) reserve a 1px transparent border at rest and step to `borderAccent` on hover and `borderFocus` with the `accent` focus ring on focus so state changes never shift geometry. Single-thing borders are wrong; a single bordered element is either a card with one row (use the card) or it does not need a border.
|
||||
`borderAccent` is reserved for the outline button. Inputs use `border`. Single-thing borders are wrong; a single bordered element is either a card with one row (use the card) or it does not need a border.
|
||||
|
||||
---
|
||||
|
||||
@@ -266,7 +266,6 @@ New status pills use `<StatusBadge>`. Identity icon badges use `<IdentityIconBad
|
||||
- `fontWeight.medium` on row titles, body text, badge text, or `<SidebarCallout>` titles. Medium is reserved for the structural-label tier described in §3 — section labels, modal/sheet titles, dense metadata emphasis, and tight action labels. Anything else is `normal`. `<ScreenTitle>` is responsive `400/300` and is never overridden.
|
||||
- `<Pressable>` wrapping `<Text>` to make a button. `<Button>` exists.
|
||||
- Importing `Pressable` or a `Touchable*` outside `components/ui/`. A raw pressable has no standard press or hover feedback, so every one drifts. `paseo/no-raw-pressable` reports it; the files on its burn-down list in `.oxlintrc.json` may only leave it.
|
||||
- Importing `EditingTextInput` outside `components/ui/` (or wrapping any text input in `withUnistyles`). Form inputs use `<FormTextInput>` and search inputs use `<SearchField>`; `paseo/no-raw-text-input` enforces this outside the explicit bespoke-editor allowlist. Nested `withUnistyles` drops box styles on web.
|
||||
- Bare `<Text>` for a section header inside settings. `<SettingsSection>` exists.
|
||||
- A muted paragraph between a section header and its card. Section-level explanation is the header's `info` tooltip (§7).
|
||||
- A "Settings" CTA on a detail page. Detail pages are settings; settings is reached from the sidebar, the host entry, or a row's kebab menu.
|
||||
@@ -291,7 +290,7 @@ New status pills use `<StatusBadge>`. Identity icon badges use `<IdentityIconBad
|
||||
| List+detail (compact stack, desktop sidebar+pane) | `packages/app/src/screens/settings-screen.tsx`, `packages/app/src/screens/projects-screen.tsx` |
|
||||
| Detail card+row | `packages/app/src/screens/settings/host-page.tsx`, `packages/app/src/provider-settings/internal/provider-list.tsx` |
|
||||
| Section grouping inside a card list | `packages/app/src/screens/settings/settings-section.tsx` |
|
||||
| Form modal (label + input fields, primary + cancel) | `packages/app/src/components/schedules/schedule-form-sheet.tsx`, `packages/app/src/hosts/add-host/internal/add-host-modal.tsx`, `packages/app/src/hosts/add-host/internal/pair-link-modal.tsx` |
|
||||
| Form modal (label + input fields, primary + cancel) | `packages/app/src/hosts/add-host/internal/add-host-modal.tsx`, `packages/app/src/hosts/add-host/internal/pair-link-modal.tsx`, `packages/app/src/components/project-picker-modal.tsx` |
|
||||
| Destructive confirmation | `confirmDialog` invoked from `packages/app/src/screens/settings/host-page.tsx:541-547` |
|
||||
| Centered hero / first-run | `packages/app/src/components/welcome-screen.tsx` |
|
||||
| Sidebar list (workspaces, hosts) | `packages/app/src/components/sidebar-workspace-list.tsx`, `packages/app/src/components/left-sidebar.tsx` |
|
||||
|
||||
@@ -29,13 +29,6 @@ the titlebar row. Production builds leave the variable unset and show no label.
|
||||
|
||||
`npm run dev` is only a shorthand for `npm run dev:server`. Keep `127.0.0.1:6767` for the packaged app and production-style `~/.paseo` state.
|
||||
|
||||
## Experimental GPUI client
|
||||
|
||||
The opt-in [GPUI target](../packages/app/gpui/README.md) runs the existing React
|
||||
Native app on macOS and Linux. Its contributor guide covers setup, the renderer comparison,
|
||||
unsupported features, native checks, and experiments to pick up. It connects to
|
||||
an already-running daemon and does not replace the Electron dev command.
|
||||
|
||||
## Nix desktop package
|
||||
|
||||
The flake exposes `packages.<system>.desktop` on Linux and macOS:
|
||||
|
||||
+9
-15
@@ -59,25 +59,19 @@ complete`), keyed off the opened snapshot's serverId. Waiting for data is a
|
||||
|
||||
## Form kit
|
||||
|
||||
- Compose `Field` / `SelectField` / `FormTextInput` / `SearchField` / `SegmentedControl` /
|
||||
- Compose `Field` / `SelectField` / `FormTextInput` / `SegmentedControl` /
|
||||
`Switch` from `components/ui/`. Geometry (heights, padding, radii, focus/hover
|
||||
states) is owned by `components/ui/control-geometry.ts` — controls never
|
||||
declare their own, and screens never nudge global component styles to align
|
||||
a row.
|
||||
- Use `FormTextInput` for every form field and textarea (`leading`, `trailing`,
|
||||
`clearable`, `revealable` for password visibility, `monospace`,
|
||||
`appearance="flush"` for card-embedded textareas, and `multiline` with
|
||||
`numberOfLines`), and `SearchField` for search inputs. Both build on
|
||||
`EditingTextInput`, which owns in-progress text, web IME composition safety,
|
||||
`resetKey` resets, bottom-sheet adaptation, and a single internal
|
||||
`withUnistyles` wrapper. React observes committed edits through
|
||||
`onChangeText`, and programmatic mutations use `replaceText`. Lint rejects
|
||||
raw React Native `TextInput` imports and raw `EditingTextInput` imports
|
||||
outside `components/ui/` and the small bespoke-editor allowlist.
|
||||
- Omit `size` on ordinary forms and modals so `control-geometry.ts` sizes every
|
||||
control from the sizing gate (`32px` pointer / `44px` touch). Reserve
|
||||
`size="sm"` for tight chrome (toolbars, nested settings rows), and never pick
|
||||
a control size from `useIsCompactFormFactor()` (see `docs/design.md` §4).
|
||||
- Every text field consumes `EditingTextInput`, directly or through a UI
|
||||
wrapper. The editing surface owns in-progress text; React observes committed
|
||||
edits through `onChangeText`, and programmatic mutations use the input's
|
||||
`replaceText` command. Its props omit `value` and `defaultValue`, web IME
|
||||
candidates stay unpublished until composition commits, and lint rejects raw
|
||||
React Native `TextInput` imports outside the primitive.
|
||||
- The form declares one size for all fields: `sm` on desktop, `md` compact
|
||||
(`useIsCompactFormFactor`).
|
||||
- Availability hierarchy: a field whose capability doesn't apply is **hidden**
|
||||
(isolation on a non-git project — same gating as New Workspace), not rendered
|
||||
disabled with an explanation. Disabled-with-a-reason `hint` is only for
|
||||
|
||||
+6
-7
@@ -111,18 +111,17 @@ rendered while the menu is up. `useOpenKebabMenuVisibility`
|
||||
sidebar rows: it owns `open`, hands the menu its controlled props, and ORs `open` into the
|
||||
row's own `showKebab`.
|
||||
|
||||
## Touch fallback
|
||||
## Native fallback
|
||||
|
||||
Hover doesn't exist on touch screens. Anything you hide behind hover must have a non-hover path on touch screens and compact layouts:
|
||||
Hover doesn't exist on touch devices. Anything you hide behind hover must have a non-hover path on native and compact layouts:
|
||||
|
||||
```tsx
|
||||
const revealsWithoutHover = useRevealsWithoutHover();
|
||||
const showControls = isHovered || revealsWithoutHover;
|
||||
const showControls = isHovered || isNative || isCompact;
|
||||
```
|
||||
|
||||
`useRevealsWithoutHover()` (`@/hooks/hover-reveal`) asks the pointer, not the platform: it is true when no mouse-like pointer drives the UI or the layout is compact. Don't use `isNative` for this. A touch-first browser such as iPad Safari is `isWeb` yet cannot hover, and the GPUI desktop client is native yet driven by a mouse, so `isNative` gets both wrong.
|
||||
`isNative` and `isCompact` come from `@/constants/platform` and `@/constants/layout`. Don't use `Platform.OS === "ios"` as a proxy.
|
||||
|
||||
`onPointerEnter` / `onPointerLeave` fire on the web and in the GPUI desktop client. They do not fire on iOS or Android. You do not need to gate them: on a touch screen, hover is unreachable and visibility comes from `useRevealsWithoutHover()`. This is why the workspace row's pointer events are not wrapped in `if (isWeb)`.
|
||||
`onPointerEnter` / `onPointerLeave` are DOM events. They do not fire on native. You do not need to gate them — on native, hover is unreachable anyway and visibility is driven by `isNative` / `isCompact` in your show-the-controls expression above. This is why the workspace row's pointer events are not wrapped in `if (isWeb)`.
|
||||
|
||||
## What about `Pressable.onHoverIn` / `onHoverOut`?
|
||||
|
||||
@@ -149,7 +148,7 @@ Before opening a PR that touches hover:
|
||||
- [ ] The hover trigger's bounding box contains every element the user might mouse into while interacting with the feature.
|
||||
- [ ] Hovered state does **not** change the trigger's outer geometry (`width`, `height`, `padding`, `borderWidth`, mount/unmount of siblings that shift it). Internal swaps fit inside a fixed `minHeight` / `minWidth`.
|
||||
- [ ] Revealed content inside the trigger uses `opacity` + `pointerEvents`, not conditional rendering, if mounting it would reflow the trigger.
|
||||
- [ ] Visibility on touch screens and compact layouts works without hover (`isHovered || revealsWithoutHover`, with `useRevealsWithoutHover()` called unconditionally).
|
||||
- [ ] Visibility on native and compact layouts works without hover (`isHovered || isNative || isCompact`).
|
||||
- [ ] A menu opened from the revealed trigger keeps the trigger rendered while it is open, so losing hover can't strand it.
|
||||
- [ ] If the revealed content sits in a separate layer (portal, floating panel) and the user can point at it, it is a `HoverCard`.
|
||||
- [ ] You opened the dev server, hovered the trigger, and slowly moved the mouse along **every** revealed element — including any visible gaps — without losing hover state.
|
||||
|
||||
@@ -1,63 +1,6 @@
|
||||
# Keyboard shortcuts
|
||||
|
||||
A shortcut is two registrations. An action in the action registry (`@/actions`) is something the app can run. A binding in the keybinding registry (`@/keyboard`) connects keys to an action. `@/keyboard` imports `@/actions`; `@/actions` knows nothing about keys.
|
||||
|
||||
Paseo's own actions and default bindings are in [`core-actions/internal/actions.ts`](../packages/app/src/core-actions/internal/actions.ts) and [`bindings.ts`](../packages/app/src/core-actions/internal/bindings.ts). `CoreActionsProvider` registers them at app start, so Settings, badges and Command Center see every core shortcut before any surface mounts. Add a shortcut by adding a binding; add platform support through a key source.
|
||||
|
||||
## Actions and handlers
|
||||
|
||||
An action id such as `paseo/workspace.tab.next` is the only key for dispatch, badges (`useShortcutKeys`, `Shortcut`), Command Center rows and Settings rows.
|
||||
|
||||
A mounted surface supplies behavior with `useActionHandler(actionId, handler, { enabled, scope })`. Dispatch tries handlers in active action scopes innermost first, then unscoped handlers while no overlay covers the app, with the earliest registration first among equals. When every handler declines, the action's own `run` handles it. The app shell supplies `run` for the core actions no screen owns (`APP_SHELL_ACTION_IDS` in [`app-shell-runs.ts`](../packages/app/src/core-actions/internal/app-shell-runs.ts)). Every other core action has no `run`, so it can run only while a surface handles it. Do not give such an action a declining `run`: an action with a `run` counts as available, and its chords then reserve a first step that another shortcut needs.
|
||||
|
||||
A handler declines only by returning `{ handled: false }` synchronously. Any other return, including a promise, counts as handled. Express which handler wins with `enabled` and scopes, not with mount order.
|
||||
|
||||
Finite variants are separate actions: `workspace.tab.next` and `workspace.tab.previous`, one action per `message-input.*` operation. Only a binding declared with `Digit` supplies data, as `index`. It keeps supplying the pressed digit when an override narrows it to one digit, because Settings saved captured digits literally before it captured number groups.
|
||||
|
||||
## Action scopes
|
||||
|
||||
A surface that should shadow a shortcut while it is active creates a scope with `useActionScope(name, { active })`, and passes it to its handlers as `scope` or wraps its children in `<ActionScope activation>`. The innermost active scope wins. There are no priorities.
|
||||
|
||||
Example: the composer activates `paseo/composer` while it takes input, and the New Workspace screen activates `paseo/new-workspace` while it is focused. Shift+Tab on the New Workspace screen reaches its composer, and never the mode control of a backgrounded agent composer that is still mounted.
|
||||
|
||||
Scopes order by activation, so they cannot tell which of two active surfaces the user is in. Say that with `enabled`:
|
||||
|
||||
- Several composers can be active at once, such as the main pane's and an Explorer dock agent tab's. Composer handlers register through `useComposerKeyboardActions` ([`composer/keyboard-scope.tsx`](../packages/app/src/composer/keyboard-scope.tsx)), which enables only the composer whose input had focus last. A blur, such as a click on the timeline, keeps that composer; deactivating or unmounting it releases the keys. Until an active composer's input has had focus, the innermost composer wins.
|
||||
- Desktop Settings covers the workspace, which stays mounted beneath it. Composers go inactive while `useSettingsCoversWorkspace()` holds, so Escape reaches Settings' handler and closes Settings. Compact Settings covers nothing, and Escape there still interrupts the agent.
|
||||
|
||||
An overlay that holds the keyboard, such as a dialog, a menu or the Command Center, covers the app while it is open. `useOverlayRegistration` makes the cover when the overlay takes focus (`manageFocus`, on by default) and returns it as `actionScope`. Pass the overlay's scope `name`, such as `paseo/dialog`, and wrap its content in `<ActionScope activation={actionScope}>`. While the overlay is the latest cover, it hides every activation not inside it, including ones made after it opened, and every handler mounted in no scope. An action's `run` stays available. A shortcut that a screen beneath the dialog handles does nothing while the dialog is open, and works again when it closes.
|
||||
|
||||
A registration that only claims keys, such as the hover card or select mode's Escape, passes `manageFocus: false` and covers nothing. `<ActionCover name>` covers without a key registration; only the mobile menu sheet uses it. An overlay opened with a shortcut closes with the same shortcut only through a handler inside its cover, such as `KeyboardToggleClose` in the model picker, because the cover hides the trigger's handler.
|
||||
|
||||
A Command Center row runs its action for the screen beneath the Command Center. The row calls `canDispatch` and `dispatch` with `{ beneath: "paseo/command-center" }`, which answer as if the latest Command Center cover were closed. The list is built for each opening, so it shows only rows that a handler on that screen or the action's `run` can take.
|
||||
|
||||
A handler is bound to one activation, not to a scope name. Two panes that show the same surface activate the same name separately, and a handler in one pane never runs for the other.
|
||||
|
||||
An action scope is different from the focus scope in a binding's `when` clause. Action scopes come from mounted surfaces. The focus scope comes from the focused input; see [Focus scopes](#focus-scopes).
|
||||
|
||||
## Bindings
|
||||
|
||||
A binding has an id, an action id, a combo and a `when` clause. User overrides are keyed by binding id, so never rename a shipped id, even when its combo changes (`agent-new-cmd-shift-o-mac` is bound to Cmd+O).
|
||||
|
||||
Among bindings that match the same key in the same context, a user-set binding wins over a default, then the earliest registered wins. If its action declines, the registry tries the next matching binding. A chord's first step is reserved only while the chord's action can run. On every step, a key continues a chord only when the chord ranks ahead of every runnable binding that the key completes. A plugin's default `Mod+K J` therefore leaves Ctrl+K to the Command Center until the user sets that chord, and a saved `Ctrl+G J K` continues past a default `Ctrl+G J`.
|
||||
|
||||
Settings → Shortcuts asks the registry about every captured combo with `checkCapture` (`canFire`, `conflicts`). A combo that can never fire for that binding is refused with a reason and cannot be saved: an unmodified or Shift-only printable key on a binding whose `when` only holds while typing, such as mode cycle on `Shift+M`. A combo that shares a key press with another binding is saved and shown on both rows as "Also used by …", and the user-set binding runs. The shipped defaults share no key press, so a fresh install shows no warning.
|
||||
|
||||
Badges show the first assigned binding for the platform (`displayKeysFor`). Settings → Shortcuts builds its rows from the registry with `buildShortcutSections`, so it lists every core binding with only Settings mounted.
|
||||
|
||||
A surface that reads keys itself while it holds the keyboard, such as the workspace switcher HUD, matches them with `createChordMatcher` against the bindings it picks. A binding whose action finishes when its modifier is released, such as Ctrl+Tab in the switcher, sets `holdRelease`; key sources outside the app, such as the Electron browser pane, forward that key-up.
|
||||
|
||||
Tests that drive real keys through the real table use `createRecordingCoreRegistries` from `@/core-actions/testing`.
|
||||
|
||||
## Plugin actions
|
||||
|
||||
Plugins register actions and bindings through the same two registries; the author contract is in [Actions and keyboard shortcuts](../public-docs/plugins/reference.md#actions). [`plugins/shortcuts/`](../packages/app/src/plugins/shortcuts/index.ts) connects each installation's contributions.
|
||||
|
||||
- Ids are namespaced: the plugin's `open` is the action `plugin-<pluginId>/open`, its binding ids are `plugin-<pluginId>/<id>`, and its scopes are `plugin-<pluginId>/<name>`. Overrides key off these ids, so the user's rebinding survives reinstalls and reloads.
|
||||
- A plugin installed on several hosts adds the same action once per host. The registry keeps one action whose owners are the host ids; core actions have owner `null`. `pluginActionOwnerOrder`, passed to `CoreActionsProvider`, picks the host that runs it: a global action runs on the host of the screen the user is on, else the host the user last picked for the plugin's screens, else the first online host. A workspace or agent action runs only on the active host. Offline hosts never run.
|
||||
- Every plugin screen, panel and popover activates `paseo/plugin-surface`. A plugin handler without `scope` belongs to that activation, so two panes of the same panel never run each other's handlers.
|
||||
- Core actions and bindings register before any plugin, so a core default binding is tried before a plugin binding on the same key.
|
||||
- Settings → Shortcuts and the shortcuts dialog add one section per plugin, titled with its name, with one row per action across all hosts.
|
||||
Define shortcuts in [the shared binding table](../packages/app/src/keyboard/keyboard-shortcuts.ts). Platforms contribute key sources, not separate action maps, so matching and user rebinds stay consistent across runtimes. Add a shortcut through a binding; add platform support through a key source.
|
||||
|
||||
## Badges and routing
|
||||
|
||||
@@ -83,14 +26,8 @@ after the focused text control has already handled the press, so the pipeline's
|
||||
must be claimed up front. `UIKeyCommand` takes only those keys: composer Return, the
|
||||
top overlay's Enter and arrows, and the Shift or Option shortcuts whose binding is
|
||||
active in the current focus scope, such as Shift+Tab in the composer.
|
||||
`sources/native.ts` computes the claims from the published bindings, the focus scope,
|
||||
Command Center and the visible action scopes, and recomputes them when any of these
|
||||
change. A first key is checked without the action scope stack, so a binding whose
|
||||
`when` names an action scope never claims its first key. While a chord waits, only the
|
||||
next key of each pending candidate is claimed, and a scoped candidate keeps its claim
|
||||
while its scope stays visible. A covering overlay drops the claim, so the key reaches
|
||||
the overlay's text field. Gate a key
|
||||
that a text control would type with `focusScope`, as mode cycle does. Cmd and Ctrl combos are never claimed, because
|
||||
`sources/native.ts` computes the claims from the published bindings and recomputes
|
||||
them when the focus scope changes. Cmd and Ctrl combos are never claimed, because
|
||||
text controls do not type them. Android takes no claims: a focused `EditText`
|
||||
types nothing for these combos. Keep the stream as the sole shortcut emitter: a command-owned
|
||||
press is still observed by the window.
|
||||
@@ -119,15 +56,6 @@ Verify the iOS absence case on a physical iPhone.
|
||||
Xcode 27.2 has Device Hub in place of Simulator. AppleScript keystrokes reach the
|
||||
device only while its view has Mac focus. Give it focus with a real mouse click
|
||||
(a `CGEvent`); keystrokes sent elsewhere drive Device Hub's own controls.
|
||||
Send both steps of a chord from one AppleScript `tell` block. A chord expires
|
||||
after 1.5 s, and separate `osascript` calls with settle delays exceed it, so the
|
||||
second key types into the focused field.
|
||||
|
||||
On Android debug builds, the Expo dev menu reads unmodified R, P and I on key-up
|
||||
outside text fields: R reloads, P opens the performance monitor (and the overlay
|
||||
permission page), I toggles the inspector. Before hardware-keyboard QA, set
|
||||
`keyCommandsEnabled` to `false` in the app's `expo.modules.devmenu.sharedpreferences`
|
||||
SharedPreferences.
|
||||
|
||||
Never register Backspace: it would take deletion away from text fields. Changes
|
||||
to the native module require a native rebuild; an over-the-air JavaScript update
|
||||
@@ -182,6 +110,6 @@ leaving active IME composition spans untouched for candidate navigation.
|
||||
## Keys shared with text editing
|
||||
|
||||
A binding on a key the platform already uses for editing, such as Cmd/Ctrl+Z for
|
||||
workspace archive undo, declares `when: { editable: false }`, and its handler is
|
||||
`enabled` only while it has work. A disabled or declining handler leaves the key
|
||||
workspace archive undo, declares `editable: false` and registers its handler with
|
||||
`isActive` true only while it has work. An inactive handler leaves the key
|
||||
unhandled, so the pipeline skips `preventDefault` and the platform's own undo runs.
|
||||
|
||||
@@ -32,7 +32,7 @@ The package keeps the npm tarball's layout, including its build output:
|
||||
- `android/generated` and `ios/generated` are checked-in codegen output (`includesGeneratedCode`). A change to a native component spec regenerates both; `scripts/postinstall-patches.test.mjs` compares them against the specs.
|
||||
- `src/web/wasm/md4c.js` and `lib/module/web/wasm/md4c.js` are an Emscripten build of `cpp/md4c`, `cpp/parser` and `cpp/wasm`. A parser change rebuilds both, or web keeps the old behavior while iOS and Android change. Run `cpp/wasm/build.sh` with `OUT_DIR` set to `src/web/wasm`, in `emscripten/emsdk:4.0.10` with the `-s GROWABLE_ARRAYBUFFERS=0` line removed. That version reproduces the committed JavaScript glue and has no such setting. The `lib/module` copy is the Babel output of the new file.
|
||||
- Upstream's Gradle, CMake and CocoaPods scripts detect upstream's own monorepo by the paths `packages/core` and a root `vendor/`. Do not add either path to this repository.
|
||||
- `postinstall.mjs` downloads the tree-sitter grammars into the ignored `cpp/highlight/vendor/grammars` and `vendor/tree-sitter`, and downloads RaTeX into `ios/vendor` when `enableMath` is true (unless `PASEO_FDROID_BUILD=1`). The `enriched-markdown` block in `packages/app/package.json` chooses the languages and enables native math.
|
||||
- `postinstall.mjs` downloads the tree-sitter grammars into the ignored `cpp/highlight/vendor/grammars` and `vendor/tree-sitter`. The `enriched-markdown` block in `packages/app/package.json` chooses the languages.
|
||||
|
||||
CI does not build native code or run the fork's Robolectric suites. Run `npm run test:android --workspace=@getpaseo/app` for Android changes. Native changes require a client rebuild; JavaScript refresh cannot enable compiled grammars.
|
||||
|
||||
@@ -46,17 +46,7 @@ Some fork changes are backports. A sync past the upstream version drops them in
|
||||
|
||||
## Engine constraints
|
||||
|
||||
Built-in LaTeX math is enabled by default, and video is disabled. Task lists and admonitions are enabled, and task checkboxes stay read-only. Source adaptation spaces adjacent empty GFM table delimiters before escaping prose spoiler delimiters and decodes entity text before the engine can discard it. Code spans and fences keep their literal source. Comment HTML is normalized to Markdown before parsing, and details show their summary and body expanded. `<br>` becomes a Markdown hard break, except inside a table, where a newline would end the row. There it becomes U+2028, and `cpp/parser/MD4CParser.cpp` turns U+2028 back into a line break in table cell text, never in code.
|
||||
|
||||
### LaTeX math
|
||||
|
||||
`components/markdown/math.ts` accepts `$...$`, `$$...$$`, `\(...\)`, `\[...\]`, and closed `math` fences (` ```math ` or `~~~math`). Inline `$...$` requires non-alphanumeric outer boundaries, no inner edge spaces, and no leading currency number or shell prose. Escaped `\[1, 2\]` citations, `$PATH`, regexes, and `latex` or `tex` code fences stay literal. Non-math messages skip scanning with a fast character check and do not trigger an `mdast` parse. Adapted expressions canonicalize to `$...$` or `$$...$$` for `md4c`, escape table pipes inside table rows, and flank adjacent CJK characters with hair spaces.
|
||||
|
||||
On web and Electron, `react-native-enriched-markdown` loads KaTeX (`htmlAndMathml` output with `.woff2` fonts) lazily when a document contains a math node. It caches rendered HTML in a 256-entry LRU and skips root-font overrides on `.katex` elements. Selection copy restores `[data-math-source]` to `$...$` or `$$\n...\n$$` without hidden `.katex-mathml` or `annotation` nodes. Chat Find ignores `.katex-mathml`, `annotation`, and `annotation-xml` nodes as well.
|
||||
|
||||
On iOS and Android, native views render with RaTeX (`enableMath: true` in `packages/app/package.json`). F-Droid builds (`PASEO_FDROID_BUILD=1`) disable native RaTeX in Gradle and `postinstall.mjs`, falling back to raw LaTeX. On 32-bit `x86` Android devices without `libratex_ffi.so`, the math views catch `Throwable` and render raw LaTeX text.
|
||||
|
||||
While streaming, `streaming.ts` keeps open `$$`, `\[`, and `math` fences in the unsealed tail so equations never split across blocks. Incomplete inline and display math stays withheld or literal until its closing delimiter arrives.
|
||||
Math and video are disabled. Task lists and admonitions are enabled; task checkboxes are read-only. Source adaptation spaces adjacent empty GFM table delimiters before escaping prose spoiler delimiters and decodes entity text before the engine can discard it. Code spans and fences keep their literal source. Comment HTML is normalized to Markdown before parsing; details show their summary and body expanded. `<br>` becomes a Markdown hard break, except inside a table, where a newline would end the row. There it becomes U+2028, and `cpp/parser/MD4CParser.cpp` turns U+2028 back into a line break in table cell text, never in code.
|
||||
|
||||
Mermaid fences use the existing isolated diagram runtime and fullscreen viewer. Web dispatches them through the library’s code-block override. Native has no block-renderer hook, so the renderer extracts only Mermaid fences and places the existing WebView host between library-rendered segments. This is the only block exception; see [native selection limitations](native-text-selection.md) for diagram grouping and leading inline images. Streaming keeps the last valid diagram visible while the next revision renders.
|
||||
|
||||
|
||||
+8
-28
@@ -1,7 +1,7 @@
|
||||
# Plugins
|
||||
|
||||
Local plugins contribute daemon RPCs, native app surfaces, workspace panels, Command Center items,
|
||||
keyboard shortcuts, client slash commands, timeline items, notifications, header buttons, composer pills, app themes, composer attachment sources, and settings screens.
|
||||
client slash commands, timeline items, notifications, header buttons, composer pills, app themes, composer attachment sources, and settings screens.
|
||||
Paseo executes `index.server.ts` in a subprocess and `index.client.tsx` in every connected app.
|
||||
|
||||
> **Trust every plugin you add.** `paseo plugin add` and `paseo plugin install` mean “I trust this codebase.” Plugins are unsandboxed: server code and preparation commands run with the daemon user's access on the daemon host, and client contributions run inside Paseo. The repository's dependencies and future updates are part of that trust decision. With `--host`, preparation runs on that remote daemon host.
|
||||
@@ -431,11 +431,9 @@ When the same plugin contribution exists on multiple hosts, Paseo shows it once
|
||||
adds a host picker to the screen header. The selected host supplies the bundle, RPC transport, and
|
||||
query cache. Explicit SDK targets follow the [host API contract](../public-docs/plugins/reference.md#discover-hosts-and-target-another-host).
|
||||
|
||||
Workspace panels, Command Center items, actions, keybindings, and client slash commands are client contributions. The
|
||||
Workspace panels, Command Center items, and client slash commands are client contributions. The
|
||||
daemon transports their compiled bundle without interpreting placement or callbacks. Panel props
|
||||
carry `workspaceId`, validated read-only `params` (with host-enforced `agentId` on agent panels),
|
||||
`revision`, and `tab`; optional `identity(params)` sets the coalescing key on the persisted
|
||||
`plugin` target. Required-selector hooks read normalized client state synchronously
|
||||
contain workspace and agent IDs. Required-selector hooks read normalized client state synchronously
|
||||
and use shallow equality, so a panel does not subscribe to fields it does not render. Command
|
||||
callbacks materialize their snapshots only when invoked. Contribution discovery and panel opening
|
||||
never fetch active context through plugin RPC. Snapshot DTOs are deeply readonly and frozen at
|
||||
@@ -444,8 +442,8 @@ runtime so plugin code cannot mutate normalized app state or a memoized selectio
|
||||
current installed-plugin catalog. A missing contribution renders unavailable inside the tab.
|
||||
Panels declare `locations: ["workspace", "explorer"]` to opt into Explorer hosting; omission means
|
||||
workspace only. Location controls hosting, not context. An agent panel target keeps its `agentId`
|
||||
and `params` when moved between hosts. UI launchers only offer workspace-context panels whose
|
||||
`params` schema accepts `{}`.
|
||||
when moved between hosts. Explorer configuration can create workspace-context panels and remove
|
||||
existing agent-context instances, but it cannot create an agent panel without an agent-aware command.
|
||||
|
||||
`AgentChat` renders the agent tab's own chain (`AgentPanelContent` in
|
||||
`packages/app/src/panels/agent-panel.tsx`) through `packages/app/src/agent-embed`. The chain takes
|
||||
@@ -464,10 +462,6 @@ See the public [navigation fields](../public-docs/plugins/reference.md#screens-a
|
||||
and [external links and workspace browsers](../public-docs/plugins/reference.md#external-links-and-workspace-browsers)
|
||||
for the author-facing contract.
|
||||
|
||||
Plugin actions and keybindings join the app's action and keybinding registries. Namespacing, which
|
||||
host runs an action, and the Settings sections are in
|
||||
[Plugin actions](keyboard-shortcuts.md#plugin-actions).
|
||||
|
||||
### Plugin icons
|
||||
|
||||
The [public reference](../public-docs/plugins/reference.md#icons) owns the author API: a contribution
|
||||
@@ -808,20 +802,6 @@ read. See the [public file panel reference](../public-docs/plugins/reference.md#
|
||||
the author API, selection, `DocumentFrame`, and the version requirement. The examples live in
|
||||
`plugin-examples/pdf-panel` and `plugin-examples/markdown-panel`.
|
||||
|
||||
## HtmlFrame
|
||||
|
||||
`HtmlFrame` (`packages/app/src/html-frame`) runs HTML in a sandboxed frame for plugins; the
|
||||
[public reference](../public-docs/plugins/reference.md#htmlframe) owns the author API. It reuses the
|
||||
file preview hardening: `file-panels/html-preview-csp.ts` builds the policy,
|
||||
`html-preview-navigation.ts` guards the native WebView. Web uses a `sandbox="allow-scripts"`
|
||||
`srcdoc` iframe verified with a per-mount bootstrap token before flushing queued host messages,
|
||||
native wraps the WebView in a sized `View` so inline auto-height frames work inside scrolling lists,
|
||||
and one bootstrap script (`bootstrap.ts`) gives the page the same `window.parent.postMessage`
|
||||
contract on both. A `srcdoc` iframe inherits its embedder's CSP. Neither the daemon's web UI
|
||||
(`web-ui.ts`), nor the desktop `paseo://` protocol handler, nor `index.html` sets one, so allowed
|
||||
CDN scripts load; a reverse proxy that adds a `Content-Security-Policy` header to the app page would
|
||||
also bind the frame and block them.
|
||||
|
||||
## Contribute buttons
|
||||
|
||||
Header buttons and composer pills share the client-only descriptor and registration lifecycle in
|
||||
@@ -919,9 +899,9 @@ implementations and `toPluginComposer`; never branch on `context` in the host.
|
||||
`useComposers` and `composers()` reach an agent's model by reference (`plugins/composer-items/source.ts`):
|
||||
`PluginInstallationProvider` provides the plugin's source to every surface, and
|
||||
`createPluginCapabilities` puts `composers` on every command context. `{ focused: true }` is the
|
||||
agent Command Center registration hands to agent items, published with the active host and
|
||||
workspace through `plugins/location.ts` (null when no host is active). The source and plugin actions
|
||||
read that module, not the navigation or layout stores, so the plugin runtime does not import them. The remembered workspace selection is
|
||||
agent Command Center registration hands to agent items, published through `plugins/focused-agent.ts`
|
||||
(null outside a workspace route). The source reads that module, not the navigation or layout
|
||||
stores, so the plugin runtime does not import them. The remembered workspace selection is
|
||||
navigation restore state and is not the focused agent. The query-cache subscriptions react to
|
||||
`updated` events only: a `useQuery` in another component's render announces `added`, and a
|
||||
subscriber that updates then triggers React's "update a component while rendering a different one"
|
||||
|
||||
@@ -69,51 +69,20 @@ Explicit caller restore modes and history counts pass through unchanged. JSON sn
|
||||
wire declarations remain accepted, but JSON snapshot frames have no rendering runtime.
|
||||
Terminals require `terminal-restore-modes`; older hosts show an update message without attaching.
|
||||
|
||||
## Frame transport (chunking and compression)
|
||||
## Binary chunking
|
||||
|
||||
`binary_chunking_v1` in `hello` and optional `server_info.features.binaryChunkingV1`
|
||||
negotiate connection-scoped framing. Optional `frame_codecs` in `hello` and optional
|
||||
`server_info.features.frameCodecs` negotiate a stateless per-frame codec (such as
|
||||
`"deflate-raw"`). Both peers pick the first server-advertised codec ID present in the
|
||||
client's local codec list, so selection is deterministic regardless of client list order.
|
||||
Application serializers and routed envelopes use the same boundary. Handshakes (`hello`
|
||||
and `server_info`), frames below 1024 bytes, and incompressible frames keep their
|
||||
existing uncompressed representation. The daemon sends `server_info` before it applies the
|
||||
negotiated codec, because the client selects its codec from it. A routed envelope whose
|
||||
enclosed frame is already compressed is forwarded as it is.
|
||||
|
||||
A client omits `frame_codecs` when its transport reports `local` (loopback TCP, Unix
|
||||
socket, named pipe), unless the caller lists codecs explicitly in `capabilities`. Hosts
|
||||
routed through that client still use its installed codecs, so a routed host behind a
|
||||
loopback origin compresses end to end while the origin socket carries the frames as they are. Older peers that omit `frame_codecs` or
|
||||
`features.frameCodecs` exchange uncompressed frames and retain existing frame limits.
|
||||
`binary_chunking_v1` in hello and optional `server_info.features.binaryChunkingV1`
|
||||
negotiate connection-scoped framing. Application serializers and routed envelopes use
|
||||
the same boundary. Small messages and handshakes keep their existing representation.
|
||||
Older peers retain existing frame limits.
|
||||
|
||||
The reserved binary opcode `0x31` is followed by version `1`, original kind
|
||||
(`0` text, `1` binary), and flag bits: START (`0x01`), END (`0x02`), and ENCODED (`0x04`).
|
||||
When ENCODED is set, compression happens once per logical frame before chunking; the
|
||||
payload is encoded bytes (stateless per frame, with no cross-frame dictionary state).
|
||||
Single-frame encoded messages (`START | END | ENCODED`, `0x07`) work even when outbound
|
||||
chunking is unavailable or `binary_chunking_v1` is absent. Unencoded chunking and
|
||||
multi-chunk sequences require `binary_chunking_v1`. ENCODED frames received without a
|
||||
negotiated codec, or chunks whose ENCODED flag changes mid-sequence, fail closed.
|
||||
There is no total length or chunk count; a future receiver can consume slices
|
||||
incrementally. Today the receiver buffers up to the existing 100 MiB logical limit,
|
||||
enforces the same limit as a hard decompression cap to block decompression bombs, and
|
||||
decodes UTF-8 only after END and decode complete. Transfers cannot interleave.
|
||||
(`0` text, `1` binary), and START/END flag bits `0`/`1`. Remaining bytes are an
|
||||
unchanged slice. There is no total length or chunk count; a future receiver can
|
||||
consume slices incrementally. Today the receiver buffers up to the existing
|
||||
100 MiB logical limit and decodes UTF-8 only after END. Transfers cannot interleave.
|
||||
Disconnect clears partial state and negotiation.
|
||||
|
||||
Codecs are host-supplied (`DaemonClientConfig.frameCodecs`), not sniffed in client core:
|
||||
Node entry points supply `node:zlib` (sync up to 256 KiB: encode when the raw frame is at
|
||||
most that, decode when its input and output stay within it; libuv async past it, so high-ratio inbound
|
||||
frames never stall the event loop),
|
||||
web/Electron supplies `CompressionStream("deflate-raw")`, and native iOS/Android
|
||||
supplies the `paseo-compression` Expo module. Async codecs preserve strict FIFO order on
|
||||
both send and receive; a protocol error during async decode closes the socket via
|
||||
`onProtocolError` without delivering queued frames. `close()` drops frames still decoding,
|
||||
so a client that disposes a connection never sees its stale frames. When a peer disconnects,
|
||||
the daemon awaits `flushInbound()` before `close()`, so a request the peer sent just before
|
||||
dropping applies as it would uncompressed.
|
||||
|
||||
The lower transport supplies its plaintext frame budget, including encryption
|
||||
overhead. The sender waits for drain between chunks while ordinary messages keep
|
||||
the existing delivery path. Slow-client protections count messages queued behind
|
||||
@@ -125,8 +94,7 @@ WebSocket does not report its queued bytes, so the client cannot wait for native
|
||||
drain. Android's installed OkHttp transport closes when a send would put more
|
||||
than 16 MiB in its queue. The native transport disables outbound chunking, including
|
||||
on routed channels, and retains its existing single-frame admission errors.
|
||||
Inbound chunking and single-frame compression remain enabled; daemon-to-native responses
|
||||
use the daemon's paced writes.
|
||||
Inbound chunking remains enabled; daemon-to-native responses use the daemon's paced writes.
|
||||
|
||||
## Owned observations
|
||||
|
||||
|
||||
+2
-6
@@ -442,7 +442,6 @@ const MY_PROVIDER_MODES: AgentProviderModeDefinition[] = [
|
||||
description: "Standard agent mode",
|
||||
icon: "ShieldCheck",
|
||||
colorTier: "safe",
|
||||
permissionTier: "safe",
|
||||
},
|
||||
{
|
||||
id: "autonomous",
|
||||
@@ -450,14 +449,11 @@ const MY_PROVIDER_MODES: AgentProviderModeDefinition[] = [
|
||||
description: "Runs without prompting",
|
||||
icon: "ShieldOff",
|
||||
colorTier: "dangerous",
|
||||
permissionTier: "dangerous",
|
||||
isUnattended: true,
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
Available `permissionTier` values (lowest to highest security rank for MCP mode-ceiling checks): `"planning"`, `"safe"`, `"moderate"`, `"dangerous"`.
|
||||
Available `colorTier` values (display styling, independent of `permissionTier`): `"safe"`, `"moderate"`, `"dangerous"`, `"planning"`, or a `#rrggbb` hex color.
|
||||
Available `colorTier` values: `"safe"`, `"moderate"`, `"dangerous"`, `"planning"`.
|
||||
Available `icon` values: `"ShieldCheck"`, `"ShieldAlert"`, `"ShieldOff"`.
|
||||
|
||||
Then add to the `AGENT_PROVIDER_DEFINITIONS` array:
|
||||
@@ -715,7 +711,7 @@ Tests use `isProviderAvailable(provider)` to skip when the binary or credentials
|
||||
|
||||
**Auth patterns vary.** Some providers need API keys in env vars (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`), some use OAuth tokens (`CLAUDE_CODE_OAUTH_TOKEN`), some use auth files (`~/.codex/auth.json`), and some handle auth entirely in their CLI binary (Copilot). Your `isAvailable()` method should check whatever is needed.
|
||||
|
||||
**The manifest mode list and the agent class mode list are separate.** The manifest in `provider-manifest.ts` includes UI and policy metadata (`icon`, `colorTier`, `permissionTier`, `isUnattended`). The agent class defines modes without that static metadata (just `id`, `label`, `description`). Keep them in sync.
|
||||
**The manifest mode list and the agent class mode list are separate.** The manifest in `provider-manifest.ts` includes UI metadata (`icon`, `colorTier`). The agent class defines modes without UI metadata (just `id`, `label`, `description`). Keep them in sync.
|
||||
|
||||
**`defaultCommand` is a tuple.** The first element is the binary name, the rest are default arguments. The base class uses this to find the executable and spawn the process.
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ wire record = (u16 BE ciphertextLength || ciphertext)+
|
||||
|
||||
The receiver rejects a record whose metadata disagrees between chunks, whose non-final chunks are not full, whose byte total differs from `totalLength`, or that has zero chunks, trailing bytes, reserved flags, or an invalid kind. Partial plaintext never reaches the application. Transport AD is empty, as the Noise spec writes it; framing authenticity comes from the metadata being inside the ciphertext. `packages/relay/src/protected-records.ts` owns this.
|
||||
|
||||
When `binaryCiphertext` is negotiated, both text and binary records travel as WebSocket binary frames, because the authenticated `kind` byte inside the record carries the frame kind. Base64 WebSocket text records remain accepted on receive for older peers and when `binaryCiphertext` is not negotiated.
|
||||
Frame kind is preserved on the wire the same way as legacy: text records are base64 WebSocket text, binary records are WebSocket binary when `binaryCiphertext` was negotiated.
|
||||
|
||||
## Retries and failures
|
||||
|
||||
|
||||
+36
-50
@@ -18,14 +18,14 @@ Preparation is reversible and runs on the release branch before the user authori
|
||||
6. Run `npm run release:prep:<mode>` to create the `chore(release): cut <version>` commit without a tag.
|
||||
7. Push `release/vX.Y.Z` or `release/vX.Y.Z-beta.N`.
|
||||
8. Right after the push, open the unmerged [reconcile `main`](#reconcile-main) PR from `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N`, so its CI runs in parallel with the release branch's `CI` and `Desktop Packages`. Do not merge it during Preparation.
|
||||
9. Wait for `CI` and `Desktop Packages` on the release branch to pass (never wait on `main` CI), and run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit. Because `release:prep:<mode>` updates `package-lock.json`, `CI`'s `quality` job verifies `nix/npm-deps.hash` on `release/**` branches and prints the exact `printf '%s\n' '<hash>' > nix/npm-deps.hash` command if stale.
|
||||
9. Wait for `CI` and `Desktop Packages` on the release branch to pass (never wait on `main` CI), and run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit.
|
||||
|
||||
### Ship
|
||||
|
||||
Ship starts after the user says "go ahead". All tag-triggered GitHub Actions workflows and EAS workflows build from the checked-out tag commit with local workspace packages, so none of them install `@getpaseo/*` from the public npm registry.
|
||||
|
||||
1. Run `npm run release:push` first to verify the clean release branch and push `vX.Y.Z` or `vX.Y.Z-beta.N`. Pushing the tag takes a few seconds and starts `NPM Release`, `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and (for stable tags) `Deploy App` on GitHub Actions, plus `Release Mobile` (stable) or `Release iOS Beta` (beta) on EAS. (`Deploy Website` runs later on the `release: published` event when `Desktop Release` publishes the stable GitHub Release.)
|
||||
2. Watch `NPM Release`. It publishes the seven `@getpaseo/*` packages through Trusted Publishing and checks npm visibility after publishing all packages.
|
||||
1. Run `npm run release:push` first to verify the clean release branch and push `vX.Y.Z` or `vX.Y.Z-beta.N`. Pushing the tag takes a few seconds and starts `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and (for stable tags) `Deploy App` on GitHub Actions, plus `Release Mobile` (stable) or `Release iOS Beta` (beta) on EAS. (`Deploy Website` runs later on the `release: published` event when `Desktop Release` publishes the stable GitHub Release.)
|
||||
2. Run `npm run release:publish` (stable) or `npm run release:publish:beta` (beta) in parallel with the remote builds. `scripts/publish-release-packages.mjs` publishes the seven `@getpaseo/*` packages in dependency waves and polls npm visibility between packages to avoid `E409` or `E404` propagation races.
|
||||
3. Check the green [reconcile `main`](#reconcile-main) PR against the pushed tag, then merge it right after `npm run release:push` finishes, in parallel with npm publication and the release builds. Wait for its checks only if the tag check produced changes.
|
||||
4. Create the release heartbeat immediately with `create_heartbeat` to track every ship step to completion.
|
||||
|
||||
@@ -34,7 +34,7 @@ Ship starts after the user says "go ahead". All tag-triggered GitHub Actions wor
|
||||
Wait until every gate below passes before deleting the remote release branch or reporting the release as shipped:
|
||||
|
||||
- All seven `@getpaseo/*` npm packages are visible on `latest` (stable) or `beta` (beta), and on stable the `beta` dist-tag points to the shipped version unless an active newer beta exists.
|
||||
- All tag-triggered GitHub Actions workflows are green (`NPM Release`, `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` for stable), and `Deploy Website` ran after stable publication.
|
||||
- All tag-triggered GitHub Actions workflows are green (`Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` for stable), and `Deploy Website` ran after stable publication.
|
||||
- The GitHub Release is published and non-draft (marked prerelease for beta) with the synced changelog body, all macOS, Linux, and Windows assets, the Android APK asset, and all three channel manifests (`latest-mac.yml`, `latest-linux.yml`, `latest.yml` for stable; `beta-mac.yml`, `beta-linux.yml`, `beta.yml` for beta).
|
||||
- The matching EAS workflow is green (`Release Mobile` with all six build, distribution, screenshot, and review-submission jobs for stable; `Release iOS Beta` for beta).
|
||||
- The reconcile PR is merged into `main`.
|
||||
@@ -50,29 +50,6 @@ Rules that apply to both steps:
|
||||
- An approval the user already gave covers what it names, such as an explicit PR selection or authorization to release autonomously. Do not ask for it again.
|
||||
- If the user asks for a release preview, show the prospective changelog/release contents and answer questions, but do not commit, tag, publish, or run release commands until they explicitly authorize the release.
|
||||
|
||||
## npm Trusted Publishing setup
|
||||
|
||||
Before the first release using this workflow, configure each of `@getpaseo/highlight`, `@getpaseo/relay`, `@getpaseo/protocol`, `@getpaseo/client`, `@getpaseo/plugin`, `@getpaseo/server`, and `@getpaseo/cli` on npmjs.com:
|
||||
|
||||
1. Add a GitHub Actions trusted publisher with organization `getpaseo`, repository `paseo`, and workflow filename `npm-release.yml`.
|
||||
2. Enable **Allow npm dist-tag** for the publisher.
|
||||
3. Set publishing access to **Require two-factor authentication and disallow tokens**.
|
||||
4. Publish within two days of adding the publisher, or recreate it before the first publish.
|
||||
|
||||
The tag push starts `NPM Release`. Rerun the failed workflow from GitHub Actions if publication fails. npm generates provenance for successful trusted publishes.
|
||||
|
||||
For manual Desktop or Android release runs, select the release tag as the workflow ref. The checked-out commit must match the workflow commit for the GitHub attestation. The Android attestation records the workflow that requested and downloaded the EAS build; it does not independently attest the EAS builder.
|
||||
|
||||
### Test Trusted Publishing with a canary
|
||||
|
||||
In GitHub Actions, open **NPM Release** and select **Run workflow** on `main`.
|
||||
Choose `@getpaseo/highlight` or `all`, then run the workflow. The default suffix uses the run ID and attempt.
|
||||
Set `dry_run` to preview publication without publishing. For a live run, verify provenance on npmjs.com.
|
||||
|
||||
To clean up, run `npm dist-tag rm <pkg> canary` for each published package.
|
||||
Check [npm's unpublish policy](https://docs.npmjs.com/policies/unpublish/) before running `npm unpublish <pkg>@<version>`.
|
||||
If npm does not permit removal, run `npm deprecate <pkg>@<version> "Canary test"` instead.
|
||||
|
||||
## Main stays open
|
||||
|
||||
Merge normal PRs into `main` at any time, including while a beta soaks or a release is being
|
||||
@@ -151,15 +128,16 @@ An explicit user instruction can select another base.
|
||||
6. After go-ahead, push the tag first with `npm run release:push` so remote builds start right away.
|
||||
Because the release branch is already pushed at `HEAD`, no second branch CI run starts, and only
|
||||
the tag release workflows run.
|
||||
7. After `npm run release:push` finishes, merge the green [reconcile `main`](#reconcile-main) PR and create the release heartbeat. Watch `NPM Release` alongside the other release workflows.
|
||||
7. Immediately in parallel after `npm run release:push` finishes: publish npm packages with
|
||||
`npm run release:publish` (stable) or `npm run release:publish:beta` (beta), merge the
|
||||
already-green [reconcile `main`](#reconcile-main) PR, and create the release heartbeat. (`npm run release:ship` and `npm run release:ship:beta` also run
|
||||
`release:push` before `release:publish`, so tag builds never wait behind npm.)
|
||||
|
||||
When a release starts from an older tag, check for the npm workflow before pushing the release tag:
|
||||
|
||||
```bash
|
||||
git cat-file -e HEAD:.github/workflows/npm-release.yml
|
||||
```
|
||||
|
||||
If the check fails, cherry-pick the release publishing tooling from `main` onto the release branch before preparation and CI. The release tag must include the workflow and package repository metadata.
|
||||
When promoting or branching from a tag created before `release:prep:*`, `release:ship`, and the
|
||||
`release/**` workflow triggers existed (for example `v0.17.0-beta.1`), either cherry-pick the
|
||||
release-tooling commit onto the release branch (leaving product code unchanged) or follow the
|
||||
older tag's scripts (`version:all:*`, manual `gh workflow run ci.yml --ref <branch>`,
|
||||
`release:push`, and `release:publish`) until the next tag carries the new tooling.
|
||||
|
||||
A stable hotfix can take the version a patch beta line would promote to, such as `0.13.3`
|
||||
shipping while `0.13.3-beta.2` soaks. Never republish or reuse a shipped version. Continue the line
|
||||
@@ -168,7 +146,7 @@ computes that from a prerelease, so run `npm run release:check`, bump with
|
||||
`npm version 0.13.4-beta.1 --include-workspace-root --no-git-tag-version && git commit -m "chore(release): cut 0.13.4-beta.1"`,
|
||||
push the release branch for `CI` and `Desktop Packages`, and complete the
|
||||
[pre-release dependency checks](#pre-release-dependency-checks) before shipping with
|
||||
`npm run release:push`.
|
||||
`npm run release:push` and `npm run release:publish:beta` (or `npm run release:ship:beta`).
|
||||
Record the tested beta tag as its source so its soak still counts for the unchanged content.
|
||||
|
||||
## Release inventory
|
||||
@@ -223,7 +201,7 @@ Commit and open the PR into `main`, but do not merge it during Preparation:
|
||||
|
||||
- If the release is cancelled, close the PR. `main` is untouched.
|
||||
- If the release branch changes during Preparation, re-run `npm run release:reconcile -- --ref origin/release/vX.Y.Z` on the same branch and push to the same PR.
|
||||
- At Ship, right after `npm run release:push` pushes the tag, run `npm run release:reconcile -- --tag vX.Y.Z` on the reconcile branch. A clean `git status` means the PR already matches the tag, so merge it in parallel with `NPM Release` and the tag builds. If it shows changes, push them and wait for the PR checks before merging.
|
||||
- At Ship, right after `npm run release:push` pushes the tag, run `npm run release:reconcile -- --tag vX.Y.Z` on the reconcile branch. A clean `git status` means the PR already matches the tag, so merge it in parallel with `npm run release:publish` and the tag builds. If it shows changes, push them and wait for the PR checks before merging.
|
||||
|
||||
Delete the remote release branch
|
||||
(`git push origin --delete release/vX.Y.Z` or `release/vX.Y.Z-beta.N`) only after the reconcile PR
|
||||
@@ -288,8 +266,10 @@ git push -u origin HEAD
|
||||
# 3. After go-ahead and green release-branch checks: push the tag first to start builds.
|
||||
npm run release:push
|
||||
|
||||
# 4. Merge the green reconcile/vX.Y.Z PR and create the release heartbeat.
|
||||
# Watch NPM Release and the other tag workflows.
|
||||
# 4. Run these in parallel immediately after step 3:
|
||||
npm run release:publish
|
||||
# Also merge the green reconcile/vX.Y.Z PR and create the release heartbeat.
|
||||
# (`npm run release:ship` runs `release:push` before `release:publish` if used standalone.)
|
||||
```
|
||||
|
||||
`scripts/push-current-release-tag.mjs` refuses non-`release/*` branches, checks that `HEAD` matches `origin/release/*`, tags `HEAD` with `vX.Y.Z`, and pushes the tag. Because `HEAD` is already on the pushed release branch, no second branch CI run starts.
|
||||
@@ -302,9 +282,9 @@ npm run release:push
|
||||
4. Wave 4: `@getpaseo/server` (depends on `@getpaseo/client`, `@getpaseo/highlight`, `@getpaseo/plugin`, `@getpaseo/protocol`, and `@getpaseo/relay`).
|
||||
5. Wave 5: `@getpaseo/cli` (depends on `@getpaseo/client`, `@getpaseo/protocol`, and `@getpaseo/server`).
|
||||
|
||||
After publishing all packages, the script checks their direct version endpoints in parallel for up to 10 minutes. This avoids stale packument caches delaying the publish wave. On stable releases, the script also checks `npm view @getpaseo/cli dist-tags` and moves npm's `beta` dist-tag to the new stable version across all seven packages whenever the stable version is newer than `beta` (leaving `beta` untouched during a stable hotfix on an older line).
|
||||
After each `npm publish`, the script polls `npm view` (up to 12 checks, 5 seconds apart) until the published version is visible on npm before moving to the next package. Waiting for registry visibility prevents dependent publishes and manual retries from hitting `E409` conflicts or `E404` propagation lag. On stable releases, the script also checks `npm view @getpaseo/cli dist-tags` and moves npm's `beta` dist-tag to the new stable version across all seven packages whenever the stable version is newer than `beta` (leaving `beta` untouched during a stable hotfix on an older line).
|
||||
|
||||
The tag push triggers `NPM Release`, `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` (`app.paseo.sh`, stable tags only) on GitHub Actions. `Desktop Release` and `Release Notes Sync` create the GitHub Release as a draft while builds and release-note sync run. `Deploy Website` triggers later on `release: published` when `Desktop Release` publishes the non-draft stable GitHub Release. EAS picks up the same tag through the EAS GitHub app and starts `Release Mobile` (iOS and Android store builds) in parallel, with no mobile-release workflow under `.github/workflows`. None of these workflows install `@getpaseo/*` from the public npm registry because all of them build from the checked-out tag commit and workspace packages.
|
||||
The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` (`app.paseo.sh`, stable tags only) on GitHub Actions. `Desktop Release` and `Release Notes Sync` create the GitHub Release as a draft while builds and release-note sync run. `Deploy Website` triggers later on `release: published` when `Desktop Release` publishes the non-draft stable GitHub Release. EAS picks up the same tag through the EAS GitHub app and starts `Release Mobile` (iOS and Android store builds) in parallel, with no mobile-release workflow under `.github/workflows`. None of these workflows install `@getpaseo/*` from the public npm registry because all of them build from the checked-out tag commit and workspace packages.
|
||||
|
||||
Confirm that `npm view @getpaseo/cli dist-tags` shows `latest` at the shipped version, and `beta` at the shipped version or an active newer beta, before considering the stable release complete.
|
||||
|
||||
@@ -328,6 +308,7 @@ git push -u origin HEAD # Trigger CI + Desktop Packages on release/vX.Y.Z
|
||||
# After go-ahead:
|
||||
npm run release:push # Create tag vX.Y.Z on HEAD and push (starts release builds)
|
||||
# In parallel right after release:push:
|
||||
npm run release:publish # Publish to npm (idempotent, with propagation + beta dist-tag sync)
|
||||
# Merge the green reconcile/vX.Y.Z PR and create the release heartbeat.
|
||||
```
|
||||
|
||||
@@ -345,8 +326,10 @@ npm run release:prep:beta:next # Cut X.Y.Z-beta.2, beta.3, ...
|
||||
git push -u origin HEAD
|
||||
# Wait for CI + Desktop Packages to pass and complete the pre-release dependency checks.
|
||||
|
||||
# 3. After go-ahead, push the tag, merge the reconcile PR, and create the heartbeat:
|
||||
# 3. After go-ahead: push the tag first, then run npm publish, merge the reconcile PR, and heartbeat in parallel:
|
||||
npm run release:push
|
||||
npm run release:publish:beta
|
||||
# (Or run `npm run release:ship:beta` in one shell while merging reconcile/vX.Y.Z-beta.N.)
|
||||
|
||||
# Later, after soak, promote on release/vX.Y.Z:
|
||||
npm run release:prep:promote
|
||||
@@ -355,6 +338,7 @@ git push -u origin HEAD
|
||||
# Wait for CI + Desktop Packages and complete the pre-release dependency checks.
|
||||
# After go-ahead:
|
||||
npm run release:push
|
||||
npm run release:publish
|
||||
# Merge the green reconcile/vX.Y.Z PR and create the release heartbeat in parallel.
|
||||
```
|
||||
|
||||
@@ -500,11 +484,10 @@ Do not leave the fix as a paced release. The installs that took the bad release
|
||||
|
||||
### Custom ramp on a manually-dispatched build
|
||||
|
||||
`desktop-release.yml` accepts `rollout_hours` only on `workflow_dispatch`, which is the path used to rebuild an existing tag. On that path, you can stamp a different ramp directly:
|
||||
`desktop-release.yml` accepts `rollout_hours` only on `workflow_dispatch`, which is the path used to rebuild an existing tag (retry a failed release, force a rebuild on a different ref). On that path, you can stamp a different ramp directly:
|
||||
|
||||
```bash
|
||||
gh workflow run desktop-release.yml \
|
||||
--ref v0.1.43 \
|
||||
-f tag=v0.1.43 \
|
||||
-f rollout_hours=6
|
||||
```
|
||||
@@ -687,9 +670,9 @@ The GitHub Release body is populated automatically by the `Release Notes Sync` w
|
||||
|
||||
**NEVER bump the version to fix a build problem.** New versions are reserved for meaningful product changes (features, fixes, improvements). Build/CI failures are fixed on the current version.
|
||||
|
||||
If `NPM Release` fails after `npm run release:push` pushed the tag, fix the cause and rerun the failed workflow on the same tag. Do not move or force-push the `v*` tag, because `scripts/publish-release-packages.mjs` skips packages already visible on npm and resumes from the remaining packages. If a newer beta is already published, the script refuses an older beta retry to protect the `beta` dist-tag.
|
||||
If `npm run release:publish` or `npm run release:publish:beta` fails after `npm run release:push` pushed the tag, fix the npm authentication, OTP, or local build issue and rerun the publish command on the same commit. Do not move or force-push the `v*` tag, because `scripts/publish-release-packages.mjs` skips packages already visible on npm and resumes from the remaining packages.
|
||||
|
||||
For a manual Desktop or Android rebuild, dispatch the workflow from the release tag. The workflow and checked-out commit must match the tag. A code fix on `main` does not change the tagged source.
|
||||
**Do not rely on `workflow_dispatch` for tagged code fixes.** The `workflow_dispatch` trigger runs the workflow file from the default branch but checks out the code at the tag ref (`ref: ${{ inputs.tag }}`). That means fixes committed to `main` won't change the tagged source tree being built. `workflow_dispatch` only helps when the fix lives in the workflow file itself.
|
||||
|
||||
For Docker-only retries, **do not push or force-push a `v*` release tag**.
|
||||
`v*` tag pushes rebuild desktop assets, the Android APK, Docker, release notes,
|
||||
@@ -736,11 +719,14 @@ git tag -f desktop-windows-v0.1.28 HEAD && git push origin desktop-windows-v0.1.
|
||||
|
||||
# Android APK
|
||||
git tag -f android-v0.1.28 HEAD && git push origin android-v0.1.28 --force
|
||||
|
||||
# Beta
|
||||
git tag -f v0.1.29-beta.2 HEAD && git push origin v0.1.29-beta.2 --force
|
||||
```
|
||||
|
||||
This ensures the checkout ref matches the code you want built, with the fix included.
|
||||
|
||||
- Never move a `vX.Y.Z` or `vX.Y.Z-beta.N` tag. Use a new version for code changes that affect npm packages.
|
||||
- `vX.Y.Z` or `vX.Y.Z-beta.N` rebuilds the full tagged release
|
||||
- `desktop-vX.Y.Z` rebuilds desktop for all desktop platforms only
|
||||
- `desktop-macos-vX.Y.Z`, `desktop-linux-vX.Y.Z`, and `desktop-windows-vX.Y.Z` rebuild only that desktop platform
|
||||
- `android-vX.Y.Z` rebuilds the Android APK release only
|
||||
@@ -770,7 +756,7 @@ intentionally unavailable to desktop updater clients.
|
||||
- The npm `version` lifecycle regenerates F-Droid changelog files from `CHANGELOG.md` for stable releases only (`npm run fdroid:changelogs`) and stages them, so the release commit and tag carry them. Betas are a no-op. A stable run **aborts the release** if `CHANGELOG.md` has no entry for the version being cut — commit the changelog entry first. See [docs/android.md](android.md) for why these files are generated per ABI.
|
||||
- `release:prepare` refreshes workspace `node_modules` links to prevent stale types.
|
||||
- `npm run dev:desktop` and `npm run build:desktop` target the Electron desktop package in `packages/desktop`.
|
||||
- `NPM Release` runs `scripts/publish-release-packages.mjs` for the pushed tag. It skips versions already visible on npm, retries transient registry errors, and waits for registry propagation. `release:ship` and `release:ship:beta` run `release:push`.
|
||||
- `release:publish` and `release:publish:beta` run `scripts/publish-release-packages.mjs`. They publish the seven `@getpaseo/*` packages in dependency waves, skip versions already visible on npm, retry transient registry errors, and poll `npm view` between packages so dependents do not hit `E409` or `E404` propagation lag. `release:ship` and `release:ship:beta` run `release:push` before `release:publish` or `release:publish:beta`.
|
||||
- The website uses GitHub's latest published release API for download links, so published beta prereleases do not replace the stable download target.
|
||||
|
||||
## Changelog format
|
||||
@@ -1033,7 +1019,7 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] The diff from the previous stable to the resolved release source is classified as patch or minor, with the target version and rationale approved
|
||||
- [ ] `npm run release:prep:beta:patch`, `release:prep:beta:minor`, or `release:prep:beta:next` created the version commit on `release/vX.Y.Z-beta.N` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI), with the unmerged reconcile PR opened right after the branch push
|
||||
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
|
||||
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run, while `NPM Release`, the merge of the green `reconcile/vX.Y.Z-beta.N` PR, and the release heartbeat started in parallel
|
||||
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run, while `npm run release:publish:beta`, the merge of the green `reconcile/vX.Y.Z-beta.N` PR, and the release heartbeat started in parallel
|
||||
- [ ] All seven `@getpaseo/*` npm packages show the version under the `beta` dist-tag, not `latest`
|
||||
- [ ] The GitHub prerelease was published only after the three beta manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
|
||||
- [ ] GitHub `Desktop Release` workflow for the `v*-beta.N` tag is green
|
||||
@@ -1057,7 +1043,7 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] Ensure local format, lint, and typecheck pass and the working tree is clean before running `release:prep:*`
|
||||
- [ ] `npm run release:prep:patch`, `release:prep:minor`, or `release:prep:promote` created the version commit on `release/vX.Y.Z` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI), with the unmerged reconcile PR opened right after the branch push
|
||||
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
|
||||
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z` tag without triggering a second CI run, while `NPM Release`, the merge of the green `reconcile/vX.Y.Z` PR, and the release heartbeat started in parallel
|
||||
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z` tag without triggering a second CI run, while `npm run release:publish`, the merge of the green `reconcile/vX.Y.Z` PR, and the release heartbeat started in parallel
|
||||
- [ ] All seven `@getpaseo/*` npm packages show `latest` at the new stable, and `beta` at the new stable too unless an active newer beta holds `beta`
|
||||
- [ ] The GitHub Release was published only after the three stable manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
|
||||
- [ ] GitHub `Desktop Release` workflow for the `v*` tag is green
|
||||
|
||||
@@ -24,18 +24,6 @@ value.
|
||||
|
||||
Animate only `transform` and `opacity`. Anything else is painted on the main thread every frame.
|
||||
|
||||
## The waiting mark
|
||||
|
||||
A workspace or agent with no turn running and counted background work alive shows the waiting mark
|
||||
instead of the ring: one 10 px circle stroked with eight equal dashes and gaps, so each dash is a
|
||||
short arc with its ends cut along the radius. It has no centre dot and does not move, so it needs
|
||||
none of the machinery above. It is centred in the running ring's frame
|
||||
(`components/status-ring/waiting.tsx`). Draw it wherever the ring shows for this state and nowhere
|
||||
else. The frame and its knockout stay the running ring's size so a row never changes height when the
|
||||
state changes; the smaller ring only leaves more space between the mark and the icon it sits on.
|
||||
It is `react-native-svg`, the same on web and native. The whole `Svg` is wrapped in
|
||||
`withUnistyles`, as in the context window ring, so the stroke follows theme changes.
|
||||
|
||||
## Hidden panels
|
||||
|
||||
A phone's sidebar slides into view before its panel counts as showing: the panel's active signal
|
||||
|
||||
@@ -49,5 +49,5 @@ Terminal frames share the daemon main event loop with all agent traffic. The `ev
|
||||
## Known remaining contention (follow-up candidates)
|
||||
|
||||
- A single large `agent_stream` message (e.g. a 250KB diff payload) measurably delays terminal echo (~100ms-class dips) — cost is split between daemon serialization and app-side parse/render on the shared browser main thread. See [agent-stream-performance.md](agent-stream-performance.md) for that pipeline's own budgets.
|
||||
- Relay-attached clients pay pure-JS encryption on the daemon main loop: `@noble/ciphers` ChaCha20-Poly1305 records in protected mode (`packages/relay/src/protected-records.ts`), tweetnacl in legacy mode (`packages/relay/src/encrypted-channel.ts`). Protected peers that negotiate `binaryCiphertext` send every record as a binary frame with no base64 step. Legacy text and peers that predate `binaryCiphertext` still pay base64 encode/decode.
|
||||
- Relay-attached clients pay pure-JS tweetnacl encryption on the daemon main loop (`packages/relay/src/encrypted-channel.ts`). Negotiated binary application frames stay binary ciphertext and avoid base64 encode/decode; text and mixed-version traffic remain base64 WebSocket text frames.
|
||||
- `sendToClient` re-stringifies session messages per socket; only matters for multi-socket connections.
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ Do not import `theme` from `@/styles/theme` for live UI colors. That export is a
|
||||
Wrap the icon (or other leaf component) with `withUnistyles` instead, so only that node re-renders when the theme changes:
|
||||
|
||||
```tsx
|
||||
import ChevronDown from "lucide-react-native/icons/chevron-down";
|
||||
import { ChevronDown } from "lucide-react-native";
|
||||
import { StyleSheet, withUnistyles } from "react-native-unistyles";
|
||||
|
||||
const ThemedChevronDown = withUnistyles(ChevronDown);
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
Fixed
|
||||
- Fixed OpenCode v2 skills picked inline, with attachments, or while a turn is running being sent as literal /skill text instead of loading the skill
|
||||
- Fixed Codex skills picked inline, with attachments, or while a turn is running not loading
|
||||
- Fixed Desktop image attachments disappearing across multiple windows, tab switches, and queued follow-up sends
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,6 +0,0 @@
|
||||
Fixed
|
||||
- Fixed OpenCode v2 skills picked inline, with attachments, or while a turn is running being sent as literal /skill text instead of loading the skill
|
||||
- Fixed Codex skills picked inline, with attachments, or while a turn is running not loading
|
||||
- Fixed Desktop image attachments disappearing across multiple windows, tab switches, and queued follow-up sends
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,6 +0,0 @@
|
||||
Fixed
|
||||
- Fixed OpenCode v2 skills picked inline, with attachments, or while a turn is running being sent as literal /skill text instead of loading the skill
|
||||
- Fixed Codex skills picked inline, with attachments, or while a turn is running not loading
|
||||
- Fixed Desktop image attachments disappearing across multiple windows, tab switches, and queued follow-up sends
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,6 +0,0 @@
|
||||
Fixed
|
||||
- Fixed OpenCode v2 skills picked inline, with attachments, or while a turn is running being sent as literal /skill text instead of loading the skill
|
||||
- Fixed Codex skills picked inline, with attachments, or while a turn is running not loading
|
||||
- Fixed Desktop image attachments disappearing across multiple windows, tab switches, and queued follow-up sends
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -99,12 +99,6 @@ buildNpmPackage {
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# npm ci runs with --ignore-scripts, so the root postinstall that applies
|
||||
# patches/ never runs. The web bundle imports modules those patches add
|
||||
# (lucide-react-native/context). The script spawns patch-package by name,
|
||||
# which only resolves with node_modules/.bin on PATH (npm run sets it).
|
||||
PATH="$PWD/node_modules/.bin:$PATH" node scripts/postinstall-patches.mjs
|
||||
|
||||
# Native deps (terminal emulation; libuv-linked on Linux)
|
||||
npm rebuild node-pty
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
sha256-nWaU16CvKjT2bhQ/Q0gxZOv2NGxODBwn7lZ/EQgE+u0=
|
||||
sha256-xt1xi8llKklgr6gn21Ae+Jmdke4bjMZ0F+CnR1bh8UE=
|
||||
|
||||
@@ -90,12 +90,6 @@ buildNpmPackage rec {
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# npm ci runs with --ignore-scripts, so the root postinstall that applies
|
||||
# patches/ never runs. The web bundle imports modules those patches add
|
||||
# (lucide-react-native/context). The script spawns patch-package by name,
|
||||
# which only resolves with node_modules/.bin on PATH (npm run sets it).
|
||||
PATH="$PWD/node_modules/.bin:$PATH" node scripts/postinstall-patches.mjs
|
||||
|
||||
# Rebuild only node-pty (native addon for terminal emulation). The sherpa
|
||||
# speech runtime ships prebuilt platform packages and is copied into the
|
||||
# daemon closure by scripts/trace-daemon.mjs.
|
||||
|
||||
Generated
+72
-180
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -38,7 +38,6 @@
|
||||
"js-yaml": "^4.1.1",
|
||||
"knip": "^5.82.1",
|
||||
"lefthook": "^2.1.6",
|
||||
"lockfile-lint": "5.1.1",
|
||||
"oxfmt": "0.46.0",
|
||||
"oxlint": "1.61.0",
|
||||
"oxlint-tsgolint": "^0.22.1",
|
||||
@@ -14793,20 +14792,6 @@
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/@yarnpkg/parsers": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.1.0.tgz",
|
||||
"integrity": "sha512-WoxUM/Be4hfsX06FxsvpGgfYqwgivMV7/Ol7aFuSfSmY6rRaiju4QxOEe9RUS0iYcSHWl5i9AhB1cMoE0p+XiA==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"js-yaml": "^4.3.0",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/abab": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
|
||||
@@ -17363,43 +17348,6 @@
|
||||
"layout-base": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cosmiconfig": {
|
||||
"version": "9.0.2",
|
||||
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.2.tgz",
|
||||
"integrity": "sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"env-paths": "^2.2.1",
|
||||
"import-fresh": "^3.3.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"parse-json": "^5.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/d-fischer"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.9.5"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/cosmiconfig/node_modules/env-paths": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
|
||||
"integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/create-jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz",
|
||||
@@ -25869,19 +25817,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
|
||||
"integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
@@ -26872,41 +26810,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/lockfile-lint": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lockfile-lint/-/lockfile-lint-5.1.1.tgz",
|
||||
"integrity": "sha512-GqzPAe/DvCR23Rg6vu0be+ZvpDgeri4TkTFWAQJ0MTACvWwQXah5f9kSuKyPY9Y1JRdKpQI6QOLwfdRoQezTpg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"cosmiconfig": "^9.0.0",
|
||||
"debug": "^4.3.4",
|
||||
"lockfile-lint-api": "^5.10.2",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"bin": {
|
||||
"lockfile-lint": "bin/lockfile-lint.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lockfile-lint-api": {
|
||||
"version": "5.10.2",
|
||||
"resolved": "https://registry.npmjs.org/lockfile-lint-api/-/lockfile-lint-api-5.10.2.tgz",
|
||||
"integrity": "sha512-m3bo4ScHsfyRzysYjhtGcyaoutbg9Xe8ttR6vtGrgOSJ6qj4ryi8vWPCYy8SeG4FxvHuFM5Mfcubz/REMzaUOw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@yarnpkg/parsers": "^3.0.0-rc.48.1",
|
||||
"debug": "^4.3.4",
|
||||
"object-hash": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.23",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
|
||||
@@ -30062,16 +29965,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-hash": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz",
|
||||
"integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
@@ -37659,7 +37552,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -37727,7 +37620,6 @@
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"htmlparser2": "^12.0.0",
|
||||
"i18next": "^26.3.0",
|
||||
"katex": "^0.16.47",
|
||||
"lucide-react-native": "^1.50.0",
|
||||
"markdown-it": "^10.0.0",
|
||||
"mdast-util-from-markdown": "2.0.3",
|
||||
@@ -39813,20 +39705,20 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "1.1.0",
|
||||
"@getpaseo/client": "0.19.2",
|
||||
"@getpaseo/protocol": "0.19.2",
|
||||
"@getpaseo/server": "0.19.2",
|
||||
"chalk": "5.6.2",
|
||||
"commander": "12.1.0",
|
||||
"mime-types": "2.1.35",
|
||||
"tree-kill": "1.2.2",
|
||||
"ws": "8.20.0",
|
||||
"yaml": "2.8.4",
|
||||
"zod": "4.4.3"
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.19.1",
|
||||
"@getpaseo/protocol": "0.19.1",
|
||||
"@getpaseo/server": "0.19.1",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"tree-kill": "^1.2.2",
|
||||
"ws": "^8.14.2",
|
||||
"yaml": "^2.8.4",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"bin": {
|
||||
"paseo": "bin/paseo"
|
||||
@@ -40069,11 +39961,11 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.19.2",
|
||||
"@getpaseo/relay": "0.19.2",
|
||||
"@getpaseo/protocol": "0.19.1",
|
||||
"@getpaseo/relay": "0.19.1",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
@@ -40085,7 +39977,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -40329,7 +40221,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -40375,7 +40267,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -40405,7 +40297,7 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
@@ -40413,8 +40305,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.19.2",
|
||||
"@getpaseo/protocol": "0.19.2",
|
||||
"@getpaseo/client": "0.19.1",
|
||||
"@getpaseo/protocol": "0.19.1",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -40424,8 +40316,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.19.2",
|
||||
"@getpaseo/protocol": "0.19.2",
|
||||
"@getpaseo/client": "0.19.1",
|
||||
"@getpaseo/protocol": "0.19.1",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -40447,7 +40339,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
@@ -40474,7 +40366,7 @@
|
||||
}
|
||||
},
|
||||
"packages/react-native-enriched-markdown": {
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
@@ -40490,7 +40382,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
@@ -40712,59 +40604,59 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "0.17.1",
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "0.104.2",
|
||||
"@getpaseo/client": "0.19.2",
|
||||
"@getpaseo/highlight": "0.19.2",
|
||||
"@getpaseo/plugin": "0.19.2",
|
||||
"@getpaseo/protocol": "0.19.2",
|
||||
"@getpaseo/relay": "0.19.2",
|
||||
"@isaacs/ttlcache": "2.1.4",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.19.1",
|
||||
"@getpaseo/highlight": "0.19.1",
|
||||
"@getpaseo/plugin": "0.19.1",
|
||||
"@getpaseo/protocol": "0.19.1",
|
||||
"@getpaseo/relay": "0.19.1",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/node": "2.1.2",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@modelcontextprotocol/server": "2.4.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
"@opencode/client": "2.0.10",
|
||||
"@silvia-odwyer/photon-node": "0.3.4",
|
||||
"@silvia-odwyer/photon-node": "^0.3.4",
|
||||
"@xterm/addon-serialize": "0.14.0",
|
||||
"@xterm/addon-unicode-graphemes": "0.5.0-beta.330",
|
||||
"@xterm/headless": "6.1.0-beta.334",
|
||||
"ai": "5.0.78",
|
||||
"ajv": "8.20.0",
|
||||
"bcryptjs": "3.0.3",
|
||||
"dotenv": "17.3.1",
|
||||
"esbuild": "0.25.12",
|
||||
"express": "4.22.1",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"https-proxy-agent": "7.0.6",
|
||||
"lru-cache": "11.5.1",
|
||||
"markdown-it": "10.0.0",
|
||||
"mnemonic-id": "3.2.7",
|
||||
"ajv": "^8.20.0",
|
||||
"bcryptjs": "^3.0.3",
|
||||
"dotenv": "^17.2.3",
|
||||
"esbuild": "^0.25.12",
|
||||
"express": "^4.18.2",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"https-proxy-agent": "^7.0.6",
|
||||
"lru-cache": "^11.5.1",
|
||||
"markdown-it": "^10.0.0",
|
||||
"mnemonic-id": "^3.2.7",
|
||||
"node-pty": "1.2.0-beta.15",
|
||||
"openai": "6.44.0",
|
||||
"p-limit": "7.3.0",
|
||||
"p-memoize": "8.0.0",
|
||||
"p-throttle": "8.1.0",
|
||||
"parse5": "7.3.0",
|
||||
"pino": "10.3.1",
|
||||
"pino-pretty": "13.1.3",
|
||||
"qrcode": "1.5.4",
|
||||
"rotating-file-stream": "3.2.9",
|
||||
"semver": "7.8.5",
|
||||
"openai": "^6.44.0",
|
||||
"p-limit": "^7.3.0",
|
||||
"p-memoize": "^8.0.0",
|
||||
"p-throttle": "^8.1.0",
|
||||
"parse5": "^7.3.0",
|
||||
"pino": "^10.2.0",
|
||||
"pino-pretty": "^13.1.3",
|
||||
"qrcode": "^1.5.4",
|
||||
"rotating-file-stream": "^3.2.9",
|
||||
"semver": "^7.8.5",
|
||||
"sherpa-onnx-node": "1.12.28",
|
||||
"strip-ansi": "7.1.2",
|
||||
"tree-kill": "1.2.2",
|
||||
"typescript": "5.9.3",
|
||||
"undici": "7.24.8",
|
||||
"uuid": "9.0.1",
|
||||
"which": "5.0.0",
|
||||
"ws": "8.20.0",
|
||||
"strip-ansi": "^7.1.2",
|
||||
"tree-kill": "^1.2.2",
|
||||
"typescript": "^5.9.3",
|
||||
"undici": "^7.24.8",
|
||||
"uuid": "^9.0.1",
|
||||
"which": "^5.0.0",
|
||||
"ws": "^8.14.2",
|
||||
"yaml": "2.9.1",
|
||||
"zod": "4.4.3"
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@modelcontextprotocol/client": "2.4.0",
|
||||
@@ -41687,7 +41579,7 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
@@ -43313,7 +43205,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+4
-9
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.19.2",
|
||||
"version": "0.19.1",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
@@ -127,13 +127,9 @@
|
||||
"release:publish": "node scripts/publish-release-packages.mjs",
|
||||
"release:publish:beta": "node scripts/publish-release-packages.mjs --beta",
|
||||
"release:push": "node scripts/push-current-release-tag.mjs",
|
||||
"release:ship": "npm run release:push",
|
||||
"release:ship:beta": "npm run release:push",
|
||||
"release:reconcile": "node scripts/reconcile-release.mjs",
|
||||
"gpui:install": "node scripts/gpui.mjs install",
|
||||
"gpui:bundle": "node scripts/gpui.mjs bundle",
|
||||
"build:gpui": "node scripts/gpui.mjs build",
|
||||
"dev:gpui": "node scripts/gpui.mjs run"
|
||||
"release:ship": "npm run release:push && npm run release:publish",
|
||||
"release:ship:beta": "npm run release:push && npm run release:publish:beta",
|
||||
"release:reconcile": "node scripts/reconcile-release.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ws": "^8.5.14",
|
||||
@@ -148,7 +144,6 @@
|
||||
"js-yaml": "^4.1.1",
|
||||
"knip": "^5.82.1",
|
||||
"lefthook": "^2.1.6",
|
||||
"lockfile-lint": "5.1.1",
|
||||
"oxfmt": "0.46.0",
|
||||
"oxlint": "1.61.0",
|
||||
"oxlint-tsgolint": "^0.22.1",
|
||||
|
||||
@@ -745,8 +745,7 @@ async function recordDelayedRunningTransition(
|
||||
|
||||
const prompt = "Second prompt keeps streaming.";
|
||||
gate.holdNextAgentStreamEvent("turn_started");
|
||||
// Hold every running snapshot until release so the prompt-commit emitState does not leak early.
|
||||
gate.holdAgentUpdates(agent.agentId, "running");
|
||||
gate.holdNextAgentUpdate(agent.agentId, "running");
|
||||
gate.holdNextServerMessage("send_agent_message_response");
|
||||
gate.setAgentStreamSuppressed(true);
|
||||
await recordTurnFrames(page, prompt);
|
||||
@@ -774,7 +773,7 @@ async function recordDelayedRunningTransition(
|
||||
await expect(page.getByTestId("turn-working-elapsed")).toBeVisible();
|
||||
gate.releaseHeldServerMessage("send_agent_message_response");
|
||||
responseReleased = true;
|
||||
gate.releaseHeldAgentUpdates(agent.agentId, "running");
|
||||
gate.releaseHeldAgentUpdate(agent.agentId, "running");
|
||||
snapshotReleased = true;
|
||||
} else if (releaseOrder === "response-before-turn") {
|
||||
gate.releaseHeldServerMessage("send_agent_message_response");
|
||||
@@ -783,13 +782,13 @@ async function recordDelayedRunningTransition(
|
||||
gate.releaseHeldAgentStreamEvent("turn_started");
|
||||
turnReleased = true;
|
||||
await expect(page.getByTestId("turn-working-elapsed")).toBeVisible();
|
||||
gate.releaseHeldAgentUpdates(agent.agentId, "running");
|
||||
gate.releaseHeldAgentUpdate(agent.agentId, "running");
|
||||
snapshotReleased = true;
|
||||
} else {
|
||||
gate.releaseHeldServerMessage("send_agent_message_response");
|
||||
responseReleased = true;
|
||||
await recordPaintsFor(page, 80);
|
||||
gate.releaseHeldAgentUpdates(agent.agentId, "running");
|
||||
gate.releaseHeldAgentUpdate(agent.agentId, "running");
|
||||
snapshotReleased = true;
|
||||
await expect(page.getByTestId("turn-working-elapsed")).toBeVisible();
|
||||
gate.releaseHeldAgentStreamEvent("turn_started");
|
||||
@@ -805,7 +804,7 @@ async function recordDelayedRunningTransition(
|
||||
return { frames, checkpoints };
|
||||
} finally {
|
||||
if (!turnReleased) gate.releaseHeldAgentStreamEvent("turn_started");
|
||||
if (!snapshotReleased) gate.releaseHeldAgentUpdates(agent.agentId, "running");
|
||||
if (!snapshotReleased) gate.releaseHeldAgentUpdate(agent.agentId, "running");
|
||||
if (!responseReleased) gate.releaseHeldServerMessage("send_agent_message_response");
|
||||
gate.setAgentStreamSuppressed(false);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@ import {
|
||||
expectWorkspaceAgentConfiguration,
|
||||
openCommandCenterForAgent,
|
||||
} from "../support/helpers/command-center-agent-controls";
|
||||
import { openSettingsWithShortcut } from "../support/helpers/app";
|
||||
import { clickSettingsBackToWorkspace } from "../support/helpers/settings";
|
||||
import { expectComposerVisible } from "../support/helpers/composer";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
|
||||
@@ -252,9 +250,8 @@ test.describe("Agent profiles in the model picker", () => {
|
||||
await openCommandCenterForAgent(page, workspace);
|
||||
await chooseCommandCenterAgentControl({
|
||||
page,
|
||||
sublist: "Apply profile",
|
||||
query: "ui work",
|
||||
choice: PROFILE.name,
|
||||
choice: `Profile › ${PROFILE.name}`,
|
||||
});
|
||||
await expectComposerModel(page, "One minute stream");
|
||||
await expectComposerMode(page, "Approval test");
|
||||
@@ -299,34 +296,6 @@ test.describe("Agent profiles in the model picker", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("the composer profile editor reopens after visiting Settings", async ({ page }) => {
|
||||
const seed = await seedAgentProfiles([PROFILE]);
|
||||
const workspace = await seedMockAgentWorkspace({
|
||||
repoPrefix: "agent-profiles-settings-return-",
|
||||
title: "Agent profiles Settings return",
|
||||
model: "ten-second-stream",
|
||||
modeId: "load-test",
|
||||
});
|
||||
const model = { provider: PROFILE.provider, modelId: PROFILE.model };
|
||||
|
||||
try {
|
||||
await openAgentRoute(page, workspace);
|
||||
await expectComposerVisible(page);
|
||||
await openModelPicker(page);
|
||||
await openEditProfileFromModelRow(page, model);
|
||||
|
||||
await openSettingsWithShortcut(page);
|
||||
await clickSettingsBackToWorkspace(page);
|
||||
await expectComposerVisible(page);
|
||||
await openModelPicker(page);
|
||||
await openEditProfileFromModelRow(page, model);
|
||||
await expectAgentProfileNameDraft(page, PROFILE.name);
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
await seed.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("canceling Remove in the composer profile editor keeps the editor and draft open", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
resetReactRenders,
|
||||
} from "../support/helpers/react-renders";
|
||||
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
|
||||
import { decodeWsTextFrame } from "../support/helpers/ws-frames";
|
||||
|
||||
/*
|
||||
* What the app costs per agent update while agents the user is not looking at work.
|
||||
@@ -197,9 +196,8 @@ function countAgentUpdates(page: Page): AgentUpdateTraffic {
|
||||
const previous = new Map<string, Record<string, unknown>>();
|
||||
page.on("websocket", (socket) => {
|
||||
socket.on("framereceived", ({ payload }) => {
|
||||
const text = decodeWsTextFrame(payload);
|
||||
if (text === null || !text.includes('"type":"agent_update"')) return;
|
||||
const frame = JSON.parse(text) as {
|
||||
if (typeof payload !== "string" || !payload.includes('"type":"agent_update"')) return;
|
||||
const frame = JSON.parse(payload) as {
|
||||
message?: { type?: string; payload?: { kind?: string; agent?: Record<string, unknown> } };
|
||||
};
|
||||
if (frame.message?.type !== "agent_update") return;
|
||||
|
||||
@@ -137,36 +137,3 @@ test("applies the content font size to an already-open chat", async ({ page }) =
|
||||
await agent.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("keeps agent tab menu labels whole at the largest interface font size", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
test.setTimeout(120_000);
|
||||
await page.addInitScript(() => {
|
||||
localStorage.setItem("@paseo:app-settings", JSON.stringify({ uiBaseFontSize: 21 }));
|
||||
});
|
||||
const agent = await seedMockAgentWorkspace({
|
||||
repoPrefix: "tab-menu-font-size-",
|
||||
title: "Tab menu",
|
||||
});
|
||||
try {
|
||||
await openAgentRoute(page, agent);
|
||||
const tab = page.getByTestId(`workspace-tab-agent_${agent.agentId}`).first();
|
||||
await expect(tab).toBeVisible({ timeout: 30_000 });
|
||||
await tab.click({ button: "right" });
|
||||
|
||||
const menu = page.getByTestId(`workspace-tab-context-agent_${agent.agentId}`);
|
||||
const item = page.getByTestId(
|
||||
`workspace-tab-context-agent_${agent.agentId}-copy-resume-command`,
|
||||
);
|
||||
const label = item.getByText("Copy resume command", { exact: true });
|
||||
await expect(label).toHaveCSS("font-size", "21px");
|
||||
await menu.screenshot({ path: testInfo.outputPath("agent-tab-menu-21px.png") });
|
||||
|
||||
// A single-line label that ellipsizes has a scrollWidth wider than its clientWidth.
|
||||
const overflow = await label.evaluate((element) => element.scrollWidth - element.clientWidth);
|
||||
expect(overflow).toBeLessThanOrEqual(0);
|
||||
} finally {
|
||||
await agent.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,12 +19,7 @@ import {
|
||||
} from "../support/helpers/mock-agent";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { seedSavedSettingsHosts } from "../support/helpers/settings";
|
||||
import {
|
||||
expectPickerSelected,
|
||||
selectWorkspaceIsolation,
|
||||
submitNewWorkspaceEmpty,
|
||||
} from "../support/helpers/new-workspace";
|
||||
import { checkoutBranch } from "../support/helpers/workspace";
|
||||
import { submitNewWorkspaceEmpty } from "../support/helpers/new-workspace";
|
||||
|
||||
const test = base.extend<{
|
||||
seedForkWorkspace: (options: MockAgentOptions) => Promise<MockAgentWorkspace>;
|
||||
@@ -181,9 +176,7 @@ test.describe("Assistant fork menu", () => {
|
||||
title: "Assistant fork workspace",
|
||||
initialPrompt: "emit 1 coalesced agent stream updates for assistant fork new workspace.",
|
||||
model: "ten-second-stream",
|
||||
repo: { withRemote: true, branches: ["main", "feature/fork-source"] },
|
||||
});
|
||||
checkoutBranch(session.cwd, "feature/fork-source");
|
||||
|
||||
await openAgentRoute(page, session);
|
||||
await expectComposerVisible(page);
|
||||
@@ -195,11 +188,6 @@ test.describe("Assistant fork menu", () => {
|
||||
await expect(page).toHaveURL(/\/new\?.*draftId=/, { timeout: 30_000 });
|
||||
await expectChatHistoryAttachment(page);
|
||||
|
||||
// A fork continues the source agent's work, so it starts from the branch that agent is
|
||||
// on rather than the repository default a fresh workspace starts from.
|
||||
await selectWorkspaceIsolation(page, "worktree");
|
||||
await expectPickerSelected(page, "feature/fork-source");
|
||||
|
||||
await page.getByTestId("host-picker-trigger").click();
|
||||
await page
|
||||
.getByTestId("new-workspace-host-picker-option-secondary-assistant-fork-host")
|
||||
|
||||
@@ -2,7 +2,6 @@ import { writeFile, unlink } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { expect, test, type Page } from "../support/fixtures";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import {
|
||||
expectNoBranchSwitcherInWorkspaceHeader,
|
||||
@@ -28,18 +27,22 @@ async function holdBranchSuggestions(page: Page) {
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (browser) => {
|
||||
const server = browser.connectToServer();
|
||||
browser.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{ type?: unknown; message?: { type?: unknown } }>(message);
|
||||
if (envelope?.type === "session" && envelope.message?.type === "branch_suggestions_request")
|
||||
requestCount++;
|
||||
if (typeof message === "string") {
|
||||
const envelope = JSON.parse(message);
|
||||
if (envelope.type === "session" && envelope.message?.type === "branch_suggestions_request")
|
||||
requestCount++;
|
||||
}
|
||||
server.send(message);
|
||||
});
|
||||
server.onMessage(async (message) => {
|
||||
const envelope = parseWsJsonFrame<{ type?: unknown; message?: { type?: unknown } }>(message);
|
||||
if (
|
||||
envelope?.type === "session" &&
|
||||
envelope.message?.type === "branch_suggestions_response"
|
||||
) {
|
||||
await gate;
|
||||
if (typeof message === "string") {
|
||||
const envelope = JSON.parse(message);
|
||||
if (
|
||||
envelope.type === "session" &&
|
||||
envelope.message?.type === "branch_suggestions_response"
|
||||
) {
|
||||
await gate;
|
||||
}
|
||||
}
|
||||
browser.send(message);
|
||||
});
|
||||
|
||||
@@ -6,11 +6,6 @@ import { type Locator, type Page } from "@playwright/test";
|
||||
import { buildHostWorkspaceRoute, buildSettingsSectionRoute } from "../../src/utils/host-routes";
|
||||
import { test, expect } from "../support/fixtures";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import {
|
||||
createWsFrameAssembler,
|
||||
parseWsJsonFrame,
|
||||
sendWsFrames,
|
||||
} from "../support/helpers/ws-frames";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { connectSeedClient } from "../support/helpers/seed-client";
|
||||
import { createTempGitRepo } from "../support/helpers/workspace";
|
||||
@@ -66,25 +61,27 @@ async function failNextDiscardRequest(page: Page): Promise<void> {
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (browserSocket) => {
|
||||
const serverSocket = browserSocket.connectToServer();
|
||||
browserSocket.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{
|
||||
message?: { type?: string; cwd?: string; requestId?: string };
|
||||
}>(message);
|
||||
if (envelope?.message?.type === "checkout.discard_changes.request") {
|
||||
browserSocket.send(
|
||||
JSON.stringify({
|
||||
type: "session",
|
||||
message: {
|
||||
type: "checkout.discard_changes.response",
|
||||
payload: {
|
||||
cwd: envelope.message.cwd,
|
||||
success: false,
|
||||
error: { code: "UNKNOWN", message: "Injected revert failure" },
|
||||
requestId: envelope.message.requestId,
|
||||
if (typeof message === "string") {
|
||||
const envelope = JSON.parse(message) as {
|
||||
message?: { type?: string; cwd?: string; requestId?: string };
|
||||
};
|
||||
if (envelope.message?.type === "checkout.discard_changes.request") {
|
||||
browserSocket.send(
|
||||
JSON.stringify({
|
||||
type: "session",
|
||||
message: {
|
||||
type: "checkout.discard_changes.response",
|
||||
payload: {
|
||||
cwd: envelope.message.cwd,
|
||||
success: false,
|
||||
error: { code: "UNKNOWN", message: "Injected revert failure" },
|
||||
requestId: envelope.message.requestId,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
serverSocket.send(message);
|
||||
});
|
||||
@@ -272,10 +269,6 @@ test.afterEach(async () => {
|
||||
|
||||
test("Changes without a comparison base explains how to view pending changes", async ({ page }) => {
|
||||
const workspace = await createWorkspaceWithManyTinyDiffs(2, "dev");
|
||||
// A sole branch such as dev is the repository default. With several custom branches, no
|
||||
// remote and a detached HEAD, nothing says which branch to compare against.
|
||||
execFileSync("git", ["branch", "release"], { cwd: workspace.repoPath });
|
||||
execFileSync("git", ["checkout", "--detach"], { cwd: workspace.repoPath, stdio: "ignore" });
|
||||
await openWorkspaceChangesTree(page, workspace);
|
||||
await expect(
|
||||
page.getByText("Comparison base is unavailable. Select Uncommitted to view pending changes."),
|
||||
@@ -366,14 +359,14 @@ async function holdDiffCompletion(page: Page) {
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (browserSocket) => {
|
||||
connections++;
|
||||
const serverSocket = browserSocket.connectToServer();
|
||||
const assembleServer = createWsFrameAssembler();
|
||||
browserSocket.onMessage((message) => serverSocket.send(message));
|
||||
serverSocket.onMessage((raw) => {
|
||||
const assembled = assembleServer(raw);
|
||||
if (!assembled) return;
|
||||
const binary = assembled.binary;
|
||||
if (binary && binary[0] >= DiffOpcode.Begin && binary[0] <= DiffOpcode.End) {
|
||||
const frame = decodeDiffFrame(binary);
|
||||
serverSocket.onMessage((message) => {
|
||||
if (
|
||||
typeof message !== "string" &&
|
||||
message[0] >= DiffOpcode.Begin &&
|
||||
message[0] <= DiffOpcode.End
|
||||
) {
|
||||
const frame = decodeDiffFrame(message);
|
||||
if (frame.opcode === DiffOpcode.Begin) bodyCounts.set(frame.slot, 0);
|
||||
else if (frame.opcode === DiffOpcode.Bodies)
|
||||
bodyCounts.set(frame.slot, (bodyCounts.get(frame.slot) ?? 0) + frame.files.length);
|
||||
@@ -382,11 +375,11 @@ async function holdDiffCompletion(page: Page) {
|
||||
changedBodies.push(bodyCounts.get(frame.slot) ?? 0);
|
||||
}
|
||||
}
|
||||
if (holding && binary && binary[0] === DiffOpcode.End) {
|
||||
completions.push(() => sendWsFrames(browserSocket, assembled.frames));
|
||||
if (holding && typeof message !== "string" && message[0] === DiffOpcode.End) {
|
||||
completions.push(() => browserSocket.send(message));
|
||||
return;
|
||||
}
|
||||
sendWsFrames(browserSocket, assembled.frames);
|
||||
browserSocket.send(message);
|
||||
});
|
||||
});
|
||||
return {
|
||||
@@ -570,13 +563,13 @@ test("Changes selects exact local and remote bases and retains the selection aft
|
||||
const picker = tree.getByTestId("workspace-base-branch-trigger");
|
||||
await expect(picker).toBeVisible();
|
||||
await picker.click();
|
||||
await expect(page.getByRole("option", { name: "release", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "release", exact: true })).toBeVisible();
|
||||
await page.screenshot({ path: testInfo.outputPath("base-picker.png") });
|
||||
await page.getByRole("option", { name: "release", exact: true }).click();
|
||||
await page.getByRole("button", { name: "release", exact: true }).click();
|
||||
await expect(picker).toContainText("release");
|
||||
await expect(tree.getByText("No changes to display", { exact: true })).toBeVisible();
|
||||
await picker.click();
|
||||
await page.getByRole("option", { name: "upstream/release", exact: true }).click();
|
||||
await page.getByRole("button", { name: "upstream/release", exact: true }).click();
|
||||
await expect(picker).toContainText("upstream/release");
|
||||
await expect(tree.getByText("committed-only.ts", { exact: true })).toBeVisible();
|
||||
await page.screenshot({ path: testInfo.outputPath("base-selected.png") });
|
||||
@@ -588,33 +581,6 @@ test("Changes selects exact local and remote bases and retains the selection aft
|
||||
);
|
||||
});
|
||||
|
||||
test("Changes treats a worktree on the default branch as on its base and labels a local pin", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
const workspace = await createWorktreeCheckedOutOnMain();
|
||||
await openWorkspaceChangesTree(page, workspace);
|
||||
const tree = page.getByTestId("changes-tree-panel").filter({ visible: true });
|
||||
const picker = tree.getByTestId("workspace-base-branch-trigger");
|
||||
|
||||
await test.step("a worktree on main compares against origin and offers no feature actions", async () => {
|
||||
await expect(picker).toHaveText("main");
|
||||
await expectNoFeatureActions(page);
|
||||
await page.screenshot({ path: testInfo.outputPath("on-base-worktree.png") });
|
||||
});
|
||||
|
||||
await test.step("pinning local main reads as local next to origin", async () => {
|
||||
await chooseBase(page, picker, "main");
|
||||
await expect(picker).toHaveText("main (local)");
|
||||
await expectNoFeatureActions(page);
|
||||
await page.screenshot({ path: testInfo.outputPath("local-base-pinned.png") });
|
||||
});
|
||||
|
||||
await test.step("pinning origin main drops the qualifier again", async () => {
|
||||
await chooseBase(page, picker, "origin/main");
|
||||
await expect(picker).toHaveText("main");
|
||||
});
|
||||
});
|
||||
|
||||
test("Changes lets a compact workspace change its base in a sheet", async ({ page }, testInfo) => {
|
||||
const workspace = await createWorktreeWithCommittedDiff();
|
||||
execFileSync("git", ["branch", "release"], { cwd: workspace.repoPath });
|
||||
@@ -639,7 +605,7 @@ test("Changes shows a failed base selection and lets the user retry", async ({ p
|
||||
.filter({ visible: true })
|
||||
.first();
|
||||
await picker.click();
|
||||
const option = page.getByRole("option", { name: "release", exact: true });
|
||||
const option = page.getByRole("button", { name: "release", exact: true });
|
||||
await expect(option).toBeVisible();
|
||||
execFileSync("git", ["branch", "-D", "release"], { cwd: workspace.repoPath });
|
||||
await option.click();
|
||||
@@ -660,19 +626,23 @@ test("Changes shows the base as text on a host without the base-branch capabilit
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (browser) => {
|
||||
const server = browser.connectToServer();
|
||||
browser.onMessage((frame) => {
|
||||
const envelope = parseWsJsonFrame<{ message?: { type?: string } }>(frame);
|
||||
if (envelope?.message?.type === "workspace.base_branch.set.request") baseRequests += 1;
|
||||
if (typeof frame === "string") {
|
||||
const envelope = JSON.parse(frame) as { message?: { type?: string } };
|
||||
if (envelope.message?.type === "workspace.base_branch.set.request") baseRequests += 1;
|
||||
}
|
||||
server.send(frame);
|
||||
});
|
||||
server.onMessage((frame) => {
|
||||
const envelope = parseWsJsonFrame<{
|
||||
message?: { payload?: { status?: string; features?: Record<string, unknown> } };
|
||||
}>(frame);
|
||||
const payload = envelope?.message?.payload;
|
||||
if (payload?.status === "server_info" && payload.features) {
|
||||
delete payload.features.workspaceBaseBranch;
|
||||
browser.send(JSON.stringify(envelope));
|
||||
return;
|
||||
if (typeof frame === "string") {
|
||||
const envelope = JSON.parse(frame) as {
|
||||
message?: { payload?: { status?: string; features?: Record<string, unknown> } };
|
||||
};
|
||||
const payload = envelope.message?.payload;
|
||||
if (payload?.status === "server_info" && payload.features) {
|
||||
delete payload.features.workspaceBaseBranch;
|
||||
browser.send(JSON.stringify(envelope));
|
||||
return;
|
||||
}
|
||||
}
|
||||
browser.send(frame);
|
||||
});
|
||||
@@ -771,16 +741,13 @@ async function useLegacyDiffHost(page: Page): Promise<void> {
|
||||
const serverSocket = browserSocket.connectToServer();
|
||||
browserSocket.onMessage((message) => serverSocket.send(message));
|
||||
serverSocket.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{
|
||||
message?: { payload?: { status?: string; features?: Record<string, unknown> } };
|
||||
}>(message);
|
||||
if (
|
||||
envelope?.message?.payload?.status === "server_info" &&
|
||||
envelope.message.payload.features
|
||||
) {
|
||||
delete envelope.message.payload.features.diffSubscription;
|
||||
browserSocket.send(JSON.stringify(envelope));
|
||||
return;
|
||||
if (typeof message === "string") {
|
||||
const envelope = JSON.parse(message);
|
||||
if (envelope.message?.payload?.status === "server_info") {
|
||||
delete envelope.message.payload.features.diffSubscription;
|
||||
browserSocket.send(JSON.stringify(envelope));
|
||||
return;
|
||||
}
|
||||
}
|
||||
browserSocket.send(message);
|
||||
});
|
||||
@@ -2303,27 +2270,6 @@ async function expectInSyncWithRemote(workspace: RemoteWorkspace): Promise<void>
|
||||
}
|
||||
|
||||
// A clean main that is in sync with its remote has no git action, so the button is gone.
|
||||
async function chooseBase(page: Page, picker: Locator, label: string): Promise<void> {
|
||||
await picker.click();
|
||||
await page
|
||||
.getByTestId("combobox-desktop-container")
|
||||
.getByRole("option", { name: label, exact: true })
|
||||
.click();
|
||||
}
|
||||
|
||||
// Merging, merging the base in and opening a PR only make sense on a branch off the base.
|
||||
async function expectNoFeatureActions(page: Page): Promise<void> {
|
||||
await expect(page.getByTestId("changes-primary-cta")).toHaveAccessibleName("Archive workspace", {
|
||||
timeout: 30_000,
|
||||
});
|
||||
await page.getByTestId("changes-primary-cta-caret").click();
|
||||
await expect(page.getByTestId("changes-primary-cta-menu")).toBeVisible();
|
||||
for (const action of ["merge-branch", "merge-from-base", "pr"]) {
|
||||
await expect(page.getByTestId(`changes-menu-${action}`)).toHaveCount(0);
|
||||
}
|
||||
await page.keyboard.press("Escape");
|
||||
}
|
||||
|
||||
async function expectNoGitActionLeft(page: Page): Promise<void> {
|
||||
await expect(page.getByTestId("changes-primary-cta")).toBeHidden({ timeout: 30_000 });
|
||||
}
|
||||
@@ -2469,34 +2415,6 @@ async function createWorktreeWithCommittedDiff(): Promise<DirtyWorkspace> {
|
||||
return { id: created.workspace.id, repoPath: cwd };
|
||||
}
|
||||
|
||||
// The user checks out the default branch itself in a worktree while the main checkout sits on
|
||||
// other work, so the worktree is on its own base.
|
||||
async function createWorktreeCheckedOutOnMain(): Promise<DirtyWorkspace> {
|
||||
const repo = await createTempGitRepo("changes-on-base-", {
|
||||
withRemote: true,
|
||||
files: [{ path: "tracked.ts", content: "export const tracked = 1;\n" }],
|
||||
});
|
||||
const client = await connectSeedClient();
|
||||
cleanupTasks.push({
|
||||
run: async () => {
|
||||
await client.close();
|
||||
await repo.cleanup();
|
||||
},
|
||||
});
|
||||
execFileSync("git", ["checkout", "-b", "unrelated"], { cwd: repo.path });
|
||||
const created = await client.createWorkspace({
|
||||
source: {
|
||||
kind: "worktree",
|
||||
cwd: repo.path,
|
||||
action: "checkout",
|
||||
refName: "main",
|
||||
worktreeSlug: "on-main",
|
||||
},
|
||||
});
|
||||
if (!created.workspace) throw new Error(created.error ?? "Failed to create worktree");
|
||||
return { id: created.workspace.id, repoPath: created.workspace.workspaceDirectory };
|
||||
}
|
||||
|
||||
async function createWorkspaceWithCommittedDiff(): Promise<DirtyWorkspace> {
|
||||
const repo = await createTempGitRepo("changes-committed-", {
|
||||
files: [{ path: "tracked.ts", content: "export const tracked = 1;\n" }],
|
||||
|
||||
@@ -66,7 +66,7 @@ async function selectSpeed(page: Page, label: string): Promise<void> {
|
||||
await expect(pill).toHaveAttribute("aria-selected", "true");
|
||||
return;
|
||||
}
|
||||
await page.getByRole("option", { name: label, exact: true }).last().click();
|
||||
await page.getByRole("button", { name: label, exact: true }).last().click();
|
||||
const toolbarTrigger = page.getByRole("button", { name: `Speed: ${label}`, exact: true });
|
||||
const sheetTrigger = page.getByRole("button", { name: "Select speed", exact: true });
|
||||
await expect(toolbarTrigger.or(sheetTrigger)).toBeVisible();
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
applyCommandCenterAgentControls,
|
||||
chooseCommandCenterAgentControl,
|
||||
openCommandCenterForAgent,
|
||||
searchAgentModeControls,
|
||||
searchAgentControls,
|
||||
expectCommandCenterAgentControlSelected,
|
||||
expectFocusedAgentControls,
|
||||
expectWorkspaceAgentConfiguration,
|
||||
@@ -122,9 +122,10 @@ test.describe("Command Center agent controls", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("activates the best-matching mode without models competing in top-level search", async ({
|
||||
page,
|
||||
}) => {
|
||||
test("activates the best-matching row, not the highest-ranked group", async ({ page }) => {
|
||||
// "Mode › Load Test" matches "load" at offset 0; every "Model › Mock Load Test › …" row
|
||||
// matches at offset 5. Models used to outrank modes by fixed group rank, so Enter picked a
|
||||
// model. Asserting both model and mode catches either row winning.
|
||||
const workspace = await seedMockAgentWorkspace({
|
||||
repoPrefix: "command-center-relevance-",
|
||||
title: "Command Center relevance",
|
||||
@@ -133,7 +134,7 @@ test.describe("Command Center agent controls", () => {
|
||||
try {
|
||||
await workspace.client.setAgentMode(workspace.agentId, "approval-test");
|
||||
await openCommandCenterForAgent(page, workspace);
|
||||
await searchAgentModeControls(page, "load");
|
||||
await searchAgentControls(page, "load");
|
||||
await page.keyboard.press("Enter");
|
||||
|
||||
await expectWorkspaceAgentConfiguration(workspace, {
|
||||
@@ -205,8 +206,8 @@ test.describe("Command Center agent controls", () => {
|
||||
try {
|
||||
await workspace.client.setAgentMode(workspace.agentId, "approval-test");
|
||||
const input = await openCommandCenterForAgent(page, workspace);
|
||||
await searchAgentModeControls(page, "loa");
|
||||
// Moves the highlight onto the next row, which still matches after the next keystroke.
|
||||
await searchAgentControls(page, "loa");
|
||||
// Moves the highlight onto a model row, which still matches after the next keystroke.
|
||||
await page.keyboard.press("ArrowDown");
|
||||
await input.fill("load");
|
||||
await page.keyboard.press("Enter");
|
||||
@@ -332,11 +333,7 @@ test.describe("Command Center agent controls", () => {
|
||||
});
|
||||
|
||||
const DRAFT_AGENT_CONTROL_CHOICES = [
|
||||
{
|
||||
sublist: "Switch model" as const,
|
||||
query: "ten second stream",
|
||||
choice: "Mock Load Test › Ten second stream",
|
||||
},
|
||||
{ query: "ten second stream", choice: "Model › Mock Load Test › Ten second stream" },
|
||||
{ query: "load test", choice: "Mode › Load test" },
|
||||
] as const;
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@ import { expect, test } from "../support/fixtures";
|
||||
import { openSettings } from "../support/helpers/app";
|
||||
import {
|
||||
closeCommandCenter,
|
||||
enterCommandCenterSublist,
|
||||
expectCommandCenterSublist,
|
||||
expectCommandCenterTab,
|
||||
expectCommandCenterTabs,
|
||||
openCommandCenter,
|
||||
@@ -77,7 +75,7 @@ test("workspace file search stays geometrically stable through delayed loading a
|
||||
|
||||
const panel = page.getByTestId("command-center-panel");
|
||||
await expect(panel).toBeVisible({ timeout: 30_000 });
|
||||
await expectCommandCenterSublist(panel, "Search files", "Search files...");
|
||||
await expectCommandCenterTab(panel, "Files");
|
||||
await startCommandCenterLayoutObservation(page);
|
||||
|
||||
await panel.getByTestId("command-center-input").fill(FILE_NAME);
|
||||
@@ -119,10 +117,10 @@ test("command center tabs rotate with Tab and never move the header", async ({ p
|
||||
const header = panel.getByTestId("command-center-header");
|
||||
const input = panel.getByTestId("command-center-input");
|
||||
|
||||
await test.step("⌘P opens on Search files sub-list and Backspace on an empty field returns to All", async () => {
|
||||
await test.step("⌘P opens on Files and Backspace on an empty field returns to All", async () => {
|
||||
await page.keyboard.press("Meta+P");
|
||||
await expect(panel).toBeVisible({ timeout: 30_000 });
|
||||
await expectCommandCenterSublist(panel, "Search files", "Search files...");
|
||||
await expectCommandCenterTab(panel, "Files");
|
||||
await page.keyboard.press("Backspace");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
});
|
||||
@@ -135,6 +133,8 @@ test("command center tabs rotate with Tab and never move the header", async ({ p
|
||||
await page.keyboard.press("Tab");
|
||||
await expectCommandCenterTab(panel, "Workspaces");
|
||||
await page.keyboard.press("Tab");
|
||||
await expectCommandCenterTab(panel, "Files");
|
||||
await page.keyboard.press("Tab");
|
||||
await expectCommandCenterTab(panel, "Actions");
|
||||
expect(await header.boundingBox()).toEqual(headerOnAll);
|
||||
expect((await results.boundingBox())?.y).toBe(resultsTopOnAll);
|
||||
@@ -143,7 +143,7 @@ test("command center tabs rotate with Tab and never move the header", async ({ p
|
||||
await page.keyboard.press("Shift+Tab");
|
||||
await expectCommandCenterTab(panel, "Actions");
|
||||
await page.keyboard.press("Shift+Tab");
|
||||
await expectCommandCenterTab(panel, "Workspaces");
|
||||
await expectCommandCenterTab(panel, "Files");
|
||||
});
|
||||
|
||||
await test.step("rotating keeps the query", async () => {
|
||||
@@ -162,57 +162,39 @@ test("command center tabs rotate with Tab and never move the header", async ({ p
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
await test.step("⌘K opens on All with All, Workspaces, Actions tabs", async () => {
|
||||
await test.step("⌘K opens on All", async () => {
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(panel).not.toBeVisible();
|
||||
await page.keyboard.press("Meta+K");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await expectCommandCenterTabs(panel, ["All", "Workspaces", "Actions"]);
|
||||
});
|
||||
|
||||
await test.step("overflowing filter tabs scroll into view on narrow viewports", async () => {
|
||||
const originalViewport = page.viewportSize() ?? { width: 1280, height: 720 };
|
||||
await page.setViewportSize({ width: 220, height: 640 });
|
||||
try {
|
||||
const tabsBar = panel.getByTestId("command-center-tabs");
|
||||
const metrics = await tabsBar.evaluate((el) => ({
|
||||
scrollWidth: el.scrollWidth,
|
||||
clientWidth: el.clientWidth,
|
||||
}));
|
||||
expect(metrics.scrollWidth).toBeGreaterThan(metrics.clientWidth);
|
||||
await page.keyboard.press("Shift+Tab");
|
||||
await expectCommandCenterTab(panel, "Actions");
|
||||
const actionsTab = panel.getByTestId("command-center-tab-actions");
|
||||
await expect(actionsTab).toBeInViewport({ ratio: 1 });
|
||||
await page.keyboard.press("Tab");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
const scrollLeft = await tabsBar.evaluate((el) => el.scrollLeft);
|
||||
expect(scrollLeft).toBe(0);
|
||||
} finally {
|
||||
await page.setViewportSize(originalViewport);
|
||||
}
|
||||
await test.step("in a workspace every tab is offered", async () => {
|
||||
await expectCommandCenterTabs(panel, ["All", "Workspaces", "Files", "Actions"]);
|
||||
});
|
||||
|
||||
await test.step("outside a workspace the same root tabs stay available without Search files", async () => {
|
||||
await test.step("outside a workspace there is no Files tab, and Tab skips it", async () => {
|
||||
const outside = { workspaceOpen: false };
|
||||
await closeCommandCenter(page);
|
||||
await openSettings(page);
|
||||
await page.keyboard.press("Meta+K");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await expectCommandCenterTab(panel, "All", outside);
|
||||
await expectCommandCenterTabs(panel, ["All", "Workspaces", "Actions"]);
|
||||
await expect(panel.getByTestId("command-center-search-files")).toHaveCount(0);
|
||||
await page.keyboard.press("Tab");
|
||||
await expectCommandCenterTab(panel, "Workspaces");
|
||||
await expectCommandCenterTab(panel, "Workspaces", outside);
|
||||
await page.keyboard.press("Tab");
|
||||
await expectCommandCenterTab(panel, "Actions");
|
||||
await expectCommandCenterTab(panel, "Actions", outside);
|
||||
await page.keyboard.press("Tab");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await expectCommandCenterTab(panel, "All", outside);
|
||||
await page.keyboard.press("Shift+Tab");
|
||||
await expectCommandCenterTab(panel, "Actions", outside);
|
||||
});
|
||||
} finally {
|
||||
await seeded.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("root All stays free of file-search failures while Search files reports them", async ({
|
||||
test("unscoped command search keeps commands visible and reports file-search failures", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(120_000);
|
||||
@@ -226,9 +208,6 @@ test("root All stays free of file-search failures while Search files reports the
|
||||
|
||||
await expect(panel.getByRole("button", { name: "Home", exact: true })).toBeVisible();
|
||||
await expect(panel.getByRole("button", { name: /Home failure 08/ })).toBeVisible();
|
||||
await expect(panel.getByTestId("command-center-file-search-error")).toHaveCount(0);
|
||||
|
||||
await enterCommandCenterSublist(panel, "Search files", "Search files...");
|
||||
await expect(panel.getByTestId("command-center-file-search-error")).toHaveText(
|
||||
"Error: Test file search transport failure.",
|
||||
);
|
||||
@@ -312,7 +291,6 @@ test.describe("Compact file search context", () => {
|
||||
await page.goto(`/h/${process.env.E2E_SERVER_ID}/workspace/${seeded.workspaceId}`);
|
||||
await page.getByRole("button", { name: "Open menu", exact: true }).click();
|
||||
const search = await openCommandCenter(page);
|
||||
await enterCommandCenterSublist(search, "Search files", "Search files...");
|
||||
await search.getByTestId("command-center-input").fill("lookup.ts");
|
||||
await search.getByRole("button", { name: "lookup.ts", exact: true }).click();
|
||||
await expect(page.getByTestId("sheet-tab-body")).toBeVisible();
|
||||
|
||||
@@ -1,278 +0,0 @@
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import {
|
||||
closeCommandCenter,
|
||||
enterChangeThemeSublist,
|
||||
enterCommandCenterSublist,
|
||||
expectCommandCenterSublist,
|
||||
expectCommandCenterTab,
|
||||
expectCommandCenterTabs,
|
||||
expectCommandCenterThemeSelected,
|
||||
openCommandCenter,
|
||||
switchThemeViaCommandCenter,
|
||||
} from "../support/helpers/command-center";
|
||||
import { expectWorkspaceAgentConfiguration } from "../support/helpers/command-center-agent-controls";
|
||||
import { holdDirectorySuggestionResponses } from "../support/helpers/command-center-file-search";
|
||||
import { expectFileTabOpen } from "../support/helpers/file-explorer";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
|
||||
const SAMPLE_FILES = [
|
||||
{ path: "README.md", content: "# Command Center Sub-lists\n" },
|
||||
{ path: "package.json", content: '{"name":"paseo-demo"}\n' },
|
||||
{
|
||||
path: "packages/app/src/command-center/sublist.ts",
|
||||
content: "export const COMMAND_CENTER_FILES_SUBLIST_ID = 'files';\n",
|
||||
},
|
||||
{
|
||||
path: "src/specs/auth-spec.ts",
|
||||
content: "export const authSpec = true;\n",
|
||||
},
|
||||
];
|
||||
|
||||
test.use({
|
||||
userAgent:
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/145.0 Safari/537.36",
|
||||
});
|
||||
|
||||
test("Switch model and Search files sub-lists keep top-level search clean and queue fast Cmd+P Enter", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
|
||||
const leanSpec = await seedWorkspace({
|
||||
repoPrefix: "lean-spec-",
|
||||
title: "lean-spec",
|
||||
});
|
||||
const activeWorkspace = await seedMockAgentWorkspace({
|
||||
repoPrefix: "cc-sublists-",
|
||||
title: "Command center sublists",
|
||||
model: "five-minute-stream",
|
||||
repo: { files: SAMPLE_FILES },
|
||||
});
|
||||
|
||||
try {
|
||||
const fileResponses = await holdDirectorySuggestionResponses(page);
|
||||
await openAgentRoute(page, {
|
||||
workspaceId: activeWorkspace.workspaceId,
|
||||
agentId: activeWorkspace.agentId,
|
||||
});
|
||||
await expect(
|
||||
page.getByRole("button", { name: /^Select agent mode \(/ }).filter({ visible: true }),
|
||||
).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
const panel = await openCommandCenter(page);
|
||||
const searchInput = panel.getByRole("textbox");
|
||||
|
||||
await test.step("top-level Cmd+K lists All, Workspaces, Actions and never mixes models or files", async () => {
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await expectCommandCenterTabs(panel, ["All", "Workspaces", "Actions"]);
|
||||
await expect(panel.getByRole("button", { name: /^Search files/ })).toBeVisible();
|
||||
await expect(panel.getByRole("button", { name: /^Switch model/ })).toBeVisible();
|
||||
|
||||
await searchInput.fill("spec");
|
||||
await expect(panel.getByRole("button", { name: /lean-spec/ })).toBeVisible({
|
||||
timeout: 15_000,
|
||||
});
|
||||
await expect(panel.locator('[data-testid^="command-center-model-"]')).toHaveCount(0);
|
||||
await expect(panel.locator('[data-testid^="command-center-file-row-"]')).toHaveCount(0);
|
||||
});
|
||||
|
||||
await test.step("Switch model sub-list shows active model and switches directly on Enter", async () => {
|
||||
await enterCommandCenterSublist(panel, "Switch model", "Search models...");
|
||||
await expect(searchInput).toHaveValue("");
|
||||
await expect(searchInput).toBeFocused();
|
||||
await expect(
|
||||
panel.getByRole("button", { name: "Mock Load Test › Five minute stream", exact: true }),
|
||||
).toHaveAttribute("aria-pressed", "true");
|
||||
|
||||
await searchInput.fill("ten second stream");
|
||||
await expect(
|
||||
panel.getByRole("button", { name: "Mock Load Test › Ten second stream", exact: true }),
|
||||
).toBeVisible();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(panel).not.toBeVisible();
|
||||
|
||||
await expectWorkspaceAgentConfiguration(activeWorkspace, {
|
||||
id: activeWorkspace.agentId,
|
||||
provider: "mock",
|
||||
model: "ten-second-stream",
|
||||
modeId: "load-test",
|
||||
});
|
||||
});
|
||||
|
||||
await test.step("Escape pops a drilled-in sub-list back to root, while Backspace on empty and Tab-to-Back also return", async () => {
|
||||
await openCommandCenter(page);
|
||||
await enterCommandCenterSublist(panel, "Switch model", "Search models...");
|
||||
await page.keyboard.press("Escape");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
|
||||
await enterCommandCenterSublist(panel, "Switch model", "Search models...");
|
||||
const backButton = panel.getByTestId("command-center-sublist-back");
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(backButton).toBeFocused();
|
||||
// Result rows stay out of the Tab order, so Tab wraps straight back to the search input.
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(searchInput).toBeFocused();
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(backButton).toBeFocused();
|
||||
await page.keyboard.press("Enter");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
|
||||
await enterCommandCenterSublist(panel, "Search files", "Search files...");
|
||||
await page.keyboard.press("Backspace");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await closeCommandCenter(page);
|
||||
});
|
||||
|
||||
await test.step("Cmd+P opens Search files and queues fast Enter until the query settles", async () => {
|
||||
await page.keyboard.press("Meta+P");
|
||||
await expect(panel).toBeVisible({ timeout: 15_000 });
|
||||
await expectCommandCenterSublist(panel, "Search files", "Search files...");
|
||||
await expect(panel.getByTestId("command-center-file-search-loading")).toBeHidden({
|
||||
timeout: 15_000,
|
||||
});
|
||||
|
||||
// Hold the next file search response, type a query, and hit Enter before it arrives.
|
||||
fileResponses.hold();
|
||||
await searchInput.fill("sublist.ts");
|
||||
await expect(panel.getByTestId("command-center-file-search-loading")).toBeVisible();
|
||||
await page.keyboard.press("Enter");
|
||||
// Panel stays open while waiting for the in-flight query to settle.
|
||||
await expect(panel).toBeVisible();
|
||||
|
||||
await fileResponses.release();
|
||||
await expect(panel).not.toBeVisible({ timeout: 15_000 });
|
||||
await expectFileTabOpen(page, "packages/app/src/command-center/sublist.ts");
|
||||
});
|
||||
|
||||
await test.step("Escape closes directly when opened via Cmd+P", async () => {
|
||||
await page.keyboard.press("Meta+P");
|
||||
await expect(panel).toBeVisible({ timeout: 15_000 });
|
||||
await expectCommandCenterSublist(panel, "Search files", "Search files...");
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(panel).not.toBeVisible();
|
||||
});
|
||||
} finally {
|
||||
await activeWorkspace.cleanup();
|
||||
await leanSpec.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("Change theme sub-list filters, switches themes across Dark, Light, and Pure black, and backs out cleanly", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
|
||||
const workspace = await seedWorkspace({
|
||||
repoPrefix: "cc-theme-switcher-",
|
||||
title: "Theme switcher workspace",
|
||||
});
|
||||
|
||||
try {
|
||||
await page.goto(`/h/${encodeURIComponent(getServerId())}/workspace/${workspace.workspaceId}`);
|
||||
const sidebarRow = page.getByTestId(
|
||||
`sidebar-workspace-row-${getServerId()}:${workspace.workspaceId}`,
|
||||
);
|
||||
await expect(sidebarRow).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
const panel = await openCommandCenter(page);
|
||||
const searchInput = panel.getByTestId("command-center-input");
|
||||
|
||||
await test.step("top-level Change theme shows active theme and keeps theme options out of root search", async () => {
|
||||
const trigger = panel.getByTestId("command-center-change-theme");
|
||||
await expect(trigger).toBeVisible();
|
||||
await expect(trigger).toContainText("Change theme");
|
||||
await expect(trigger).toContainText("System");
|
||||
|
||||
await searchInput.fill("pure black");
|
||||
await expect(panel.locator('[data-testid^="command-center-theme-"]')).toHaveCount(0);
|
||||
await expect(panel.getByTestId("command-center-change-theme")).toHaveCount(0);
|
||||
});
|
||||
|
||||
await test.step("entering Change theme lists all supported themes with active indicator and backs out without changing theme", async () => {
|
||||
await enterChangeThemeSublist(panel);
|
||||
await expect(searchInput).toHaveValue("");
|
||||
await expect(searchInput).toBeFocused();
|
||||
|
||||
for (const themeName of [
|
||||
"System",
|
||||
"Light",
|
||||
"Dark",
|
||||
"Zinc",
|
||||
"Midnight",
|
||||
"Claude",
|
||||
"Ghostty",
|
||||
"Pure black",
|
||||
]) {
|
||||
await expect(panel.getByRole("button", { name: themeName, exact: true })).toBeVisible();
|
||||
}
|
||||
await expectCommandCenterThemeSelected(panel, "System");
|
||||
|
||||
await searchInput.fill("pure");
|
||||
await expect(panel.getByRole("button", { name: "Pure black", exact: true })).toBeVisible();
|
||||
await expect(panel.getByRole("button", { name: "Light", exact: true })).toHaveCount(0);
|
||||
|
||||
// Backing out via Escape returns to root without applying the filtered/highlighted theme.
|
||||
await page.keyboard.press("Escape");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await expect(panel.getByTestId("command-center-change-theme")).toContainText("System");
|
||||
|
||||
// Re-entering and backing out via Backspace on empty query also keeps System active.
|
||||
await enterChangeThemeSublist(panel);
|
||||
await page.keyboard.press("ArrowDown");
|
||||
await page.keyboard.press("Backspace");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await expect(panel.getByTestId("command-center-change-theme")).toContainText("System");
|
||||
await closeCommandCenter(page);
|
||||
});
|
||||
|
||||
await test.step("switching to Default Dark updates the app theme and active indicator", async () => {
|
||||
await switchThemeViaCommandCenter(page, "dark", "Dark");
|
||||
await expect(sidebarRow).toHaveCSS("background-color", "rgb(40, 42, 41)");
|
||||
|
||||
await openCommandCenter(page);
|
||||
await expect(panel.getByTestId("command-center-change-theme")).toContainText("Dark");
|
||||
await expect(panel).toHaveCSS("background-color", "rgb(24, 27, 26)");
|
||||
await enterChangeThemeSublist(panel);
|
||||
await expectCommandCenterThemeSelected(panel, "Dark");
|
||||
await page.keyboard.press("Escape");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await closeCommandCenter(page);
|
||||
});
|
||||
|
||||
await test.step("switching to Light updates the app theme and active indicator", async () => {
|
||||
await switchThemeViaCommandCenter(page, "light", "Light");
|
||||
await expect(sidebarRow).toHaveCSS("background-color", "rgb(212, 212, 213)");
|
||||
|
||||
await openCommandCenter(page);
|
||||
await expect(panel.getByTestId("command-center-change-theme")).toContainText("Light");
|
||||
await expect(panel).toHaveCSS("background-color", "rgb(255, 255, 255)");
|
||||
await enterChangeThemeSublist(panel);
|
||||
await expectCommandCenterThemeSelected(panel, "Light");
|
||||
await page.keyboard.press("Escape");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await closeCommandCenter(page);
|
||||
});
|
||||
|
||||
await test.step("switching to Pure black updates the app theme and persists across reload", async () => {
|
||||
await switchThemeViaCommandCenter(page, "pure black", "Pure black");
|
||||
await expect(sidebarRow).toHaveCSS("background-color", "rgb(29, 29, 29)");
|
||||
|
||||
await page.reload();
|
||||
await expect(sidebarRow).toBeVisible({ timeout: 30_000 });
|
||||
await expect(sidebarRow).toHaveCSS("background-color", "rgb(29, 29, 29)");
|
||||
|
||||
await openCommandCenter(page);
|
||||
await expect(panel.getByTestId("command-center-change-theme")).toContainText("Pure black");
|
||||
await expect(panel).toHaveCSS("background-color", "rgb(0, 0, 0)");
|
||||
await enterChangeThemeSublist(panel);
|
||||
await expectCommandCenterThemeSelected(panel, "Pure black");
|
||||
await page.keyboard.press("Escape");
|
||||
await expectCommandCenterTab(panel, "All");
|
||||
await closeCommandCenter(page);
|
||||
});
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
@@ -2,7 +2,6 @@ import type { Locator } from "@playwright/test";
|
||||
import { test, expect, type Page } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
@@ -69,12 +68,15 @@ async function rejectNextLabelAssignment(page: Page): Promise<void> {
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (browser) => {
|
||||
const server = browser.connectToServer();
|
||||
browser.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{
|
||||
type?: string;
|
||||
message?: { type?: string; requestId?: string };
|
||||
}>(message);
|
||||
const request = envelope?.type === "session" ? (envelope.message ?? null) : null;
|
||||
if (!request) {
|
||||
const raw = typeof message === "string" ? message : message.toString("utf8");
|
||||
let request: { type?: string; requestId?: string } | null = null;
|
||||
try {
|
||||
const envelope = JSON.parse(raw) as {
|
||||
type?: string;
|
||||
message?: { type?: string; requestId?: string };
|
||||
};
|
||||
request = envelope.type === "session" ? (envelope.message ?? null) : null;
|
||||
} catch {
|
||||
server.send(message);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ test.describe("Command center workspaces", () => {
|
||||
|
||||
await test.step("an agent title finds the archived workspace on All", async () => {
|
||||
// Opened from the app shell, outside any workspace.
|
||||
await selectCommandCenterTab(panel, "All");
|
||||
await selectCommandCenterTab(panel, "All", { workspaceOpen: false });
|
||||
await input.fill("invoice totals");
|
||||
await expect(archivedRow.getByTestId("command-center-workspace-agent")).toHaveText(
|
||||
"Audit invoice totals",
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from "../support/helpers/mock-agent";
|
||||
import { expectWorkspaceTabVisible, openSessions } from "../support/helpers/archive-tab";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { decodeWsTextFrame, parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import {
|
||||
switchWorkspaceViaSidebar,
|
||||
@@ -147,31 +146,40 @@ async function installListCommandsStub(
|
||||
});
|
||||
|
||||
server.onMessage((message) => {
|
||||
const parsed = parseWsJsonFrame<{
|
||||
type?: string;
|
||||
message?: {
|
||||
if (typeof message !== "string") {
|
||||
ws.send(message);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const parsed = JSON.parse(message) as {
|
||||
type?: string;
|
||||
payload?: {
|
||||
commands?: unknown;
|
||||
error?: string | null;
|
||||
message?: {
|
||||
type?: string;
|
||||
payload?: {
|
||||
commands?: unknown;
|
||||
error?: string | null;
|
||||
};
|
||||
};
|
||||
};
|
||||
}>(message);
|
||||
const payload = parsed?.message?.payload;
|
||||
if (
|
||||
parsed?.type === "session" &&
|
||||
parsed.message?.type === "list_commands_response" &&
|
||||
payload
|
||||
) {
|
||||
const send = (result: ListCommandsReply) => {
|
||||
payload.commands = result.commands;
|
||||
payload.error = result.error;
|
||||
ws.send(JSON.stringify(parsed));
|
||||
};
|
||||
const result = reply();
|
||||
if (result instanceof Promise) void result.then(send);
|
||||
else send(result);
|
||||
return;
|
||||
const payload = parsed.message?.payload;
|
||||
if (
|
||||
parsed.type === "session" &&
|
||||
parsed.message?.type === "list_commands_response" &&
|
||||
payload
|
||||
) {
|
||||
const send = (result: ListCommandsReply) => {
|
||||
payload.commands = result.commands;
|
||||
payload.error = result.error;
|
||||
ws.send(JSON.stringify(parsed));
|
||||
};
|
||||
const result = reply();
|
||||
if (result instanceof Promise) void result.then(send);
|
||||
else send(result);
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
// Forward non-JSON frames unchanged.
|
||||
}
|
||||
|
||||
ws.send(message);
|
||||
@@ -183,8 +191,7 @@ async function holdWorkspaceCreateWithCommandsStub(page: Page): Promise<{ releas
|
||||
let release: (() => void) | null = null;
|
||||
await installListCommandsStub(page, undefined, {
|
||||
onClientMessage(message, forward) {
|
||||
const text = decodeWsTextFrame(message);
|
||||
if (text !== null && text.includes('"workspace.create.request"')) {
|
||||
if (typeof message === "string" && message.includes('"workspace.create.request"')) {
|
||||
release = forward;
|
||||
return;
|
||||
}
|
||||
@@ -401,9 +408,8 @@ function expectPopoverFramesStable(frames: PopoverFrame[]): void {
|
||||
function recordCommandRequestsByAgentId(page: Page): string[] {
|
||||
const requests: string[] = [];
|
||||
const record = ({ payload }: { payload: string | Buffer }) => {
|
||||
const text = decodeWsTextFrame(payload);
|
||||
if (text === null || !text.includes("list_commands_request")) return;
|
||||
if (!text.includes("draftConfig")) requests.push(text);
|
||||
if (typeof payload !== "string" || !payload.includes("list_commands_request")) return;
|
||||
if (!payload.includes("draftConfig")) requests.push(payload);
|
||||
};
|
||||
page.on("websocket", (socket) => socket.on("framesent", record));
|
||||
return requests;
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
import { expect, test, type Page } from "../support/fixtures";
|
||||
import { gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { dragTabIntoExplorer, ensureExplorerSidebar } from "../support/helpers/workspace-tabs";
|
||||
|
||||
type SeededWorkspace = Awaited<ReturnType<typeof seedWorkspace>>;
|
||||
type Pane = "main" | "dock";
|
||||
|
||||
const PANE_TEST_IDS: Record<Pane, string> = {
|
||||
main: "workspace-pane-main",
|
||||
dock: "workspace-explorer-sidebar",
|
||||
};
|
||||
|
||||
test.use({ viewport: { width: 1600, height: 900 } });
|
||||
|
||||
function pane(page: Page, which: Pane) {
|
||||
return page.getByTestId(PANE_TEST_IDS[which]).filter({ visible: true });
|
||||
}
|
||||
|
||||
function composerInput(page: Page, which: Pane) {
|
||||
return pane(page, which).getByRole("textbox", { name: "Message agent..." });
|
||||
}
|
||||
|
||||
function agentTab(page: Page, which: Pane, agentId: string) {
|
||||
return pane(page, which).getByTestId(`workspace-tab-agent_${agentId}`);
|
||||
}
|
||||
|
||||
/** Starts a long-streaming mock agent and waits until its tab shows in the main pane. */
|
||||
async function startRunningAgent(
|
||||
page: Page,
|
||||
workspace: SeededWorkspace,
|
||||
title: string,
|
||||
): Promise<string> {
|
||||
const agent = await workspace.client.createAgent({
|
||||
provider: "mock",
|
||||
cwd: workspace.repoPath,
|
||||
workspaceId: workspace.workspaceId,
|
||||
title,
|
||||
modeId: "load-test",
|
||||
model: "one-minute-stream",
|
||||
initialPrompt: `Keep running ${title}.`,
|
||||
});
|
||||
await workspace.client.waitForAgentUpsert(
|
||||
agent.id,
|
||||
(snapshot) => snapshot.status === "running",
|
||||
15_000,
|
||||
);
|
||||
await expect(agentTab(page, "main", agent.id)).toBeVisible();
|
||||
return agent.id;
|
||||
}
|
||||
|
||||
/** Moves an agent's tab into the Explorer dock, then shows the other agent in the main pane. */
|
||||
async function dockAgentBesideMain(page: Page, dockAgentId: string, mainAgentId: string) {
|
||||
await ensureExplorerSidebar(page);
|
||||
await dragTabIntoExplorer(page, `agent_${dockAgentId}`);
|
||||
await expect(agentTab(page, "dock", dockAgentId)).toBeVisible();
|
||||
// Click the tab's leading edge; its close button overlays the trailing edge on hover.
|
||||
await agentTab(page, "main", mainAgentId).click({ position: { x: 12, y: 13 } });
|
||||
await expect(composerInput(page, "dock")).toBeVisible();
|
||||
}
|
||||
|
||||
async function focusComposer(page: Page, which: Pane) {
|
||||
await composerInput(page, which).click();
|
||||
}
|
||||
|
||||
/** Leaves the composer the way a click on the agent's timeline does. */
|
||||
async function blurComposer(page: Page, which: Pane) {
|
||||
await composerInput(page, which).blur();
|
||||
}
|
||||
|
||||
async function openSettings(page: Page) {
|
||||
await page.getByTestId("sidebar-settings").filter({ visible: true }).first().click();
|
||||
await expect(page).toHaveURL(/\/settings/);
|
||||
}
|
||||
|
||||
async function agentStatus(workspace: SeededWorkspace, agentId: string): Promise<string | null> {
|
||||
const fetched = await workspace.client.fetchAgent({ agentId });
|
||||
return fetched?.agent.status ?? null;
|
||||
}
|
||||
|
||||
async function expectAgentInterrupted(workspace: SeededWorkspace, agentId: string) {
|
||||
await expect.poll(() => agentStatus(workspace, agentId), { timeout: 15_000 }).toBe("idle");
|
||||
}
|
||||
|
||||
async function expectAgentRunning(workspace: SeededWorkspace, agentId: string) {
|
||||
expect(await agentStatus(workspace, agentId)).toBe("running");
|
||||
}
|
||||
|
||||
test("Escape interrupts the agent whose composer had focus last, not the Explorer dock's", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
const workspace = await seedWorkspace({ repoPrefix: "composer-escape-dock-" });
|
||||
try {
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
const mainAgentId = await startRunningAgent(page, workspace, "main agent");
|
||||
// The dock's composer mounts after the main pane's.
|
||||
const dockAgentId = await startRunningAgent(page, workspace, "dock agent");
|
||||
await dockAgentBesideMain(page, dockAgentId, mainAgentId);
|
||||
|
||||
await test.step("Escape after the main composer blurs interrupts only the main agent", async () => {
|
||||
await focusComposer(page, "main");
|
||||
await blurComposer(page, "main");
|
||||
await page.keyboard.press("Escape");
|
||||
await expectAgentInterrupted(workspace, mainAgentId);
|
||||
await expectAgentRunning(workspace, dockAgentId);
|
||||
});
|
||||
|
||||
await test.step("Escape in the dock's composer interrupts the dock agent", async () => {
|
||||
await focusComposer(page, "dock");
|
||||
await page.keyboard.press("Escape");
|
||||
await expectAgentInterrupted(workspace, dockAgentId);
|
||||
});
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("Escape on desktop Settings closes it and leaves the agent running", async ({ page }) => {
|
||||
test.setTimeout(180_000);
|
||||
const workspace = await seedWorkspace({ repoPrefix: "composer-escape-settings-" });
|
||||
try {
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
const agentId = await startRunningAgent(page, workspace, "running agent");
|
||||
await focusComposer(page, "main");
|
||||
await openSettings(page);
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
await expect(page).toHaveURL(new RegExp(`/workspace/${workspace.workspaceId}`));
|
||||
await expectAgentRunning(workspace, agentId);
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
@@ -248,10 +248,10 @@ async function readSettledFrameBorder(page: Page): Promise<string> {
|
||||
});
|
||||
}
|
||||
|
||||
// `borderAccent` at rest, `borderFocus` while focused: greys in both themes, never the accent.
|
||||
// `borderAccent` at rest, `surface4` while focused: greys in both themes, never the accent.
|
||||
const FRAME_BORDERS = {
|
||||
dark: { rest: "rgb(47, 53, 52)", focus: "rgb(66, 70, 69)" },
|
||||
light: { rest: "rgb(236, 236, 241)", focus: "rgb(208, 208, 213)" },
|
||||
dark: { rest: "rgb(47, 53, 52)", focus: "rgb(89, 91, 91)" },
|
||||
light: { rest: "rgb(236, 236, 241)", focus: "rgb(212, 212, 216)" },
|
||||
} as const;
|
||||
|
||||
for (const colorScheme of ["dark", "light"] as const) {
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
expectTabTitleFits,
|
||||
} from "../support/helpers/launcher";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import {
|
||||
ensureExplorerSidebar,
|
||||
openFilesPanel,
|
||||
@@ -437,12 +436,13 @@ test("retains populated Explorer chat and terminal attachments through appearanc
|
||||
const attaches: string[] = [];
|
||||
page.on("websocket", (socket) =>
|
||||
socket.on("framesent", (frame) => {
|
||||
const parsed = parseWsJsonFrame<{
|
||||
message?: { type?: unknown; terminalId?: string };
|
||||
}>(frame.payload);
|
||||
const message = parsed?.message;
|
||||
if (message?.type === "subscribe_terminal_request" && typeof message.terminalId === "string")
|
||||
attaches.push(message.terminalId);
|
||||
if (typeof frame.payload !== "string") return;
|
||||
try {
|
||||
const message = JSON.parse(frame.payload).message;
|
||||
if (message?.type === "subscribe_terminal_request") attaches.push(message.terminalId);
|
||||
} catch {
|
||||
/* Binary terminal traffic is not a JSON request. */
|
||||
}
|
||||
}),
|
||||
);
|
||||
try {
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
import { openChangesPanel } from "../support/helpers/workspace-tabs";
|
||||
import { gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { daemonWsRoutePattern, getE2EDaemonPort } from "../support/helpers/daemon-port";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
|
||||
|
||||
let workspace: SeededWorkspace;
|
||||
@@ -20,26 +19,28 @@ async function failNextDeleteRequest(page: Page): Promise<void> {
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (browserSocket) => {
|
||||
const serverSocket = browserSocket.connectToServer();
|
||||
browserSocket.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{
|
||||
message?: { type?: string; cwd?: string; path?: string; requestId?: string };
|
||||
}>(message);
|
||||
if (envelope?.message?.type === "fs.entry.delete.request") {
|
||||
browserSocket.send(
|
||||
JSON.stringify({
|
||||
type: "session",
|
||||
message: {
|
||||
type: "fs.entry.delete.response",
|
||||
payload: {
|
||||
cwd: envelope.message.cwd,
|
||||
path: envelope.message.path,
|
||||
success: false,
|
||||
error: "Injected delete failure",
|
||||
requestId: envelope.message.requestId,
|
||||
if (typeof message === "string") {
|
||||
const envelope = JSON.parse(message) as {
|
||||
message?: { type?: string; cwd?: string; path?: string; requestId?: string };
|
||||
};
|
||||
if (envelope.message?.type === "fs.entry.delete.request") {
|
||||
browserSocket.send(
|
||||
JSON.stringify({
|
||||
type: "session",
|
||||
message: {
|
||||
type: "fs.entry.delete.response",
|
||||
payload: {
|
||||
cwd: envelope.message.cwd,
|
||||
path: envelope.message.path,
|
||||
success: false,
|
||||
error: "Injected delete failure",
|
||||
requestId: envelope.message.requestId,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
serverSocket.send(message);
|
||||
});
|
||||
@@ -52,14 +53,18 @@ async function hideContextActionCapabilities(page: Page): Promise<void> {
|
||||
const serverSocket = browserSocket.connectToServer();
|
||||
browserSocket.onMessage((message) => serverSocket.send(message));
|
||||
serverSocket.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{
|
||||
if (typeof message !== "string") {
|
||||
browserSocket.send(message);
|
||||
return;
|
||||
}
|
||||
const envelope = JSON.parse(message) as {
|
||||
message?: {
|
||||
type?: string;
|
||||
payload?: { status?: string; features?: Record<string, unknown> };
|
||||
};
|
||||
}>(message);
|
||||
};
|
||||
if (
|
||||
envelope?.message?.type === "status" &&
|
||||
envelope.message?.type === "status" &&
|
||||
envelope.message.payload?.status === "server_info"
|
||||
) {
|
||||
envelope.message.payload.features = {
|
||||
@@ -68,10 +73,8 @@ async function hideContextActionCapabilities(page: Page): Promise<void> {
|
||||
fsEntryDuplicate: false,
|
||||
checkoutDiscardChanges: false,
|
||||
};
|
||||
browserSocket.send(JSON.stringify(envelope));
|
||||
return;
|
||||
}
|
||||
browserSocket.send(message);
|
||||
browserSocket.send(JSON.stringify(envelope));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -85,15 +88,17 @@ async function disconnectNextContextAction(page: Page): Promise<{ wait: () => Pr
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (browserSocket) => {
|
||||
const serverSocket = browserSocket.connectToServer();
|
||||
browserSocket.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{ message?: { type?: string } }>(message);
|
||||
const type = envelope?.message?.type;
|
||||
if (type?.startsWith("fs.entry.") || type === "checkout.discard_changes.request") {
|
||||
resolveRequest?.();
|
||||
void browserSocket.close({
|
||||
code: 1008,
|
||||
reason: "Context action connection failed",
|
||||
});
|
||||
return;
|
||||
if (typeof message === "string") {
|
||||
const envelope = JSON.parse(message) as { message?: { type?: string } };
|
||||
const type = envelope.message?.type;
|
||||
if (type?.startsWith("fs.entry.") || type === "checkout.discard_changes.request") {
|
||||
resolveRequest?.();
|
||||
void browserSocket.close({
|
||||
code: 1008,
|
||||
reason: "Context action connection failed",
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
serverSocket.send(message);
|
||||
});
|
||||
@@ -125,7 +130,7 @@ test("creates, renames, copies, and deletes entries through the file explorer",
|
||||
|
||||
await page.getByTestId("files-new-folder").click();
|
||||
await expect(nameInput).toBeVisible();
|
||||
const draftRow = page.getByTestId("file-explorer-draft-row");
|
||||
const draftRow = nameInput.locator("xpath=..");
|
||||
const placeholderColor = await nameInput.evaluate(
|
||||
(input) => getComputedStyle(input, "::placeholder").color,
|
||||
);
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from "../support/helpers/file-explorer";
|
||||
import { gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
|
||||
let workspace: SeededWorkspace;
|
||||
|
||||
@@ -98,15 +97,9 @@ function recordDirectoryListings(page: Page): string[] {
|
||||
const listed: string[] = [];
|
||||
page.on("websocket", (socket) => {
|
||||
socket.on("framesent", ({ payload }) => {
|
||||
const parsed = parseWsJsonFrame<{
|
||||
message?: { type?: unknown; mode?: unknown; path?: string };
|
||||
}>(payload);
|
||||
const message = parsed?.message;
|
||||
if (
|
||||
message?.type === "file_explorer_request" &&
|
||||
message.mode === "list" &&
|
||||
typeof message.path === "string"
|
||||
) {
|
||||
if (typeof payload !== "string") return;
|
||||
const { message } = JSON.parse(payload);
|
||||
if (message?.type === "file_explorer_request" && message.mode === "list") {
|
||||
listed.push(message.path);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -133,67 +133,3 @@ test("links in chat and file tabs offer file actions and reveal the file in File
|
||||
await agent.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
const UNIFIED_LINKS_REPLY = [
|
||||
"Open [general settings](paseo://settings/general),",
|
||||
"[editor link](vscode://file/tmp/example.ts),",
|
||||
"[blocked pairing](paseo://pair#offer=secret),",
|
||||
"or [blocked script](javascript:alert(1)).",
|
||||
].join(" ");
|
||||
|
||||
test("chat links classify internal, custom-scheme, and blocked URLs on web", async ({
|
||||
context,
|
||||
page,
|
||||
}, testInfo) => {
|
||||
testInfo.setTimeout(180_000);
|
||||
const agent = await seedMockAgentWorkspace({
|
||||
repoPrefix: "unified-links-web-",
|
||||
title: "Unified chat links",
|
||||
initialPrompt: "Show mixed protocol links",
|
||||
featureValues: { mockAssistantResponse: UNIFIED_LINKS_REPLY },
|
||||
});
|
||||
try {
|
||||
await openAgentRoute(page, agent);
|
||||
|
||||
const internalLink = replyLink(page, "general settings");
|
||||
await expect(internalLink).toBeVisible();
|
||||
await expect(internalLink).toHaveAttribute("href", "/settings/general");
|
||||
|
||||
// Right-click menu labels match the unified link classification.
|
||||
await internalLink.click({ button: "right" });
|
||||
await expectMenuItems(page, ["Open in Paseo", "Copy link"]);
|
||||
await dismissMenu(page);
|
||||
|
||||
const editorLink = replyLink(page, "editor link");
|
||||
await expect(editorLink).toBeVisible();
|
||||
await expect(editorLink).toHaveAttribute("href", "vscode://file/tmp/example.ts");
|
||||
await editorLink.click({ button: "right" });
|
||||
await expectMenuItems(page, ["Open in external app", "Copy link"]);
|
||||
await dismissMenu(page);
|
||||
|
||||
// Blocked and unroutable links render as inert text, not anchors.
|
||||
const assistantMessage = page.getByTestId("assistant-message");
|
||||
await expect(assistantMessage).toContainText("blocked pairing");
|
||||
await expect(assistantMessage).toContainText("blocked script");
|
||||
await expect(replyLink(page, "blocked pairing")).toHaveCount(0);
|
||||
await expect(replyLink(page, "blocked script")).toHaveCount(0);
|
||||
|
||||
// Middle-clicking an internal paseo:// link opens its SPA route in a new browser tab.
|
||||
const popupPromise = context.waitForEvent("page");
|
||||
await internalLink.click({ button: "middle" });
|
||||
const popup = await popupPromise;
|
||||
try {
|
||||
await expect(popup).toHaveURL(/\/settings\/general$/);
|
||||
} finally {
|
||||
await popup.close();
|
||||
}
|
||||
|
||||
// Left-clicking an internal paseo:// link navigates inside Paseo without opening a new tab.
|
||||
const pagesBeforeClick = context.pages().length;
|
||||
await internalLink.click();
|
||||
await expect(page).toHaveURL(/\/settings\/general$/);
|
||||
expect(context.pages().length).toBe(pagesBeforeClick);
|
||||
} finally {
|
||||
await agent.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -173,33 +173,28 @@ test("customizes a host badge and preserves its appearance after reload", async
|
||||
});
|
||||
|
||||
base(
|
||||
"activates Add host from the sidebar host picker via Arrow+Enter and click",
|
||||
"activates Add host from the sidebar host picker via focus+Enter and Arrow+Enter",
|
||||
async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
const trigger = page.getByTestId("sidebar-hosts-trigger");
|
||||
await expect(trigger).toBeVisible();
|
||||
|
||||
// ArrowDown + Enter on Add host must open the Add connection dialog rather than selecting the active host.
|
||||
// Focus + Enter on Add host must open the Add connection dialog rather than selecting the active host.
|
||||
const addConnectionDialog = page.getByRole("dialog").filter({ hasText: "Add connection" });
|
||||
await trigger.click();
|
||||
const listbox = page.getByTestId("combobox-desktop-container");
|
||||
const addHostOption = page.getByRole("option", { name: "Add host", exact: true });
|
||||
await expect(addHostOption).toBeVisible();
|
||||
await expect(addHostOption).toHaveAttribute("tabindex", "-1");
|
||||
await page.keyboard.press("ArrowDown");
|
||||
await expect(listbox).toHaveAttribute(
|
||||
"aria-activedescendant",
|
||||
(await addHostOption.getAttribute("id"))!,
|
||||
);
|
||||
const addHostButton = page.getByRole("button", { name: "Add host", exact: true });
|
||||
await expect(addHostButton).toBeVisible();
|
||||
await addHostButton.focus();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(addConnectionDialog).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(addConnectionDialog).toBeHidden();
|
||||
|
||||
// Clicking the Add host option also opens Add connection.
|
||||
// ArrowDown + Enter must also reach Add host from the host list.
|
||||
await trigger.click();
|
||||
await expect(addHostOption).toBeVisible();
|
||||
await addHostOption.click();
|
||||
await expect(addHostButton).toBeVisible();
|
||||
await page.keyboard.press("ArrowDown");
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(addConnectionDialog).toBeVisible();
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { expect, type Locator, type Page } from "@playwright/test";
|
||||
import { test } from "../support/fixtures";
|
||||
import { openSettings } from "../support/helpers/app";
|
||||
import { gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { openSettingsSection } from "../support/helpers/settings";
|
||||
import { waitForWorkspaceTabsVisible } from "../support/helpers/workspace-tabs";
|
||||
|
||||
const HEADER_ICON_BUTTONS = ["workspace-header-menu-trigger", "workspace-explorer-toggle"];
|
||||
@@ -16,18 +14,12 @@ function matchesFocusVisible(target: Locator): Promise<boolean> {
|
||||
return target.evaluate((el) => el.matches(":focus-visible"));
|
||||
}
|
||||
|
||||
async function tabUntilFocused(page: Page, target: Locator): Promise<void> {
|
||||
// Start from the preceding tabbable sibling so Tab naturally lands on target,
|
||||
// or step back and Tab forward onto target.
|
||||
await target.focus();
|
||||
await page.keyboard.press("Shift+Tab");
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(target).toBeFocused();
|
||||
}
|
||||
|
||||
async function expectTabFocusRing(page: Page, testId: string): Promise<void> {
|
||||
async function expectKeyboardFocusRing(page: Page, testId: string): Promise<void> {
|
||||
const button = visible(page, testId);
|
||||
await tabUntilFocused(page, button);
|
||||
// Chromium matches :focus-visible on a programmatic focus that follows keyboard input.
|
||||
await page.keyboard.press("Shift");
|
||||
await button.focus();
|
||||
await expect(button).toBeFocused();
|
||||
expect(await matchesFocusVisible(button)).toBe(true);
|
||||
await expect(button).toHaveCSS("outline-style", "solid");
|
||||
await expect(button).toHaveCSS("outline-width", "2px");
|
||||
@@ -38,16 +30,6 @@ async function expectTabFocusRing(page: Page, testId: string): Promise<void> {
|
||||
async function expectNoPointerFocusRing(page: Page, testId: string): Promise<void> {
|
||||
const button = visible(page, testId);
|
||||
await button.blur();
|
||||
if (testId === "workspace-header-menu-trigger") {
|
||||
await button.click();
|
||||
const backdrop = page.getByTestId("workspace-header-menu-backdrop");
|
||||
await expect(backdrop).toBeVisible();
|
||||
await backdrop.click();
|
||||
await expect(backdrop).toHaveCount(0);
|
||||
expect(await matchesFocusVisible(button)).toBe(false);
|
||||
await expect(button).toHaveCSS("outline-style", "none");
|
||||
return;
|
||||
}
|
||||
// Toggle twice so the layout ends where it started.
|
||||
await button.click();
|
||||
await button.click();
|
||||
@@ -57,44 +39,16 @@ async function expectNoPointerFocusRing(page: Page, testId: string): Promise<voi
|
||||
}
|
||||
|
||||
test.describe("Icon button focus ring", () => {
|
||||
test("header icon buttons show the focus ring for keyboard :focus-visible only", async ({
|
||||
page,
|
||||
}) => {
|
||||
test("header icon buttons show the focus ring for keyboard focus only", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1440, height: 900 });
|
||||
const workspace = await seedWorkspace({ repoPrefix: "icon-button-focus-" });
|
||||
try {
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await waitForWorkspaceTabsVisible(page);
|
||||
for (const testId of HEADER_ICON_BUTTONS) {
|
||||
await expectTabFocusRing(page, testId);
|
||||
await expectNoPointerFocusRing(page, testId);
|
||||
await expectKeyboardFocusRing(page, testId);
|
||||
}
|
||||
|
||||
// Verify the New tab panel edit-terminal-profiles pencil button (#9758) draws a :focus-visible ring.
|
||||
const editProfilesButton = visible(page, "workspace-new-tab-edit-terminal-profiles");
|
||||
await expect(editProfilesButton).toBeVisible();
|
||||
await tabUntilFocused(page, editProfilesButton);
|
||||
expect(await matchesFocusVisible(editProfilesButton)).toBe(true);
|
||||
await expect(editProfilesButton).toHaveCSS("outline-style", "solid");
|
||||
await expect(editProfilesButton).toHaveCSS("outline-width", "2px");
|
||||
await editProfilesButton.blur();
|
||||
await expect(editProfilesButton).toHaveCSS("outline-style", "none");
|
||||
|
||||
await openSettings(page);
|
||||
await openSettingsSection(page, "chat");
|
||||
const outlineSwitch = page.getByRole("switch", { name: "Chat outline" });
|
||||
await expect(outlineSwitch).toBeVisible();
|
||||
await tabUntilFocused(page, outlineSwitch);
|
||||
expect(await matchesFocusVisible(outlineSwitch)).toBe(true);
|
||||
await expect(outlineSwitch).toHaveCSS("outline-style", "none");
|
||||
const switchTrack = outlineSwitch.locator('[data-switch-track="true"]');
|
||||
await expect(switchTrack).toHaveCSS("outline-style", "solid");
|
||||
await expect(switchTrack).toHaveCSS("outline-width", "2px");
|
||||
await outlineSwitch.blur();
|
||||
await outlineSwitch.click();
|
||||
await outlineSwitch.click();
|
||||
expect(await matchesFocusVisible(outlineSwitch)).toBe(false);
|
||||
await expect(switchTrack).toHaveCSS("outline-style", "none");
|
||||
await expectNoPointerFocusRing(page, "workspace-explorer-toggle");
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
import type { Locator, Page } from "@playwright/test";
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { closeCommandCenter, openCommandCenter } from "../support/helpers/command-center";
|
||||
|
||||
// Where Settings → Keyboard shortcuts persists a rebound shortcut.
|
||||
const OVERRIDE_STORAGE_KEY = "@paseo:keyboard-shortcut-overrides";
|
||||
const COMMAND_CENTER_BINDINGS = [
|
||||
"command-center-toggle-cmd-k-mac",
|
||||
"command-center-toggle-ctrl-k-non-mac",
|
||||
] as const;
|
||||
const COMMAND_CENTER_BINDING = "command-center-toggle-ctrl-k-non-mac";
|
||||
|
||||
async function rebindCommandCenter(page: Page, combo: string): Promise<void> {
|
||||
await page.addInitScript(
|
||||
([key, bindingIds, value]) => {
|
||||
const overrides = Object.fromEntries(bindingIds.map((id) => [id, value]));
|
||||
window.localStorage.setItem(key, JSON.stringify(overrides));
|
||||
([key, bindingId, value]) => {
|
||||
window.localStorage.setItem(key, JSON.stringify({ [bindingId]: value }));
|
||||
},
|
||||
[OVERRIDE_STORAGE_KEY, COMMAND_CENTER_BINDINGS, combo] as const,
|
||||
[OVERRIDE_STORAGE_KEY, COMMAND_CENTER_BINDING, combo] as const,
|
||||
);
|
||||
await gotoAppShell(page);
|
||||
await expect(page.getByTestId("sidebar-search")).toBeVisible({ timeout: 30_000 });
|
||||
@@ -26,18 +21,6 @@ async function expectCommandCenterOpen(page: Page): Promise<void> {
|
||||
await expect(page.getByTestId("command-center-panel")).toBeVisible({ timeout: 10_000 });
|
||||
}
|
||||
|
||||
async function expectCommandCenterSearchAcceptsKey(
|
||||
page: Page,
|
||||
panel: Locator,
|
||||
key: string,
|
||||
): Promise<void> {
|
||||
const searchInput = panel.getByTestId("command-center-input");
|
||||
await expect(searchInput).toBeFocused({ timeout: 10_000 });
|
||||
await page.keyboard.press(key);
|
||||
await expect(searchInput).toHaveValue(key);
|
||||
await expectCommandCenterOpen(page);
|
||||
}
|
||||
|
||||
test.describe("Multi-step shortcut", () => {
|
||||
test("completes a chord whose second step is a bare key", async ({ page }) => {
|
||||
await rebindCommandCenter(page, "Ctrl+K J");
|
||||
@@ -58,17 +41,4 @@ test.describe("Multi-step shortcut", () => {
|
||||
|
||||
await expectCommandCenterOpen(page);
|
||||
});
|
||||
|
||||
test("typing a rebound printable shortcut inside Command Center enters text instead of toggling it closed", async ({
|
||||
page,
|
||||
}) => {
|
||||
await rebindCommandCenter(page, "J");
|
||||
|
||||
const commandCenter = await openCommandCenter(page);
|
||||
await expectCommandCenterSearchAcceptsKey(page, commandCenter, "j");
|
||||
|
||||
await closeCommandCenter(page);
|
||||
await page.keyboard.press("j");
|
||||
await expectCommandCenterOpen(page);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
type TerminalProfile,
|
||||
} from "../support/helpers/new-workspace-launch";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { runCommandCenterItem } from "../support/helpers/command-center";
|
||||
import { waitForSidebarHydration } from "../support/helpers/workspace-ui";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
|
||||
@@ -193,20 +192,6 @@ test.describe("Tab creation", () => {
|
||||
await expect(agent).toBeFocused();
|
||||
});
|
||||
|
||||
test("the Command Center's New terminal row replaces a focused New tab", async ({ page }) => {
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await openNewTabMenuWithShortcut(page);
|
||||
const tabs = (await getTabTestIds(page)).length;
|
||||
|
||||
await runCommandCenterItem(page, "New terminal");
|
||||
|
||||
await expect(
|
||||
page.getByTestId("workspace-new-tab-panel").filter({ visible: true }),
|
||||
).toBeHidden();
|
||||
await expectTerminalSurfaceVisible(page);
|
||||
await expect.poll(async () => (await getTabTestIds(page)).length).toBe(tabs);
|
||||
});
|
||||
|
||||
test("the Agent menu creates a draft and shows its composer within the visual budget", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
import { expect } from "@playwright/test";
|
||||
import { test } from "../support/fixtures";
|
||||
import {
|
||||
expectCompletedDiagram,
|
||||
requestDiagram,
|
||||
waitForDiagramTurnToComplete,
|
||||
} from "../support/helpers/diagram";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
|
||||
const MERMAID_DIAGRAM = [
|
||||
"```mermaid",
|
||||
"flowchart LR",
|
||||
" Start --> Middle",
|
||||
" Middle --> Ship",
|
||||
"```",
|
||||
].join("\n");
|
||||
|
||||
test("keeps the diagram source when the Mermaid runtime fails to load, then renders after it recovers", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(120_000);
|
||||
let runtimeChunkReachable = false;
|
||||
let blockedRequests = 0;
|
||||
await page.route(/html\.gen/, async (route) => {
|
||||
if (runtimeChunkReachable) {
|
||||
await route.continue();
|
||||
return;
|
||||
}
|
||||
blockedRequests += 1;
|
||||
await route.abort("connectionrefused");
|
||||
});
|
||||
|
||||
const agent = await seedMockAgentWorkspace({
|
||||
repoPrefix: "mermaid-runtime-load-",
|
||||
title: "Mermaid runtime load",
|
||||
featureValues: {
|
||||
mockStreamingAssistantResponse: MERMAID_DIAGRAM,
|
||||
mockStreamingAssistantIntervalMs: 10,
|
||||
},
|
||||
});
|
||||
try {
|
||||
await test.step("A failed runtime load leaves the diagram source on screen", async () => {
|
||||
await openAgentRoute(page, agent);
|
||||
await requestDiagram(agent);
|
||||
await waitForDiagramTurnToComplete(agent);
|
||||
await expect(page.getByText("Middle --> Ship")).toBeVisible({ timeout: 30_000 });
|
||||
expect(blockedRequests).toBeGreaterThan(0);
|
||||
await expect(page.getByRole("img", { name: "Diagram" }).locator("iframe")).toHaveCount(0);
|
||||
});
|
||||
|
||||
await test.step("Once the chunk is reachable, the next diagram loads it and renders", async () => {
|
||||
runtimeChunkReachable = true;
|
||||
await requestDiagram(agent);
|
||||
await waitForDiagramTurnToComplete(agent);
|
||||
await expectCompletedDiagram(page, ["Start", "Ship"]);
|
||||
});
|
||||
} finally {
|
||||
await agent.cleanup();
|
||||
}
|
||||
});
|
||||
@@ -86,7 +86,7 @@ async function selectMode(page: Page, label: string): Promise<void> {
|
||||
await expect(popup).toBeVisible({ timeout: 10_000 });
|
||||
await expectNoTruncation(popup);
|
||||
|
||||
const searchInput = page.getByRole("combobox", { name: /search mode/i });
|
||||
const searchInput = page.getByRole("textbox", { name: /search mode/i });
|
||||
await expect(searchInput).toBeVisible({ timeout: 10_000 });
|
||||
await searchInput.fill(label);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { expect, test, type Page } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import {
|
||||
openNewWorkspaceComposer,
|
||||
selectWorkspaceIsolation,
|
||||
@@ -34,7 +33,12 @@ function parseEnvelope(message: WebSocketMessage): {
|
||||
type?: unknown;
|
||||
message?: Record<string, unknown>;
|
||||
} | null {
|
||||
return parseWsJsonFrame<{ type?: unknown; message?: Record<string, unknown> }>(message);
|
||||
const raw = typeof message === "string" ? message : message.toString("utf8");
|
||||
try {
|
||||
return JSON.parse(raw) as { type?: unknown; message?: Record<string, unknown> };
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function sessionMessage(message: WebSocketMessage): Record<string, unknown> | null {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { runCommandCenterItem } from "../support/helpers/command-center";
|
||||
import {
|
||||
chooseProjectWithKeyboard,
|
||||
connectNewWorkspaceDaemonClient,
|
||||
@@ -162,23 +161,6 @@ test.describe("New workspace entry points", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("the Command Center's New workspace row opens the project picker on the New Workspace screen", async ({
|
||||
page,
|
||||
}) => {
|
||||
const seeded: SeededWorkspace = await seedWorkspace({ repoPrefix: "entry-command-center-" });
|
||||
|
||||
try {
|
||||
await gotoAppShell(page);
|
||||
await waitForSidebarHydration(page);
|
||||
await openGlobalNewWorkspaceComposer(page);
|
||||
|
||||
await runCommandCenterItem(page, "New workspace");
|
||||
await expect(page.getByPlaceholder("Search projects")).toBeVisible();
|
||||
} finally {
|
||||
await seeded.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("Ctrl+N opens the project picker with search focused", async ({ page }) => {
|
||||
const seeded: SeededWorkspace = await seedWorkspace({ repoPrefix: "entry-shortcut-" });
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { expect, test, type Page } from "../support/fixtures";
|
||||
import type { FormPreferences } from "@/create-agent-preferences/preferences";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import { openAgentRoute } from "../support/helpers/mock-agent";
|
||||
import {
|
||||
openGlobalNewWorkspaceComposer,
|
||||
@@ -14,7 +13,12 @@ const CREATE_AGENT_PREFERENCES_KEY = "@paseo:create-agent-preferences";
|
||||
type WebSocketMessage = string | Buffer;
|
||||
|
||||
function parseWebSocketJson(message: WebSocketMessage): unknown {
|
||||
return parseWsJsonFrame(message);
|
||||
const rawMessage = typeof message === "string" ? message : message.toString("utf8");
|
||||
try {
|
||||
return JSON.parse(rawMessage);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getSessionMessage(message: WebSocketMessage): Record<string, unknown> | null {
|
||||
@@ -97,8 +101,7 @@ test.describe("New Workspace mode cycle safety", () => {
|
||||
// Regression guard for the P1 safety bug: cycling the execution mode with Shift+Tab in
|
||||
// the New Workspace composer must never reach a backgrounded, still-mounted agent's mode
|
||||
// control and silently change that (possibly running) agent's mode — e.g. into a
|
||||
// permissive/bypass mode. The New Workspace screen's `paseo/new-workspace` action scope
|
||||
// must shadow a backgrounded composer's handler.
|
||||
// permissive/bypass mode. See use-keyboard-action-handler.ts.
|
||||
test("Shift+Tab in New Workspace never changes a backgrounded agent's mode", async ({ page }) => {
|
||||
const seeded = await seedWorkspace({ repoPrefix: "mode-cycle-safety-" });
|
||||
await seedCodexDefaultPreferences(page);
|
||||
|
||||
@@ -38,7 +38,6 @@ import {
|
||||
submitNewWorkspacePrompt,
|
||||
} from "../support/helpers/new-workspace";
|
||||
import {
|
||||
checkoutBranch,
|
||||
commitLocalOnly,
|
||||
createTempGitRepo,
|
||||
readRepoRef,
|
||||
@@ -817,34 +816,6 @@ test.describe("New workspace flow", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("branches off the repository default when the checkout is on a feature branch", async ({
|
||||
page,
|
||||
}) => {
|
||||
const tempRepo = await createTempGitRepo("ref-default-feature-", {
|
||||
withRemote: true,
|
||||
branches: ["main", "feature/unrelated"],
|
||||
});
|
||||
|
||||
try {
|
||||
const originHead = readRepoRef(tempRepo.path, "refs/remotes/origin/main");
|
||||
checkoutBranch(tempRepo.path, "feature/unrelated");
|
||||
const featureHead = commitLocalOnly(tempRepo.path, "feature work");
|
||||
|
||||
const openedProject = await openWorktreeComposerForRepo(page, tempRepo.path);
|
||||
await expectPickerSelected(page, "main");
|
||||
const created = await createWorktreeAndRead(page, openedProject);
|
||||
|
||||
expect(created.branchInfo.hasAncestor(originHead)).toBe(true);
|
||||
expect(created.branchInfo.hasAncestor(featureHead)).toBe(false);
|
||||
expect(await readWorktreeBaseMetadata(created.workspaceDirectory)).toEqual({
|
||||
baseRefName: "main",
|
||||
baseRef: "refs/remotes/origin/main",
|
||||
});
|
||||
} finally {
|
||||
await tempRepo.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("branches off the local ref when the local row is chosen explicitly", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
@@ -893,7 +864,7 @@ test.describe("New workspace flow", () => {
|
||||
// tracks gets its own row rather than silently sharing origin's. Two rows reading
|
||||
// "main" is the ambiguity this whole change exists to remove.
|
||||
await expectStartingRefRows(page, [
|
||||
"main (upstream), default branch",
|
||||
"main (upstream), upstream branch",
|
||||
"main, origin branch",
|
||||
]);
|
||||
await expectPickerSelected(page, "main (upstream)");
|
||||
|
||||
@@ -50,7 +50,6 @@ import { createTempDirectory, createTempGitRepo } from "../support/helpers/works
|
||||
const MIDNIGHT_MUTED_FOREGROUND = "rgb(154, 157, 176)";
|
||||
|
||||
test("a new user is walked through setup once", async ({ page }, testInfo) => {
|
||||
test.setTimeout(180_000);
|
||||
const host = await startSetupHost("fresh");
|
||||
const repo = await createTempGitRepo("onboarding-folder-");
|
||||
|
||||
@@ -90,24 +89,6 @@ test("a new user is walked through setup once", async ({ page }, testInfo) => {
|
||||
await expectSetupStep(page, "Your providers");
|
||||
});
|
||||
|
||||
await test.step("a removed provider can be added back with Remove enabled", async () => {
|
||||
const detail = setupSheet(page, "provider-settings-sheet");
|
||||
const remove = detail.getByRole("button", { name: "Remove", exact: true });
|
||||
|
||||
await openAddProvider(page);
|
||||
await installAcpCatalogProvider(page, "Junie");
|
||||
page.once("dialog", (dialog) => void dialog.accept());
|
||||
await remove.click();
|
||||
await expect(detail).toHaveCount(0);
|
||||
|
||||
await openAddProvider(page);
|
||||
await installAcpCatalogProvider(page, "Junie");
|
||||
await expect(remove).toHaveText("Remove");
|
||||
await expect(remove).toBeEnabled();
|
||||
await detail.getByRole("button", { name: "Back to providers", exact: true }).click();
|
||||
await expect(detail).toHaveCount(0);
|
||||
});
|
||||
|
||||
await test.step("with no agent history, Add project opens the regular flow and the folder shows as added", async () => {
|
||||
await continueSetup(page);
|
||||
await expectSetupStep(page, "Add your projects");
|
||||
@@ -147,6 +128,33 @@ test("a new user is walked through setup once", async ({ page }, testInfo) => {
|
||||
}
|
||||
});
|
||||
|
||||
test("a provider removed in setup can be added back and removed again", async ({ page }) => {
|
||||
test.setTimeout(180_000);
|
||||
const host = await startSetupHost("re-add");
|
||||
const detail = setupSheet(page, "provider-settings-sheet");
|
||||
const remove = detail.getByTestId("provider-remove");
|
||||
page.on("dialog", (dialog) => void dialog.accept());
|
||||
|
||||
try {
|
||||
await openAppAsNewUser(page, host);
|
||||
await continueSetup(page);
|
||||
await expectSetupStep(page, "Your providers");
|
||||
|
||||
await openAddProvider(page);
|
||||
await installAcpCatalogProvider(page, "Junie");
|
||||
await remove.click();
|
||||
await expect(detail).toHaveCount(0);
|
||||
|
||||
// Adding it back opens the same provider's sheet, which must not still be removing it.
|
||||
await openAddProvider(page);
|
||||
await installAcpCatalogProvider(page, "Junie");
|
||||
await expect(remove).toHaveText("Remove");
|
||||
await expect(remove).toBeEnabled();
|
||||
} finally {
|
||||
await host.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("a new user goes from the loading screen straight into setup", async ({ page }) => {
|
||||
const host = await startSetupHost("first-launch");
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import { buildCreateAgentPreferences, buildSeededHost } from "../support/helpers
|
||||
import { startIsolatedHostDaemon } from "../support/helpers/isolated-host-daemon";
|
||||
import type { MockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import {
|
||||
expectFoldedTurnAtReadingPosition,
|
||||
expectOldestLoadedTurnPartial,
|
||||
@@ -89,13 +88,11 @@ test("loads history across browser reconnection while retaining old-daemon conne
|
||||
const observationSockets = new Set<unknown>();
|
||||
page.on("websocket", (socket) => {
|
||||
socket.on("framesent", ({ payload }) => {
|
||||
const frame = parseWsJsonFrame<{
|
||||
type?: unknown;
|
||||
message?: { type?: unknown; subscribe?: unknown };
|
||||
}>(payload);
|
||||
if (typeof payload !== "string") return;
|
||||
const frame = JSON.parse(payload);
|
||||
if (
|
||||
frame?.type === "session" &&
|
||||
frame.message?.type === "fetch_agents_request" &&
|
||||
frame.type === "session" &&
|
||||
frame.message.type === "fetch_agents_request" &&
|
||||
frame.message.subscribe
|
||||
)
|
||||
observationSockets.add(socket);
|
||||
|
||||
@@ -261,7 +261,7 @@ async function pickCurrentMode(page: Page, embed: ReturnType<Page["getByTestId"]
|
||||
await trigger.click();
|
||||
const popup = page.getByTestId("combobox-desktop-container").last();
|
||||
await expect(popup).toBeVisible({ timeout: 10_000 });
|
||||
await popup.getByRole("option", { name: label, exact: true }).click();
|
||||
await popup.getByRole("button", { name: label, exact: true }).click();
|
||||
await expect(page.getByTestId("combobox-desktop-container")).toHaveCount(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,788 +0,0 @@
|
||||
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import type { Locator, Page } from "@playwright/test";
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { openCommandCenter } from "../support/helpers/command-center";
|
||||
import { buildAgentRoute } from "../support/helpers/mock-agent";
|
||||
import { connectNewWorkspaceDaemonClient } from "../support/helpers/new-workspace";
|
||||
import { approveClientPluginsInUi } from "../support/helpers/plugin-execution-approval";
|
||||
import { pluginRequirements } from "../support/helpers/plugin-fixture";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
|
||||
const PLUGIN_ID = "composer-pill-items-e2e";
|
||||
const WIDE = { width: 1440, height: 900 };
|
||||
const COMPACT = { width: 390, height: 844 };
|
||||
|
||||
function pluginSource(workspaceId: string, agentId: string): string {
|
||||
return `import React from "react";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
import { useWorkspace } from "@getpaseo/plugin/client";
|
||||
import { ComposerPill, ScrollView } from "@getpaseo/plugin/client/ui";
|
||||
|
||||
function InboxScreen({ theme, params }) {
|
||||
return (
|
||||
<View style={{ flex: 1, padding: 24, gap: 8 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>Inbox screen for {params.agentId}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function InboxPopover({ theme, layout, close, openScreen, workspaceId, agentId }) {
|
||||
const workspaceName = useWorkspace(${JSON.stringify(workspaceId)}, (w) => w.name);
|
||||
return (
|
||||
<View style={{ padding: 12, gap: 10 }}>
|
||||
<Text style={{ color: theme.colors.foreground, fontSize: 16 }}>Inbox decisions</Text>
|
||||
<Text style={{ color: theme.colors.foregroundMuted }}>Workspace: {workspaceName}</Text>
|
||||
<Text style={{ color: theme.colors.foregroundMuted }}>
|
||||
Pill IDs: {workspaceId} / {agentId}
|
||||
</Text>
|
||||
<Text style={{ color: theme.colors.foregroundMuted }}>
|
||||
Presentation: {layout.compact ? "compact" : "wide"}
|
||||
</Text>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Open inbox screen"
|
||||
onPress={() => openScreen({ screenId: "inbox", params: { agentId: ${JSON.stringify(agentId)} } })}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Open screen</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Close inbox popover"
|
||||
onPress={close}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Done</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function TallDecisionsPopover({ theme, close }) {
|
||||
return (
|
||||
<View style={{ flex: 1, minHeight: 0 }}>
|
||||
<View
|
||||
testID="tall-popover-header"
|
||||
style={{
|
||||
paddingHorizontal: 14,
|
||||
paddingVertical: 12,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: theme.colors.border,
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground, fontWeight: "600" }}>Open decisions</Text>
|
||||
</View>
|
||||
<ScrollView testID="tall-popover-scroll" style={{ flex: 1 }}>
|
||||
{Array.from({ length: 24 }, (_, index) => (
|
||||
<View
|
||||
key={index}
|
||||
style={{
|
||||
paddingHorizontal: 14,
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: theme.colors.border,
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>{"Decision item " + index}</Text>
|
||||
</View>
|
||||
))}
|
||||
</ScrollView>
|
||||
<View
|
||||
testID="tall-popover-footer"
|
||||
style={{
|
||||
paddingHorizontal: 14,
|
||||
paddingVertical: 12,
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: theme.colors.border,
|
||||
}}
|
||||
>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Submit decisions"
|
||||
onPress={close}
|
||||
style={{
|
||||
paddingVertical: 8,
|
||||
paddingHorizontal: 12,
|
||||
borderRadius: 6,
|
||||
backgroundColor: theme.colors.surface2,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Submit</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function TallDecisionsPill({ openPopover }) {
|
||||
return (
|
||||
<ComposerPill
|
||||
icon="ListChecks"
|
||||
label="All decisions"
|
||||
onPress={() => openPopover(TallDecisionsPopover)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function RevealResultsPopover({ theme, close }) {
|
||||
const [clicks, setClicks] = React.useState(0);
|
||||
const [revealed, setRevealed] = React.useState(false);
|
||||
return (
|
||||
<View style={revealed ? { flex: 1, minHeight: 0 } : { padding: 12, gap: 8 }}>
|
||||
<View
|
||||
testID="reveal-popover-header"
|
||||
style={{
|
||||
paddingHorizontal: revealed ? 14 : 0,
|
||||
paddingVertical: revealed ? 10 : 0,
|
||||
gap: 8,
|
||||
}}
|
||||
>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={"Reveal count: " + clicks}
|
||||
onPress={() => setClicks((count) => count + 1)}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>{"Reveal count: " + clicks}</Text>
|
||||
</Pressable>
|
||||
{revealed ? null : (
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Show results"
|
||||
onPress={() => setRevealed(true)}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Show results</Text>
|
||||
</Pressable>
|
||||
)}
|
||||
</View>
|
||||
{revealed ? (
|
||||
<ScrollView testID="reveal-popover-scroll" style={{ flex: 1 }}>
|
||||
{Array.from({ length: 24 }, (_, index) => (
|
||||
<View
|
||||
key={index}
|
||||
style={{
|
||||
paddingHorizontal: 14,
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: theme.colors.border,
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>{"Result item " + index}</Text>
|
||||
</View>
|
||||
))}
|
||||
</ScrollView>
|
||||
) : null}
|
||||
<View style={{ paddingHorizontal: revealed ? 14 : 0, paddingVertical: revealed ? 10 : 0 }}>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Close reveal popover"
|
||||
onPress={close}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Close results</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function RevealResultsPill({ openPopover }) {
|
||||
return (
|
||||
<ComposerPill
|
||||
icon="Search"
|
||||
label="Lazy results"
|
||||
onPress={() => openPopover(RevealResultsPopover)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function FixedScrollPopover({ theme, close }) {
|
||||
const [expanded, setExpanded] = React.useState(false);
|
||||
const [height, setHeight] = React.useState(600);
|
||||
const [extraFooterAction, setExtraFooterAction] = React.useState(false);
|
||||
const [filtered, setFiltered] = React.useState(false);
|
||||
return (
|
||||
<View style={expanded ? { flex: 1, minHeight: 0 } : undefined}>
|
||||
<View testID="fixed-scroll-header" style={{ paddingHorizontal: 14, paddingVertical: 10 }}>
|
||||
<Text style={{ color: theme.colors.foreground, fontWeight: "600" }}>Fixed viewport</Text>
|
||||
<Pressable accessibilityRole="button" onPress={() => setHeight(120)}>
|
||||
<Text style={{ color: theme.colors.foreground }}>Shrink fixed viewport</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
<ScrollView testID="fixed-scroll-body" style={expanded ? { flex: 1 } : { height }}>
|
||||
{Array.from({ length: filtered ? 1 : 16 }, (_, index) => (
|
||||
<View key={index} style={{ height: 40, justifyContent: "center", paddingHorizontal: 14 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>{"Fixed row " + index}</Text>
|
||||
</View>
|
||||
))}
|
||||
</ScrollView>
|
||||
<View
|
||||
testID="fixed-scroll-footer"
|
||||
style={{ gap: 8, paddingHorizontal: 14, paddingVertical: 10 }}
|
||||
>
|
||||
<View style={{ flexDirection: "row", flexWrap: "wrap", gap: 12 }}>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Filter fixed rows"
|
||||
onPress={() => setFiltered((value) => !value)}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Filter rows</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Add footer action"
|
||||
onPress={() => setExtraFooterAction((value) => !value)}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Add footer action</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Expand fixed viewport"
|
||||
onPress={() => setExpanded((value) => !value)}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>
|
||||
{expanded ? "Collapse fixed" : "Expand fixed"}
|
||||
</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Close fixed viewport"
|
||||
onPress={close}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Close fixed</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
{extraFooterAction ? (
|
||||
<View testID="fixed-scroll-extra-action" style={{ height: 48, justifyContent: "center" }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>Secondary footer action</Text>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function FixedScrollPill({ openPopover }) {
|
||||
return (
|
||||
<ComposerPill
|
||||
icon="PanelTop"
|
||||
label="Fixed scroll"
|
||||
onPress={() => openPopover(FixedScrollPopover)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function LivePopover({ theme, close }) {
|
||||
return (
|
||||
<View style={{ padding: 12, gap: 8 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>Live popover content</Text>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Trigger live update"
|
||||
onPress={() => updateLivePopover?.()}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Update</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Close live popover"
|
||||
onPress={close}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Close</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
let updateLivePopover = null;
|
||||
|
||||
function QuietPill({ workspaceId }) {
|
||||
const name = useWorkspace(workspaceId, (w) => w.name);
|
||||
if (name !== "Show quiet pill") return null;
|
||||
return <ComposerPill icon="Sparkles" label="Quiet" onPress={() => {}} />;
|
||||
}
|
||||
|
||||
let finishAction = () => {};
|
||||
let actionAttempts = 0;
|
||||
|
||||
function ActionPill() {
|
||||
const [checks, setChecks] = React.useState(0);
|
||||
return (
|
||||
<ComposerPill
|
||||
icon="Play"
|
||||
label={checks === 0 ? "Run check" : "Checks · " + checks}
|
||||
title="Run check action"
|
||||
onPress={async () => {
|
||||
actionAttempts += 1;
|
||||
if (actionAttempts === 1) throw new Error("Action check failed");
|
||||
await new Promise((resolve) => {
|
||||
finishAction = resolve;
|
||||
});
|
||||
setChecks((n) => n + 1);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function InboxPill({ openPopover }) {
|
||||
return (
|
||||
<ComposerPill
|
||||
icon="Inbox"
|
||||
label="2 decisions"
|
||||
onPress={() => openPopover(InboxPopover)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function contribute(client) {
|
||||
const workspaceId = ${JSON.stringify(workspaceId)};
|
||||
const agentId = ${JSON.stringify(agentId)};
|
||||
client.addScreen({ id: "inbox", title: "Inbox Screen", Component: InboxScreen });
|
||||
const removeQuiet = client.addComposerPillItem({ id: "quiet", title: "Quiet", Component: QuietPill });
|
||||
const removeAction = client.addComposerPillItem({ id: "action", title: "Run check", Component: ActionPill });
|
||||
const removeInbox = client.addComposerPillItem({ id: "inbox", title: "Inbox decisions", Component: InboxPill });
|
||||
const removeTall = client.addComposerPillItem({ id: "tall", title: "All decisions", Component: TallDecisionsPill });
|
||||
const removeReveal = client.addComposerPillItem({ id: "reveal", title: "Reveal results", Component: RevealResultsPill });
|
||||
const removeFixed = client.addComposerPillItem({ id: "fixed", title: "Fixed viewport", Component: FixedScrollPill });
|
||||
|
||||
const live = client.addComposerPill({
|
||||
id: "live-popover",
|
||||
workspaceId,
|
||||
agentId,
|
||||
button: {
|
||||
title: "Live popover",
|
||||
icon: "Eye",
|
||||
label: "Live",
|
||||
behavior: { kind: "popover", Content: LivePopover },
|
||||
},
|
||||
});
|
||||
|
||||
const dynamicMenu = client.addComposerPill({
|
||||
id: "dynamic-menu",
|
||||
workspaceId,
|
||||
agentId,
|
||||
button: {
|
||||
title: "Dynamic menu",
|
||||
icon: "List",
|
||||
label: "Decisions",
|
||||
behavior: {
|
||||
kind: "menu",
|
||||
items: [
|
||||
{
|
||||
kind: "item",
|
||||
id: "D42",
|
||||
title: "Decision D42",
|
||||
behavior: {
|
||||
kind: "action",
|
||||
onPress() {
|
||||
dynamicMenu.update({ label: "Picked D42" });
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
client.addCommandCenterItem({
|
||||
id: "finish-check",
|
||||
title: "Finish check action",
|
||||
icon: "Check",
|
||||
context: "workspace",
|
||||
onSelect: () => finishAction(),
|
||||
});
|
||||
updateLivePopover = () =>
|
||||
live.update({
|
||||
label: "Live · 2",
|
||||
behavior: { kind: "popover", Content: LivePopover },
|
||||
});
|
||||
|
||||
return () => {
|
||||
finishAction();
|
||||
removeQuiet();
|
||||
removeAction();
|
||||
removeInbox();
|
||||
removeTall();
|
||||
removeReveal();
|
||||
removeFixed();
|
||||
live.remove();
|
||||
dynamicMenu.remove();
|
||||
};
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
async function runCommand(page: Page, title: string) {
|
||||
const panel = await openCommandCenter(page);
|
||||
await panel.getByTestId("command-center-input").fill(title);
|
||||
await panel.getByRole("button", { name: title, exact: true }).click();
|
||||
await expect(panel).not.toBeVisible();
|
||||
}
|
||||
|
||||
async function expectStill(subject: Locator) {
|
||||
let previous: {
|
||||
buffer: Buffer;
|
||||
box: { x: number; y: number; width: number; height: number };
|
||||
} | null = null;
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
const box = await subject.boundingBox();
|
||||
if (!box || box.width <= 0 || box.height <= 0) {
|
||||
previous = null;
|
||||
return false;
|
||||
}
|
||||
const buffer = await subject.screenshot();
|
||||
const still =
|
||||
previous !== null &&
|
||||
Math.abs(box.x - previous.box.x) < 0.5 &&
|
||||
Math.abs(box.y - previous.box.y) < 0.5 &&
|
||||
Math.abs(box.width - previous.box.width) < 0.5 &&
|
||||
Math.abs(box.height - previous.box.height) < 0.5 &&
|
||||
buffer.equals(previous.buffer);
|
||||
previous = { buffer, box };
|
||||
return still;
|
||||
},
|
||||
{ intervals: [150] },
|
||||
)
|
||||
.toBe(true);
|
||||
}
|
||||
|
||||
async function qaScreenshot(page: Page, name: string) {
|
||||
const directory = process.env.PASEO_QA_SCREENSHOT_DIR;
|
||||
if (!directory) return;
|
||||
await page.waitForTimeout(300);
|
||||
await page.screenshot({ path: path.join(directory, `${name}.png`) });
|
||||
}
|
||||
|
||||
async function scrollToEndAndExpectPinned(options: {
|
||||
page: Page;
|
||||
header: Locator;
|
||||
footer: Locator;
|
||||
scroll: Locator;
|
||||
bottomItemLabel: string;
|
||||
}) {
|
||||
const { page, header, footer, scroll, bottomItemLabel } = options;
|
||||
const initialHeaderY = (await header.boundingBox())!.y;
|
||||
const initialFooterY = (await footer.boundingBox())!.y;
|
||||
const canScroll = await scroll.evaluate((node) => node.scrollHeight > node.clientHeight + 1);
|
||||
expect(canScroll).toBe(true);
|
||||
await scroll.evaluate((node) => {
|
||||
node.scrollTop = node.scrollHeight;
|
||||
});
|
||||
await expect(page.getByText(bottomItemLabel, { exact: true })).toBeVisible();
|
||||
expect((await header.boundingBox())!.y).toBe(initialHeaderY);
|
||||
expect((await footer.boundingBox())!.y).toBe(initialFooterY);
|
||||
}
|
||||
|
||||
async function expectPinnedScrollableDesktopPopover(page: Page, pluginId: string) {
|
||||
const surface = page.getByTestId(`plugin-composer-pill-${pluginId}-tall-popover`);
|
||||
const header = page.getByTestId("tall-popover-header");
|
||||
const footer = page.getByTestId("tall-popover-footer");
|
||||
const scroll = page.getByTestId("tall-popover-scroll");
|
||||
|
||||
await expect(header).toBeVisible();
|
||||
await expect(footer).toBeVisible();
|
||||
await expectStill(header);
|
||||
|
||||
const surfaceBox = (await surface.boundingBox())!;
|
||||
const headerBox = (await header.boundingBox())!;
|
||||
const footerBox = (await footer.boundingBox())!;
|
||||
expect(surfaceBox.height).toBeLessThanOrEqual(441);
|
||||
// 0px outer padding (1px surface border only).
|
||||
expect(Math.abs(headerBox.y - surfaceBox.y - 1)).toBeLessThanOrEqual(1);
|
||||
expect(
|
||||
Math.abs(surfaceBox.y + surfaceBox.height - (footerBox.y + footerBox.height) - 1),
|
||||
).toBeLessThanOrEqual(1);
|
||||
|
||||
await scrollToEndAndExpectPinned({
|
||||
page,
|
||||
header,
|
||||
footer,
|
||||
scroll,
|
||||
bottomItemLabel: "Decision item 23",
|
||||
});
|
||||
}
|
||||
|
||||
async function expectPinnedScrollableCompactSheet(page: Page, pluginId: string) {
|
||||
const sheetContent = page.getByTestId(`plugin-composer-pill-${pluginId}-tall-popover-content`);
|
||||
const header = page.getByTestId("tall-popover-header");
|
||||
const footer = page.getByTestId("tall-popover-footer");
|
||||
const scroll = page.getByTestId("tall-popover-scroll");
|
||||
|
||||
await expect(sheetContent).toBeVisible();
|
||||
await expect(footer).toBeInViewport();
|
||||
await expectStill(sheetContent);
|
||||
|
||||
const sheetBox = (await sheetContent.boundingBox())!;
|
||||
const footerBox = (await footer.boundingBox())!;
|
||||
expect(sheetBox.height).toBeLessThanOrEqual(COMPACT.height * 0.8 + 1);
|
||||
expect(footerBox.y + footerBox.height).toBeLessThanOrEqual(COMPACT.height + 1);
|
||||
|
||||
await scrollToEndAndExpectPinned({
|
||||
page,
|
||||
header,
|
||||
footer,
|
||||
scroll,
|
||||
bottomItemLabel: "Decision item 23",
|
||||
});
|
||||
}
|
||||
|
||||
async function expectRevealedScrollerPreservesCompactState(page: Page, pluginId: string) {
|
||||
const revealPill = page.getByRole("button", { name: "Lazy results", exact: true });
|
||||
await expect(revealPill).toBeVisible();
|
||||
await revealPill.click();
|
||||
|
||||
const sheetContent = page.getByTestId(`plugin-composer-pill-${pluginId}-reveal-popover-content`);
|
||||
await expect(sheetContent).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Reveal count: 0", exact: true })).toBeInViewport();
|
||||
await expectStill(sheetContent);
|
||||
|
||||
await page.getByRole("button", { name: "Reveal count: 0", exact: true }).click();
|
||||
await expect(page.getByRole("button", { name: "Reveal count: 1", exact: true })).toBeVisible();
|
||||
await page.getByRole("button", { name: "Show results", exact: true }).click();
|
||||
|
||||
const scroll = page.getByTestId("reveal-popover-scroll");
|
||||
await expect(scroll).toBeVisible();
|
||||
await expectStill(sheetContent);
|
||||
// Revealing a ScrollView in an open sheet must keep plugin state mounted and cap sheet height.
|
||||
await expect(page.getByRole("button", { name: "Reveal count: 1", exact: true })).toBeVisible();
|
||||
expect((await sheetContent.boundingBox())!.height).toBeLessThanOrEqual(COMPACT.height * 0.8 + 1);
|
||||
await scroll.evaluate((node) => {
|
||||
node.scrollTop = node.scrollHeight;
|
||||
});
|
||||
await expect(page.getByText("Result item 23", { exact: true })).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "Close reveal popover", exact: true }).click();
|
||||
await expect(scroll).toHaveCount(0);
|
||||
}
|
||||
|
||||
async function expectCompactSheetHugsFixedScrollPopover(page: Page, pluginId: string) {
|
||||
const fixedPill = page.getByRole("button", { name: "Fixed scroll", exact: true });
|
||||
await expect(fixedPill).toBeVisible();
|
||||
await fixedPill.click();
|
||||
|
||||
const sheetContent = page.getByTestId(`plugin-composer-pill-${pluginId}-fixed-popover-content`);
|
||||
const scroll = page.getByTestId("fixed-scroll-body");
|
||||
await expect(sheetContent).toBeVisible();
|
||||
await expect.poll(async () => (await sheetContent.boundingBox())!.height).toBeGreaterThan(600);
|
||||
await page.getByRole("button", { name: "Shrink fixed viewport", exact: true }).click();
|
||||
await expect.poll(async () => (await sheetContent.boundingBox())!.height).toBeLessThan(340);
|
||||
await expect(page.getByTestId("fixed-scroll-footer")).toBeInViewport();
|
||||
await expectStill(sheetContent);
|
||||
|
||||
const sheetBox = (await sheetContent.boundingBox())!;
|
||||
const footerBox = (await page.getByTestId("fixed-scroll-footer").boundingBox())!;
|
||||
// A 120px fixed-height ScrollView with short header/footer must hug its own ~200-260px height
|
||||
// rather than expanding to the 80% sheet cap (675px).
|
||||
expect(sheetBox.height).toBeLessThan(340);
|
||||
expect(
|
||||
Math.abs(sheetBox.y + sheetBox.height - (footerBox.y + footerBox.height)),
|
||||
).toBeLessThanOrEqual(2);
|
||||
await scroll.evaluate((node) => {
|
||||
node.scrollTop = node.scrollHeight;
|
||||
});
|
||||
await expect(page.getByText("Fixed row 15", { exact: true })).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "Add footer action", exact: true }).click();
|
||||
await expectStill(sheetContent);
|
||||
const grownSheetBox = (await sheetContent.boundingBox())!;
|
||||
const extraActionBox = (await page.getByTestId("fixed-scroll-extra-action").boundingBox())!;
|
||||
expect(grownSheetBox.height).toBeGreaterThanOrEqual(sheetBox.height + 40);
|
||||
expect(extraActionBox.y + extraActionBox.height).toBeLessThanOrEqual(
|
||||
grownSheetBox.y + grownSheetBox.height + 2,
|
||||
);
|
||||
|
||||
await page.getByRole("button", { name: "Add footer action", exact: true }).click();
|
||||
await expectStill(sheetContent);
|
||||
|
||||
await page.getByRole("button", { name: "Filter fixed rows", exact: true }).click();
|
||||
await expectStill(sheetContent);
|
||||
const filteredBox = (await sheetContent.boundingBox())!;
|
||||
const filteredFooterBox = (await page.getByTestId("fixed-scroll-footer").boundingBox())!;
|
||||
expect(Math.abs(filteredBox.height - sheetBox.height)).toBeLessThanOrEqual(2);
|
||||
expect(
|
||||
Math.abs(filteredBox.y + filteredBox.height - (filteredFooterBox.y + filteredFooterBox.height)),
|
||||
).toBeLessThanOrEqual(2);
|
||||
|
||||
await page.getByRole("button", { name: "Filter fixed rows", exact: true }).click();
|
||||
await expectStill(sheetContent);
|
||||
|
||||
await page.getByRole("button", { name: "Expand fixed viewport", exact: true }).click();
|
||||
await expectStill(sheetContent);
|
||||
const expandedBox = (await sheetContent.boundingBox())!;
|
||||
const expandedScrollBox = (await scroll.boundingBox())!;
|
||||
expect(expandedBox.height).toBeGreaterThan(450);
|
||||
expect(expandedBox.height).toBeLessThanOrEqual(COMPACT.height * 0.8 + 2);
|
||||
expect(expandedScrollBox.height).toBeGreaterThan(300);
|
||||
|
||||
await page.getByRole("button", { name: "Expand fixed viewport", exact: true }).click();
|
||||
await expectStill(sheetContent);
|
||||
const collapsedBox = (await sheetContent.boundingBox())!;
|
||||
expect(collapsedBox.height).toBeLessThan(340);
|
||||
|
||||
await page.getByRole("button", { name: "Close fixed viewport", exact: true }).click();
|
||||
await expect(scroll).toHaveCount(0);
|
||||
}
|
||||
|
||||
test("declarative addComposerPillItem + ComposerPill and imperative pill fixes work end-to-end", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
const workspace = await seedWorkspace({ repoPrefix: "composer-pill-items-" });
|
||||
const agent = await workspace.client.createAgent({
|
||||
provider: "mock",
|
||||
cwd: workspace.repoPath,
|
||||
workspaceId: workspace.workspaceId,
|
||||
title: "Declarative composer pills",
|
||||
model: "e2e-fast-stream",
|
||||
modeId: "load-test",
|
||||
});
|
||||
const client = await connectNewWorkspaceDaemonClient({ ownProjects: false });
|
||||
const config = await client.getDaemonConfig();
|
||||
const directory = await mkdtemp(path.join(tmpdir(), "paseo-pill-items-"));
|
||||
try {
|
||||
await writeFile(
|
||||
path.join(directory, "paseo-plugin.json"),
|
||||
JSON.stringify({ id: PLUGIN_ID, requirements: pluginRequirements }),
|
||||
);
|
||||
await writeFile(
|
||||
path.join(directory, "index.client.tsx"),
|
||||
pluginSource(workspace.workspaceId, agent.id),
|
||||
);
|
||||
await client.patchDaemonConfig({ pluginsEnabled: true });
|
||||
await client.installDirectoryPlugin(directory);
|
||||
|
||||
await page.setViewportSize(WIDE);
|
||||
await gotoAppShell(page);
|
||||
await approveClientPluginsInUi(page, [PLUGIN_ID]);
|
||||
await page.goto(buildAgentRoute(workspace.workspaceId, agent.id));
|
||||
|
||||
const actionPill = page.getByRole("button", { name: "Run check action", exact: true });
|
||||
const inboxPill = page.getByRole("button", { name: "2 decisions", exact: true });
|
||||
await expect(actionPill).toBeVisible();
|
||||
await expect(inboxPill).toBeVisible();
|
||||
|
||||
await test.step("null items leave no empty gap in the composer track", async () => {
|
||||
await expect(page.getByRole("button", { name: "Quiet", exact: true })).toHaveCount(0);
|
||||
const actionBox = (await actionPill.boundingBox())!;
|
||||
const inboxBox = (await inboxPill.boundingBox())!;
|
||||
expect(Math.abs(actionBox.y - inboxBox.y)).toBeLessThan(2);
|
||||
expect(actionBox.height).toBeGreaterThanOrEqual(32);
|
||||
expect(inboxBox.height).toBeGreaterThanOrEqual(32);
|
||||
// 4px track gap between adjacent pills with no empty wrapper gap in between.
|
||||
expect(inboxBox.x - (actionBox.x + actionBox.width)).toBeLessThanOrEqual(8);
|
||||
await qaScreenshot(page, "01-desktop-track");
|
||||
});
|
||||
|
||||
await test.step("ComposerPill shows error toast on rejection, enters pending busy state, and recovers", async () => {
|
||||
await actionPill.click();
|
||||
await expect(page.getByText("Action check failed", { exact: true })).toBeVisible();
|
||||
await expect(actionPill).toBeEnabled();
|
||||
|
||||
await actionPill.click();
|
||||
await expect(actionPill).toBeDisabled();
|
||||
await expect(actionPill).toHaveAttribute("aria-busy", "true");
|
||||
await qaScreenshot(page, "02-desktop-pill-pending");
|
||||
|
||||
await runCommand(page, "Finish check action");
|
||||
await expect(actionPill).toBeEnabled();
|
||||
await expect(actionPill).toContainText("Checks · 1");
|
||||
});
|
||||
|
||||
await test.step("openPopover anchors above the pill on desktop, dismisses cleanly, and openScreen navigates", async () => {
|
||||
await inboxPill.click();
|
||||
const popoverTitle = page.getByText("Inbox decisions", { exact: true });
|
||||
await expect(popoverTitle).toBeInViewport();
|
||||
await expect(page.getByText("Presentation: wide", { exact: true })).toBeVisible();
|
||||
await expect(
|
||||
page.getByText(`Pill IDs: ${workspace.workspaceId} / ${agent.id}`, { exact: true }),
|
||||
).toBeVisible();
|
||||
await expectStill(popoverTitle);
|
||||
|
||||
const pillBox = (await inboxPill.boundingBox())!;
|
||||
const popoverBox = (await page
|
||||
.getByTestId(`plugin-composer-pill-${PLUGIN_ID}-inbox-popover`)
|
||||
.boundingBox())!;
|
||||
expect(popoverBox.y + popoverBox.height).toBeLessThanOrEqual(pillBox.y + 1);
|
||||
expect(Math.abs(popoverBox.x - pillBox.x)).toBeLessThan(80);
|
||||
await qaScreenshot(page, "03-desktop-popover");
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(popoverTitle).toHaveCount(0);
|
||||
|
||||
await inboxPill.click();
|
||||
await expect(popoverTitle).toBeVisible();
|
||||
await page.getByRole("button", { name: "Open inbox screen", exact: true }).click();
|
||||
await expect(popoverTitle).toHaveCount(0);
|
||||
await expect(page.getByText(`Inbox screen for ${agent.id}`, { exact: true })).toBeVisible();
|
||||
await page.getByTestId("plugin-surface-close").click();
|
||||
await expect(inboxPill).toBeVisible();
|
||||
});
|
||||
|
||||
await test.step("imperative PluginButtonStore fixes: same-Content popover stays open on update and dynamic menu IDs work", async () => {
|
||||
const livePill = page.getByRole("button", { name: "Live popover", exact: true });
|
||||
await livePill.click();
|
||||
await expect(page.getByText("Live popover content", { exact: true })).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "Trigger live update", exact: true }).click();
|
||||
await expect(livePill).toContainText("Live · 2");
|
||||
await expect(page.getByText("Live popover content", { exact: true })).toBeVisible();
|
||||
await page.getByRole("button", { name: "Close live popover", exact: true }).click();
|
||||
await expect(page.getByText("Live popover content", { exact: true })).toHaveCount(0);
|
||||
|
||||
const menuPill = page.getByRole("button", { name: "Dynamic menu", exact: true });
|
||||
await menuPill.click();
|
||||
await page.getByRole("menuitem", { name: "Decision D42", exact: true }).click();
|
||||
await expect(menuPill).toContainText("Picked D42");
|
||||
});
|
||||
|
||||
await test.step("on compact layouts openPopover renders a bottom sheet and dismisses cleanly", async () => {
|
||||
await page.setViewportSize(COMPACT);
|
||||
await expect(inboxPill).toBeVisible();
|
||||
await inboxPill.click();
|
||||
const compactLabel = page.getByText("Presentation: compact", { exact: true });
|
||||
await expect(compactLabel).toBeInViewport();
|
||||
const sheetBox = (await compactLabel.boundingBox())!;
|
||||
expect(sheetBox.y).toBeGreaterThan(COMPACT.height / 2);
|
||||
await qaScreenshot(page, "04-compact-sheet");
|
||||
await page.getByRole("button", { name: "Close inbox popover", exact: true }).click();
|
||||
await expect(compactLabel).toHaveCount(0);
|
||||
});
|
||||
|
||||
await test.step("tall raw-canvas popover caps at <= 440px on desktop and <= 80% on compact sheet with pinned header/footer and scrolling body", async () => {
|
||||
const tallPill = page.getByRole("button", { name: "All decisions", exact: true });
|
||||
await page.setViewportSize(WIDE);
|
||||
await expect(tallPill).toBeVisible();
|
||||
await tallPill.click();
|
||||
|
||||
await expectPinnedScrollableDesktopPopover(page, PLUGIN_ID);
|
||||
await qaScreenshot(page, "05-desktop-tall-popover");
|
||||
await page.getByRole("button", { name: "Submit decisions", exact: true }).click();
|
||||
await expect(page.getByTestId("tall-popover-header")).toHaveCount(0);
|
||||
|
||||
await page.setViewportSize(COMPACT);
|
||||
await tallPill.click();
|
||||
await expectPinnedScrollableCompactSheet(page, PLUGIN_ID);
|
||||
await qaScreenshot(page, "06-compact-tall-sheet");
|
||||
await page.getByRole("button", { name: "Submit decisions", exact: true }).click();
|
||||
await expect(page.getByTestId("tall-popover-header")).toHaveCount(0);
|
||||
});
|
||||
|
||||
await test.step("compact raw-canvas sheet preserves plugin state when revealing a ScrollView via user action", async () => {
|
||||
await page.setViewportSize(COMPACT);
|
||||
await expectRevealedScrollerPreservesCompactState(page, PLUGIN_ID);
|
||||
});
|
||||
|
||||
await test.step("compact raw-canvas sheet hugs a fixed-height ScrollView without expanding to 80%", async () => {
|
||||
await page.setViewportSize(COMPACT);
|
||||
await expectCompactSheetHugsFixedScrollPopover(page, PLUGIN_ID);
|
||||
});
|
||||
} finally {
|
||||
await client.removePlugin(PLUGIN_ID).catch(() => undefined);
|
||||
await client.patchDaemonConfig({ pluginsEnabled: config.config.pluginsEnabled });
|
||||
await client.close();
|
||||
await rm(directory, { recursive: true, force: true });
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
withPluginFocusingAnAgentWithContextUsage,
|
||||
withPluginHoldingNewWorkspaceComposer,
|
||||
withPluginWritingToAnotherWorkspace,
|
||||
withPluginSettingsFromComposer,
|
||||
} from "../support/helpers/plugin-composers-by-reference";
|
||||
|
||||
test("a panel in the Explorer inserts at the cursor of the focused agent's composer", async ({
|
||||
@@ -222,26 +221,3 @@ test("focus reaches an agent kept in the Explorer on a compact screen", async ({
|
||||
await author.expectParentReadyToType();
|
||||
});
|
||||
});
|
||||
|
||||
test("Settings accepts clicks after a composer plugin closes its dialog and navigates", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(120_000);
|
||||
await withPluginSettingsFromComposer(page, { width: 1280, height: 800 }, async (flow) => {
|
||||
await flow.openPluginDialog();
|
||||
await flow.openSettingsFromPlugin();
|
||||
await flow.changeSetting();
|
||||
await flow.returnToChat();
|
||||
});
|
||||
});
|
||||
|
||||
test("Settings accepts clicks after navigation from the compact model sheet", async ({ page }) => {
|
||||
test.setTimeout(120_000);
|
||||
await withPluginSettingsFromComposer(page, { width: 430, height: 900 }, async (flow) => {
|
||||
await flow.openModelSheet();
|
||||
await flow.openPluginDialog();
|
||||
await flow.openSettingsFromPlugin();
|
||||
await flow.changeSetting();
|
||||
await flow.returnToChat();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
openFromInstalledTab,
|
||||
openListingPage,
|
||||
uninstallFromPage,
|
||||
verifyLocalizedMediaInDirectory,
|
||||
} from "../support/helpers/plugin-directory";
|
||||
|
||||
test("installs a listed plugin from Browse and uninstalls it from either of its pages", async ({
|
||||
@@ -171,11 +170,3 @@ test("opens plugin pages without empty markdown collapse, stacked back flash, or
|
||||
await expectStableDesktopBackToListing(page);
|
||||
await expectStackedFirstFrameOnNarrowDesktop(page);
|
||||
});
|
||||
|
||||
test("shows localized featured card and detail screenshots when the app language changes", async ({
|
||||
page,
|
||||
directoryHost,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 1280, height: 960 });
|
||||
await verifyLocalizedMediaInDirectory(page, directoryHost);
|
||||
});
|
||||
|
||||
@@ -27,10 +27,7 @@ import {
|
||||
} from "@getpaseo/plugin/client";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { DocumentFrame, Loading } from "@getpaseo/plugin/client/ui";
|
||||
function FileDetailsScreen({ params }) {
|
||||
return <View><Text>File screen: {params.file}</Text></View>;
|
||||
}
|
||||
function Pdf({ file, workspaceId, openScreen }) {
|
||||
function Pdf({ file, workspaceId }) {
|
||||
usePaseo();
|
||||
useQueryClient();
|
||||
const workspace = useWorkspace(workspaceId, value => ({ id: value.id }));
|
||||
@@ -47,9 +44,6 @@ function Pdf({ file, workspaceId, openScreen }) {
|
||||
<Text>Path {file.path}</Text>
|
||||
<Text>Bytes {bytes.bytes.length}; URL bytes {urlBytes}</Text>
|
||||
<Text>Workspace {workspace?.id}</Text>
|
||||
<Pressable accessibilityRole="button" onPress={() => openScreen({ screenId: "details", params: { file: file.name } })}>
|
||||
<Text>Open screen from file panel</Text>
|
||||
</Pressable>
|
||||
<DocumentFrame url={href} testID="plugin-pdf-frame" />
|
||||
</View>;
|
||||
}
|
||||
@@ -75,7 +69,6 @@ function Markdown({ file, tab }) {
|
||||
</View>;
|
||||
}
|
||||
export default function contribute(client) {
|
||||
client.addScreen({ id: "details", title: "File details", Component: FileDetailsScreen });
|
||||
client.addFilePanel({ id: "pdf", title: "PDF", icon: "FileText",
|
||||
files: { extensions: ["pdf", "txt"] }, Component: Pdf });
|
||||
client.addFilePanel({ id: "markdown", title: "Plugin Markdown", icon: "FileText",
|
||||
@@ -99,16 +92,6 @@ async function associateMarkdownWithPlugin(page: Page) {
|
||||
async function editMarkdownThroughPlugin(page: Page) {
|
||||
await page.getByRole("button", { name: "Edit Markdown through plugin", exact: true }).click();
|
||||
}
|
||||
async function openFileDetailsScreenFromPanel(page: Page, name: string) {
|
||||
await page.getByRole("button", { name: "Open screen from file panel", exact: true }).click();
|
||||
await expect(page).toHaveURL(
|
||||
new RegExp(`/plugin/${PLUGIN_ID}/surface/details\\?param\\.file=${encodeURIComponent(name)}$`),
|
||||
);
|
||||
await expect(page.getByText(`File screen: ${name}`, { exact: true })).toBeVisible();
|
||||
await page.getByTestId("plugin-surface-close").click();
|
||||
await expect(page.getByText(`PDF plugin: ${name}`, { exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
/** Opens the tab with Paseo's Markdown panel from "Open with…" and shows its Source view. */
|
||||
async function openBuiltinMarkdownSource(page: Page, name: string) {
|
||||
await page.getByTestId(`workspace-tab-file_${name}`).first().click({ button: "right" });
|
||||
@@ -169,7 +152,6 @@ test("directory plugins render PDF bytes and write Markdown through the file han
|
||||
const pdfScreenshot = testInfo.outputPath("plugin-pdf-web.png");
|
||||
await page.screenshot({ path: pdfScreenshot });
|
||||
await testInfo.attach("plugin-pdf-web", { path: pdfScreenshot, contentType: "image/png" });
|
||||
await openFileDetailsScreenFromPanel(page, "report.pdf");
|
||||
|
||||
// A plugin panel claiming a text file competes with Source, so Paseo asks over the plugin.
|
||||
await openWorkspaceFile(page, "bytes.txt");
|
||||
|
||||
@@ -12,7 +12,6 @@ import { buildOpenProjectRoute } from "@/utils/host-routes";
|
||||
import { expect, test as base, type Page } from "../support/fixtures";
|
||||
import { gotoAppShell, openSettings } from "../support/helpers/app";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { createWsTextFrameDecoder, parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { connectNewWorkspaceDaemonClient } from "../support/helpers/new-workspace";
|
||||
import { waitForSettledPosition } from "../support/helpers/sheet-layout";
|
||||
@@ -130,22 +129,18 @@ async function advertisePluginCapabilities(
|
||||
const server = browser.connectToServer();
|
||||
browser.onMessage((message) => server.send(message));
|
||||
server.onMessage((message) => {
|
||||
const envelope = parseWsJsonFrame<{
|
||||
message?: {
|
||||
type?: unknown;
|
||||
payload?: { status?: unknown; features?: Record<string, unknown> };
|
||||
};
|
||||
}>(message);
|
||||
if (
|
||||
envelope?.message?.type === "status" &&
|
||||
envelope.message.payload?.status === "server_info" &&
|
||||
envelope.message.payload.features
|
||||
) {
|
||||
Object.assign(envelope.message.payload.features, features);
|
||||
browser.send(JSON.stringify(envelope));
|
||||
if (typeof message !== "string") {
|
||||
browser.send(message);
|
||||
return;
|
||||
}
|
||||
browser.send(message);
|
||||
const envelope = JSON.parse(message);
|
||||
if (
|
||||
envelope.message?.type === "status" &&
|
||||
envelope.message.payload?.status === "server_info"
|
||||
) {
|
||||
Object.assign(envelope.message.payload.features, features);
|
||||
}
|
||||
browser.send(JSON.stringify(envelope));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -153,12 +148,10 @@ async function advertisePluginCapabilities(
|
||||
function observePluginCatalog(page: Page) {
|
||||
let responses = 0;
|
||||
page.on("websocket", (socket) => {
|
||||
const decode = createWsTextFrameDecoder();
|
||||
socket.on("framereceived", ({ payload }) => {
|
||||
const text = decode(payload);
|
||||
if (text === null) return;
|
||||
if (typeof payload !== "string") return;
|
||||
try {
|
||||
const envelope = JSON.parse(text) as {
|
||||
const envelope = JSON.parse(payload) as {
|
||||
type?: unknown;
|
||||
message?: { type?: unknown };
|
||||
};
|
||||
@@ -827,11 +820,15 @@ async function installPluginWithUntrustedDescription(
|
||||
function observePluginReload(page: Page) {
|
||||
const requests: number[] = [];
|
||||
const responses: number[] = [];
|
||||
const isSessionMessage = (payload: string | Buffer, type: string): boolean => {
|
||||
const envelope = parseWsJsonFrame<{ type?: unknown; message?: { type?: unknown } }>(payload);
|
||||
if (!envelope) return false;
|
||||
const message = envelope.type === "session" ? envelope.message : envelope;
|
||||
return message?.type === type;
|
||||
const isSessionMessage = (payload: unknown, type: string): boolean => {
|
||||
if (typeof payload !== "string") return false;
|
||||
try {
|
||||
const envelope = JSON.parse(payload) as { type?: unknown; message?: { type?: unknown } };
|
||||
const message = envelope.type === "session" ? envelope.message : envelope;
|
||||
return message?.type === type;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
page.on("websocket", (socket) => {
|
||||
// The reload request travels client -> daemon (outbound); the answer comes back inbound.
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { openSettings } from "../support/helpers/app";
|
||||
import { closeCommandCenter } from "../support/helpers/command-center";
|
||||
import { openSettingsSection } from "../support/helpers/settings";
|
||||
import { runCommand } from "../support/helpers/plugin-sidebar-items";
|
||||
import {
|
||||
activateList,
|
||||
closeDialogWithEscape,
|
||||
closeRecentDecisions,
|
||||
expectInboxOpen,
|
||||
expectSelection,
|
||||
expectSubmitted,
|
||||
findCommandCenterRow,
|
||||
focusDecisionPane,
|
||||
installShortcutsExample,
|
||||
installShortcutsExampleOnTwoHosts,
|
||||
expectInboxOpenOn,
|
||||
showScreenOnHost,
|
||||
decisionList,
|
||||
openHelpDialog,
|
||||
openRecentDecisions,
|
||||
searchField,
|
||||
SHORTCUTS_PLUGIN_NAME,
|
||||
} from "../support/helpers/plugin-shortcuts";
|
||||
import {
|
||||
openShortcutSettings,
|
||||
pressCapturedKeys,
|
||||
saveRebinding,
|
||||
shortcutRow,
|
||||
startRebinding,
|
||||
} from "../support/helpers/shortcut-settings";
|
||||
|
||||
// Linux Chromium is not mac: the example's Mod+Shift+I is Ctrl+Shift+I here.
|
||||
test.describe("Plugin shortcuts", () => {
|
||||
test("the example's keys open its screen, move the active list and submit the focused pane", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
const example = await installShortcutsExample(page);
|
||||
try {
|
||||
await test.step("Ctrl+Shift+I opens the Inbox from a workspace", async () => {
|
||||
await page.keyboard.press("Control+Shift+I");
|
||||
await expectInboxOpen(page);
|
||||
await expectSelection(page, "Open", "Approve the migration");
|
||||
});
|
||||
|
||||
await test.step("J moves the active list only", async () => {
|
||||
await page.keyboard.press("j");
|
||||
await expectSelection(page, "Open", "Merge the docs");
|
||||
|
||||
await activateList(page, "Done");
|
||||
await page.keyboard.press("j");
|
||||
await expectSelection(page, "Done", "Rename the CLI");
|
||||
await expectSelection(page, "Open", "Merge the docs");
|
||||
});
|
||||
|
||||
await test.step("typing j in the search field types it", async () => {
|
||||
await searchField(page).click();
|
||||
await page.keyboard.press("j");
|
||||
await expect(searchField(page)).toHaveValue("j");
|
||||
await expectSelection(page, "Done", "Rename the CLI");
|
||||
await searchField(page).fill("");
|
||||
});
|
||||
|
||||
await test.step("a dialog over the list stops K, and closing it gives K back", async () => {
|
||||
const dialog = await openHelpDialog(page);
|
||||
await page.keyboard.press("k");
|
||||
await expectSelection(page, "Done", "Rename the CLI");
|
||||
await closeDialogWithEscape(page, dialog);
|
||||
|
||||
await page.keyboard.press("k");
|
||||
await expectSelection(page, "Done", "Pick a logo");
|
||||
});
|
||||
|
||||
await test.step("a popover over the list takes J, and closing it gives J back", async () => {
|
||||
await openRecentDecisions(page);
|
||||
await page.keyboard.press("j");
|
||||
await expectSelection(page, "Recent", "Open the beta");
|
||||
await expectSelection(page, "Done", "Pick a logo");
|
||||
await closeRecentDecisions(page);
|
||||
|
||||
await page.keyboard.press("j");
|
||||
await expectSelection(page, "Done", "Rename the CLI");
|
||||
});
|
||||
|
||||
await test.step("the Next decision row in the Command Center moves the active list", async () => {
|
||||
await activateList(page, "Open");
|
||||
await (await findCommandCenterRow(page, "Next decision")).click();
|
||||
await expectSelection(page, "Open", "Ship the release");
|
||||
});
|
||||
|
||||
await test.step("the Command Center row and the popover badge show the keys", async () => {
|
||||
const row = await findCommandCenterRow(page, "Open Inbox");
|
||||
await expect(row).toContainText("Ctrl+Shift+I");
|
||||
await closeCommandCenter(page);
|
||||
|
||||
await openRecentDecisions(page);
|
||||
await expect(page.getByRole("button", { name: /^Open Inbox/ })).toContainText(
|
||||
"Ctrl+Shift+I",
|
||||
);
|
||||
await closeRecentDecisions(page);
|
||||
});
|
||||
|
||||
await test.step("Ctrl+Enter submits the decision in the focused pane only", async () => {
|
||||
await example.openWorkspace();
|
||||
await runCommand(page, "Compare decisions");
|
||||
await expectSubmitted(page, "Approve the migration", false);
|
||||
await expectSubmitted(page, "Ship the release", false);
|
||||
|
||||
await focusDecisionPane(page, "Ship the release");
|
||||
await page.keyboard.press("Control+Enter");
|
||||
await expectSubmitted(page, "Ship the release", true);
|
||||
await expectSubmitted(page, "Approve the migration", false);
|
||||
|
||||
await focusDecisionPane(page, "Approve the migration");
|
||||
await page.keyboard.press("Control+Enter");
|
||||
await expectSubmitted(page, "Approve the migration", true);
|
||||
});
|
||||
|
||||
await test.step("Settings lists the actions under the plugin's name, and a new key replaces the old", async () => {
|
||||
await openShortcutSettings(page);
|
||||
await expect(page.getByText(SHORTCUTS_PLUGIN_NAME, { exact: true })).toBeVisible();
|
||||
await expect(shortcutRow(page, "Open Inbox")).toContainText("Ctrl+Shift+I");
|
||||
await expect(shortcutRow(page, "Next decision")).toContainText("J");
|
||||
|
||||
await startRebinding(page, "Open Inbox");
|
||||
await pressCapturedKeys(page, "Control+Shift+U");
|
||||
await saveRebinding(page, "Open Inbox");
|
||||
await expect(shortcutRow(page, "Open Inbox")).toContainText("Ctrl+Shift+U");
|
||||
|
||||
await page.keyboard.press("Control+Shift+U");
|
||||
await expectInboxOpen(page);
|
||||
|
||||
const row = await findCommandCenterRow(page, "Open Inbox");
|
||||
await expect(row).toContainText("Ctrl+Shift+U");
|
||||
await closeCommandCenter(page);
|
||||
});
|
||||
} finally {
|
||||
await example.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("a plugin on two hosts has one Settings row and keeps its shortcut when one host goes offline", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
const hosts = await installShortcutsExampleOnTwoHosts(page);
|
||||
try {
|
||||
await test.step("Settings lists each action once", async () => {
|
||||
await openSettings(page);
|
||||
await openSettingsSection(page, "shortcuts");
|
||||
await expect(shortcutRow(page, "Open Inbox")).toHaveCount(1);
|
||||
await expect(shortcutRow(page, "Next decision")).toHaveCount(1);
|
||||
});
|
||||
|
||||
await test.step("Ctrl+Shift+I opens the Inbox, and the user moves it to Secondary", async () => {
|
||||
await page.keyboard.press("Control+Shift+I");
|
||||
await expect(decisionList(page, "Open")).toBeVisible();
|
||||
await showScreenOnHost(page, "Secondary");
|
||||
await expectInboxOpenOn(page, hosts.secondaryServerId);
|
||||
});
|
||||
|
||||
await test.step("with Secondary offline, Ctrl+Shift+I opens the Inbox on Primary", async () => {
|
||||
await hosts.disconnectSecondary();
|
||||
await page.keyboard.press("Control+Shift+I");
|
||||
await expectInboxOpenOn(page, hosts.primaryServerId);
|
||||
});
|
||||
} finally {
|
||||
await hosts.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -3,11 +3,6 @@ import type { Locator, Page } from "@playwright/test";
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import {
|
||||
createWsFrameAssembler,
|
||||
parseWsJsonFrame,
|
||||
sendWsFrames,
|
||||
} from "../support/helpers/ws-frames";
|
||||
import {
|
||||
BOTS_PLUGIN_ID,
|
||||
COMPACT,
|
||||
@@ -115,13 +110,9 @@ function trackReleasedSubscriptions(page: Page): Set<string> {
|
||||
}
|
||||
|
||||
function collectRelease(released: Set<string>, payload: string | Buffer) {
|
||||
const frame = parseWsJsonFrame<{
|
||||
message?: { type?: unknown; payload?: { subscriptionId?: string } };
|
||||
}>(payload);
|
||||
if (
|
||||
frame?.message?.type === "subscription.release.response" &&
|
||||
typeof frame.message.payload?.subscriptionId === "string"
|
||||
)
|
||||
if (typeof payload !== "string") return;
|
||||
const frame = JSON.parse(payload);
|
||||
if (frame.message?.type === "subscription.release.response")
|
||||
released.add(frame.message.payload.subscriptionId);
|
||||
}
|
||||
|
||||
@@ -145,14 +136,10 @@ function sidebarFooter(page: Page): Locator {
|
||||
return visibleTestId(page, "sidebar-add-project").locator("xpath=..");
|
||||
}
|
||||
|
||||
function isPluginCatalogResponse(text: string | null): boolean {
|
||||
if (text === null) return false;
|
||||
try {
|
||||
const frame = JSON.parse(text) as { type?: unknown; message?: { type?: unknown } };
|
||||
return frame.type === "session" && frame.message?.type === "plugin.catalog.get.response";
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
function isPluginCatalogResponse(message: string | Buffer): boolean {
|
||||
if (typeof message !== "string") return false;
|
||||
const frame = JSON.parse(message);
|
||||
return frame.type === "session" && frame.message?.type === "plugin.catalog.get.response";
|
||||
}
|
||||
|
||||
async function holdNextPluginCatalogResponse(page: Page) {
|
||||
@@ -160,17 +147,14 @@ async function holdNextPluginCatalogResponse(page: Page) {
|
||||
let holdCatalog = true;
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (socket) => {
|
||||
const server = socket.connectToServer();
|
||||
const assembleServer = createWsFrameAssembler();
|
||||
socket.onMessage((message) => server.send(message));
|
||||
server.onMessage((raw) => {
|
||||
const assembled = assembleServer(raw);
|
||||
if (!assembled) return;
|
||||
if (holdCatalog && isPluginCatalogResponse(assembled.text)) {
|
||||
server.onMessage((message) => {
|
||||
if (holdCatalog && isPluginCatalogResponse(message)) {
|
||||
holdCatalog = false;
|
||||
response.resolve(() => sendWsFrames(socket, assembled.frames));
|
||||
response.resolve(() => socket.send(message));
|
||||
return;
|
||||
}
|
||||
sendWsFrames(socket, assembled.frames);
|
||||
socket.send(message);
|
||||
});
|
||||
});
|
||||
return { response: response.promise };
|
||||
|
||||
@@ -1,288 +0,0 @@
|
||||
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import type { Locator, TestInfo } from "@playwright/test";
|
||||
import { expect, test, type Page } from "../support/fixtures";
|
||||
import { openCommandCenter } from "../support/helpers/command-center";
|
||||
import { openFileExplorer, openFileFromExplorer } from "../support/helpers/file-explorer";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
import { connectNewWorkspaceDaemonClient } from "../support/helpers/new-workspace";
|
||||
import { approveClientPluginsInUi } from "../support/helpers/plugin-execution-approval";
|
||||
import { pluginRequirements } from "../support/helpers/plugin-fixture";
|
||||
|
||||
const PLUGIN_ID = "tab-set-title-e2e";
|
||||
const WIDE = { width: 1440, height: 900 };
|
||||
|
||||
const CLIENT_SOURCE = `import React from "react";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
import type {
|
||||
PluginAgentPanelProps,
|
||||
PluginClientContext,
|
||||
PluginFilePanelProps,
|
||||
PluginWorkspacePanelProps,
|
||||
} from "@getpaseo/plugin/client";
|
||||
|
||||
function TitleControls({
|
||||
prefix,
|
||||
nextTitle,
|
||||
tab,
|
||||
}: {
|
||||
prefix: string;
|
||||
nextTitle: string;
|
||||
tab: PluginWorkspacePanelProps["tab"];
|
||||
}) {
|
||||
return (
|
||||
<View style={{ padding: 16, gap: 8 }}>
|
||||
<Text>{prefix} panel</Text>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={() => tab.setTitle(" " + nextTitle + " ")}
|
||||
>
|
||||
<Text>Set {prefix} title</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={() => tab.setTitle(" ")}
|
||||
>
|
||||
<Text>Whitespace {prefix} title</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={() => tab.setTitle(null)}
|
||||
>
|
||||
<Text>Reset {prefix} title</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function StatusPanel({ tab }: PluginWorkspacePanelProps) {
|
||||
return <TitleControls prefix="status" nextTitle="Status (3)" tab={tab} />;
|
||||
}
|
||||
|
||||
function ExplorerStatusPanel({ tab }: PluginWorkspacePanelProps) {
|
||||
return <TitleControls prefix="explorer" nextTitle="Explorer (7)" tab={tab} />;
|
||||
}
|
||||
|
||||
function InspectorPanel({ tab }: PluginAgentPanelProps) {
|
||||
return <TitleControls prefix="agent" nextTitle="Inspector: live" tab={tab} />;
|
||||
}
|
||||
|
||||
function NotesTxtPanel({ tab }: PluginFilePanelProps) {
|
||||
return <TitleControls prefix="file" nextTitle="Readout" tab={tab} />;
|
||||
}
|
||||
|
||||
export default function contribute(client: PluginClientContext) {
|
||||
client.addWorkspacePanel({
|
||||
id: "status",
|
||||
title: "Status",
|
||||
icon: "PanelsTopLeft",
|
||||
locations: ["workspace", "explorer"],
|
||||
Component: StatusPanel,
|
||||
});
|
||||
client.addWorkspacePanel({
|
||||
id: "explorer-status",
|
||||
title: "Explorer status",
|
||||
icon: "PanelsTopLeft",
|
||||
locations: ["workspace", "explorer"],
|
||||
Component: ExplorerStatusPanel,
|
||||
});
|
||||
client.addAgentPanel({
|
||||
id: "inspector",
|
||||
title: "Inspector",
|
||||
icon: "Scan",
|
||||
locations: ["workspace", "explorer"],
|
||||
Component: InspectorPanel,
|
||||
});
|
||||
client.addFilePanel({
|
||||
id: "txt-viewer",
|
||||
title: "Custom TXT",
|
||||
icon: "FileText",
|
||||
files: { extensions: ["txt"] },
|
||||
Component: NotesTxtPanel,
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-status",
|
||||
title: "Open status panel",
|
||||
icon: "PanelsTopLeft",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "status" });
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-explorer-status",
|
||||
title: "Open explorer status panel",
|
||||
icon: "PanelsTopLeft",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "explorer-status" }, { placement: { type: "explorer" } });
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-inspector",
|
||||
title: "Open inspector panel",
|
||||
icon: "Scan",
|
||||
context: "agent",
|
||||
onSelect({ workspaceLayout, agent }) {
|
||||
workspaceLayout.open({ panelId: "inspector", params: { agentId: agent.id } });
|
||||
},
|
||||
});
|
||||
return () => {};
|
||||
}
|
||||
`;
|
||||
|
||||
async function runCommand(page: Page, title: string): Promise<void> {
|
||||
const panel = await openCommandCenter(page);
|
||||
await panel.getByTestId("command-center-input").fill(title);
|
||||
await panel.getByRole("button", { name: title, exact: true }).click();
|
||||
await expect(panel).not.toBeVisible();
|
||||
}
|
||||
|
||||
function mainPane(page: Page): Locator {
|
||||
return page.locator('[data-testid^="workspace-pane-"]').filter({ visible: true }).first();
|
||||
}
|
||||
|
||||
function explorer(page: Page): Locator {
|
||||
return page.getByTestId("workspace-explorer-sidebar");
|
||||
}
|
||||
|
||||
function tabChip(scope: Locator, idPart: string): Locator {
|
||||
return scope
|
||||
.locator(
|
||||
`[data-testid^="workspace-tab-"][data-testid*="${idPart}"]:not([data-testid^="workspace-tab-tooltip"]):not([data-testid^="workspace-tab-modified"])`,
|
||||
)
|
||||
.first();
|
||||
}
|
||||
|
||||
async function capture(page: Page, testInfo: TestInfo, name: string): Promise<void> {
|
||||
const screenshot = testInfo.outputPath(`${name}.png`);
|
||||
await page.screenshot({ path: screenshot });
|
||||
await testInfo.attach(name, { path: screenshot, contentType: "image/png" });
|
||||
}
|
||||
|
||||
test("PluginTab.setTitle updates and resets tab labels in main pane, Explorer, agent, and file panels", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
test.setTimeout(180_000);
|
||||
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-tab-set-title-"));
|
||||
const workspace = await seedMockAgentWorkspace({
|
||||
repoPrefix: "plugin-tab-set-title-",
|
||||
title: "Tab Title Agent",
|
||||
repo: {
|
||||
files: [{ path: "notes.txt", content: "Sample notes\n" }],
|
||||
},
|
||||
});
|
||||
const client = await connectNewWorkspaceDaemonClient({ ownProjects: false });
|
||||
const previousConfig = await client.getDaemonConfig();
|
||||
|
||||
await writeFile(
|
||||
path.join(directory, "paseo-plugin.json"),
|
||||
JSON.stringify({ id: PLUGIN_ID, requirements: pluginRequirements }),
|
||||
);
|
||||
await writeFile(path.join(directory, "index.client.tsx"), CLIENT_SOURCE);
|
||||
|
||||
try {
|
||||
await client.patchDaemonConfig({ pluginsEnabled: true });
|
||||
await client.installDirectoryPlugin(directory);
|
||||
await page.setViewportSize(WIDE);
|
||||
await openAgentRoute(page, {
|
||||
workspaceId: workspace.workspaceId,
|
||||
agentId: workspace.agentId,
|
||||
});
|
||||
await approveClientPluginsInUi(page, [PLUGIN_ID]);
|
||||
|
||||
await test.step("main pane workspace panel sets, trims, clears, and resets title + tooltip", async () => {
|
||||
await runCommand(page, "Open status panel");
|
||||
const tab = tabChip(mainPane(page), "_status");
|
||||
await expect(tab).toContainText("Status");
|
||||
await expect(tab).toHaveAttribute("aria-label", "Status");
|
||||
|
||||
await page.getByRole("button", { name: "Set status title", exact: true }).click();
|
||||
await expect(tab).toContainText("Status (3)");
|
||||
await expect(tab).toHaveAttribute("aria-label", "Status (3)");
|
||||
await expect.poll(() => page.title()).toBe("Status (3)");
|
||||
await tab.hover();
|
||||
await expect(page.getByText("Status (3)").last()).toBeVisible();
|
||||
await capture(page, testInfo, "main-pane-title-override");
|
||||
|
||||
await page.getByRole("button", { name: "Whitespace status title", exact: true }).click();
|
||||
await expect(tab).toContainText("Status");
|
||||
await expect(tab).toHaveAttribute("aria-label", "Status");
|
||||
|
||||
await page.getByRole("button", { name: "Set status title", exact: true }).click();
|
||||
await expect(tab).toContainText("Status (3)");
|
||||
|
||||
await page.getByRole("button", { name: "Reset status title", exact: true }).click();
|
||||
await expect(tab).toContainText("Status");
|
||||
await expect.poll(() => page.title()).toBe("Status");
|
||||
});
|
||||
|
||||
await test.step("Explorer workspace panel sets and resets title", async () => {
|
||||
await runCommand(page, "Open explorer status panel");
|
||||
const explorerTab = tabChip(explorer(page), "explorer-status");
|
||||
await expect(explorerTab).toContainText("Explorer status");
|
||||
await expect(explorerTab).toHaveAttribute("aria-label", "Explorer status");
|
||||
|
||||
await page.getByRole("button", { name: "Set explorer title", exact: true }).click();
|
||||
await expect(explorerTab).toContainText("Explorer (7)");
|
||||
await expect(explorerTab).toHaveAttribute("aria-label", "Explorer (7)");
|
||||
await capture(page, testInfo, "explorer-title-override");
|
||||
|
||||
await page.getByRole("button", { name: "Reset explorer title", exact: true }).click();
|
||||
await expect(explorerTab).toContainText("Explorer status");
|
||||
await expect(explorerTab).toHaveAttribute("aria-label", "Explorer status");
|
||||
});
|
||||
|
||||
await test.step("agent panel sets and resets title", async () => {
|
||||
await mainPane(page).getByTestId(`workspace-tab-agent_${workspace.agentId}`).click();
|
||||
await runCommand(page, "Open inspector panel");
|
||||
const agentTab = tabChip(mainPane(page), "inspector");
|
||||
await expect(agentTab).toContainText("Inspector");
|
||||
|
||||
await page.getByRole("button", { name: "Set agent title", exact: true }).click();
|
||||
await expect(agentTab).toContainText("Inspector: live");
|
||||
|
||||
await page.getByRole("button", { name: "Reset agent title", exact: true }).click();
|
||||
await expect(agentTab).toContainText("Inspector");
|
||||
});
|
||||
|
||||
await test.step("file panel sets and resets title", async () => {
|
||||
await openFileExplorer(page);
|
||||
await openFileFromExplorer(page, "notes.txt");
|
||||
await expect(page.getByText("Open .txt files with", { exact: true })).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.getByText("Open .txt files with", { exact: true })).toBeHidden();
|
||||
|
||||
const fileTab = mainPane(page).getByTestId("workspace-tab-file_notes.txt");
|
||||
await expect(fileTab).toContainText("notes.txt");
|
||||
|
||||
await page.getByRole("button", { name: "Set file title", exact: true }).click();
|
||||
await expect(fileTab).toContainText("Readout");
|
||||
await expect(fileTab).toHaveAttribute("aria-label", "Readout");
|
||||
|
||||
await page.getByRole("button", { name: "Reset file title", exact: true }).click();
|
||||
await expect(fileTab).toContainText("notes.txt");
|
||||
await expect(fileTab).toHaveAttribute("aria-label", "notes.txt");
|
||||
});
|
||||
|
||||
await test.step("removing the plugin clears active title override to Plugin unavailable", async () => {
|
||||
await tabChip(mainPane(page), "_status").click();
|
||||
await page.getByRole("button", { name: "Set status title", exact: true }).click();
|
||||
const tab = tabChip(mainPane(page), "_status");
|
||||
await expect(tab).toContainText("Status (3)");
|
||||
|
||||
await client.removePlugin(PLUGIN_ID);
|
||||
await expect(tab).toContainText("Plugin unavailable", { timeout: 30_000 });
|
||||
await expect(tab).toHaveAttribute("aria-label", "This plugin panel is unavailable");
|
||||
});
|
||||
} finally {
|
||||
await client.removePlugin(PLUGIN_ID).catch(() => undefined);
|
||||
await client
|
||||
.patchDaemonConfig({ pluginsEnabled: previousConfig.config.pluginsEnabled ?? false })
|
||||
.catch(() => undefined);
|
||||
await client.close().catch(() => undefined);
|
||||
await workspace.cleanup().catch(() => undefined);
|
||||
await rm(directory, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
@@ -326,537 +326,3 @@ test("a file a plugin opens in another workspace waits there on a phone", async
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const PARAMS_AND_IDENTITY_ENTRY = `import {
|
||||
type PluginClientContext,
|
||||
type PluginWorkspacePanelProps,
|
||||
useTabState,
|
||||
useWorkspaceLayout,
|
||||
} from "@getpaseo/plugin/client";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
import { z } from "zod";
|
||||
|
||||
const decisionParams = z.object({ decisionId: z.string() });
|
||||
const decisionStateSchema = z.object({ note: z.string() });
|
||||
|
||||
function DecisionsPanel({
|
||||
params,
|
||||
revision,
|
||||
tab,
|
||||
theme,
|
||||
}: PluginWorkspacePanelProps<z.infer<typeof decisionParams>>) {
|
||||
const [state, setState] = useTabState(tab, decisionStateSchema, { note: "initial" });
|
||||
return (
|
||||
<View style={{ flex: 1, padding: 16, gap: 8 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>
|
||||
{\`decision:\${params.decisionId}|rev:\${revision}|state:\${state.note}\`}
|
||||
</Text>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={() => setState({ note: "pinned" })}
|
||||
>
|
||||
<Text style={{ color: theme.colors.foreground }}>Pin decision state</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const prParams = z.object({
|
||||
prNumber: z.number(),
|
||||
commentId: z.string().optional(),
|
||||
});
|
||||
|
||||
function PrPanel({
|
||||
workspaceId,
|
||||
params,
|
||||
revision,
|
||||
theme,
|
||||
}: PluginWorkspacePanelProps<z.infer<typeof prParams>>) {
|
||||
const readBack = useWorkspaceLayout(workspaceId, (layout) => {
|
||||
const found = layout.tabs.find((entry) => entry.panelId === "workspace-layout/pr" && entry.params.prNumber === params.prNumber);
|
||||
return found ? JSON.stringify(found.params) : "missing";
|
||||
});
|
||||
return (
|
||||
<View style={{ flex: 1, padding: 16, gap: 8 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>
|
||||
{\`pr:\${params.prNumber}|comment:\${params.commentId ?? "none"}|rev:\${revision}\`}
|
||||
</Text>
|
||||
<Text style={{ color: theme.colors.foregroundMuted }}>
|
||||
{\`readback:\${params.prNumber}:\${readBack}\`}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function StaticPanel({ theme }: PluginWorkspacePanelProps) {
|
||||
return (
|
||||
<View style={{ flex: 1, padding: 16 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>Static parameterless panel</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export default function contribute(client: PluginClientContext) {
|
||||
client.addWorkspacePanel({
|
||||
id: "decisions",
|
||||
title: "Decisions",
|
||||
icon: "ListChecks",
|
||||
locations: ["explorer"],
|
||||
params: decisionParams,
|
||||
Component: DecisionsPanel,
|
||||
});
|
||||
client.addWorkspacePanel({
|
||||
id: "pr",
|
||||
title: "PR",
|
||||
icon: "GitPullRequest",
|
||||
params: prParams,
|
||||
identity: (p) => String(p.prNumber),
|
||||
Component: PrPanel,
|
||||
});
|
||||
client.addWorkspacePanel({
|
||||
id: "static",
|
||||
title: "Static",
|
||||
icon: "Square",
|
||||
locations: ["workspace", "explorer"],
|
||||
Component: StaticPanel,
|
||||
});
|
||||
|
||||
client.addCommandCenterItem({
|
||||
id: "open-decision-d1",
|
||||
title: "Open decision D1",
|
||||
icon: "ListChecks",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "decisions", params: { decisionId: "D1" } });
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-decision-d2",
|
||||
title: "Open decision D2",
|
||||
icon: "ListChecks",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "decisions", params: { decisionId: "D2" } });
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-pr-1a",
|
||||
title: "Open PR 1 comment a",
|
||||
icon: "GitPullRequest",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "pr", params: { prNumber: 1, commentId: "a" } });
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-pr-2x",
|
||||
title: "Open PR 2 comment x",
|
||||
icon: "GitPullRequest",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "pr", params: { prNumber: 2, commentId: "x" } });
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-pr-1b",
|
||||
title: "Open PR 1 comment b",
|
||||
icon: "GitPullRequest",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "pr", params: { prNumber: 1, commentId: "b" } });
|
||||
},
|
||||
});
|
||||
|
||||
return () => {};
|
||||
}
|
||||
`;
|
||||
|
||||
async function expectNewTabLauncherPanelAvailability(
|
||||
page: Page,
|
||||
input: { present: readonly string[]; absent: readonly string[] },
|
||||
): Promise<void> {
|
||||
await mainPanes(page).first().getByTestId("workspace-new-tab-button").click();
|
||||
const menu = page.getByTestId("workspace-new-tab-menu").filter({ visible: true });
|
||||
for (const label of input.present) {
|
||||
await expect(menu.getByText(label, { exact: true })).toBeVisible();
|
||||
}
|
||||
for (const label of input.absent) {
|
||||
await expect(menu.getByText(label, { exact: true })).toHaveCount(0);
|
||||
}
|
||||
await page.keyboard.press("Escape");
|
||||
}
|
||||
|
||||
async function expectDecisionsPanel(
|
||||
page: Page,
|
||||
input: { tabs: number; decisionId: string; revision: number; stateNote: string },
|
||||
): Promise<void> {
|
||||
await expect(
|
||||
explorer(page)
|
||||
.getByTestId("workspace-tabs-row")
|
||||
.getByRole("button", { name: "Decisions", exact: true }),
|
||||
).toHaveCount(input.tabs);
|
||||
await expect(
|
||||
explorer(page).getByText(
|
||||
`decision:${input.decisionId}|rev:${input.revision}|state:${input.stateNote}`,
|
||||
{ exact: true },
|
||||
),
|
||||
).toBeVisible();
|
||||
}
|
||||
|
||||
async function pinDecisionState(page: Page): Promise<void> {
|
||||
await explorer(page).getByRole("button", { name: "Pin decision state" }).click();
|
||||
}
|
||||
|
||||
async function expectPrPanel(
|
||||
page: Page,
|
||||
input: {
|
||||
tabs: number;
|
||||
prNumber: number;
|
||||
commentId: string;
|
||||
revision: number;
|
||||
persistedParams?: { prNumber: number; commentId: string };
|
||||
},
|
||||
): Promise<void> {
|
||||
await expect(
|
||||
mainPanes(page)
|
||||
.first()
|
||||
.getByTestId("workspace-tabs-row")
|
||||
.getByRole("button", { name: "PR", exact: true }),
|
||||
).toHaveCount(input.tabs);
|
||||
await expect(
|
||||
page.getByText(`pr:${input.prNumber}|comment:${input.commentId}|rev:${input.revision}`, {
|
||||
exact: true,
|
||||
}),
|
||||
).toBeVisible();
|
||||
if (input.persistedParams) {
|
||||
await expect(
|
||||
page.getByText(`readback:${input.prNumber}:${JSON.stringify(input.persistedParams)}`, {
|
||||
exact: true,
|
||||
}),
|
||||
).toBeVisible();
|
||||
}
|
||||
}
|
||||
|
||||
test("reused Explorer panels and keyed workspace panels deliver params, identity, revision, and tab state", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
const example = await copyPluginExample("workspace-layout");
|
||||
await writeFile(path.join(example.directory, "index.client.tsx"), PARAMS_AND_IDENTITY_ENTRY);
|
||||
const workspace = await seedMockAgentWorkspace({
|
||||
repoPrefix: "plugin-params-identity-",
|
||||
title: AGENT_TITLE,
|
||||
repo: { files: REPO_FILES },
|
||||
});
|
||||
try {
|
||||
await withPluginInstalled(example.directory, async () => {
|
||||
await page.setViewportSize(WIDE);
|
||||
await openAgentRoute(page, workspace);
|
||||
await approveClientPluginsInUi(page, ["workspace-layout"]);
|
||||
|
||||
await test.step("parameterless launcher hides panels with required params and keeps parameterless ones", async () => {
|
||||
await expectNewTabLauncherPanelAvailability(page, {
|
||||
present: ["Static"],
|
||||
absent: ["PR", "Decisions"],
|
||||
});
|
||||
});
|
||||
|
||||
await test.step("reused Explorer panel updates params in place, bumps revision, and preserves tab.state", async () => {
|
||||
await runCommand(page, "Open decision D1");
|
||||
await expectDecisionsPanel(page, {
|
||||
tabs: 1,
|
||||
decisionId: "D1",
|
||||
revision: 1,
|
||||
stateNote: "initial",
|
||||
});
|
||||
|
||||
await pinDecisionState(page);
|
||||
await expectDecisionsPanel(page, {
|
||||
tabs: 1,
|
||||
decisionId: "D1",
|
||||
revision: 1,
|
||||
stateNote: "pinned",
|
||||
});
|
||||
|
||||
await runCommand(page, "Open decision D2");
|
||||
await expectDecisionsPanel(page, {
|
||||
tabs: 1,
|
||||
decisionId: "D2",
|
||||
revision: 2,
|
||||
stateNote: "pinned",
|
||||
});
|
||||
});
|
||||
|
||||
await test.step("keyed panel opens separate tabs per identity key and updates hint params on reveal", async () => {
|
||||
await runCommand(page, "Open PR 1 comment a");
|
||||
await expectPrPanel(page, { tabs: 1, prNumber: 1, commentId: "a", revision: 1 });
|
||||
|
||||
await runCommand(page, "Open PR 2 comment x");
|
||||
await expectPrPanel(page, { tabs: 2, prNumber: 2, commentId: "x", revision: 1 });
|
||||
|
||||
await runCommand(page, "Open PR 1 comment b");
|
||||
await expectPrPanel(page, {
|
||||
tabs: 2,
|
||||
prNumber: 1,
|
||||
commentId: "b",
|
||||
revision: 2,
|
||||
persistedParams: { prNumber: 1, commentId: "b" },
|
||||
});
|
||||
});
|
||||
});
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
await example.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
const MIN_WIDTH_ENTRY = `import type {
|
||||
PluginAgentPanelProps,
|
||||
PluginClientContext,
|
||||
PluginFilePanelProps,
|
||||
PluginWorkspacePanelProps,
|
||||
} from "@getpaseo/plugin/client";
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
function WideWorkspacePanel({ theme }: PluginWorkspacePanelProps) {
|
||||
return (
|
||||
<View style={{ flex: 1, padding: 16, backgroundColor: theme.colors.surface0 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>Wide workspace panel content</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function WideAgentPanel({ theme, params }: PluginAgentPanelProps) {
|
||||
return (
|
||||
<View style={{ flex: 1, padding: 16, backgroundColor: theme.colors.surface0 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>{\`Wide agent panel \${params.agentId}\`}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function WideSpecFilePanel({ theme, file }: PluginFilePanelProps) {
|
||||
return (
|
||||
<View style={{ flex: 1, padding: 16, backgroundColor: theme.colors.surface0 }}>
|
||||
<Text style={{ color: theme.colors.foreground }}>{\`Wide spec file \${file.name}\`}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export default function contribute(client: PluginClientContext) {
|
||||
client.addWorkspacePanel({
|
||||
id: "wide-board",
|
||||
title: "Wide board",
|
||||
icon: "PanelsTopLeft",
|
||||
locations: ["explorer"],
|
||||
minWidth: 480,
|
||||
Component: WideWorkspacePanel,
|
||||
});
|
||||
client.addAgentPanel({
|
||||
id: "wide-review",
|
||||
title: "Wide review",
|
||||
icon: "Scan",
|
||||
locations: ["explorer"],
|
||||
minWidth: 520,
|
||||
Component: WideAgentPanel,
|
||||
});
|
||||
client.addFilePanel({
|
||||
id: "wide-spec",
|
||||
title: "Wide spec",
|
||||
icon: "FileText",
|
||||
files: { extensions: ["specfile"] },
|
||||
minWidth: 600,
|
||||
Component: WideSpecFilePanel,
|
||||
});
|
||||
|
||||
client.addCommandCenterItem({
|
||||
id: "open-wide-board",
|
||||
title: "Open wide board",
|
||||
icon: "PanelsTopLeft",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open({ panelId: "wide-board" }, { placement: { type: "explorer" } });
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-wide-review",
|
||||
title: "Open wide review",
|
||||
icon: "Scan",
|
||||
context: "agent",
|
||||
onSelect({ workspaceLayout, agent }) {
|
||||
workspaceLayout.open(
|
||||
{ panelId: "wide-review", params: { agentId: agent.id } },
|
||||
{ placement: { type: "explorer" } },
|
||||
);
|
||||
},
|
||||
});
|
||||
client.addCommandCenterItem({
|
||||
id: "open-wide-spec",
|
||||
title: "Open wide spec",
|
||||
icon: "FileText",
|
||||
context: "workspace",
|
||||
onSelect({ workspaceLayout }) {
|
||||
workspaceLayout.open(
|
||||
{ panelId: "paseo/file", params: { path: "sample.specfile" } },
|
||||
{ placement: { type: "explorer" } },
|
||||
);
|
||||
},
|
||||
});
|
||||
return () => {};
|
||||
}
|
||||
`;
|
||||
|
||||
async function expectExplorerWidth(page: Page, expected: number): Promise<void> {
|
||||
await expect
|
||||
.poll(async () => (await explorer(page).boundingBox())?.width)
|
||||
.toBeCloseTo(expected, 0);
|
||||
}
|
||||
|
||||
async function expectExplorerWidthAtMost(page: Page, max: number): Promise<void> {
|
||||
await expect
|
||||
.poll(async () => (await explorer(page).boundingBox())?.width)
|
||||
.toBeLessThanOrEqual(max);
|
||||
}
|
||||
|
||||
async function dragExplorerHandle(page: Page, deltaX: number): Promise<void> {
|
||||
const handle = page
|
||||
.getByTestId("workspace-explorer-sidebar-resize-handle")
|
||||
.getByRole("separator");
|
||||
const bounds = await handle.boundingBox();
|
||||
if (!bounds) throw new Error("Explorer resize handle is missing");
|
||||
const startX = bounds.x + bounds.width / 2;
|
||||
const startY = bounds.y + Math.min(100, bounds.height / 2);
|
||||
await page.mouse.move(startX, startY);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(startX + deltaX, startY, { steps: 10 });
|
||||
await page.mouse.up();
|
||||
}
|
||||
|
||||
test("plugin panel minWidth widens desktop Explorer non-destructively, respects body minimum, and is ignored on compact", async ({
|
||||
page,
|
||||
}) => {
|
||||
test.setTimeout(180_000);
|
||||
const example = await copyPluginExample("workspace-layout");
|
||||
await writeFile(path.join(example.directory, "index.client.tsx"), MIN_WIDTH_ENTRY);
|
||||
const workspace = await seedMockAgentWorkspace({
|
||||
repoPrefix: "plugin-min-width-",
|
||||
title: AGENT_TITLE,
|
||||
repo: {
|
||||
files: [...REPO_FILES, { path: "sample.specfile", content: "spec v1\n" }],
|
||||
},
|
||||
});
|
||||
try {
|
||||
await withPluginInstalled(example.directory, async () => {
|
||||
await page.setViewportSize({ width: 1440, height: 900 });
|
||||
await openAgentRoute(page, workspace);
|
||||
await approveClientPluginsInUi(page, ["workspace-layout"]);
|
||||
|
||||
await test.step("workspace panel minWidth: 480 widens Explorer and restores 320px on Files", async () => {
|
||||
await runCommand(page, "Open wide board");
|
||||
await expect(
|
||||
explorer(page).getByText("Wide workspace panel content", { exact: true }),
|
||||
).toBeVisible();
|
||||
await expectExplorerWidth(page, 480);
|
||||
|
||||
await explorer(page)
|
||||
.getByRole("button", { name: "Browse workspace files", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 320);
|
||||
});
|
||||
|
||||
await test.step("agent panel minWidth: 520 and file panel minWidth: 600 widen Explorer and restore 320px", async () => {
|
||||
await runCommand(page, "Open wide review");
|
||||
await expect(
|
||||
explorer(page).getByText(`Wide agent panel ${workspace.agentId}`, { exact: true }),
|
||||
).toBeVisible();
|
||||
await expectExplorerWidth(page, 520);
|
||||
|
||||
await explorer(page)
|
||||
.getByRole("button", { name: "Browse workspace files", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 320);
|
||||
|
||||
await runCommand(page, "Open wide spec");
|
||||
await page.getByRole("button", { name: "Use", exact: true }).click();
|
||||
await expect(
|
||||
explorer(page).getByText("Wide spec file sample.specfile", { exact: true }),
|
||||
).toBeVisible();
|
||||
await expectExplorerWidth(page, 600);
|
||||
|
||||
await explorer(page)
|
||||
.getByRole("button", { name: "Browse workspace files", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 320);
|
||||
});
|
||||
|
||||
await test.step("live drag clamps at minWidth and preserves dragged wider width across tabs", async () => {
|
||||
await runCommand(page, "Open wide board");
|
||||
await expectExplorerWidth(page, 480);
|
||||
|
||||
// Drag narrower -> clamps at 480 and does not overwrite default 320 on Files.
|
||||
await dragExplorerHandle(page, 120);
|
||||
await expectExplorerWidth(page, 480);
|
||||
await explorer(page)
|
||||
.getByRole("button", { name: "Browse workspace files", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 320);
|
||||
|
||||
// Drag wider to 560 -> persists 560 across Files, and minWidth: 600 still widens to 600.
|
||||
await runCommand(page, "Open wide board");
|
||||
await expectExplorerWidth(page, 480);
|
||||
await dragExplorerHandle(page, -80);
|
||||
await expectExplorerWidth(page, 560);
|
||||
await explorer(page)
|
||||
.getByRole("button", { name: "Browse workspace files", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 560);
|
||||
await explorer(page)
|
||||
.getByTestId("workspace-tabs-row")
|
||||
.getByRole("button", { name: "sample.specfile", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 600);
|
||||
await explorer(page)
|
||||
.getByRole("button", { name: "Browse workspace files", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 560);
|
||||
});
|
||||
|
||||
await test.step("narrow desktop viewport keeps at least 360px for the workspace body", async () => {
|
||||
await explorer(page)
|
||||
.getByTestId("workspace-tabs-row")
|
||||
.getByRole("button", { name: "sample.specfile", exact: true })
|
||||
.click();
|
||||
await expectExplorerWidth(page, 600);
|
||||
|
||||
await page.setViewportSize({ width: 750, height: 900 });
|
||||
await expectExplorerWidthAtMost(page, 390);
|
||||
const mainBox = await mainPanes(page).first().boundingBox();
|
||||
expect(mainBox?.width ?? 0).toBeGreaterThanOrEqual(360);
|
||||
});
|
||||
|
||||
await test.step("compact/mobile viewport ignores minWidth and renders full-width Explorer overlay", async () => {
|
||||
await page.setViewportSize(COMPACT);
|
||||
await expect(page.getByTestId("compact-shell")).toBeVisible();
|
||||
await expectMobileExplorerHidden(page);
|
||||
await page
|
||||
.getByTestId("workspace-explorer-toggle")
|
||||
.filter({ visible: true })
|
||||
.first()
|
||||
.click();
|
||||
await expectMobileExplorerVisible(page);
|
||||
await explorer(page)
|
||||
.getByTestId("workspace-tabs-row")
|
||||
.getByRole("button", { name: "Wide board", exact: true })
|
||||
.click();
|
||||
await expect(
|
||||
explorer(page).getByText("Wide workspace panel content", { exact: true }),
|
||||
).toBeVisible();
|
||||
await expectExplorerWidth(page, COMPACT.width);
|
||||
await closeMobileExplorer(page);
|
||||
await expectMobileExplorerHidden(page);
|
||||
});
|
||||
});
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
await example.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -42,40 +42,17 @@ import { useAgent, useWorkspace, openExternalUrl } from "@getpaseo/plugin/client
|
||||
import { ExternalLink } from "@getpaseo/plugin/client/ui";
|
||||
import { recordComposerOpen } from "./shared/rpc";
|
||||
|
||||
function WorkspacePanel({ workspaceId, host, layout, openScreen }) {
|
||||
function WorkspacePanel({ workspaceId, host, layout }) {
|
||||
const workspace = useWorkspace(workspaceId, (value) => ({ id: value.id }));
|
||||
const renderCount = useRef(0);
|
||||
renderCount.current += 1;
|
||||
return <View>
|
||||
<Text>Workspace bridge {workspace?.id}</Text>
|
||||
<Text>Workspace renders {renderCount.current}</Text>
|
||||
<Text>Host {host.id}</Text>
|
||||
<Text>Layout {layout.compact ? "compact" : "wide"}</Text>
|
||||
<Pressable accessibilityRole="button" onPress={() => openScreen({ screenId: "details", params: { source: "workspace-panel", item: workspaceId } })}><Text>Open screen from workspace panel</Text></Pressable>
|
||||
</View>;
|
||||
return <View><Text>Workspace bridge {workspace?.id}</Text><Text>Workspace renders {renderCount.current}</Text><Text>Host {host.id}</Text><Text>Layout {layout.compact ? "compact" : "wide"}</Text></View>;
|
||||
}
|
||||
|
||||
function AgentPanel({ workspaceId, agentId, host, layout, openScreen }) {
|
||||
function AgentPanel({ workspaceId, agentId, host, layout }) {
|
||||
const workspace = useWorkspace(workspaceId, (value) => ({ id: value.id }));
|
||||
const agent = useAgent(agentId, (value) => ({ id: value.id }));
|
||||
return <View>
|
||||
<Text>Agent bridge {agent?.id}</Text>
|
||||
<Text>Workspace {workspace?.id}</Text>
|
||||
<Text>Host {host.id}</Text>
|
||||
<Text>Layout {layout.compact ? "compact" : "wide"}</Text>
|
||||
<Pressable accessibilityRole="button" onPress={() => openScreen({ screenId: "details", params: { source: "agent-panel", item: agentId } })}><Text>Open screen from agent panel</Text></Pressable>
|
||||
</View>;
|
||||
}
|
||||
|
||||
function DetailsScreen({ params, openScreen }) {
|
||||
return <View>
|
||||
<Text>{"Details screen: " + params.source + " / " + params.item}</Text>
|
||||
<Pressable accessibilityRole="button" onPress={() => openScreen({ screenId: "chained", params: { from: params.source ?? "" } })}><Text>Open chained screen</Text></Pressable>
|
||||
</View>;
|
||||
}
|
||||
|
||||
function ChainedScreen({ params }) {
|
||||
return <View><Text>{"Chained screen from " + params.from}</Text></View>;
|
||||
return <View><Text>Agent bridge {agent?.id}</Text><Text>Workspace {workspace?.id}</Text><Text>Host {host.id}</Text><Text>Layout {layout.compact ? "compact" : "wide"}</Text></View>;
|
||||
}
|
||||
|
||||
function DirectCollisionSurface({ navigation }) {
|
||||
@@ -150,8 +127,6 @@ function contributeClient(client) {
|
||||
}
|
||||
|
||||
export default function contribute(client) {
|
||||
client.addScreen({ id: "details", title: (params) => "Details: " + (params.source ?? ""), Component: DetailsScreen });
|
||||
client.addScreen({ id: "chained", title: "Chained", Component: ChainedScreen });
|
||||
client.addSurface("collision", DirectCollisionSurface);
|
||||
client.addSurface("sidebar-destination", SidebarCollisionSurface);
|
||||
client.addSidebarItem({ id: "collision", title: "Collision sidebar", icon: "Blocks", surface: "sidebar-destination" });
|
||||
@@ -277,34 +252,6 @@ async function openCompactSidebar(page: Page): Promise<void> {
|
||||
await expect(page.getByTestId("sidebar-search")).toBeVisible();
|
||||
}
|
||||
|
||||
async function openPluginScreenFromButton(
|
||||
page: Page,
|
||||
input: {
|
||||
buttonName: string;
|
||||
screenId: string;
|
||||
params: Record<string, string>;
|
||||
expectedText: string;
|
||||
},
|
||||
): Promise<void> {
|
||||
await page.getByRole("button", { name: input.buttonName, exact: true }).click();
|
||||
const query = Object.entries(input.params)
|
||||
.map(([key, value]) => `${encodeURIComponent(`param.${key}`)}=${encodeURIComponent(value)}`)
|
||||
.join("&");
|
||||
await expect(page).toHaveURL(
|
||||
new RegExp(`/plugin/${PLUGIN_ID}/surface/${input.screenId}\\?${query.replaceAll(".", "\\.")}$`),
|
||||
);
|
||||
await expect(page.getByText(input.expectedText, { exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
async function closeTopPluginScreen(
|
||||
page: Page,
|
||||
options: { compact?: boolean; expectedText: string },
|
||||
): Promise<void> {
|
||||
const testId = options.compact ? "header-back-button" : "plugin-surface-close";
|
||||
await page.getByTestId(testId).filter({ visible: true }).last().click();
|
||||
await expect(page.getByText(options.expectedText, { exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
async function capture(page: Page, testInfo: TestInfo, name: string): Promise<void> {
|
||||
const screenshot = testInfo.outputPath(`${name}.png`);
|
||||
await page.screenshot({ path: screenshot });
|
||||
@@ -391,24 +338,6 @@ test.describe("plugin workspace panels and Command Center", () => {
|
||||
await expect(page.getByText(`Host ${getServerId()}`, { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("Layout wide", { exact: true })).toBeVisible();
|
||||
await capture(page, testInfo, "plugin-workspace-panel-wide");
|
||||
await openPluginScreenFromButton(page, {
|
||||
buttonName: "Open screen from workspace panel",
|
||||
screenId: "details",
|
||||
params: { source: "workspace-panel", item: primary.workspaceId },
|
||||
expectedText: `Details screen: workspace-panel / ${primary.workspaceId}`,
|
||||
});
|
||||
await openPluginScreenFromButton(page, {
|
||||
buttonName: "Open chained screen",
|
||||
screenId: "chained",
|
||||
params: { from: "workspace-panel" },
|
||||
expectedText: "Chained screen from workspace-panel",
|
||||
});
|
||||
await closeTopPluginScreen(page, {
|
||||
expectedText: `Details screen: workspace-panel / ${primary.workspaceId}`,
|
||||
});
|
||||
await closeTopPluginScreen(page, {
|
||||
expectedText: `Workspace bridge ${primary.workspaceId}`,
|
||||
});
|
||||
});
|
||||
|
||||
await test.step("plugin links open browser tabs and in-app browsing is unavailable", async () => {
|
||||
@@ -546,16 +475,6 @@ test.describe("plugin workspace panels and Command Center", () => {
|
||||
).toBeVisible();
|
||||
await expect(page.getByText(`Host ${getServerId()}`, { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("Layout compact", { exact: true })).toBeVisible();
|
||||
await openPluginScreenFromButton(page, {
|
||||
buttonName: "Open screen from agent panel",
|
||||
screenId: "details",
|
||||
params: { source: "agent-panel", item: agent.id },
|
||||
expectedText: `Details screen: agent-panel / ${agent.id}`,
|
||||
});
|
||||
await closeTopPluginScreen(page, {
|
||||
compact: true,
|
||||
expectedText: `Agent bridge ${agent.id}`,
|
||||
});
|
||||
});
|
||||
|
||||
await test.step("removing the active plugin renders the panel unavailable", async () => {
|
||||
|
||||
@@ -1,400 +0,0 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { readFile, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { deflateRawSync } from "node:zlib";
|
||||
import { expect, type Page } from "@playwright/test";
|
||||
import {
|
||||
decodeHostRouteFrame,
|
||||
HOST_ROUTE_OPCODE,
|
||||
} from "@getpaseo/protocol/binary-frames/host-route";
|
||||
import { test } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { connectDaemonClient } from "../support/helpers/daemon-client-loader";
|
||||
import { getE2EDaemonPort } from "../support/helpers/daemon-port";
|
||||
import {
|
||||
expectExplorerEntryVisible,
|
||||
expectFileTabOpen,
|
||||
openFileExplorer,
|
||||
openFileFromExplorer,
|
||||
} from "../support/helpers/file-explorer";
|
||||
import { startIsolatedHostDaemon } from "../support/helpers/isolated-host-daemon";
|
||||
import { waitForTabBar } from "../support/helpers/launcher";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
|
||||
interface HostAdminClient {
|
||||
connect(): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
addHost(input: { connection: string; label?: string }): Promise<{ registrationId: string }>;
|
||||
listHosts(): Promise<{
|
||||
hosts: Array<{ registrationId: string; status: string; serverId?: string | null }>;
|
||||
}>;
|
||||
removeHost(registrationId: string): Promise<void>;
|
||||
}
|
||||
|
||||
interface BrowserCompressionTraffic {
|
||||
connectedPorts: Set<string>;
|
||||
/** `frame_codecs` of each hello the browser sent on its own socket; null when omitted. */
|
||||
outerHelloCodecs: Array<string[] | null>;
|
||||
/** `frame_codecs` of each hello the browser sent to a routed host through the primary. */
|
||||
routedHelloCodecs: Array<string[] | null>;
|
||||
outerEncodedFrames: number[];
|
||||
routedEncodedFrames: number[];
|
||||
}
|
||||
|
||||
interface SentHello {
|
||||
type?: string;
|
||||
capabilities?: { frame_codecs?: unknown };
|
||||
}
|
||||
|
||||
function helloCodecs(hello: SentHello): string[] | null {
|
||||
const codecs = hello.capabilities?.frame_codecs;
|
||||
return Array.isArray(codecs) ? (codecs as string[]) : null;
|
||||
}
|
||||
|
||||
function parseJson<T>(text: string): T | null {
|
||||
try {
|
||||
return JSON.parse(text) as T;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function observeBrowserCompressionTraffic(page: Page): BrowserCompressionTraffic {
|
||||
const traffic: BrowserCompressionTraffic = {
|
||||
connectedPorts: new Set(),
|
||||
outerHelloCodecs: [],
|
||||
routedHelloCodecs: [],
|
||||
outerEncodedFrames: [],
|
||||
routedEncodedFrames: [],
|
||||
};
|
||||
|
||||
page.on("websocket", (socket) => {
|
||||
const port = new URL(socket.url()).port;
|
||||
traffic.connectedPorts.add(port);
|
||||
|
||||
socket.on("framesent", ({ payload }) => {
|
||||
if (typeof payload !== "string") return;
|
||||
const parsed = parseJson<
|
||||
SentHello & { message?: { type?: string; data?: unknown; binary?: unknown } }
|
||||
>(payload);
|
||||
if (parsed?.type === "hello") {
|
||||
traffic.outerHelloCodecs.push(helloCodecs(parsed));
|
||||
return;
|
||||
}
|
||||
const routed = parsed?.message;
|
||||
if (
|
||||
parsed?.type === "session" &&
|
||||
routed?.type === "hosts.route.frame.request" &&
|
||||
typeof routed.data === "string"
|
||||
) {
|
||||
const hello = parseJson<SentHello>(routed.data);
|
||||
if (hello?.type === "hello") traffic.routedHelloCodecs.push(helloCodecs(hello));
|
||||
}
|
||||
});
|
||||
|
||||
socket.on("framereceived", ({ payload }) => {
|
||||
if (!(payload instanceof Buffer) || payload.byteLength < 4) return;
|
||||
const inspectRouted = (buf: Uint8Array) => {
|
||||
if (buf.byteLength < 4 || buf[0] !== HOST_ROUTE_OPCODE) return;
|
||||
const routed = decodeHostRouteFrame(buf);
|
||||
if (
|
||||
routed &&
|
||||
routed.payload instanceof Uint8Array &&
|
||||
routed.payload.byteLength >= 4 &&
|
||||
routed.payload[0] === 0x31 &&
|
||||
(routed.payload[3]! & 0x04) !== 0
|
||||
) {
|
||||
traffic.routedEncodedFrames.push(routed.payload.byteLength);
|
||||
}
|
||||
};
|
||||
|
||||
if (payload[0] === 0x31 && (payload[3]! & 0x04) !== 0) {
|
||||
traffic.outerEncodedFrames.push(payload.byteLength);
|
||||
return;
|
||||
}
|
||||
inspectRouted(payload);
|
||||
});
|
||||
});
|
||||
|
||||
return traffic;
|
||||
}
|
||||
|
||||
async function expectRoutedHelloAdvertises(
|
||||
traffic: BrowserCompressionTraffic,
|
||||
codecId: string,
|
||||
): Promise<void> {
|
||||
await expect
|
||||
.poll(() => traffic.routedHelloCodecs.some((codecs) => codecs?.includes(codecId) === true), {
|
||||
timeout: 20_000,
|
||||
})
|
||||
.toBe(true);
|
||||
}
|
||||
|
||||
async function waitForHostOnline(client: HostAdminClient, registrationId: string): Promise<void> {
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
const { hosts } = await client.listHosts();
|
||||
for (const row of hosts) {
|
||||
if (row.registrationId === registrationId) return row.status;
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
{ timeout: 30_000 },
|
||||
)
|
||||
.toBe("online");
|
||||
}
|
||||
|
||||
const PROTOCOL_DIST_DIR = path.resolve(__dirname, "../../../protocol/dist");
|
||||
const SERVED_PROTOCOL_FILES = new Set([
|
||||
"web-frame-codec.js",
|
||||
"frame-transport.js",
|
||||
"websocket-message-limit.js",
|
||||
"binary-frames/host-route.js",
|
||||
]);
|
||||
|
||||
async function verifyProductionWebCodecInChromium(page: Page, bombB64: string, validText: string) {
|
||||
const origin = "https://paseo-codec-test.local";
|
||||
await page.route(`${origin}/**`, async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
if (url.pathname === "/index.html") {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "text/html",
|
||||
body: "<!doctype html><html><body></body></html>",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const name = url.pathname.slice(1);
|
||||
if (SERVED_PROTOCOL_FILES.has(name)) {
|
||||
const source = await readFile(path.join(PROTOCOL_DIST_DIR, name), "utf8");
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/javascript; charset=utf-8",
|
||||
body: source,
|
||||
});
|
||||
return;
|
||||
}
|
||||
await route.abort();
|
||||
});
|
||||
|
||||
try {
|
||||
await page.goto(`${origin}/index.html`);
|
||||
return await page.evaluate(
|
||||
async ({ encodedBombB64, sampleText, codecModuleUrl }) => {
|
||||
const mod = (await import(codecModuleUrl)) as {
|
||||
createWebDeflateRawCodec: (options?: {
|
||||
DecompressionStream?: new (
|
||||
format: "deflate-raw",
|
||||
) => TransformStream<Uint8Array, Uint8Array>;
|
||||
}) => {
|
||||
encode(input: Uint8Array): Promise<Uint8Array>;
|
||||
decode(input: Uint8Array, maxOutputBytes: number): Promise<Uint8Array>;
|
||||
} | null;
|
||||
};
|
||||
|
||||
const NativeDecompressionStream = window.DecompressionStream;
|
||||
let maxSingleWriteBytes = 0;
|
||||
let inputBytesWritten = 0;
|
||||
let outputBytesProduced = 0;
|
||||
|
||||
class MeasuringDecompressionStream {
|
||||
readonly readable: ReadableStream<Uint8Array>;
|
||||
readonly writable: WritableStream<Uint8Array>;
|
||||
constructor(format: "deflate-raw") {
|
||||
const inner = new NativeDecompressionStream(format);
|
||||
const innerWriter = inner.writable.getWriter();
|
||||
const innerReader = inner.readable.getReader();
|
||||
this.writable = new WritableStream<Uint8Array>({
|
||||
write(chunk) {
|
||||
inputBytesWritten += chunk.byteLength;
|
||||
if (chunk.byteLength > maxSingleWriteBytes) {
|
||||
maxSingleWriteBytes = chunk.byteLength;
|
||||
}
|
||||
const bytes = new Uint8Array(chunk.byteLength);
|
||||
bytes.set(chunk);
|
||||
return innerWriter.write(bytes);
|
||||
},
|
||||
close: () => innerWriter.close(),
|
||||
abort: (reason) => innerWriter.abort(reason),
|
||||
});
|
||||
this.readable = new ReadableStream<Uint8Array>({
|
||||
async pull(controller) {
|
||||
const { value, done } = await innerReader.read();
|
||||
if (done) {
|
||||
controller.close();
|
||||
return;
|
||||
}
|
||||
outputBytesProduced += value.byteLength;
|
||||
controller.enqueue(value);
|
||||
},
|
||||
cancel(reason) {
|
||||
return innerReader.cancel(reason);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Exact-limit round-trip using production createWebDeflateRawCodec directly.
|
||||
const rawCodec = mod.createWebDeflateRawCodec();
|
||||
if (!rawCodec) throw new Error("createWebDeflateRawCodec returned null in Chromium");
|
||||
const encodedSample = await rawCodec.encode(new TextEncoder().encode(sampleText));
|
||||
const sampleByteLength = new TextEncoder().encode(sampleText).byteLength;
|
||||
const decodedExact = await rawCodec.decode(encodedSample, sampleByteLength);
|
||||
const exactMatch = new TextDecoder().decode(decodedExact) === sampleText;
|
||||
let rejectedBelowLimit = false;
|
||||
try {
|
||||
await rawCodec.decode(encodedSample, sampleByteLength - 1);
|
||||
} catch (err) {
|
||||
rejectedBelowLimit = /exceeded limit/.test(String(err));
|
||||
}
|
||||
|
||||
// Bomb test using production createWebDeflateRawCodec with injected native stream spy.
|
||||
const bin = atob(encodedBombB64);
|
||||
const bombInput = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; i++) bombInput[i] = bin.charCodeAt(i);
|
||||
|
||||
const measuredCodec = mod.createWebDeflateRawCodec({
|
||||
DecompressionStream: MeasuringDecompressionStream,
|
||||
});
|
||||
if (!measuredCodec) throw new Error("measured createWebDeflateRawCodec returned null");
|
||||
// Reset counters after constructor's format support probe.
|
||||
maxSingleWriteBytes = 0;
|
||||
inputBytesWritten = 0;
|
||||
outputBytesProduced = 0;
|
||||
|
||||
let bombRejected = false;
|
||||
let bombError = "";
|
||||
try {
|
||||
await measuredCodec.decode(bombInput, 64 * 1024);
|
||||
} catch (err) {
|
||||
bombError = String(err);
|
||||
bombRejected = /exceeded limit/.test(bombError);
|
||||
}
|
||||
|
||||
return {
|
||||
exactMatch,
|
||||
rejectedBelowLimit,
|
||||
bombRejected,
|
||||
bombError,
|
||||
maxSingleWriteBytes,
|
||||
inputBytesWritten,
|
||||
totalInputBytes: bombInput.byteLength,
|
||||
outputBytesProduced,
|
||||
};
|
||||
},
|
||||
{ encodedBombB64: bombB64, sampleText: validText, codecModuleUrl: "/web-frame-codec.js" },
|
||||
);
|
||||
} finally {
|
||||
await page.unroute(`${origin}/**`);
|
||||
}
|
||||
}
|
||||
|
||||
test.describe("Routed host frame compression in browser", () => {
|
||||
test.describe.configure({ timeout: 240_000 });
|
||||
|
||||
test("decodes compressed routed file reads via browser Web Streams without connecting directly to the secondary daemon", async ({
|
||||
page,
|
||||
}) => {
|
||||
const primaryPort = String(getE2EDaemonPort());
|
||||
const secondaryServerId = `srv_rcomp_${randomUUID().replaceAll("-", "").slice(0, 12)}`;
|
||||
let secondaryDaemon: Awaited<ReturnType<typeof startIsolatedHostDaemon>> | undefined;
|
||||
let primaryClient: HostAdminClient | undefined;
|
||||
let registrationId: string | null = null;
|
||||
let secondaryWorkspace: Awaited<ReturnType<typeof seedWorkspace>> | null = null;
|
||||
|
||||
const fileName = "routed-compression.ts";
|
||||
const startMarker = `ROUTED_BROWSER_DEFLATE_START_${randomUUID().slice(0, 8)}`;
|
||||
const endMarker = `ROUTED_BROWSER_DEFLATE_END_${randomUUID().slice(0, 8)}`;
|
||||
const largeFileContent =
|
||||
`// ${startMarker}\n` +
|
||||
Array.from(
|
||||
{ length: 450 },
|
||||
(_, i) => `export const routedLine${i} = "Paseo routed browser deflate-raw line ${i}";`,
|
||||
).join("\n") +
|
||||
`\n// ${endMarker}\n`;
|
||||
|
||||
try {
|
||||
secondaryDaemon = await startIsolatedHostDaemon(secondaryServerId);
|
||||
primaryClient = await connectDaemonClient<HostAdminClient>({
|
||||
clientIdPrefix: "routed-compression-admin",
|
||||
});
|
||||
secondaryWorkspace = await seedWorkspace({
|
||||
repoPrefix: "routed-compression-",
|
||||
port: secondaryDaemon.port,
|
||||
});
|
||||
await writeFile(path.join(secondaryWorkspace.repoPath, fileName), largeFileContent, "utf8");
|
||||
|
||||
// Register secondary on primary so the browser discovers it solely as a routed host.
|
||||
const registration = await primaryClient.addHost({
|
||||
connection: `127.0.0.1:${secondaryDaemon.port}`,
|
||||
label: "Routed Compression Host",
|
||||
});
|
||||
registrationId = registration.registrationId;
|
||||
await waitForHostOnline(primaryClient, registrationId);
|
||||
|
||||
const traffic = observeBrowserCompressionTraffic(page);
|
||||
|
||||
await test.step("open the routed host workspace through the primary daemon", async () => {
|
||||
await gotoAppShell(page);
|
||||
|
||||
const routedProjectGroup = page.getByRole("group", {
|
||||
name: path.basename(secondaryWorkspace!.repoPath),
|
||||
});
|
||||
await expect(routedProjectGroup).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
// The browser reaches the primary over loopback, so its own socket stays uncompressed,
|
||||
// while the routed host session negotiates deflate-raw end to end.
|
||||
expect(traffic.outerHelloCodecs.length).toBeGreaterThan(0);
|
||||
expect(new Set(traffic.outerHelloCodecs)).toEqual(new Set([null]));
|
||||
await expectRoutedHelloAdvertises(traffic, "deflate-raw");
|
||||
await routedProjectGroup.getByRole("button", { name: "main" }).click();
|
||||
await waitForTabBar(page);
|
||||
});
|
||||
|
||||
await test.step("open the 32 KB file from the routed host and verify compressed delivery", async () => {
|
||||
await openFileExplorer(page);
|
||||
await expectExplorerEntryVisible(page, fileName);
|
||||
await openFileFromExplorer(page, fileName);
|
||||
await expectFileTabOpen(page, fileName);
|
||||
|
||||
// Verify the browser decoded the compressed routed file cleanly.
|
||||
await expect(page.getByText(startMarker).first()).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
// Browser must only have opened sockets to the primary daemon (never directly to secondary).
|
||||
expect(traffic.connectedPorts.has(primaryPort)).toBe(true);
|
||||
expect(traffic.connectedPorts.has(String(secondaryDaemon!.port))).toBe(false);
|
||||
|
||||
// Real deflate-raw 0x31 ENCODED frames crossed the routed host channel, compressed once.
|
||||
expect(traffic.routedEncodedFrames.length).toBeGreaterThan(0);
|
||||
expect(Math.max(...traffic.routedEncodedFrames)).toBeLessThan(
|
||||
largeFileContent.length * 0.35,
|
||||
);
|
||||
expect(traffic.outerEncodedFrames).toEqual([]);
|
||||
});
|
||||
} finally {
|
||||
if (registrationId && primaryClient) {
|
||||
await primaryClient.removeHost(registrationId).catch(() => undefined);
|
||||
}
|
||||
await primaryClient?.close().catch(() => undefined);
|
||||
await secondaryWorkspace?.cleanup();
|
||||
await secondaryDaemon?.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("bounds Chromium decompression allocation using the production web frame codec", async ({
|
||||
page,
|
||||
}) => {
|
||||
const bombB64 = deflateRawSync(Buffer.alloc(20 * 1024 * 1024), { level: 9 }).toString("base64");
|
||||
const sampleText = "Paseo Chromium deflate-raw boundary check 🚀 ".repeat(200);
|
||||
const result = await verifyProductionWebCodecInChromium(page, bombB64, sampleText);
|
||||
|
||||
expect(result.exactMatch).toBe(true);
|
||||
expect(result.rejectedBelowLimit).toBe(true);
|
||||
expect(result.bombRejected).toBe(true);
|
||||
expect(result.maxSingleWriteBytes).toBeGreaterThan(0);
|
||||
expect(result.maxSingleWriteBytes).toBeLessThanOrEqual(1024);
|
||||
expect(result.inputBytesWritten).toBeLessThan(result.totalInputBytes);
|
||||
expect(result.outputBytesProduced).toBeLessThan(4 * 1024 * 1024);
|
||||
});
|
||||
});
|
||||
@@ -326,7 +326,7 @@ test("sidebar Add host preserves its caller and stays closed after theme changes
|
||||
|
||||
async function openSidebarAddHost(page: import("@playwright/test").Page) {
|
||||
await page.getByRole("button", { name: "Hosts", exact: true }).click();
|
||||
await page.getByRole("option", { name: "Add host", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Add host", exact: true }).click();
|
||||
await expect(page.getByRole("button", { name: "Direct connection", exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ test("New workspace Add host preserves the prompt after connecting", async ({ pa
|
||||
|
||||
async function openNewWorkspaceAddHost(page: import("@playwright/test").Page) {
|
||||
await page.getByTestId("host-picker-trigger").click();
|
||||
await page.getByRole("option", { name: "Add host", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Add host", exact: true }).click();
|
||||
}
|
||||
|
||||
async function connectToTestHost(page: import("@playwright/test").Page) {
|
||||
@@ -410,41 +410,3 @@ async function connectToTestHost(page: import("@playwright/test").Page) {
|
||||
await page.getByRole("button", { name: "Connect", exact: true }).click();
|
||||
await expect(page.getByTestId("add-host-modal")).toBeHidden({ timeout: 30_000 });
|
||||
}
|
||||
|
||||
test.describe("Settings host page on a wide touch screen", () => {
|
||||
test.use({ viewport: { width: 1400, height: 480 }, hasTouch: true, isMobile: true });
|
||||
|
||||
test("an info tip opened by a tap closes when the pane scrolls or another spot is tapped", async ({
|
||||
page,
|
||||
}) => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, getServerId());
|
||||
|
||||
const infoTip = page
|
||||
.getByTestId("host-page-idle-runtime-cleanup-card")
|
||||
.getByRole("button", { name: /^About / });
|
||||
await infoTip.scrollIntoViewIfNeeded();
|
||||
await infoTip.tap();
|
||||
await expect(page.getByRole("tooltip")).toBeVisible();
|
||||
|
||||
await infoTip.evaluate((element) => {
|
||||
for (let node = element.parentElement; node; node = node.parentElement) {
|
||||
if (
|
||||
node.scrollHeight > node.clientHeight &&
|
||||
getComputedStyle(node).overflowY !== "visible"
|
||||
) {
|
||||
node.scrollTop += 40;
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new Error("The settings pane has nothing to scroll");
|
||||
});
|
||||
await expect(page.getByRole("tooltip")).toHaveCount(0);
|
||||
|
||||
await infoTip.tap();
|
||||
await expect(page.getByRole("tooltip")).toBeVisible();
|
||||
await page.getByTestId("host-page-identity").tap();
|
||||
await expect(page.getByRole("tooltip")).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,9 +41,6 @@ import {
|
||||
connectDirectHost,
|
||||
connectDirectHostExpectingPassword,
|
||||
pasteIntoDirectHost,
|
||||
pasteClipboardIntoDirectField,
|
||||
pasteIntoMiddleOfDirectHost,
|
||||
typeDirectHostCharacters,
|
||||
fillDirectHostPromptPassword,
|
||||
openCompactSettings,
|
||||
expectCompactSettingsList,
|
||||
@@ -59,7 +56,6 @@ import {
|
||||
fillDirectHostUri,
|
||||
expectDirectHostFormValues,
|
||||
expectDirectHostSslEnabled,
|
||||
expectDirectHostSslDisabled,
|
||||
fillDirectHostAddress,
|
||||
toggleDirectHostSsl,
|
||||
expectDirectHostUriValue,
|
||||
@@ -112,25 +108,24 @@ test.describe("Settings sidebar scroll position", () => {
|
||||
await expectSettingsSidebarScrollOffset(page, 0);
|
||||
});
|
||||
|
||||
test("updates typography and normalizes font sizes in one Appearance visit", async ({ page }) => {
|
||||
test("updates appearance without losing the detail scroll or form edits", async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsSection(page, "appearance");
|
||||
const { offset, keywordColor } = await revealSettingsSyntaxTheme(page);
|
||||
await changeSettingsSyntaxTheme(page, "Dracula");
|
||||
await expectSettingsDetailScrollOffset(page, offset);
|
||||
await expectSettingsSyntaxColorChanged(page, keywordColor);
|
||||
await changeSettingsTypography(page);
|
||||
});
|
||||
|
||||
await test.step("change the syntax theme without losing the detail scroll", async () => {
|
||||
const { offset, keywordColor } = await revealSettingsSyntaxTheme(page);
|
||||
await changeSettingsSyntaxTheme(page, "Dracula");
|
||||
await expectSettingsDetailScrollOffset(page, offset);
|
||||
await expectSettingsSyntaxColorChanged(page, keywordColor);
|
||||
});
|
||||
|
||||
await test.step("apply valid font edits to Settings and the preview", async () => {
|
||||
await changeSettingsTypography(page);
|
||||
});
|
||||
|
||||
await test.step("normalize out-of-range and empty font sizes on commit", async () => {
|
||||
await normalizeSettingsFontSizes(page);
|
||||
});
|
||||
test("shows normalized font sizes after committing out-of-range and empty values", async ({
|
||||
page,
|
||||
}) => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsSection(page, "appearance");
|
||||
await normalizeSettingsFontSizes(page);
|
||||
});
|
||||
|
||||
test("keeps the sidebar context through interface font changes", async ({ page }) => {
|
||||
@@ -378,110 +373,6 @@ test.describe("Settings sidebar navigation", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("direct connection form smart-fills on paste without disrupting manual typing", async ({
|
||||
page,
|
||||
}) => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openAddHostFlow(page);
|
||||
await selectHostConnectionType(page, "direct");
|
||||
await expectDirectConnectionMode(page, "Form");
|
||||
|
||||
await test.step("pasting localhost:port splits Host and Port", async () => {
|
||||
await pasteClipboardIntoDirectField(page, "Host", "localhost:6768");
|
||||
await expectDirectHostFormValues(page, { host: "localhost", port: "6768", password: "" });
|
||||
await expectDirectHostSslDisabled(page);
|
||||
});
|
||||
|
||||
await test.step("pasting an https URI populates Host, Port, and Use SSL", async () => {
|
||||
await pasteClipboardIntoDirectField(page, "Host", "https://myhost.ts.net:7443/");
|
||||
await expectDirectHostFormValues(page, { host: "myhost.ts.net", port: "7443", password: "" });
|
||||
await expectDirectHostSslEnabled(page);
|
||||
});
|
||||
|
||||
await test.step("pasting a full Paseo URI populates Host, Port, Use SSL, and Password", async () => {
|
||||
await pasteClipboardIntoDirectField(
|
||||
page,
|
||||
"Host",
|
||||
"tcp://100.91.42.18:6769?ssl=false&password=my%20secret",
|
||||
);
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "100.91.42.18",
|
||||
port: "6769",
|
||||
password: "my secret",
|
||||
});
|
||||
await expectDirectHostSslDisabled(page);
|
||||
});
|
||||
|
||||
await test.step("pasting https without a port defaults Port to 443", async () => {
|
||||
await pasteClipboardIntoDirectField(page, "Host", "https://tunnel.example.test");
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "tunnel.example.test",
|
||||
port: "443",
|
||||
password: "my secret",
|
||||
});
|
||||
await expectDirectHostSslEnabled(page);
|
||||
});
|
||||
|
||||
await test.step("typing bare IPv6 and pasting into the middle of Host stay literal", async () => {
|
||||
await typeDirectHostCharacters(page, "2001:1234::1");
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "2001:1234::1",
|
||||
port: "443",
|
||||
password: "my secret",
|
||||
});
|
||||
|
||||
await pasteIntoMiddleOfDirectHost(page, "example.com", 2, "sub:9000");
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "exsub:9000ample.com",
|
||||
port: "443",
|
||||
password: "my secret",
|
||||
});
|
||||
});
|
||||
|
||||
await test.step("pasting a tcp URI without password clears a previous host password", async () => {
|
||||
await pasteClipboardIntoDirectField(page, "Host", "tcp://second.example.test:7443");
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "second.example.test",
|
||||
port: "7443",
|
||||
password: "",
|
||||
});
|
||||
await expectDirectHostSslDisabled(page);
|
||||
});
|
||||
|
||||
await test.step("clicking Use SSL after typing an https URL keeps SSL enabled", async () => {
|
||||
await expectDirectHostSslDisabled(page);
|
||||
await typeDirectHostCharacters(page, "https://typed.example.test:7443");
|
||||
await toggleDirectHostSsl(page);
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "typed.example.test",
|
||||
port: "7443",
|
||||
password: "",
|
||||
});
|
||||
await expectDirectHostSslEnabled(page);
|
||||
});
|
||||
|
||||
await test.step("pasting a host:port into Port fills Host and Port", async () => {
|
||||
await pasteClipboardIntoDirectField(page, "Port", "hetzner.tail8a2f.ts.net:6768");
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "hetzner.tail8a2f.ts.net",
|
||||
port: "6768",
|
||||
password: "",
|
||||
});
|
||||
});
|
||||
|
||||
await test.step("pasting a live daemon address connects cleanly", async () => {
|
||||
await pasteClipboardIntoDirectField(page, "Host", `http://127.0.0.1:${getE2EDaemonPort()}/`);
|
||||
await expectDirectHostFormValues(page, {
|
||||
host: "127.0.0.1",
|
||||
port: String(getE2EDaemonPort()),
|
||||
password: "",
|
||||
});
|
||||
await expectDirectHostSslDisabled(page);
|
||||
await connectDirectHost(page);
|
||||
});
|
||||
});
|
||||
|
||||
test("direct connection connects to a URI with Host blank", async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import {
|
||||
cancelRebinding,
|
||||
openShortcutSettings,
|
||||
pressCapturedKeys,
|
||||
saveRebinding,
|
||||
shortcutRow,
|
||||
startRebinding,
|
||||
} from "../support/helpers/shortcut-settings";
|
||||
|
||||
// Linux Chromium is not mac: Toggle command center is Ctrl+K, and Toggle
|
||||
// Explorer sidebar has a row for Ctrl+E and another for its alternate, Ctrl+`.
|
||||
const COMMAND_CENTER = "Toggle command center";
|
||||
const EXPLORER_SIDEBAR = "Toggle Explorer sidebar";
|
||||
const MODE_CYCLE = "Cycle agent mode";
|
||||
|
||||
function explorerBackquoteRow(page: Page) {
|
||||
return shortcutRow(page, EXPLORER_SIDEBAR).filter({ hasText: "`" });
|
||||
}
|
||||
|
||||
test.describe("Settings → Shortcuts capture", () => {
|
||||
test("refuses a key that can never fire, warns on a collision and lets the user's choice win", async ({
|
||||
page,
|
||||
}) => {
|
||||
await openShortcutSettings(page);
|
||||
|
||||
await test.step("refuses a plain key for a shortcut that only works while typing", async () => {
|
||||
await startRebinding(page, MODE_CYCLE);
|
||||
await pressCapturedKeys(page, "Shift+M");
|
||||
|
||||
const row = shortcutRow(page, MODE_CYCLE);
|
||||
await expect(row.getByRole("alert")).toHaveText(
|
||||
"This shortcut works while typing, so it needs Ctrl, Cmd or Alt.",
|
||||
);
|
||||
await expect(row.getByText("End with a number from 1 to 9.")).toBeHidden();
|
||||
await expect(row.getByRole("button", { name: "Done" })).toBeDisabled();
|
||||
|
||||
await pressCapturedKeys(page, "Backspace", "Control+M");
|
||||
await expect(row.getByRole("alert")).toBeHidden();
|
||||
await expect(row.getByRole("button", { name: "Done" })).toBeEnabled();
|
||||
|
||||
await cancelRebinding(page, MODE_CYCLE);
|
||||
await expect(row.getByText("Press shortcut...")).toBeHidden();
|
||||
});
|
||||
|
||||
await test.step("warns on a collision on both rows and still saves", async () => {
|
||||
await startRebinding(page, COMMAND_CENTER);
|
||||
await pressCapturedKeys(page, "Control+Backquote");
|
||||
await expect(shortcutRow(page, COMMAND_CENTER)).toContainText(
|
||||
`Also used by ${EXPLORER_SIDEBAR}`,
|
||||
);
|
||||
await saveRebinding(page, COMMAND_CENTER);
|
||||
|
||||
await expect(shortcutRow(page, COMMAND_CENTER)).toContainText(
|
||||
`Also used by ${EXPLORER_SIDEBAR}`,
|
||||
);
|
||||
await expect(shortcutRow(page, EXPLORER_SIDEBAR)).toHaveCount(2);
|
||||
await expect(
|
||||
page.getByRole("button", { name: `Actions for ${EXPLORER_SIDEBAR} (1/2, Ctrl+E)` }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: `Actions for ${EXPLORER_SIDEBAR} (2/2, Ctrl+\`)` }),
|
||||
).toBeVisible();
|
||||
await expect(explorerBackquoteRow(page)).toContainText(`Also used by ${COMMAND_CENTER}`);
|
||||
await expect(
|
||||
shortcutRow(page, EXPLORER_SIDEBAR).filter({ hasNotText: "`" }),
|
||||
).not.toContainText("Also used by");
|
||||
});
|
||||
|
||||
await test.step("runs the user's shortcut, not the default it shares keys with", async () => {
|
||||
await page.keyboard.press("Control+Backquote");
|
||||
|
||||
await expect(page.getByTestId("command-center-panel")).toBeVisible();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,171 +0,0 @@
|
||||
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import type { Locator, Page } from "@playwright/test";
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { connectSeedClient } from "../support/helpers/seed-client";
|
||||
import {
|
||||
closeSidebarDisplayPreferences,
|
||||
openSidebarProjectFilter,
|
||||
} from "../support/helpers/sidebar";
|
||||
|
||||
const PROJECT_COUNT = 36;
|
||||
const LAST_PROJECT_NAME = `Project ${String(PROJECT_COUNT - 1).padStart(2, "0")}`;
|
||||
|
||||
interface SeededProjects {
|
||||
cleanup(): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds enough projects to overflow the display-preferences popover. Each project
|
||||
* owns its own directory under one temporary parent, removed with the daemon
|
||||
* records in `cleanup`.
|
||||
*/
|
||||
async function seedManyProjects(): Promise<SeededProjects> {
|
||||
const parentDirectory = await mkdtemp(path.join(tmpdir(), "paseo-e2e-project-filter-"));
|
||||
const client = await connectSeedClient();
|
||||
try {
|
||||
const directoryPaths = Array.from({ length: PROJECT_COUNT }, (_, index) =>
|
||||
path.join(parentDirectory, `Project ${String(index).padStart(2, "0")}`),
|
||||
);
|
||||
await Promise.all(directoryPaths.map((directoryPath) => mkdir(directoryPath)));
|
||||
const addedProjectIds = await Promise.all(
|
||||
directoryPaths.map(async (directoryPath) => {
|
||||
const added = await client.addProject(directoryPath);
|
||||
if (!added.project) throw new Error(`The daemon did not add ${directoryPath}`);
|
||||
return added.project.projectId;
|
||||
}),
|
||||
);
|
||||
return {
|
||||
cleanup: async () => {
|
||||
await Promise.all(
|
||||
addedProjectIds.map((projectId) =>
|
||||
client.removeProject(projectId).catch(() => undefined),
|
||||
),
|
||||
);
|
||||
await client.close().catch(() => undefined);
|
||||
await rm(parentDirectory, { recursive: true, force: true }).catch(() => undefined);
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
await client.close().catch(() => undefined);
|
||||
await rm(parentDirectory, { recursive: true, force: true }).catch(() => undefined);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function projectFilterFlyout(page: Page): Locator {
|
||||
return page.getByTestId("sidebar-display-preferences-content-projectFilter");
|
||||
}
|
||||
|
||||
function viewportHeight(page: Page): number {
|
||||
const viewport = page.viewportSize();
|
||||
if (!viewport) throw new Error("The page has no viewport");
|
||||
return viewport.height;
|
||||
}
|
||||
|
||||
async function openProjectFilter(page: Page): Promise<Locator> {
|
||||
await gotoAppShell(page);
|
||||
await expect(page.getByTestId("sidebar-display-preferences-menu")).toBeVisible({
|
||||
timeout: 30_000,
|
||||
});
|
||||
await openSidebarProjectFilter(page);
|
||||
|
||||
const flyout = projectFilterFlyout(page);
|
||||
await expect(flyout).toBeVisible();
|
||||
// The flyout paints off-screen until it has measured its anchor and content.
|
||||
await expect.poll(async () => (await flyout.boundingBox())?.y ?? -9999).toBeGreaterThan(0);
|
||||
return flyout;
|
||||
}
|
||||
|
||||
async function requireBox(locator: Locator): Promise<{ y: number; height: number }> {
|
||||
const box = await locator.boundingBox();
|
||||
if (!box) throw new Error(`${locator.toString()} has no box`);
|
||||
return box;
|
||||
}
|
||||
|
||||
/** The flyout must sit entirely inside the window, not run past its bottom edge. */
|
||||
async function expectProjectFilterInsideWindow(flyout: Locator, height: number): Promise<void> {
|
||||
await expect(async () => {
|
||||
const box = await requireBox(flyout);
|
||||
expect(box.y).toBeGreaterThanOrEqual(0);
|
||||
expect(box.y + box.height).toBeLessThanOrEqual(height);
|
||||
expect(box.height).toBeLessThan(height);
|
||||
}).toPass({ timeout: 10_000 });
|
||||
}
|
||||
|
||||
/** The row exists in the list but starts below the visible window. */
|
||||
async function expectBelowWindow(row: Locator, height: number): Promise<void> {
|
||||
const box = await requireBox(row);
|
||||
expect(box.y).toBeGreaterThan(height);
|
||||
}
|
||||
|
||||
/** The row is reachable inside the flyout's viewport after scrolling. */
|
||||
async function expectInsideFlyout(flyout: Locator, row: Locator): Promise<void> {
|
||||
const surface = await requireBox(flyout);
|
||||
const box = await requireBox(row);
|
||||
expect(box.y).toBeGreaterThanOrEqual(surface.y);
|
||||
expect(box.y + box.height).toBeLessThanOrEqual(surface.y + surface.height + 1);
|
||||
}
|
||||
|
||||
function scrollTopOf(flyout: Locator): Promise<number | null> {
|
||||
return flyout.evaluate((root) => {
|
||||
const candidates = [root, ...Array.from(root.querySelectorAll<HTMLElement>("*"))];
|
||||
const found = candidates.find((candidate) => {
|
||||
const overflowY = getComputedStyle(candidate).overflowY;
|
||||
return (
|
||||
(overflowY === "auto" || overflowY === "scroll") &&
|
||||
candidate.scrollHeight > candidate.clientHeight + 1
|
||||
);
|
||||
});
|
||||
return found ? found.scrollTop : null;
|
||||
});
|
||||
}
|
||||
|
||||
/** Drives the flyout with the mouse wheel until the target row lands inside its viewport. */
|
||||
async function scrollToLastProject(page: Page, flyout: Locator, lastRow: Locator): Promise<void> {
|
||||
await flyout.hover();
|
||||
await expect(async () => {
|
||||
await page.mouse.wheel(0, 2_000);
|
||||
const surface = await requireBox(flyout);
|
||||
const row = await requireBox(lastRow);
|
||||
expect(row.y).toBeGreaterThanOrEqual(surface.y);
|
||||
expect(row.y + row.height).toBeLessThanOrEqual(surface.y + surface.height + 1);
|
||||
expect(await scrollTopOf(flyout)).toBeGreaterThan(0);
|
||||
}).toPass({ timeout: 10_000 });
|
||||
}
|
||||
|
||||
// #9182: with more projects than fit in the window, the project filter grew past
|
||||
// the bottom edge and had no scroll container, so the rows below the fold could
|
||||
// not be reached or toggled.
|
||||
test("the project filter stays inside the window and scrolls to its last row", async ({ page }) => {
|
||||
const projects = await seedManyProjects();
|
||||
|
||||
try {
|
||||
await page.setViewportSize({ width: 1280, height: 720 });
|
||||
const flyout = await openProjectFilter(page);
|
||||
const lastRow = flyout.getByText(LAST_PROJECT_NAME, { exact: true });
|
||||
|
||||
await test.step("the flyout fits inside the window while the last project starts below it", async () => {
|
||||
const height = viewportHeight(page);
|
||||
await expectProjectFilterInsideWindow(flyout, height);
|
||||
await expectBelowWindow(lastRow, height);
|
||||
});
|
||||
|
||||
await test.step("mouse wheel scrolling reaches the last project inside the flyout", async () => {
|
||||
await scrollToLastProject(page, flyout, lastRow);
|
||||
await expectInsideFlyout(flyout, lastRow);
|
||||
});
|
||||
|
||||
await test.step("shrinking the window keeps the flyout inside the viewport and scrollable", async () => {
|
||||
await page.setViewportSize({ width: 1280, height: 540 });
|
||||
await expectProjectFilterInsideWindow(flyout, viewportHeight(page));
|
||||
await scrollToLastProject(page, flyout, lastRow);
|
||||
await expectInsideFlyout(flyout, lastRow);
|
||||
await closeSidebarDisplayPreferences(page);
|
||||
});
|
||||
} finally {
|
||||
await projects.cleanup();
|
||||
}
|
||||
});
|
||||
@@ -1,7 +1,6 @@
|
||||
import { test, expect, type Page } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { parseWsJsonFrame } from "../support/helpers/ws-frames";
|
||||
import {
|
||||
expectNewWorkspaceProjectSelected,
|
||||
openNewWorkspaceComposer,
|
||||
@@ -68,11 +67,16 @@ async function collapseStatusGroupContaining(page: Page, workspaceId: string): P
|
||||
function readSessionMessage(
|
||||
message: string | Buffer,
|
||||
): { type?: unknown; requestId?: unknown } | null {
|
||||
const envelope = parseWsJsonFrame<{ type?: unknown; message?: unknown }>(message);
|
||||
if (!envelope || envelope.type !== "session" || typeof envelope.message !== "object") {
|
||||
const raw = typeof message === "string" ? message : message.toString("utf8");
|
||||
try {
|
||||
const envelope = JSON.parse(raw) as { type?: unknown; message?: unknown };
|
||||
if (envelope.type !== "session" || typeof envelope.message !== "object") {
|
||||
return null;
|
||||
}
|
||||
return envelope.message as { type?: unknown; requestId?: unknown };
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
return envelope.message as { type?: unknown; requestId?: unknown };
|
||||
}
|
||||
|
||||
const PIN_REJECTION_MESSAGE = "Pin rejected by test.";
|
||||
|
||||
@@ -805,36 +805,3 @@ test.describe("Half-screen desktop layout", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("Wide touch layout", () => {
|
||||
test.use({ viewport: { width: 1400, height: 900 }, hasTouch: true, isMobile: true });
|
||||
|
||||
test("tapping a sidebar row opens its workspace without a hover card and shows the row menu", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = await seedWorkspace({ repoPrefix: "sidebar-touch-tap-" });
|
||||
|
||||
try {
|
||||
const created = await workspace.client.createWorkspace({
|
||||
source: { kind: "directory", path: workspace.repoPath, projectId: workspace.projectId },
|
||||
title: "Tapped workspace",
|
||||
});
|
||||
if (!created.workspace) throw new Error(created.error ?? "Failed to create a second row");
|
||||
const tappedId = created.workspace.id;
|
||||
|
||||
await gotoAppShell(page);
|
||||
const row = await waitForSidebarWorkspace(page, tappedId);
|
||||
await expect(
|
||||
page.getByTestId(`sidebar-workspace-kebab-${getServerId()}:${tappedId}`),
|
||||
).toBeVisible();
|
||||
|
||||
await row.tap();
|
||||
await expect(page).toHaveURL(new RegExp(`/workspace/${escapeRegex(tappedId)}`), {
|
||||
timeout: 30_000,
|
||||
});
|
||||
await expectWorkspaceHoverCardClosed(page);
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
import { expect, metroTest, test } from "../support/fixtures";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
import { test } from "../support/fixtures";
|
||||
import { startupScenario } from "../support/helpers/startup-dsl";
|
||||
|
||||
// Modules the Metro dev bundle has evaluated when the first screen is visible, set 10% above
|
||||
// the measured count (Welcome 3,985; restored chat 4,725). Before inline requires both screens
|
||||
// evaluated 6,167. A failure means startup now evaluates code the first screen does not
|
||||
// render: find what pulled it in before raising the budget.
|
||||
const WELCOME_MODULE_BUDGET = 4_380;
|
||||
const RESTORED_CHAT_MODULE_BUDGET = 5_200;
|
||||
|
||||
const MERMAID_RUNTIME = /mermaid\/runtime\/html\.gen\.ts$/;
|
||||
// The Markdown renderer's KaTeX loader (`web/katex.js`) and the runtime it imports (`katex.mjs`).
|
||||
const KATEX = /\/katex\.m?js$/;
|
||||
|
||||
const PLAIN_TEXT_REPLY_PROMPT = "Emit 1 assistant messages before synthetic user message.";
|
||||
const PLAIN_TEXT_REPLY = "Synthetic pre-echo message 1";
|
||||
|
||||
test.describe("Startup loading presentation", () => {
|
||||
test("mobile reconnect preserves the saved host shell", async ({ page }) => {
|
||||
const startup = await startupScenario(page)
|
||||
@@ -31,36 +16,4 @@ test.describe("Startup loading presentation", () => {
|
||||
await startup.expectsNoSavedHostErrorStatus();
|
||||
await startup.expectsNoLocalServerStartupCopy();
|
||||
});
|
||||
|
||||
test("a returning user's restored chat loads only what it renders", async ({ page }) => {
|
||||
test.setTimeout(120_000);
|
||||
const agent = await seedMockAgentWorkspace({
|
||||
repoPrefix: "startup-budget-",
|
||||
title: "Startup budget chat",
|
||||
initialPrompt: PLAIN_TEXT_REPLY_PROMPT,
|
||||
});
|
||||
try {
|
||||
await openAgentRoute(page, agent);
|
||||
await expect(page.getByText(PLAIN_TEXT_REPLY, { exact: true })).toBeVisible();
|
||||
|
||||
const startup = await startupScenario(page).withModuleEvaluationRecording().openRoot();
|
||||
|
||||
await startup.expectsRestoredChat(PLAIN_TEXT_REPLY);
|
||||
await startup.expectsFirstScreenEvaluatedAtMost(RESTORED_CHAT_MODULE_BUDGET);
|
||||
await startup.expectsFirstScreenSkipped([MERMAID_RUNTIME]);
|
||||
} finally {
|
||||
await agent.cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
metroTest("a new user's Welcome screen loads only what it renders", async ({ page }) => {
|
||||
const startup = await startupScenario(page)
|
||||
.asNewUser()
|
||||
.withModuleEvaluationRecording()
|
||||
.openRoot();
|
||||
|
||||
await startup.expectsWelcomeScreen();
|
||||
await startup.expectsFirstScreenEvaluatedAtMost(WELCOME_MODULE_BUDGET);
|
||||
await startup.expectsFirstScreenSkipped([MERMAID_RUNTIME, KATEX]);
|
||||
});
|
||||
|
||||
@@ -6,7 +6,6 @@ import { expect, test, type Page } from "../support/fixtures";
|
||||
import { runWorkspaceActionFromCommandCenter } from "../support/helpers/command-center-workspace-actions";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { decodeWsTextFrame } from "../support/helpers/ws-frames";
|
||||
import {
|
||||
delegateFleetThroughMcp,
|
||||
expectManagedSubagentArchived,
|
||||
@@ -200,10 +199,9 @@ test("MCP delegates to self and B and opens both qualified children in ordinary
|
||||
socket.on("close", () => activeDaemonSockets.delete(socket));
|
||||
}
|
||||
socket.on("framesent", ({ payload }) => {
|
||||
const text = decodeWsTextFrame(payload);
|
||||
if (text === null || !text.startsWith("{")) return;
|
||||
if (text.includes('"hosts.route.open.request"')) routeOpens++;
|
||||
const outer = JSON.parse(text);
|
||||
if (typeof payload !== "string" || !payload.startsWith("{")) return;
|
||||
if (String(payload).includes('"hosts.route.open.request"')) routeOpens++;
|
||||
const outer = JSON.parse(String(payload));
|
||||
const request = outer.type === "session" ? outer.message : null;
|
||||
if (
|
||||
request?.type &&
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user