Files
hyperframes/.github/workflows/preview-regression.yml
Miguel Ángel 042ec2ebd0 fix(studio): restore overscan and publish the zoom viewport (#5151)
* fix(studio): restore the timeline overscan budget

* test(studio): align window witnesses with the restored budget

* fix(studio): publish the viewport when a zoom anchor lands

* fix(studio): publish the viewport when a zoom-out ends at its laid-out scale

An eased zoom-out that ends at the scale already laid out only moves the scroll position,
so the timeline drew from the old position until the next scroll event. The zoom input
now publishes that scroll through the same callback the zoom anchor uses.

* fix(studio): a pan at the laid-out scale publishes its scroll before paint

The same-scale ending of a zoom ran outside React, so its scroll publish rendered on the
next task, after the browser painted the old window. It now flushes like the scale change
beside it, and its test pans at the laid-out scale instead of changing it.

* test(studio): a same-scale pan must render its scroll before paint

Reads the render window outside act, so unwrapping the flush fails it, and records each
published scroll at call time instead of reading the live element afterwards.
2026-10-08 08:37:55 +00:00

174 lines
5.9 KiB
YAML

name: preview-regression
permissions:
contents: read
# Suppress hyperframes CLI telemetry from HeyGen's own CI runs.
# External users' CI continues to emit telemetry unless they set this themselves.
env:
HYPERFRAMES_NO_TELEMETRY: "1"
on:
pull_request:
push:
branches:
- main
concurrency:
group: preview-regression-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
preview: ${{ steps.filter.outputs.preview }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
# HEAD is the PR merge ref; its first parent is the current base tip, unlike the payload's
# base.sha, which goes stale and would count the base's newer commits as the PR's changes.
- name: Find the pull request's current base
id: base
if: github.event_name == 'pull_request'
run: |
git rev-parse --verify -q HEAD^2 > /dev/null || { echo "::error::HEAD is not the pull request merge commit"; exit 1; }
sha="$(git rev-parse --verify HEAD^1)"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
id: filter
with:
token: ""
base: ${{ steps.base.outputs.sha }}
filters: |
preview:
- "packages/core/**"
- "packages/parsers/**"
- "packages/studio-server/**"
- "packages/lint/**"
- "packages/player/**"
- "packages/studio/**"
- "packages/cli/**"
- "packages/producer/src/parity-harness.ts"
- "packages/producer/src/parity-fixtures.ts"
- "packages/producer/tests/parity/**"
- "package.json"
- "bun.lock"
- ".github/workflows/preview-regression.yml"
preflight:
name: Preflight (lint + format)
needs: changes
if: needs.changes.outputs.preview == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: ./.github/actions/preflight
preview-parity:
name: Preview parity
needs: [changes, preflight]
if: needs.changes.outputs.preview == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- run: bun install --frozen-lockfile
- name: Build workspace packages (required for vite config loading)
run: |
bun run --filter '@hyperframes/{parsers,lint,studio-server}' build
bun run --cwd packages/core build
- name: Run Studio preview routing regression
run: |
bun run --cwd packages/studio test -- vite.thumbnail.test.ts src/utils/projectRouting.test.ts src/utils/frameCapture.test.ts
bun run --cwd packages/studio-server test -- src/routes/thumbnail.test.ts
- name: Build preview runtime
run: bun run --cwd packages/core build:hyperframes-runtime
- name: Prepare parity fixtures
run: bun run --cwd packages/producer parity:fixtures:ci
- name: Install ffmpeg
uses: ./.github/actions/install-ffmpeg-linux
- name: Set up Chrome
id: setup-chrome
uses: browser-actions/setup-chrome@c785b87e244131f27c9f19c1a33e2ead956ab7ce # v1
with:
chrome-version: stable
- name: Start parity fixture server
run: |
cd packages/producer/tests/parity/fixtures
python3 -m http.server 4173 --bind 127.0.0.1 > /tmp/preview-parity-http.log 2>&1 &
echo "$!" > /tmp/preview-parity-http.pid
for _ in $(seq 1 30); do
if curl -fsS http://127.0.0.1:4173/minimal-wysiwyg.html >/dev/null; then
exit 0
fi
sleep 1
done
cat /tmp/preview-parity-http.log
exit 1
- name: Run preview parity check
working-directory: packages/producer
env:
PUPPETEER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
run: bun run parity:check:ci
- name: Upload parity artifacts
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: preview-parity-artifacts
path: packages/producer/.debug/parity-harness-ci/
if-no-files-found: ignore
retention-days: 30
preview-regression:
runs-on: ubuntu-latest
needs: [changes, preview-parity]
if: always()
steps:
- name: Check results
env:
PREVIEW_FILTER_RESULT: ${{ needs.changes.outputs.preview }}
PREVIEW_PARITY_RESULT: ${{ needs.preview-parity.result }}
run: |
{
echo "## Preview regression gate"
echo ""
echo "- paths-filter \`preview\` matched: \`${PREVIEW_FILTER_RESULT}\`"
echo "- preview-parity result: \`${PREVIEW_PARITY_RESULT}\`"
echo ""
} >> "$GITHUB_STEP_SUMMARY"
if [ "${PREVIEW_FILTER_RESULT}" != "true" ]; then
echo "::notice title=Preview regression::SKIPPED — no preview/runtime changes. Auto-pass."
echo "**Status:** SKIPPED (no preview/runtime changes — auto-pass)" >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
if [ "${PREVIEW_PARITY_RESULT}" != "success" ]; then
echo "**Status:** FAILED" >> "$GITHUB_STEP_SUMMARY"
echo "Preview parity check failed"
exit 1
fi
echo "**Status:** PASSED" >> "$GITHUB_STEP_SUMMARY"