Skip to content

fix(framework-editor): prevent silent loss of new requirements #3074

Merged
tofikwest merged 4 commits into
releasefrom
main
Jun 10, 2026
Merged

fix(framework-editor): prevent silent loss of new requirements #3074
tofikwest merged 4 commits into
releasefrom
main

Conversation

@tofikwest

@tofikwest tofikwest commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes COMP-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

Summary by cubic

Prevents new controls and requirements from “vanishing” in the Framework Editor by enforcing required links on framework tabs, preserving link selections on commit, and warning before leaving with unsaved changes.

  • Bug Fixes

    • Controls tab: block committing a control with no requirement links and show a clear error.
    • Requirement picker on the Controls tab is scoped to the current framework’s requirements.
    • Persist pre-selected requirement/policy/task links on commit; failed links surface errors; successful commits call router.refresh().
    • Both grids: rows without a name now error instead of being silently skipped; failed rows stay dirty.
    • AddExistingItemDialog shows the API’s actual error message (e.g., “Framework has no requirements to link the control to”).
  • New Features

    • RelationalCell: allowSelectOnNewRows lets users pick links on new rows; links are saved on commit (used for requirements on the Controls tab and controls on the Requirements tab).
    • Unsaved changes guard: confirm on tab switch and browser reload; FrameworkTabs prevents accidental loss of uncommitted rows.

Written for commit 5f64e6f. Summary will update on new commits.

Review in cubic

github-actions Bot and others added 4 commits June 9, 2026 22:15
…ntrols

A control created from a framework's Controls tab was created as a global
template with no link to the framework, while the tab only lists controls
linked to the framework's requirements — so committed controls silently
vanished on the next visit. Uncommitted grid rows were also discarded
without warning on tab navigation, and rows that failed (or were skipped
for a missing name) stayed in the grid looking committed.

- RelationalCell: allow picking links on uncommitted rows (opt-in
  allowSelectOnNewRows); both grids persist those links on commit
- controls grid: on a framework tab, block committing a control with zero
  requirement links with an actionable error instead of letting it vanish
- framework tab: requirement picker on new control rows is scoped to the
  framework's own requirements
- both grids: empty-name rows now produce a commit error instead of being
  silently skipped; fully-successful commits router.refresh() to re-sync
- FrameworkTabs + beforeunload: confirm before discarding uncommitted rows
- AddExistingItemDialog: surface the API's real error message (e.g.
  "Framework has no requirements to link the control to")
- add vitest setup for framework-editor + 15 unit tests

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Next's build-time typecheck on Vercel resolves two vite copies (root vs
vitest's bundled one), making the plugin's Plugin type incompatible with
vitest's defineConfig. esbuild already handles TSX for tests, so the
plugin was only adding the type conflict.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-link-blocker

fix(framework-editor): prevent silent loss of new requirements and controls
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment Jun 10, 2026 3:30pm
comp-framework-editor (staging) Ready Ready Preview, Comment Jun 10, 2026 3:30pm
portal (staging) Ready Ready Preview, Comment Jun 10, 2026 3:30pm

Request Review

@tofikwest tofikwest merged commit 7f0b5ca into release Jun 10, 2026
11 of 13 checks passed
@claudfuen

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.74.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants