mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 12:54:29 +00:00
* fix(studio): add smooth preview zoom with pinch/Ctrl+scroll - Scale iframe content from inside (contentDocument.documentElement) instead of scaling the parent div, avoiding compositor re-rasterization on every zoom frame — critical for smooth zoom on high-refresh displays (240Hz) - Document-level capture-phase wheel handler bypasses the DomEditOverlay - Center-based zoom (no pan drift from pointer-anchored formulas) - Transient HUD shows zoom % briefly, no persistent UI controls - Double-click preview area to reset zoom to fit - Drag-to-pan when zoomed past 100% - Momentum scroll suppression after pinch gesture (400ms cooldown) - Delta clamping (MAX_DELTA=10) prevents overshooting on fast gestures - toDomPrecision rounds transform values to 4 decimals (matches tldraw) - Zoom state persisted to localStorage with 200ms debounce - Exposes --preview-zoom CSS custom property for overlay coordinate mapping - Fix infinite render loop in NLELayout (onIframeRef → refreshPreviewDocumentVersion) * fix(studio): use CSS zoom instead of transform scale for preview zoom CSS transform: scale() on a div containing an iframe causes compositor cross-layer sync issues that produce visible frame tearing on high-refresh displays (240Hz ProMotion). CSS zoom property changes the actual rendered size without compositor layer synchronization, eliminating the jumping. - Replace transform: scale(Z) with zoom: Z on the stage div - Keep transform: translate() for panning (compositor-friendly, no iframe) - Overlays work correctly since getBoundingClientRect() includes zoom - Remove will-change, transition hacks, pointer-events toggles * fix(ci): use apt-get for ffmpeg in preview-regression workflow The FedericoCarboni/setup-ffmpeg action downloads from an external URL that has been persistently unreachable, causing CI failures. Switch to apt-get install which uses Ubuntu's package repos (same as ci.yml and player-perf.yml). * fix(studio): clear zoom timers on NLEPreview unmount settleTimerRef, hudTimerRef, and retiringTimerRef could fire after component unmount. Add cleanup effect to prevent stale callbacks. * feat(studio): persist sidebar, timeline, and playback speed across reloads Wire up studioUiPreferences for the three remaining UI states requested in #752: left sidebar collapsed, timeline visibility, and playback rate. All three now survive page reloads using the same localStorage key as preview zoom.
141 lines
4.5 KiB
YAML
141 lines
4.5 KiB
YAML
name: preview-regression
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
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: 2
|
|
outputs:
|
|
preview: ${{ steps.filter.outputs.preview }}
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
|
|
id: filter
|
|
with:
|
|
token: ""
|
|
filters: |
|
|
preview:
|
|
- "packages/core/**"
|
|
- "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"
|
|
|
|
preview-parity:
|
|
name: Preview parity
|
|
needs: changes
|
|
if: needs.changes.outputs.preview == 'true'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
|
|
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- run: bun install --frozen-lockfile
|
|
|
|
- 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/core test -- src/studio-api/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
|
|
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends ffmpeg
|
|
|
|
- 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"
|