Skip to content

Gate ABv1 editing and add remigration dialog - #1291

Merged
neelasha-writer merged 2 commits into
devfrom
fix-ACTION-5731-remigration-warning-banner
Jul 8, 2026
Merged

Gate ABv1 editing and add remigration dialog#1291
neelasha-writer merged 2 commits into
devfrom
fix-ACTION-5731-remigration-warning-banner

Conversation

@neelasha-writer

@neelasha-writer neelasha-writer commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a compact remigration warning dialog that opens only from the fe.web-app editor launch path and is suppressed on refresh.
  • Gate ABv1 edit actions behind server-provided edit access, while preserving org-admin access as a fallback.
  • Keep the editor visible for blocked users, but grey it out with a blocking overlay and guard global edit handlers.

Test plan

  • npm exec -w writer-ui -- eslint src/tests/mocks.ts src/core/index.ts src/builder/BuilderApp.vue src/builder/BuilderEditBlockedState.vue src/builder/BuilderRemigrationWarningDialog.vue src/wds/WdsModal.vue --ext .vue,.ts,.js,.jsx,.cjs,.mjs --ignore-path ../../.gitignore --ignore-path .gitignore
  • python3 -m py_compile src/writer/app_runner.py src/writer/ss_types.py
  • Local preview: opened http://localhost:5173/?showRemigrationWarning=true and confirmed allowed/admin sessions render editor tabs and the dialog.

Notes

  • agent-manager should pass x-can-edit-agent: true for non-admin AIS users who can edit ABv1 agents.

Summary by CodeRabbit

  • New Features
    • Added a clear blocked-editing state for builder mode when the user lacks edit permission.
    • Added a compact “Migrate again to update your app” remigration warning dialog (triggered via URL query).
    • Added support for a compact modal size.
  • Bug Fixes
    • Blocked editor interactions (keyboard, selection, drag-and-drop, clicks) when editing is disabled.
    • Ensured instance and note trackers render only when editing is permitted (with tighter UI-mode conditions).
    • Restricted when the remigration warning is shown to the appropriate app and navigation scenarios.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d78e9ab-fa70-4060-a07a-599ae97cd57e

📥 Commits

Reviewing files that changed from the base of the PR and between 1286313 and c8be1f4.

📒 Files selected for processing (8)
  • src/ui/src/builder/BuilderApp.vue
  • src/ui/src/builder/BuilderEditBlockedState.vue
  • src/ui/src/builder/BuilderRemigrationWarningDialog.vue
  • src/ui/src/core/index.ts
  • src/ui/src/tests/mocks.ts
  • src/ui/src/wds/WdsModal.vue
  • src/writer/app_runner.py
  • src/writer/ss_types.py

📝 Walkthrough

Walkthrough

Adds an edit-permission flag (canEditAgent) propagated from backend request headers through Pydantic models and frontend core computed state to the builder UI. The builder now gates rendering and user interactions on this flag, adds a permission-blocked screen, a compact modal variant, and a remigration warning dialog.

Changes

Edit Permission Gating

Layer / File(s) Summary
Backend canEdit permission field
src/writer/ss_types.py, src/writer/app_runner.py
Adds canEdit optional field to WriterApplicationInformation and computes it from the x-can-edit-agent header or org-admin status during session init.
Core canEditAgent computed and mocks
src/ui/src/core/index.ts, src/ui/src/tests/mocks.ts
Extends writerApplication type with canEdit, adds canEditAgent computed based on Writer Cloud/org-admin/canEdit state, exposes it on core, and updates mocks with matching computed properties.
Compact WdsModal size variant
src/ui/src/wds/WdsModal.vue
Adds a "compact" size option to the size prop with a corresponding CSS class and scoped styles for a narrower layout.
BuilderEditBlockedState component
src/ui/src/builder/BuilderEditBlockedState.vue
New component rendering a centered card informing users they lack edit permission.
BuilderRemigrationWarningDialog component
src/ui/src/builder/BuilderRemigrationWarningDialog.vue
New component rendering a compact WdsModal warning that changes won't sync automatically, with an isOpen model and dismiss action.
BuilderApp integration of edit gating and remigration dialog
src/ui/src/builder/BuilderApp.vue
Gates the main builder UI, instance/note trackers, and interaction handlers (keyboard, drag/click/dblclick/dragstart/dragend) on canEditAgent; renders BuilderEditBlockedState; reads query params to conditionally show BuilderRemigrationWarningDialog.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BuilderApp
  participant QueryParams
  participant BuilderRemigrationWarningDialog
  participant WdsModal

  BuilderApp->>QueryParams: read showRemigrationWarning param
  BuilderApp->>BuilderApp: check canEditAgent, refresh, cutoff/flag
  BuilderApp->>BuilderRemigrationWarningDialog: set showRemigrationWarningDialog = true
  BuilderRemigrationWarningDialog->>WdsModal: render compact modal
  WdsModal->>BuilderRemigrationWarningDialog: user clicks "I understand"
  BuilderRemigrationWarningDialog->>BuilderApp: isOpen = false
Loading

Possibly related PRs

Suggested reviewers: madeindjs, yavorsky

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: gating ABv1 editing and adding the remigration dialog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-ACTION-5731-remigration-warning-banner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d21ac443-1200-433a-a5f3-8d3a43d5da62

📥 Commits

Reviewing files that changed from the base of the PR and between c8be1f4 and 37ada08.

📒 Files selected for processing (2)
  • src/ui/src/builder/BuilderApp.vue
  • src/ui/src/builder/BuilderEditBlockedState.vue
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/ui/src/builder/BuilderEditBlockedState.vue
  • src/ui/src/builder/BuilderApp.vue

📝 Walkthrough

Walkthrough

Adds a canEditAgent permission flag from backend session headers through core state to the builder UI. The builder gates editing UI and interactions on this flag, adds a blocked-state screen, a compact modal variant, and a remigration warning dialog.

Changes

Edit Permission Gating

Layer / File(s) Summary
Backend canEdit permission field
src/writer/ss_types.py, src/writer/app_runner.py
Adds canEdit optional field to WriterApplicationInformation and computes it from the x-can-edit-agent header or org-admin status during session init.
Core canEditAgent computed and mocks
src/ui/src/core/index.ts, src/ui/src/tests/mocks.ts
Extends writerApplication type with canEdit, adds canEditAgent computed based on Writer Cloud/org-admin/canEdit state, exposes it on core, and updates mocks with matching computed properties.
Compact WdsModal size variant
src/ui/src/wds/WdsModal.vue
Adds a "compact" size option to the size prop with a corresponding CSS class and scoped styles for a narrower layout.
BuilderEditBlockedState component
src/ui/src/builder/BuilderEditBlockedState.vue
New component rendering a centered card informing users they lack edit permission.
BuilderRemigrationWarningDialog component
src/ui/src/builder/BuilderRemigrationWarningDialog.vue
New component rendering a compact WdsModal warning that changes won't sync automatically, with an isOpen model and dismiss action.
BuilderApp integration of edit gating and remigration dialog
src/ui/src/builder/BuilderApp.vue
Gates the main builder UI, instance/note trackers, and interaction handlers on canEditAgent; renders BuilderEditBlockedState; reads query params to conditionally show BuilderRemigrationWarningDialog.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BuilderApp
  participant QueryParams
  participant BuilderRemigrationWarningDialog
  participant WdsModal

  BuilderApp->>QueryParams: read showRemigrationWarning param
  BuilderApp->>BuilderApp: check canEditAgent, refresh, cutoff/flag
  BuilderApp->>BuilderRemigrationWarningDialog: set showRemigrationWarningDialog = true
  BuilderRemigrationWarningDialog->>WdsModal: render compact modal
  WdsModal->>BuilderRemigrationWarningDialog: user clicks "I understand"
  BuilderRemigrationWarningDialog->>BuilderApp: isOpen = false
Loading

Possibly related PRs

Suggested reviewers: yavorsky, as-flow

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the two main changes: editor access gating and the new remigration dialog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-ACTION-5731-remigration-warning-banner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants