fix(editor): Resolve $vars by the workflow's project; close the remaining editor-ui gaps #5

Open
ggrace wants to merge 8 commits from fix/editor-vars-workflow-project into develop
Owner

Summary

The editor-ui unit suite was standing-red (18 files, 136 tests; see docs/red-frontend-suite-triage.md). Every failure traced to clean-room code drifting from what the surviving upstream specs and the backend expect. The last three items were Greg's product calls.

  • $vars used the wrong project (130 of 136). The rebuilt environments store scoped expression variables by the project in the URL, while execution resolves $vars against the workflow's owning project (getVariables). Previews could show another project's variables, and every NDV spec that auto-mocks the router crashed. Half-mounted components then leaked DOM, which explains the "found multiple elements" cluster. The testing-library dom@9/@10 split was a red herring. The store now scopes by the open workflow's home project.
  • Custom instance roles: the project option is now "Create" (project:create), not instance-wide "Manage". This matches the upstream UI, tooltip and spec. Existing roles keep their stored scopes.
  • Highlighted execution data restored: data set with $execution.customData was shown nowhere. The dropdown is rebuilt clean-room from the orphaned styles and strings plus the spec: an ellipsis button with a count badge.
  • Evaluations ungated: the evaluations quota is added to the fair-code unlimited list (the A13 mechanism), so the E13 rebuild is reachable on real instances.
  • The paywall test ID now matches the spec.

How to test

pnpm build
cd packages/frontend/editor-ui && pnpm test && pnpm typecheck

Verification

  • editor-ui full suite: 992 of 993 files passing. The remaining file (node-creator triggers) passes after the evaluations change: 18 files / 306 tests in the re-run of node-creator and evaluation specs.
  • editor-ui typecheck: exit 0, 0 errors.
  • New environments.store.test.ts: pins workflow-project scoping, global-only for a workflow without a home project, and explicit-project resolution.
  • Experiment: removing just the route read turned 14 of the 18 files green, confirming the root cause before the real fix.
  • Other packages:
    • @n8n/permissions 134/134;
    • roles UI 191/191;
    • cli license and evaluation unit 83/83;
    • evaluation integration 136/136.

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive.
  • Docs updated or follow-up ticket created. (DEFORK_CHANGELOG.md, triage doc)
  • Tests included.

🤖 Generated with Claude Code


Migrated from GitHub PR #63.

## Summary The editor-ui unit suite was standing-red (18 files, 136 tests; see `docs/red-frontend-suite-triage.md`). Every failure traced to clean-room code drifting from what the surviving upstream specs and the backend expect. The last three items were Greg's product calls. - **`$vars` used the wrong project** (130 of 136). The rebuilt environments store scoped expression variables by the project in the URL, while execution resolves `$vars` against the **workflow's owning project** (`getVariables`). Previews could show another project's variables, and every NDV spec that auto-mocks the router crashed. Half-mounted components then leaked DOM, which explains the "found multiple elements" cluster. The testing-library dom@9/@10 split was a red herring. The store now scopes by the open workflow's home project. - **Custom instance roles:** the project option is now "Create" (`project:create`), not instance-wide "Manage". This matches the upstream UI, tooltip and spec. Existing roles keep their stored scopes. - **Highlighted execution data restored:** data set with `$execution.customData` was shown nowhere. The dropdown is rebuilt clean-room from the orphaned styles and strings plus the spec: an ellipsis button with a count badge. - **Evaluations ungated:** the evaluations quota is added to the fair-code unlimited list (the A13 mechanism), so the E13 rebuild is reachable on real instances. - The paywall test ID now matches the spec. ## How to test ``` pnpm build cd packages/frontend/editor-ui && pnpm test && pnpm typecheck ``` ## Verification - **editor-ui full suite:** 992 of 993 files passing. The remaining file (node-creator triggers) passes after the evaluations change: 18 files / 306 tests in the re-run of node-creator and evaluation specs. - **editor-ui typecheck:** exit 0, 0 errors. - **New `environments.store.test.ts`:** pins workflow-project scoping, global-only for a workflow without a home project, and explicit-project resolution. - **Experiment:** removing just the route read turned 14 of the 18 files green, confirming the root cause before the real fix. - **Other packages:** - `@n8n/permissions` 134/134; - roles UI 191/191; - cli license and evaluation unit 83/83; - evaluation integration 136/136. ## Review / Merge checklist - [x] I have seen this code, I have run this code, and I take responsibility for this code. - [x] PR title and summary are descriptive. - [x] Docs updated or follow-up ticket created. (`DEFORK_CHANGELOG.md`, triage doc) - [x] Tests included. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Migrated from GitHub PR #63._
The clean-room environments store scoped `$vars` by projectsStore's
currentProjectId, which reads the route. That disagreed with execution
(the backend resolves $vars against the workflow's owning project), could
show another project's variables after opening a workflow by direct link,
and crashed every NDV spec that auto-mocks vue-router -- 14 of the 18 red
editor-ui files, including the "found multiple elements" fallout.
Scope by the open workflow's home project; components holding their own
workflow document pass its project explicitly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The rebuilt global custom-role groups offered project "Manage" (create,
read, update, delete and list every project). The upstream editor config,
its tooltip ("Create new projects") and its spec expect a single "Create"
option; managing existing projects stays per project via project roles.
The scope whitelist is unchanged, so existing custom roles keep their scopes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Executions' custom data (`$execution.customData`) was no longer shown
anywhere: the dropdown went with a purged component, leaving its styles,
typed customData and i18n strings orphaned in the preview. Rebuilt
clean-room from those leftovers and the surviving spec: an ellipsis button
with a count badge opening a key/value list, gated like annotations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Evaluations (rebuilt in E13) hung on a license-server quota that defaults
to 0, so they were hidden on every real instance. Add the evaluations quota
to the fork's fair-code unlimited list (the A13 mechanism); the frontend
treats a not-yet-loaded evaluation setting as enabled too. Every consumer
already treats -1 as unlimited.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Also swaps the new highlighted-data list's legacy --color--text--tint-1 for
the semantic --text-color--subtler (frontend AGENTS.md).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018F9GRMoJ5bpYz885WDquXV
Merge branch 'develop' into fix/editor-vars-workflow-project
Some checks failed
CI: Pull Requests (Build, Test, Lint) / Install & Build (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Lint (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Performance (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Notify Slack on failure (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests-2 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests-3 (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Unit tests (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Typecheck (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Lint (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Check packaging (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Prepare Docker (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / SQLite: Sanity Check (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / E2E (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Dev-server boot smoke (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / DB Tests (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Performance (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / E2E Performance (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Security Checks (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Workflow scripts (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Instance AI Discovery Evals (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Required Checks (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / QA Metrics (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / prepare-docker (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / build-and-test-performance (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Canvas Perf Sentinels (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Build & publish image (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Shard 1 (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Post Metrics Comment (pull_request) Has been cancelled
75885b108c
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018F9GRMoJ5bpYz885WDquXV
Some checks failed
build-windows.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (push) Failing after 0s
release-build-daytona-snapshot.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (push) Failing after 0s
release-promote-backport-labels.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (push) Failing after 0s
sbom-generation-callable.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (push) Failing after 0s
test-evals-mcp.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (push) Failing after 0s
test-workflows-callable.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (push) Failing after 0s
build-windows.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (pull_request) Failing after 0s
release-build-daytona-snapshot.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (pull_request) Failing after 0s
release-promote-backport-labels.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (pull_request) Failing after 0s
sbom-generation-callable.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (pull_request) Failing after 0s
test-evals-mcp.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (pull_request) Failing after 0s
test-workflows-callable.yml / Merge branch 'develop' into fix/editor-vars-workflow-project (pull_request) Failing after 0s
CI: Validate CODEOWNERS / validate (pull_request) Failing after 1s
CI: PR Quality Checks / Handle /size-limit-override (pull_request) Has been skipped
CI: PR Quality Checks / PR Size Limit (pull_request) Failing after 50s
CI: PR Quality Checks / Detect Changes (pull_request) Successful in 8s
CI: PR Quality Checks / Do Not Merge (pull_request) Successful in 1s
CI: Master (Build, Test, Lint) / Build for Github Cache (pull_request) Failing after 2m14s
CI: PR Quality Checks / Static Analysis (pull_request) Failing after 3m9s
CI: PR Quality Checks / Required PR Quality Checks (pull_request) Failing after 2s
CI: Master (Build, Test, Lint) / Backend Unit Tests (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Backend Integration Tests (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Nodes Unit Tests (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Frontend (1/2) (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Frontend (2/2) (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Backend Unit Tests-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Backend Integration Tests-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Nodes Unit Tests-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Frontend (1/2)-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Frontend (2/2)-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Lint-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Benchmarks (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Install & Build (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests-1 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Lint (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Performance (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Notify Slack on failure (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests-2 (pull_request) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests-3 (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Unit tests (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Typecheck (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Lint (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Check packaging (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Prepare Docker (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / SQLite: Sanity Check (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / E2E (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Dev-server boot smoke (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / DB Tests (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Performance (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / E2E Performance (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Security Checks (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Workflow scripts (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Instance AI Discovery Evals (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Required Checks (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / QA Metrics (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / prepare-docker (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / build-and-test-performance (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Canvas Perf Sentinels (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Build & publish image (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Shard 1 (pull_request) Has been cancelled
CI: Pull Requests (Build, Test, Lint) / Post Metrics Comment (pull_request) Has been cancelled
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/editor-vars-workflow-project:fix/editor-vars-workflow-project
git switch fix/editor-vars-workflow-project

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff fix/editor-vars-workflow-project
git switch fix/editor-vars-workflow-project
git rebase develop
git switch develop
git merge --ff-only fix/editor-vars-workflow-project
git switch fix/editor-vars-workflow-project
git rebase develop
git switch develop
git merge --no-ff fix/editor-vars-workflow-project
git switch develop
git merge --squash fix/editor-vars-workflow-project
git switch develop
git merge --ff-only fix/editor-vars-workflow-project
git switch develop
git merge fix/editor-vars-workflow-project
git push origin develop
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ggrace/n8n!5
No description provided.