mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-01 21:05:42 +09:00
82bd484b9df30ca31c84f14e8ecf3da5800125e6
9
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
44f0956579 |
fix: Address reported MCP failures and screenshot diagnostics (#6657)
A Form-only POST action was falsely reported as running when a page renders. The security audit now uses the same resource-selection logic as page generation, while still warning when the POST is also used for page content. This PR also shows editors the actual Content-mode save rejection instead of a misleading build-permission message. Patch commits stop waiting after two minutes. A lost response leaves the result uncertain and refreshes project state without resending the patch; completed version conflicts retain the same-transaction confirmation retry. Staging publish jobs now include the complete hosted URL, so agents do not have to guess the publisher host. Screenshot capture reports page JavaScript errors without including the page's error text or script URL. SVG content edits now keep their image type and dimensions; the reported HTTP 500 in #6615 remains unverified. It does not change the shared-Slot rule that caused #6637. Closes #6622 Closes #6620 Ref #6615 Ref #6637 Ref #6648 Ref #6635 The SVG revision fix changes one production line and reuses the existing asset-type detector. Screenshot error detection stays tied to the active page frame during navigation, so an outgoing page or embedded frame cannot be blamed for the next capture. Script URLs are omitted because their paths can contain private data or point to a logging call instead of the fault. ## Tasks - [x] Make timeout/reset commit handling safe when the original server request may still be running; add a regression test. - [x] Remove untrustworthy screenshot source locations; update regression tests and PR claims. - [x] Re-run focused checks, review the final diff, and monitor required CI after the merge-safety fixes. All four required workflows passed on `9d79ce052b`. - [x] Reproduce the SVG revision type loss in #6615's workflow; preserve image metadata and verify the uploaded bytes. - [x] Keep the reported HTTP 500 open: the original asset was identified from production data, but the failed PUT status/request ID is unavailable, so this PR does not claim a fix. - [x] Keep the approved generic screenshot error wording for #6635; verify the focused test and required CI. - [x] Reproduce #6635's missing JavaScript source location with a CDP fixture, then remove path reporting after review found it could expose private page data. Keep #6635 open for a safe diagnostic design. - [x] Review documentation impact for the screenshot diagnostic. The authoritative MCP guide documents screenshot inputs, not this error output, so no docs change is needed. - [x] Re-run focused tests, typechecks, and CI after the screenshot change. All required CI workflows passed. - [x] Reproduce #6620's initial connection reset and deadline failures, then verify uncertain-commit handling without an unsafe resend. - [x] Return the correct hosted staging URL for #6648; verify the current origin against the reported project without republishing. - [x] Check the other reports against production records and code paths; keep unverified causes open rather than claim fixes. - [x] Reproduce #6622 with a regression test that failed before the fix and passed afterward. - [x] Reuse the page-resource selection logic in the audit; cover an independently rendered POST and a connected Content Block. - [x] Reproduce the misleading Content-mode message with a failing test, then preserve the specific reason after checking edit permission. - [x] Review the authoritative docs; correct the native Form action instructions and regenerate MCP docs. - [x] Triage recent reporter issues: close #6634 as a duplicate of #6636 and #6630 as untestable without a project ID; keep the other project/environment-specific reports open. - [x] Run focused tests, typechecks, lint, package-boundary and generated-doc checks. No fixture inputs or outputs changed. - [x] Monitor required CI checks and fix failures. All workflows pass; the visual test now hides its blinking editor caret. - [x] Review the final diff and review threads. No unrelated files or open review threads. - [x] Run the approved full Luna/low agent evaluations and record the failures below. ## Verification - #6615: the SVG revision test failed before the one-line fix because storage received `file` instead of `image`; it passes now with SVG bytes, image metadata, and the same asset ID. All 314 asset-uploader tests and its typecheck pass. Read-only production checks found the original 4,292-byte SVG and later 4,457-byte replacement; both parse as 581×140 images, and no failed-update revision was saved. The original HTTP 500 remains unreproduced, so #6615 stays open. No fixture inputs or generated fixture outputs changed. The existing asset docs already cover SVG editing; no docs change is needed. - Audit: 41 tests pass (new test failed before the fix). - SDK resource generation: 71 tests pass. - Builder patch authorization: 10 tests pass (changed test failed before the fix). - Project-build, SDK, CLI, and Builder typechecks pass; lint and package-boundary checks pass. - Generated MCP docs are clean. All required CI workflows pass. - #6620: the reset/deadline tests failed before the merge-safety fix and pass now without a resend. HTTP client tests (50) and focused project-session tests (55) pass, as do the Project Build, Vision, and CLI typechecks, lint, and package boundaries. The patch request abort is exercised with a simulated deadline; no production mutation was made. - #6635: the published home page returned HTTP 200, produced a full-page Chrome screenshot, and had no current page JavaScript error. A synthetic Chrome page confirmed that both thrown exceptions and `console.error` can yield a script URL, but the URL path is not safe or necessarily the fault location. The capture now omits that URL while retaining page-frame error detection. Focused Vision tests (60), CLI preview tests (50), typechecks, lint, and package-boundary checks pass. The reported page fault itself is not reproduced today, so the issue remains open. - #6626: the reported published route now returns HTTP 404; the current home page has no images and a full-page Chrome screenshot succeeds. This does not recreate the image-heavy local preview or its DevTools disconnect. - #6648: the project’s reported staging builds are marked published; its current `.wstd.io` origin returns HTTP 200, while `.wstd.work` returns 404. New staging URL tests failed before the change and pass after it, including already-qualified and custom-only domains. Domain tests (17), Builder API router tests (53), Domain and Builder typechecks, lint, and generated API checks pass. The API still does not verify DNS at publish time, so this issue remains open. - Full Luna/low agent suite after the #6635 change: 6 of 9 fixtures passed. Both Markdown blog fixtures again failed at screenshot verification with `ENOENT`. The managed-Form authoring agent missed template discovery, audit, and responsive evidence in this run; that fixture passed in the previous run. The MDX fixture passed. The suite is not claimed as green. Existing baselines use incompatible or missing model settings and were not updated. Connected MDX inside the same Form remains a conservative audit case: the audit cannot inspect that document's resource references from Builder state alone. |
||
|
|
d4b5b328a4 |
fix: Resolve reproduced bugs reported on Discord (#6639)
## What this fixes This PR fixes the bugs from #6633 that we could reproduce: - Spacing reset no longer triggers canvas Delete; autocomplete selection is readable in both themes. - Breakpoint widths save on Enter or blur, without reordering while someone types. Typed addresses no longer reuse an old history suggestion. - Redirect edits use saved project state, and unchanged old redirects do not block unrelated edits. Client-side links now follow project redirects, including sites with a custom 404 page. A new publish keeps polling past an old failed build. - Editors can open older projects and edit supported Markdown bindings without changing protected styles or permissions. Older Code Text edits now survive save, reload, and a later Builder visit; Editors cannot replace Code Text bindings. - Form writes are sent once per submission, even when a response fails. Safe response redirects still work. - Published pages and Builder Preview restore scroll without unwanted smooth animation. Preview keeps smooth anchors, repeated anchors, Back/Forward positions, and page entry animations. - Large-page selection and paste avoid rerendering unchanged Navigator rows and rescanning unchanged asset references. Keyboard focus now follows a moved row when its new parent expands. ## Checklist - [x] Third deep review: verify the pending legacy Editor permission and remounted scroll-restoration fixes; simplify the 11 modified files and deleted hook; demonstrate regression failures and passes. - [x] Third review: review documentation and fixture impact; run affected tests, typechecks, lint, formatting, and package boundaries. - [x] Third review: commit only the pending changes, push to this PR, review hosted results, and pass required CI. - [x] Second deep review: check save permissions, redirects, scroll, and UI state; fix reproduced problems and rerun affected checks. - [x] Deep-review the full PR, simplify repeated code, fix verified problems, and rerun affected checks. - [x] Make project redirects work on client-side link clicks, including sites with a custom 404 page; add a failing regression test, verify both runtimes, and review documentation impact. - [x] Reproduce the changed behaviors; show regression tests fail and pass. - [x] Check Editor, Preview, Navigator, Form, redirect, publish, and theme behavior in focused tests and browser workflows. - [x] Review the full diff for correctness, duplication, and needless complexity. Simplify redirect validation and strengthen the cross-page anchor test. - [x] Inspect light and dark autocomplete screenshots and approve the one intended new visual story. - [x] Review documentation impact. Update the Form guide for uncertain delivery responses; other changes restore expected behavior. - [x] Complete independent review, package typechecks, lint, boundaries, generated API/docs checks, and fixture build. - [x] Run the approved full agent evaluation suite. Eight of nine scenarios passed; the remaining evaluator and baseline limits are below. - [x] Pass required CI on the earlier review commits; the third-review head is tracked above. ## Implementation notes Preview uses one navigation request between the Builder and canvas. It records scroll before a page changes and restores it before entry animations. Router keys are observed only in Preview. This adds 211 net production lines because shorter approaches failed repeated anchors, delayed navigation, and returns from Design. Navigator and focus changes add 87 lines; the shared published-page hook adds 40. The earlier cleanup added 427 net production lines; this review adds 43 net non-test lines. Legacy document bindings are normalized when loading a snapshot and checking Editor capabilities. Older Code Text content is normalized on reads without saving; the first edit removes its stale property in the same version-checked save. Direct Editor patches cannot add or replace Code Text expressions. Editor reads do not migrate the database. Read-only bindings and template styles remain protected. No schema, package, icon, or product copy changes are included. The visual harness has an opt-in focus setting for the autocomplete story. Its default blur behavior is unchanged. The test now mounts scroll restoration after the route content, matching the production Body; it checks an anchor found only on the destination page. ## Review follow-up The review found two reproducible bugs. Older Code Text edited by an Editor could be overwritten by the legacy `code` property on a later Builder visit. A Navigator row moved into a collapsed parent could lose keyboard focus. Both are fixed with regression tests. The review also removed one duplicate parser, a repeated autocomplete color check, and an unnecessary prop scan on page-only saves. The Remix scroll test now mounts restoration in the same order as production. The legacy Code Text test covers literal and expression content, direct patch permissions, save retries, undo/redo, and Editor → reload → Builder → reload. The local end-to-end test passed. The other focused tests, affected package typechecks, lint, formatting, package boundaries, generated API/docs checks, and fixture build passed. A fixture sync picked up unrelated remote sitemap data; that generated drift was removed from this PR. The full agent evaluation was not rerun for this follow-up. ## Client-side redirects The root loader now checks redirects when the path changes, even when a custom 404 route matches. A generated yes/no flag in its own file avoids extra navigation requests on projects without redirects; the browser does not receive the redirect list. Projects with redirects pay for a root-loader check on each path change. Query-only navigation keeps the router's normal revalidation behavior. The new test reproduced the custom-404 failure before the fix and passes afterward. Both React Router and Remix templates, generated fixtures, typechecks, production builds, and the redirect-settings browser test pass. Existing redirect docs already describe this expected behavior, so no docs change is needed. ## Performance With 3,000 styled elements, median selection fell from 986 ms to 413 ms in a controlled local browser test. Full page paste including save measured 3.4 seconds afterward; the earlier run varied from 4 to 15 seconds, so that is not a reliable whole-paste speed multiplier. Skipping an unchanged asset-reference rewrite reduced that isolated step from 1,500 ms to 7 ms with 200 assets, 3,000 properties, and 12,000 styles. The browser still downloads and syncs project data, traverses the tree, validates and imports assets, inserts content, renders, and saves. Cross-project imports can still transfer assets. ## Second review follow-up Changing a breakpoint from Min width to Max width (or back) now saves the type and width together. A mixed Builder/Editor save now checks each Editor change against the Builder changes before it, including older Code Text bindings and changes to Content block boundaries. If an earlier save fails, later entries do not run against a state that was never saved. A full page reload now restores its saved scroll position without animating through the page. Client navigation still uses the existing hook. The two early scripts add no network request; they run next to the router's restore script, then restore the page's smooth-scroll setting. A nonce on Body is passed to all three scripts. Rebuilding Editor permissions costs a fresh scan only for mixed-permission batches; all-Builder batches keep the fast path. Focused checks passed: 40 patch authorization/save tests, five breakpoint browser tests, two early-scroll browser tests, 12 router navigation browser tests, four package typechecks, lint, formatting, and diff checks. The real SSR test also passed with delayed hydration and a nonce-only script policy, with no scroll animation or hydration warning. The full agent evaluation was not rerun; the earlier 8/9 result and its known evaluator limit remain unchanged. Documentation impact was reviewed again; these changes restore expected behavior and need no new user guide. On commit `b61c3aaf07`, the main workflow, all ten Builder browser shards, lint, submodule checks, and the approved visual rerun passed. The first visual comparison still records the already reviewed autocomplete difference; its approval rerun passed. ## Third review follow-up The pending changes close two Editor permission gaps. IDs hidden by read-time Code Text normalization remain reserved, so an Editor cannot reuse one to overwrite a protected saved prop. New Code Text accepts literal content but cannot introduce expressions. A Builder can deliberately replace a legacy prop and leave the replacement editable. Scroll preparation now runs after the destination DOM is inserted and before the router restores scroll. This preserves smooth anchors when restoration remounts with a page. The shared component replaces the separate hook. The navigation test now covers all six cases with and without remounting, removing the duplicate remount setup. The patch adds 51 net non-test lines, close to the 50-line estimate; the extra state records hidden saved IDs, and the extra component orders the three layout effects. Regression checks reproduced the hidden-ID overwrite, new expression insertion, copied-prop ID reuse, and instant remounted anchor before the fixes. They pass with the fixes. Local checks passed: all 2,677 project-build tests, 48 patch tests, the three SDK package suites (including 219 SDK React tests with one existing skip and 46 React Router tests), all five affected package typechecks, lint, formatting, package boundaries, generated API/docs checks, and fixture regeneration. Two Form tests timed out in the first parallel SDK run; both passed in isolation, and the complete SDK suite passed with one worker. Fixture regeneration used the existing local snapshots and downloaded required assets; it produced no tracked fixture changes. Remote fixture synchronization was not rerun. The Code Text, Content Block, share-link, and Link docs already describe the intended behavior, so no docs change is needed. The full agent evaluation was not rerun; its earlier 8/9 result and baseline limits still apply. A separate local model review was unavailable. Hosted automatic code and security reviews completed on `472dbc103e`; neither posted findings, and there are no unresolved review threads. Committed and pushed as `472dbc103e`. The [main workflow](https://github.com/webstudio-is/webstudio/actions/runs/42071262279) passed, including all ten Builder end-to-end shards, both package/CLI/core/app environments, typechecks, lint, generated checks, migrations, and size checks. Development preview fixture checks passed on Ubuntu and Windows. The [visual approval rerun](https://github.com/webstudio-is/webstudio/actions/runs/42071810156) passed. Its initial run flagged only the previously approved autocomplete story; all 267 stories were compared, with no other differences. The story was unchanged by this commit, so its existing approval was reapplied. The worktree is clean, and the remote branch matches the local commit. The excluded issues and other worktrees were not changed. No production deployment was initiated. ## Remaining follow-ups - #6645: The measured asset-remapping slowdown is fixed here, but the reported 30-second end-to-end paste remains unverified. Closed as not planned until the reporter shares a reproducer. - #6646: MCP can now inspect Global root defaults, but the reporter's original AI run remains unverified. - #5379: The broader proposal to remove the root grid remains open; this PR fixes the narrower overflow bug #6070. - #6644 was closed as not planned after local tests passed. The bad SSL report and unrelated feature requests are outside this PR. No shipped-fix announcement or production release is included. ## Verification The previous commit passed the main workflow, all ten browser shards, lint, submodule checks, and the approved visual rerun. The review commit passed the main workflow, all ten Builder browser shards, lint, submodule checks, and the visual-approval run. The initial visual check flagged the already-reviewed new autocomplete story; the approval run passed without a visual code change. An earlier browser run caught a generated-file format change; the follow-up kept that format intact and passed the same test. The full agent evaluation suite was not rerun for this redirect follow-up; Oleg asked to run it once all remaining work is fixed. Local: 2,675 project-build tests, 1,522 Builder core tests (one existing skip), 40 React Router tests, eight affected-package typechecks, lint, format, boundaries, generated API/docs checks, and fixture build passed. The earlier head also passed the Builder app, SDK, component, CLI, Editor/Preview/Navigator browser tests. On the final commit, all ten hosted browser groups, package and app checks, fixtures, migrations, and the approved visual run passed. The first Builder core job hit its seven-minute CI limit without an assertion failure; its single-job retry passed. The first visual job listed the already reviewed new autocomplete story; its approval rerun passed. The complete Sol/high agent suite finished with **8/9 scenarios passing**. The remaining native Form authoring evaluator rejects a plain HTML action URL as though it were a managed Webstudio Action. That fixture did not test actual browser submission, so no runtime claim is made. The comparison gate remains non-green: five baselines use another model and four fixtures have no accepted baseline. No baseline or validator was changed to hide this. The MCP Form result fix for #6640 is now included below. A fast redirect no longer leaves MCP without the Form result. The older local source failure helped reproduce this case. Closes #6633 Closes #6640 Closes #2439 Closes #6642 Ref #6645 Closes #6641 Closes #6643 Ref #6644 Ref #6646 Closes #6647 Ref #5379 Closes #6070 Ref #980 Ref #4309 Ref #6573 ### Consolidation of follow-up fixes - [x] Include and verify the Resource body, expression Tab, and 404 starter fixes from #6649, #6651, and #6650. - [x] Include and verify the root overflow, Navigator lag, and asset-paste fixes from #6652, #6653, and #6654. - [x] Include the Global root MCP inspection fix from #6655, with its discoverable example. - [x] Review `docs/` and fixture impact for the combined changes. - [x] Pass final CI on the combined branch. - [x] Close the superseded PRs after their changes were verified here. The 30-second end-to-end paste report is closed in #6645 until the reporter shares a reproducer. The original MCP agent outcome in #6646 is still unverified. Oleg approved keeping the public MCP example. The fix from #6656 is now included in this PR. The combined branch passed 236 focused tests, Builder/SDK/project-build typechecks, lint, formatting, package boundaries, generated API and MCP-doc checks, and the fixture pipeline. The fixture sync fetched an unrelated live-project change; rebuilding from the checked-in data restored a clean worktree. All nine agent evaluation scenarios passed, but the comparison gate remains non-green because saved baselines are missing or use a different model. The [main workflow](https://github.com/webstudio-is/webstudio/actions/runs/42090765144) passed all jobs, including ten Builder browser shards. The [approved visual rerun](https://github.com/webstudio-is/webstudio/actions/runs/42091462930) passed; its first run flagged only the already-reviewed new autocomplete story. PRs #6649–#6655 were closed as superseded, with their changes retained here. ### Final MCP Form consolidation - [x] Include the tested MCP Form redirect fix from #6656 without changing submission count or result limits. - [x] Run focused Vision/CLI tests and review the combined diff. - [x] Review `docs/` and fixture impact for this fix. The change is limited to Vision's Form result capture and tests; no docs or fixture update is needed. - [x] Pass CI on the new combined head. - [x] Close #6656 once its change is verified here. The user clarified that all bug-fix PRs from this work should be one PR. The MCP Form redirect fix belongs here too. The two Vision files match #6656 exactly. All 121 Vision tests, Vision and CLI typechecks, formatting, and the 59 focused Form capture tests passed. In the full local CLI run, 1,304 tests passed and two unrelated tests failed under parallel load; both passed in a single-worker rerun. The [main CI run](https://github.com/webstudio-is/webstudio/actions/runs/42093902295) passed, including all ten Builder browser shards. The [approved visual run](https://github.com/webstudio-is/webstudio/actions/runs/42095225165) passed. The initial visual run flagged only the previously approved autocomplete story. #6656 is closed as superseded by this PR. No production release was started. ### Large-project Navigator follow-up - [x] Import the provided large project into an isolated local Builder and measure selection-to-Style-Panel time with the tree expanded. - [x] Measure Navigator scrolling and confirm whether the current scroll path is native. - [x] Fix only the reproduced bottlenecks, with regression checks that fail before the change and pass afterward. - [x] Review `docs/` and fixture impact; run focused tests, typecheck, lint, and browser checks. - [x] Open the fixed local Builder for Oleg's manual check, then pass final CI. This follows the original large-page Navigator report in #6641. The separate 30-second paste report #6645 remains closed because it describes a different action and has no paste reproduction yet. The imported project has about 1,244 visible Navigator rows on the measured page. With the tree expanded, selection took roughly 0.9–2.2 seconds before this change and roughly 0.5–1.3 seconds afterward in local browser runs. Browser style recalculation fell from about 0.4–1.0 seconds to about 0.1–0.3 seconds per selection; times vary by run. The Navigator now uses native scrolling and lets the browser skip layout for rows off-screen. Horizontal wheel scrolling was restored and checked after Oleg spotted a regression. A focused regression test failed before the change and passes now. The Navigator tests, Builder typecheck, lint, formatting, diff check, and local browser selection/vertical/horizontal scrolling passed. The `docs/` guide and fixtures need no change because the interaction stays the same. Oleg reports that performance feels good in the local Builder. The [main CI run](https://github.com/webstudio-is/webstudio/actions/runs/42103807815) passed, including all ten Builder browser shards. One unrelated design-system browser test timed out on the first run and passed on retry. The [visual approval run](https://github.com/webstudio-is/webstudio/actions/runs/42105155951) passed after review of tiny Navigator text-pixel differences and the previously approved autocomplete story. No production release was started. ### Final review: Navigator drop marker - [x] Reproduce the clipped marker with a focused regression test. - [x] Keep the marker visible without losing off-screen-row performance. - [x] Review `docs/` and fixture impact, run focused tests, typecheck, lint, formatting, and browser checks. - [x] Push this fix to the same PR and pass required CI. The regression test failed before the fix (`auto` instead of `visible`) and passed afterward. A sortable row now marks when it has a drop target; only that row skips the off-screen containment rule, so its marker can cross the row edge. Other rows retain containment. Navigator and tree browser tests, both typechecks, lint, formatting, and diff checks passed locally. The Navigator guide still describes the same drag-and-drop behavior; no docs or fixture update is needed. This adds two net non-test lines, matching the small-change estimate. The [main CI run](https://github.com/webstudio-is/webstudio/actions/runs/42109032555) passed all 23 jobs. Two MCP Form browser shards first returned an unexpected `unknown` form status, then passed on rerun without a code change. The [visual approval run](https://github.com/webstudio-is/webstudio/actions/runs/42109658799) also passed. No production release was started. ### Drop marker color follow-up - [x] Remove the white outline and white fill so the marker is blue with a transparent center in both themes. - [x] Add a browser regression check that fails before the fix and passes after it. - [x] Review `docs/` and fixture impact; run focused tests, typecheck, lint, and formatting. - [x] Push to this PR and pass required CI. The old styles failed the new light/dark browser test because the line had a white outline. After removing the outline and the white circle backing, all 20 focused indicator/tree tests pass. Design-system typecheck, lint, formatting, and diff checks pass. The Navigator guide describes behavior, not marker colors, so docs need no update. No fixture input or output changes. The [main CI run](https://github.com/webstudio-is/webstudio/actions/runs/42115118863) passed all 23 jobs. Three MCP Form browser shards first returned an unexpected `unknown` status and passed on rerun without a code change. The [approved visual run](https://github.com/webstudio-is/webstudio/actions/runs/42115696559) passed after GitHub cancelled its first attempt. The intentional indicator difference and the two previously reviewed Navigator text differences were approved. No production release was started. ### MCP Form status follow-up - [x] Review the old first-attempt failures and compare the new first-pass Form CI results; the old reports did not expose which layer failed. - [x] Stop masking pre-submission browser errors as uncertain Form outcomes; confirm the regression test fails before and passes after. - [x] Review `docs/` and fixture impact; run focused tests and package checks. - [x] Push the fix to this PR and pass required CI. The CLI had returned `unknown` for every browser error, including startup failures before any Form submission. It now lets those errors surface. The browser observer still returns `unknown` if a submission may have happened, and neither path retries it. This removes 8 net production lines. The regression test failed before the fix and passes afterward. All 50 CLI preview tests and 59 Vision browser tests passed, as did CLI/Vision typechecks, lint, formatting, and the diff check. No docs or fixtures changed. The approved full agent evaluation ran: 8/9 scenarios passed; the existing managed-Form authoring `contactPage` check failed, while the Form runtime scenario passed. The comparison gate is also non-green because saved baselines are missing or incompatible. Commit: `a2ff0822ad`. The intermittent CI cause still needs a first-attempt check. [Main CI on the new head](https://github.com/webstudio-is/webstudio/actions/runs/42123770480) passed all jobs, including all ten Builder browser shards on their first attempt. The Form-heavy shards 1, 5, 6, 9, and 10 passed. The [approved visual run](https://github.com/webstudio-is/webstudio/actions/runs/42124446769) passed; its initial run showed only the four previously reviewed UI differences, none from this CLI-only patch. The older flaky `unknown` results cannot be attributed to startup versus post-dispatch observation from their logs, so this fix addresses a proven masking bug and adds regression coverage, but does not prove every possible intermittent observer failure is gone. No production release was started. |
||
|
|
13eb7527ef |
fix: route deprecated Webhook Forms through Form backend (#6553)
Deprecated Webhook Forms reuse the existing Form execution pipeline without teaching the modern backend about WebhookForm. ## User-facing behavior and how to test it - Existing saved Webhook Forms keep their markup, action settings, and success/error feedback. Submit a published Webhook Form and check both outcomes. - URL and Resource actions preserve configured methods, headers, dependencies, body overrides, and the last submitted value for repeated field names. Test a configured action and inspect the received request. - Default owner notifications use the Email Worker, including submitted files. Submit a Webhook Form without a custom action and inspect the owner email and attachment. - Configured Email actions validate recipients and retain threading metadata. Test valid recipients and a rejected recipient limit. ## Implementation - One deprecated Webhook Form adapter calls existing bot validation, Email preparation, recipient validation, resource loading, and response handling. - Both generated route templates call that adapter. Both paths reuse an internal resource-graph traversal helper; modern submission behavior is unchanged. - Root actions use the protected, uncached request override. Dependencies reuse existing generated Assets and Resource caching behavior. - Keep reachable-resource filtering because Email preparation runs before loading: unrelated Email settings must not break the selected action. - Remove dead `getDefaultActionResource` wiring from generated templates. ## Verification - Focused SDK tests: 116 passed (11 deprecated Webhook Form adapter and 105 modern submission, Email, and handler tests), including unrelated resources, missing dependencies, cycles, Email preflight/threading, and single-attempt Email failures. - Resource generator tests: 26 passed. - Full CLI prebuild suite: 139 passed after tracked fixture regeneration; focused deprecated Webhook Form adapter tests: 9 passed. - Repository fixture pipeline (`pnpm -r fixtures:build`) passed. All tracked generated `getDefaultActionResource` references were removed, and no Builder `N8N_FORM_EMAIL_HOOK` reference remains. - Final MCP-generated local Preview E2E rerun: 3/3 passed. - Focused saved Webhook Form custom-action E2E rerun: 2/2 passed (setup and test), including a single POST through the protected test receiver after Builder reload. - SDK, CLI, and Builder typechecks, focused lint and formatting, and `git diff --check` passed. - Deprecated component picker regression test passed (2/2); verified it fails when WebhookForm deprecation is disabled, then passes with deprecation restored. - Independent Astra review found no blocker, including the 62 generated fixture changes. No production deployment or live secret change was performed. - Required staging CI checks passed on previous head `15635fc` (Main workflow, visual regression, submodules, and lint). An unrelated existing MCP success-redirect E2E assertion failed once in shard 5, passed in a focused local rerun (2/2 including setup), then shard 5 passed on GitHub rerun without code changes. - Terminology pass (`4a69ab573`): renamed the dedicated SDK adapter and migration helper, updated both route templates and generated fixtures, corrected the active identity migration marker comments, and synchronized docs and test names. Focused tests passed: SDK 35, CLI prebuild 12 plus 2 after final title change, MCP 7, migrations 8, React browser 7, CLI docs 9. Seven affected package typechecks, fixture builds, formatting, and `git diff --check` passed. That historical head was superseded; latest-head CI results are recorded below. - ResourceForm identity migration (`29a21edbb`): focused migration (23), DB patch (25), project-build DB/session (93), Builder API/import/auth/patch (60), React SDK (162), runtime/MCP (239), registry (11), CLI evaluation (90), CLI session/sync (55), and protocol (15) tests passed; full CLI prebuild (139) passed. Affected typechecks, lint, formatting, and `git diff --check` passed. Independent Astra review found no blocker. No deployment was performed. - Prepublish Webhook Form warning (`25855e8f00`): audit checks every non-draft published page and links nested/shared instances to the correct page; modern ResourceForm, native forms, draft-only forms, and orphans are excluded. Focused audit tests (13), Builder navigation tests (6), project-build and Builder typechecks, lint, formatting, and `git diff --check` passed. Independent Astra review found no blocker; publishing remains nonblocking. No deployment was performed. - ResourceForm test and CI expectation repair (`e1a527fbcc`): focused React SDK (24), Builder preview/registry (38), project-build pages (1), and CLI fixture API (8) tests passed; Remix and React Router targeted browser suites, affected package typechecks, full formatting (3375 files), lint, and `git diff --check` passed. Astra review found no blocker. Persisted identity and runtime exports were unchanged. - Project bundle fixture repair (`70889ef27d`): eight bundles now carry the current contract version; the two unmarked historical Form instances in `webstudio-features` normalize to WebhookForm. Protocol fixture tests (17), protocol typecheck, CLI fixture build, formatting, lint, and diff check passed. Independent Astra review found no blocker. - Story/MCP E2E CI repair (`483614e6c5`): SDK CLI story tests (7), ResourceForm fragment tests (34), and focused local managed-form E2E (4 including setup) passed. SDK CLI and Builder typechecks, lint, formatting, and diff check passed. Astra review found no blocker. The initial local Preview build used an ignored stale React Router `lib` artifact; rebuilding it restored the passing E2E run. - Latest PR head `483614e6c5`: Main workflow [run 39317777032](https://github.com/webstudio-is/webstudio/actions/runs/39317777032) passed, including all package matrices and six Builder E2E shards. Visual regression [run 39317796922](https://github.com/webstudio-is/webstudio/actions/runs/39317796922), submodules, and PR lint checks passed. The overlapping unapproved visual run was cancelled by the approved rerun. - Shared bot-value generator (`ecc4cad1e9`): SDK helper tests (3), React Router WebhookForm/ResourceForm browser tests (5), SDK/Router/Remix typechecks and builds, SDK browser-boundary check, formatting, and diff check passed. Brave bypasses media queries, working media queries produce a fresh timestamp per submission, and failed queries produce `jsdom`; each managed/legacy submission has one bot field. Independent Astra review found no blocker. Latest-head Main workflow [run 39325677117](https://github.com/webstudio-is/webstudio/actions/runs/39325677117) passed, including all six Builder E2E shards; approved visual regression [run 39325702835](https://github.com/webstudio-is/webstudio/actions/runs/39325702835), submodules, and PR lint passed. The superseded visual run was cancelled by the approved rerun.\n\n- Historical Form clipboard guard (`e864283d1c`): instance/page transfer parsers reject ambiguous legacy `Form` before asset import; direct fragment/page/folder mutations preflight before changes. Canonical ResourceForm, WebhookForm, and NativeForm remain accepted. Project-build tests (89), Builder paste browser tests (69), both typechecks, focused lint/formatting, and diff check passed. Independent Astra review found no blocker. Latest-head Main workflow [run 39329184890](https://github.com/webstudio-is/webstudio/actions/runs/39329184890) passed, including all six Builder E2E shards; approved visual regression [run 39329562692](https://github.com/webstudio-is/webstudio/actions/runs/39329562692), submodules, and PR lint passed. The earlier unapproved visual run reported two expected story differences.\n\n## Compatibility notes - Root HTTP actions reject private and same-origin destinations. Dependencies retain their existing fetch/cache behavior. - Routes retain the 25 MiB request limit. Shared execution applies bot validation, a 10-second Resource timeout, and one retry for eligible HTTP failures; an ambiguous failure can duplicate an HTTP action. Email actions are not retried. - Default email uses the Email Worker's sender, plain text, recipient limits, and attachment limits instead of the legacy n8n HTML/basic-auth path. - Self-hosted sites need normal Email sender configuration. Direct Builder draft Preview handling is outside this published-route change. - Coordinate this CLI release with [SaaS PR #669](https://github.com/webstudio-is/webstudio-saas/pull/669), which removes the n8n helper and `N8N_FORM_EMAIL_HOOK` from new published-site builds. Publish with a CLI artifact containing this adapter. Existing deployed workers retain their bundled code and injected hook until republished, so keep the actual n8n endpoint available while those sites remain active. ## Implementation checklist - [x] Align saved Webhook Form custom-action E2E with the protected receiver and verify one submission. - [x] Regenerate tracked published-site fixtures with the updated CLI and confirm no `getDefaultActionResource` or `N8N_FORM_EMAIL_HOOK` references remain in Builder source/config/fixtures. - [x] Review authoritative `docs/` impact of removing the obsolete Builder hook wiring; related deprecation and integration docs were updated. - [x] Route deprecated Webhook Form submissions through the shared execution pipeline with one adapter. - [x] Preserve configured actions, dependencies, repeated fields, body overrides, and saved feedback. - [x] Prepare and validate Email actions using existing shared logic. - [x] Remove duplicated orchestration and dead generated context wiring. - [x] Verify generated routes and MCP-generated Preview submissions. - [x] Mark the Webhook Form component and its dedicated dependencies visibly deprecated, while leaving shared Form infrastructure active. - [x] Group Webhook Form-only SDK code for straightforward removal while preserving public APIs and generated output. - [x] Use deprecated terminology consistently for Webhook Form-only PR code, and clarify the active identity migration marker. - [x] Confirm required staging CI checks. - [x] Use ResourceForm as the one active modern component identity across Builder, SDK, runtime, templates, generated code, and docs. - [x] Migrate historical Form, NativeForm, ResourceForm, and WebhookForm identities in one idempotent pass using the historical pages marker. - [x] Remove the marker from ordinary project and snapshot APIs while preserving historical input readers. - [x] Persist pages and instances together when a historical marked project is saved, including a pages-only edit. - [x] Verify migration, export/reimport, old CLI and server snapshots, page-only save, generation, and affected typechecks. - [x] Complete an independent architecture review before commit or push. - [x] Warn at prepublish for deprecated Webhook Forms on published pages, with a link to each affected element. - [x] Verify modern ResourceForm is excluded and nested/shared Webhook Forms navigate to the correct page. - [x] Complete independent review, focused tests, and affected typechecks before push. - [x] Remove local `ResourceForm as Form` aliases from React SDK tests and fixtures; use the canonical component name throughout. - [x] Fix stale identity expectations found in CI and verify affected tests/typechecks. - [x] Complete independent review before push. - [x] Refresh tracked project bundle fixtures to the current bundle contract and canonical WebhookForm identity; verify protocol and affected CLI flows. - [x] Align SDK CLI story assertions and MCP E2E fragment fixtures with the persisted ResourceForm component name; rerun affected checks. - [x] Share one browser bot-value generator across ResourceForm submission and deprecated Webhook Form wrappers, preserving field ownership and behavior. - [x] Verify bot timestamps, Brave/media failure handling, repeated submissions, affected typechecks, and independent review before push. - [x] Reject ambiguous historical `Form` clipboard fragments before any insertion or transfer mutation, with clear recopy guidance; preserve canonical ResourceForm action remapping.\n- [x] Verify instance/page/template/folder paste regressions, independent review, and latest-head CI.\n\n - [x] Explain Email attachment size limits in the Email action UI and give a useful error when the aggregate encoded attachments exceed the local guard. - [x] Check Preview and published behavior, boundary tests, and authoritative Form docs; verify the focused change and get independent review. Ref #4093 - [x] Preserve safe email codes/messages through MCP, including local attachment and upload limit errors. - [x] Correct Form documentation for each enforced limit and verify Preview/published/MCP paths. - [x] Verify Builder SDK and MCP focused tests, typechecks, and independent review before push. - Email limits and failure copy (`6d215f3ec3`): the shared SDK checks 32 attachments and 7 MiB aggregate Base64 data before dispatch; the 25 MiB multipart response and Email action guidance use approved copy. Managed Email error codes pass through Form and MCP results with resource IDs, while MCP still omits resource bodies. Form docs distinguish the Worker 7 MiB JSON cap from Cloudflare's 5 MiB complete message and verified-destination exception, and correct the no-retry behavior. Focused SDK tests 89, Builder API tests 44, UI browser tests 42, SDK/Builder/CLI/docs typechecks, lint, formatting, and generated MCP docs check passed. Astra found no blocker. No real email or production deployment occurred. - Latest Email limits head `6d215f3ec3`: Main workflow [run 39393037290](https://github.com/webstudio-is/webstudio/actions/runs/39393037290) passed on rerun, including all six Builder E2E shards; approved visual regression [run 39393456618](https://github.com/webstudio-is/webstudio/actions/runs/39393456618), submodules, and PR lint passed. The initial unapproved visual run showed the same two previously accepted story differences. - [x] Address review: normalize previous-Builder `Form` instance patches before persistence, preserve historical WebhookForm identity, and cover marked/unmarked cases. Documentation impact reviewed: this restores intended save behavior, so no user guide change is needed. - Review finding follow-up (`ce05dd733a`): three Form identity patch regressions passed red/green; full project build-patch tests 28/28, project typecheck, lint, formatting, and diff check passed. Independent Astra review found no blocker. Incoming PATCH `Form` is treated as the immediately previous Builder's modern form alias; already stored unmarked historical `Form` continues to migrate to WebhookForm. The old patch protocol has no client-release identifier, so pre-October-14 live clients adding new ambiguous IDs cannot be identified separately. - Latest review-fix head `ce05dd733a`: Main workflow [run 39397337356](https://github.com/webstudio-is/webstudio/actions/runs/39397337356) passed, including six E2E shards after a targeted shard-4 rerun for an unrelated MDX slash-menu timeout. Approved visual regression [run 39397395206](https://github.com/webstudio-is/webstudio/actions/runs/39397395206), submodules, and PR lint passed. The unapproved synchronize visual run was cancelled by the approved rerun. |
||
|
|
dde30ffb54 |
feat: Improve MCP authoring, compact output, and agent onboarding (#5883)
## Summary This improves how agents discover, author, inspect, and verify Webstudio projects while reducing unnecessary MCP context usage. ## What changed - Adds an **Agents** section to Project Settings with ready-to-run setup commands and client configuration for Claude Code, Codex, Cursor, and VS Code. - Makes large list and schema responses compact and paginated by default, with **verbose** available when complete records or diagnostics are needed. - Applies consistent compact output to assets, instances, styles, design tokens, CLI schemas, and project-session metadata. - Returns actionable expression warnings for props, resources, and Collection bindings, including unknown variables and risky render-time mutation resources. - Improves Collection expression guidance so agents can bind array items with the correct scoped variables. - Reports rendered audit outcomes explicitly as complete, partial, confirmation-required, or failed. - Expands runtime output schemas so MCP clients can validate responses reliably. - Strengthens the packaged CLI smoke workflow with a realistic seven-page stdio MCP scenario. ## Architecture - Consolidates `project-build` from 65 file-oriented entrypoints to 11 architecture-owned surfaces. - Separates the core model, contracts, runtime authoring, transfer, state, project sessions, MCP, visual tooling, persistence codecs, and authenticated server services. - Isolates Node-only JSX evaluation from browser-safe transfer utilities and authenticated server modules. - Keeps persistence codecs independent from authenticated database services, preventing unrelated module initialization. - Defines shared instance-path types once and reuses them across runtime modules. - Preserves Immer initialization through explicit package side-effect metadata. - Adds package tests that prevent a return to source-file entrypoints or generic exposure of Node-only surfaces. ## Validation - Full repository checks, tests, typechecks, generated-file checks, and fixtures - All 163 Builder test files and 2,141 tests - All 71 project-build test files and 1,794 tests - Lint and package-boundary validation - Full packed CLI release smoke test, including install, preview, agent setup, seven-page stdio MCP workflow, rendered audit, and structured commands |
||
|
|
d291e4b671 |
feat: Builder api runtime contracts guardrails for MCP (#5857)
This PR expands Webstudio MCP and CLI into a more complete agent authoring interface. Agents can discover project capabilities, edit real Webstudio content, use data/resources, verify visual output, and report useful issues when workflows fail. ## MCP User Capabilities - Create, update, duplicate, reorder, and delete pages. - Create pages from templates and manage reusable page templates. - Inspect project pages, instances, props, styles, assets, variables, resources, and metadata. - Insert Webstudio components and authored JSX fragments into pages. - Edit text, props, styles, breakpoints, design tokens, and CSS variables. - Update page metadata, SEO fields, redirects, marketplace metadata, and project settings. - Create and use static data variables. - Create and use dynamic resources fetched over HTTP. - Use REST, GraphQL, and built-in system resources in authored pages. - Bind data variables and resources to visible page content. - Create resource-backed pages such as sitemap XML, structured SEO data, and API-driven content sections. - Preview current project state without requiring a publish step. - Capture screenshots for visual verification. - Verify responsive designs across desktop, tablet, and mobile breakpoints. - Use screenshot diff and OCR-style checks to inspect rendered output. - Reset and refresh local MCP project state when needed. - Discover available CLI/MCP commands from generated manuals. - Use clearer examples for resources, data variables, JSX authoring, previewing, and visual checks. - Read marketplace product metadata without requiring a full project snapshot. - Get safer guidance when using low-level patch tools. - Get a ready-to-copy Discord report template when MCP/CLI behavior is confusing or broken. |
||
|
|
e7b7faeca5 | fix: performance optimizations (#5827) | ||
|
|
392c9089be |
fix: content mode permissions (#5795)
**Summary** Fixes content-mode edit permissions so editor-only users can perform allowed content workflows without backend “build permission” failures. **Changes** - Added shared content-mode permission validation used by backend authorization. - Aligned content-mode capabilities around editable props, editable instances, content roots, pages, assets, and template insertion. - Allowed content-safe instance/text/page/template/style changes while keeping design/data/resource changes build-only. - Updated template insertion to preserve content-safe local styles and reuse tokens by id. - Added accessible `SyncStatusDot` for e2e-visible sync state without replacing the existing sync status UI. - Added builder e2e setup with Postgres/PostgREST and a first content-mode browser test: - edit existing text as an editor-only user - wait for saved state via the sync status dot - reload and verify persistence **Verification** - `pnpm --filter=@webstudio-is/builder test -- sync-status.test.tsx` - `pnpm --filter=@webstudio-is/builder typecheck` - `git diff --check` - `pnpm e2e:builder` |
||
|
|
cc26648519 |
fix: Fix page template editor permissions (#5793)
Adds permission protection around page templates so content editors can create pages from templates without being able to open, edit, or patch template pages directly. |
||
|
|
b006947a85 |
feat: WIP realtime collaboration to builder (#5726)
https://github.com/webstudio-is/webstudio/issues/46 |