diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d64e8227..c2d1ae3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,11 @@ concurrency: group: ci-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} +# Runners are pinned rather than ubuntu-latest: Playwright cannot install Chromium on Ubuntu 26.04. jobs: checks: name: Lint, build, and unit tests - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 30 steps: - name: Checkout @@ -55,7 +56,7 @@ jobs: e2e_suites: name: List e2e suites - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 5 outputs: suites: ${{ steps.list.outputs.suites }} @@ -78,7 +79,7 @@ jobs: e2e: name: E2E (${{ matrix.suite.script }}) needs: e2e_suites - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 60 strategy: fail-fast: false @@ -99,16 +100,20 @@ jobs: - name: Install dependencies run: npm ci + # ImageOS (for example ubuntu24) keys the browser cache by runner image, so a cache built on + # another Ubuntu release is never restored here. - name: Read Playwright version id: playwright - run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT" + run: | + echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT" + echo "image=$ImageOS" >> "$GITHUB_OUTPUT" - name: Cache Playwright browsers id: browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}-chromium + key: playwright-${{ steps.playwright.outputs.image }}-${{ steps.playwright.outputs.version }}-chromium - name: Install Playwright Chromium if: steps.browsers.outputs.cache-hit != 'true' @@ -178,7 +183,7 @@ jobs: name: CI passed if: always() needs: [checks, rust_tests, e2e_suites, e2e] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: {} steps: - name: Require every CI job to pass diff --git a/CHANGELOG.md b/CHANGELOG.md index 7120bdc7..c7d827cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ All notable changes to Kromacut are documented in this file. - **Choose the slicer for Open in Slicer (desktop, #152)** - **Open in Slicer** now asks which app opens the model before building it. The chooser lists **System default** (the system's `.3mf` app, as before) plus Bambu Studio, Orca Slicer, PrusaSlicer, and UltiMaker Cura when they are installed in their usual locations: `/Applications` or `~/Applications` on macOS; Program Files or `%LOCALAPPDATA%\Programs` on Windows, including the newest versioned Cura folder (a saved older Cura stays usable after a newer version is installed next to it, #200); and `PATH` commands or Flatpak installs on Linux. **Browse** picks any other app with the native file dialog; only app bundles, `.exe` files, or executables are accepted, and Kromacut remembers picked apps in its config folder, up to 16, always keeping the saved slicer among them so later Browse picks cannot push it out. Models are only ever launched with a detected slicer or a picked app, never with a program named by the web view. **Always use this slicer** saves the choice under `kromacut:desktop-slicer`, so later clicks open the model straight away and the menu names the slicer; **Choose Slicer** in the same menu changes or forgets it. Closing a chooser opened from the menu returns keyboard focus to the download button, because the menu item that opened it is gone (#185). A saved slicer that was moved or uninstalled is forgotten and the chooser explains why. Flatpak slicers receive the model through Flatpak file forwarding, so their sandbox can read it. Launch failures keep the existing localized error. The chooser and menu are localized into all 12 languages, and the export guides describe the choice. Added native tests for per-platform detection, newest-version selection, a saved older Cura staying launchable after an upgrade, launchable-app validation, the detected-or-picked launch rule, picked-app storage that keeps the saved slicer, launch commands, and slicer path decoding; unit tests for the saved preference; and browser regressions for choosing, remembering, changing, browsing (including which saved slicer Browse keeps), forgetting, a missing saved slicer, and focus after closing a chooser opened from the menu. - **Change or forget the saved slicer from Settings (desktop, #173)** - The desktop Settings dialog gains an **Open in Slicer** row that shows the saved choice (**Ask every time**, **System default**, or the slicer's name and path) and works without an image or model. **Change** opens the slicer chooser, whose confirm button then reads **Save**: it saves the selected slicer, including one picked with **Browse**, without exporting or opening anything; the **Always use this slicer** switch is hidden there because the choice is always saved. **Forget** clears the saved choice so the next Open in Slicer asks again. Closing the chooser opened from Settings returns keyboard focus to the Settings button. Settings and the 3D download menu share one preference, so a change in either shows up in the other straight away. The new strings, the updated remember hint, and the export guides' Open in Slicer paragraph are localized into all 12 languages. Added browser regressions for the browser build without the row, saving a detected, browsed, or system-default slicer from Settings without exporting, including with a model built, keeping the saved slicer launchable while browsing, focus after closing the chooser, cancelling, forgetting, and the download menu following a choice made or forgotten in Settings. - **Saved slicer survives a slow check (desktop, #186)** - When **Open in Slicer** is still checking the saved slicer while a new one is saved or forgotten in Settings, the late check result is ignored. It no longer clears the newly saved slicer or opens the model in the replaced one. A rebuild that finishes during the check is exported with its own head count, pause schedule, and layer heights, instead of the settings of the build shown when **Open in Slicer** was clicked. Added unit regressions that hold the slicer lookup until after Settings saves a new slicer or a new build finishes. -- **Pull request CI and `test:e2e:all`** - Pull requests into `develop` and `main`, and pushes to them, now run lint, the build, unit tests, the desktop app's Rust tests (`cargo test` on Linux, macOS, and Windows), and every Playwright e2e suite in parallel jobs, with cached npm packages, Chromium, and cargo builds. One `CI passed` check summarizes the result. Fork pull requests get a read-only token and no secrets. `npm run test:e2e:all` runs the same suites locally one after another: the `@smoke` tests, then the docs, landing, privacy, terms, 404, i18n, and i18n build suites, each on a fresh server. It fails if any suite fails, if a Playwright config isn't in the suite list, or if a test isn't run by any suite; the long `@full` export matrix stays on demand. Area specs now refuse to run under the wrong Playwright config and name the script to use. Palette Proof, the Settings legal links, and the adaptive Stack Matrix round trip were not in any suite and now run with `@smoke`. +- **Pull request CI and `test:e2e:all`** - Pull requests into `develop` and `main`, and pushes to them, now run lint, the build, unit tests, the desktop app's Rust tests (`cargo test` on Linux, macOS, and Windows), and every Playwright e2e suite in parallel jobs, with cached npm packages, Chromium, and cargo builds. The other Linux jobs run on Ubuntu 24.04 rather than `ubuntu-latest` (Ubuntu 26.04), where Playwright cannot install Chromium, and the Chromium cache is keyed by runner image. One `CI passed` check summarizes the result. Fork pull requests get a read-only token and no secrets. `npm run test:e2e:all` runs the same suites locally one after another: the `@smoke` tests, then the docs, landing, privacy, terms, 404, i18n, and i18n build suites, each on a fresh server. It fails if any suite fails, if a Playwright config isn't in the suite list, or if a test isn't run by any suite; the long `@full` export matrix stays on demand. Area specs now refuse to run under the wrong Playwright config and name the script to use. Palette Proof, the Settings legal links, and the adaptive Stack Matrix round trip were not in any suite and now run with `@smoke`. - **Cats Exact benchmark reproducibility** - Audited the stale replay fingerprint against historical prediction changes while preserving captured observations and artifact hashes. Calibrated benchmarks capture provenance before optimization, pin archived source and provenance to one resolved commit, and save full results before golden assertions. CLI validation rejects invalid case/head/grouping selections and report paths that alias saved inputs, and checks replay results against preparation checksums; cached preparation requires an uncached Exact result and rejects mismatched physical/separation settings, repeat budgets, profiles, palettes, and model contexts. Fresh-stack multi-head measurements support warmed repeated samples, deterministic result checks, and separate fitting, optimization, analysis, and build-validation timing. The cats fixtures record the profile hash of the committed LF file instead of its Windows CRLF form, and `.kfil` and performance fixture JSON files are checked out byte-for-byte on every platform, so the immutability check passes on macOS and Linux; cached multi-head preparation still accepts results captured from CRLF checkouts of the same profile. - **Multi-head printing guide** - New in-app documentation page explaining Multi-head printing: prerequisites, how layers become color runs and windows, the Head Schedule, the combination search space, Color grouping, and what Fast, Balanced, and Thorough search depth change, with four explanatory diagrams. The guide, navigation metadata, and diagrams are available in all 12 languages, with measured translated labels and reciprocal Auto-paint links. Covers routed preview colors, 3MF head assignments and M600 checkpoints, single-head fallback, and cancellation when the image changes. Regression checks require matching guide metadata and complete diagram catalogs and label bounds; browser coverage loads the guide and all four illustrations in every language. - **Multi-head printing** - Auto-paint can analyze per-pixel filament orders across 2–8 heads in a background worker. Successful builds route every color region through its per-layer filament path and scheduled physical head; the preview shows each region’s predicted blend, corrected by the same calibration evidence as single-head builds, and can display its physical filament instead. All smoothing strengths share conforming region boundaries and closed layer geometry, with chunked generation to keep builds responsive. Multi-head 3MFs retain that geometry and physical filament colors, use the selected head count and head assignments, and insert M600 pause markers at exactly the Head Schedule’s swap checkpoints. Selected heads beyond the filament count remain EMPTY, and Center/Edge priorities use the same weighted targets as normal Auto-paint; colors with zero regional weight retain printable surfaces through palette matching and finite routing groups without changing weighted centroids. Fast/Balanced/Thorough controls search effort with bounded deterministic sampling. A **Color grouping** control chooses the search targets: Layer-based merges colors sharing a printer layer; Color-based keeps hues separate within a bounded group budget while preserving every member’s original print layer. At least one group is retained per occupied layer, including visible regions with zero regional weight, so capped palettes keep every printable color assigned without changing scoring weights. Color-based can produce more printed colors, but does not guarantee lower color error. Fast fitted-optics simulation nominates a bounded shortlist; windows and final region paths are scored with the full appearance model and usage-weighted CIEDE2000 on the original grouped colors. Fully scored assignments are reused when their physical context is unchanged, avoiding repeated broad searches during reconciliation. The current order remains available during reconciliation, and calibrated preview colors and the 0.25 minimum predicted gain gate are retained. Head count, search depth, color grouping, and the mode toggle persist through fallback builds and retain edits made during analysis; Multi-head and Flat Paint are mutually exclusive. Worker errors, unusable or non-improving plans, and plans whose predicted usage-weighted mean CIEDE2000 gain over the normal stack is below 0.25 retain the normal single-head model, with a notice and its original start color and swaps. Instructions follow the built snapshot, and before the first multi-head build **Copy** gives the same build prompt the panel shows, not single-head swaps; fallback builds copy their single-head plan. Image changes cancel pending analysis and discard obsolete builds. Controls, notices, schedules, copied text, and usage guides are localized into all 12 languages. Added region/filament routing, head/extruder, pause, smoothing/topology, fallback, predicted gain, async lifecycle, worker failure, and browser settings-persistence regression coverage. Color-group regressions cover capped palettes crossing physical layer boundaries, and calibrated image measurements use final-stack surfaces with CIEDE2000. Added full-model shortlist, proof-anchor, weighted reconciliation, seeded corrected multi-window routing, and bounded-evaluation regressions plus reproducible measured-profile cats/Rocco benchmarks; removed unused LUT analyzers and test-only assignment bookkeeping.