feat: sunsetting legacy editor#4908
Conversation
Security Review ✅
|
|
@doc-han I am blocking out some time today to go through this 🙏🏻 |
There was a problem hiding this comment.
Hey @doc-han, looking good! The deleted Elixir modules have zero dangling references, so that's great.
But assets/js/editor - the legacy editor directory - isn't touched at all in this PR, because the collaborative editor still depends on two files in it. We should resolve this now:
- Copy
magic-completion.tsandes5.min.dts.jsinto the collaborative editor and repoint the imports.CollaborativeMonaco.tsxandloadDTS.tscurrently import both files fromassets/js/editor - Extract
DEFAULT_TEXTout ofassets/js/editor/Editor.tsx. This is currently used byusePlaceholders.tsimport that one constant. Pull it into a small shared constants file soEditor.tsxhas n remaining importers either. - Once 1 and 2 are done, delete
assets/js/editorentirely, includinglib/es5.dts.jsandlib/es5.min.dts.js - Delete the dead
.job-editor-panelCSS inassets/css/app.cssas the only component using it was already removed - Add a new CHANGELOG.md entry. It belongs in a "Removed" entry and should mention that we are removing the user-facing setting (
prefer_legacy_editor) and retires public URLs (/w/:id/legacy,/w/new/legacy)
By the way, I still haven't done manual testing, but happy to do some after these points are addressed :)
elias-ba
left a comment
There was a problem hiding this comment.
Hey @doc-han, really clean sunset - I went digging for the scary stuff (dangling refs to the deleted modules, whether the collaborative editor and its AI still stand on their own) and it all holds up nicely 🙌 I'm building on @lmac-1's review rather than repeating it, so I've skipped the changelog + the assets/js/editor cleanup since she's got those covered.
A couple of extra things from me:
-
Deep links - left an inline on the redirect controller. Old
?a=<run>bookmarks won't follow the run anymore. More a question than a blocker. -
A test I think we lost by accident - deleting the legacy
trigger_test.exsalso took the only coverage of the passwordless / SSO webhook-secret reveal inWebhookAuthMethodFormComponent, and that component is still alive (mounted incollaborate.exand project settings). The surviving SSO tests are for reauth/profile, not the webhook reveal. Since it's a secret-disclosure path, could we port those 1-2 tests onto the surviving component ? -
A bit more dead code to sweep while we're in here - on top of Lucy's list:
workflow_live/components.exstill hasworkflow_diagram/1(rendersphx-hook="WorkflowDiagram", a hook that isn't registered anymore), pluscreate_job_panel/1andpanel/1with no callers, andui_metrics.exonly logged events the deleted JS used to emit.editorUrlConversion.tsalso has no prod caller now - though if we reuse it for the deep-link thing above, it earns its keep 🙂
Nothing blocking from my side once Lucy's points land. Thanks for taking this one on, it's a big one 💪
| defp redirect_preserving_query(conn, base_path) do | ||
| target = | ||
| case conn.query_string do | ||
| "" -> base_path | ||
| query -> base_path <> "?" <> query | ||
| end | ||
|
|
||
| conn | ||
| |> redirect(to: target) | ||
| |> halt() | ||
| end |
There was a problem hiding this comment.
Hey @doc-han, nice and tidy PR 🙏 One thing I bumped into here: we forward the raw query string, but the old editor and the collaborative one use different param names. So an old bookmarked run link like /w/:id/legacy?a=<run_id>&m=history redirects to /w/:id?a=<run_id>..., and the collaborative editor only reads run= (see collaborate.ex handle_params), so the run isn't followed - the user just lands on a blank editor. Funny thing is we already have this exact mapping in assets/js/utils/editorUrlConversion.ts (a -> run, s -> job/trigger/edge, m -> panel), it's just client-side. Do you think it's worth mapping at least a -> run here so shared run links keep working ? Not a blocker, more a question.
Description
This PR sunsets the legacy editor
Closes #4402
Validation steps
Manual QA — Legacy editor sunset
Redirects
/projects/:id/w/:wid/legacyredirects to the collaborative editor/projects/:id/w/new/legacyredirects to the new-workflow flowLegacy users
Collaborative editor (regression)
AI Assistant
Additional notes for the reviewer
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)