Skip to content

refactor: remove deprecated ManualLayoutV1 and related dependencies#2713

Merged
davydkov merged 4 commits intomainfrom
intelligent-brahmagupta
Mar 7, 2026
Merged

refactor: remove deprecated ManualLayoutV1 and related dependencies#2713
davydkov merged 4 commits intomainfrom
intelligent-brahmagupta

Conversation

@davydkov
Copy link
Copy Markdown
Member

@davydkov davydkov commented Mar 7, 2026

Summary

  • Remove all V1 manual layout references including the ViewManualLayout type, serialization/deserialization logic, and V1-specific layout application
  • Remove the "Migrate Manual Layouts" VSCode command
  • Remove @msgpack/msgpack and @smithy/util-base64 dependencies that were only used for V1 encoding

Test plan

  • Verify pnpm typecheck passes
  • Verify pnpm test passes
  • Confirm VSCode extension loads without the removed migration command

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed deprecated ManualLayoutV1 support, its migration command/workflow, and related processing/serialization across the product
    • Removed the VS Code "Migrate manual layouts" command, its registration, and localization entry
    • Cleaned up tests and removed unused utilities and dependencies
    • Bumped Node runtime pins and base images; updated several dependency versions in workspace catalog

Remove all V1 manual layout references including the ViewManualLayout type,
serialization/deserialization logic, migration command, and V1-specific
layout application. Also removes @msgpack/msgpack and @smithy/util-base64
dependencies that were only used for V1 encoding.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 7, 2026

🦋 Changeset detected

Latest commit: 932fed6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@likec4/core Patch
@likec4/language-server Patch
@likec4/layouts Patch
likec4-vscode Patch
@likec4/playground Patch
@likec4/config Patch
@likec4/diagram Patch
@likec4/generators Patch
@likec4/language-services Patch
likec4 Patch
@likec4/mcp Patch
@likec4/react Patch
@likec4/vite-plugin Patch
@likec4/vscode-preview Patch
@likec4/docs-astro Patch
@likec4/style-preset Patch
@likec4/styles Patch
@likec4/log Patch
@likec4/tsconfig Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 521156e4-be62-426a-bb56-4598baa27962

📥 Commits

Reviewing files that changed from the base of the PR and between 8a5041b and 932fed6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .nvmrc
  • .tool-versions
  • Dockerfile
  • package.json
  • packages/language-server/package.json
  • packages/likec4/package.json
  • pnpm-workspace.yaml
✅ Files skipped from review due to trivial changes (1)
  • .nvmrc
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/language-server/package.json

📝 Walkthrough

Walkthrough

Removes the deprecated ManualLayoutV1 surface: types, parsing, serialization, validation, migration command, runtime application, tests, and associated utilities across core, language-server, layouts, and VSCode packages.

Changes

Cohort / File(s) Summary
Release
\.changeset/remove-manual-layout-v1.md
Added a changeset announcing removal of ManualLayoutV1 and the migration command; patch bumps for multiple packages.
Core types
packages/core/src/types/view-common.ts, packages/core/src/types/view-computed.ts
Removed ViewManualLayout type and deleted manualLayout property from computed view properties; cleaned related imports.
Language Server types & parsing
packages/language-server/src/ast.ts, packages/language-server/src/model/parser/DeploymentViewParser.ts, packages/language-server/src/model/parser/ViewsParser.ts
Removed manualLayout from AST/view interfaces and eliminated parse-time manualLayout computation/imports.
Language Server model-change
packages/language-server/src/model-change/removeManualLayoutV1.ts, packages/language-server/src/model-change/ModelChanges.ts
Deleted removeManualLayoutV1 implementation and removed its invocation from model-change cleanup flows.
Language Server validation & utils
packages/language-server/src/validation/view.ts, packages/language-server/src/view-utils/manual-layout.ts, packages/language-server/src/view-utils/manual-layout.spec.ts
Replaced manual-layout detection with generated-marker regex and updated warning text; removed legacy serialization/deserialization utilities and tests; added applyStylesToManualLayout API for style propagation.
Language Server diagnostics/actions
packages/language-server/src/lsp/CodeActionProvider.ts
Disabled code action generation for manual-layout-related diagnostics (method now returns undefined and action construction removed).
Layouts (Graphviz & manual)
packages/layouts/src/graphviz/GraphvizLayoter.ts, packages/layouts/src/graphviz/GraphvizParser.ts, packages/layouts/src/manual/applyManualLayout.ts
Removed runtime application of manual layouts from Graphviz flow and deleted the entire manual applyManualLayout implementation.
VSCode extension
packages/vscode/package.json, packages/vscode/package.nls.json, packages/vscode/src/commands/index.ts, packages/vscode/src/commands/migrateManualLayouts.ts
Removed likec4.migrate-manual-layouts command, its localization key, registration call, and full migrate-manual-layouts command implementation (UI, orchestration, telemetry).
Packaging & deps
packages/language-server/package.json, package.json, packages/likec4/package.json, .nvmrc, .tool-versions, Dockerfile, pnpm-workspace.yaml
Bumped Node engine to >=22.22.1 (and related tool files); removed @msgpack/msgpack and @smithy/util-base64 from language-server; updated several catalog dependency versions.
Tests
packages/language-server/src/model/__tests__/model-builder.spec.ts
Removed test case that validated parsing of manual layout and migration warning.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(220,220,255,0.5)
    participant VSCode
    participant Extension
    participant LS as LanguageServer
    participant Workspace
  end

  Note over VSCode,Extension: OLD FLOW (before this PR)
  VSCode->>Extension: User triggers migrate-manual-layouts
  Extension->>LS: request computed models / views
  LS->>Workspace: read files / AST / comments
  LS->>Workspace: detect & remove ManualLayoutV1 (workspace edit)
  Workspace-->>LS: edit applied
  LS-->>Extension: results
  Extension-->>VSCode: show completion

  Note over VSCode,Extension: NEW FLOW (after this PR)
  VSCode->>Extension: (command removed) — no trigger
  Extension--xLS: no migration flow
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hopped through branches, nibbling lines of old,

The ManualLayoutV1 story now neatly told.
No migrate command, no comment to chase,
I bounded off—lighter code, faster pace. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers the main changes but lacks the completion of required checklist items, making compliance unclear. Complete the checklist by marking which items apply to this change (tests added, documentation updates, etc.) to clearly indicate what verification steps were taken.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective: removing deprecated ManualLayoutV1 and related dependencies.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch intelligent-brahmagupta

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/language-server/src/view-utils/manual-layout.ts (1)

45-56: Minor: Consolidate edge property updates to avoid intermediate objects.

When both color and line differ, this creates two intermediate objects. Consider combining the checks:

♻️ Proposed consolidation
-    if (latestEdge.color !== e.color) {
-      e = {
-        ...e,
-        color: latestEdge.color,
-      }
-    }
-    if (latestEdge.line !== e.line) {
-      e = {
-        ...e,
-        line: latestEdge.line,
-      }
-    }
+    if (latestEdge.color !== e.color || latestEdge.line !== e.line) {
+      e = {
+        ...e,
+        color: latestEdge.color,
+        line: latestEdge.line,
+      }
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/language-server/src/view-utils/manual-layout.ts` around lines 45 -
56, Consolidate the two separate updates that create intermediate objects by
merging the property checks for latestEdge.color and latestEdge.line into a
single conditional that builds one updated edge object; locate the code where
variable e is compared to latestEdge (variables named e and latestEdge in
manual-layout.ts) and replace the two sequential assignments with one update
that only sets changed properties (color and/or line) on e and assigns the new
object once.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/language-server/src/view-utils/manual-layout.ts`:
- Around line 45-56: Consolidate the two separate updates that create
intermediate objects by merging the property checks for latestEdge.color and
latestEdge.line into a single conditional that builds one updated edge object;
locate the code where variable e is compared to latestEdge (variables named e
and latestEdge in manual-layout.ts) and replace the two sequential assignments
with one update that only sets changed properties (color and/or line) on e and
assigns the new object once.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 76a81531-cd06-4a19-a386-5b3386831dae

📥 Commits

Reviewing files that changed from the base of the PR and between ea36665 and bc47423.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • .changeset/remove-manual-layout-v1.md
  • packages/core/src/types/view-common.ts
  • packages/core/src/types/view-computed.ts
  • packages/language-server/package.json
  • packages/language-server/src/ast.ts
  • packages/language-server/src/lsp/CodeActionProvider.ts
  • packages/language-server/src/model-change/ModelChanges.ts
  • packages/language-server/src/model-change/removeManualLayoutV1.ts
  • packages/language-server/src/model/__tests__/model-builder.spec.ts
  • packages/language-server/src/model/parser/DeploymentViewParser.ts
  • packages/language-server/src/model/parser/ViewsParser.ts
  • packages/language-server/src/validation/view.ts
  • packages/language-server/src/view-utils/manual-layout.spec.ts
  • packages/language-server/src/view-utils/manual-layout.ts
  • packages/layouts/src/graphviz/GraphvizLayoter.ts
  • packages/layouts/src/graphviz/GraphvizParser.ts
  • packages/layouts/src/manual/applyManualLayout.ts
  • packages/vscode/package.json
  • packages/vscode/package.nls.json
  • packages/vscode/src/commands/index.ts
  • packages/vscode/src/commands/migrateManualLayouts.ts
💤 Files with no reviewable changes (17)
  • packages/language-server/src/ast.ts
  • packages/layouts/src/graphviz/GraphvizLayoter.ts
  • packages/vscode/package.nls.json
  • packages/vscode/package.json
  • packages/language-server/src/model/parser/DeploymentViewParser.ts
  • packages/language-server/src/model/tests/model-builder.spec.ts
  • packages/language-server/package.json
  • packages/language-server/src/model/parser/ViewsParser.ts
  • packages/vscode/src/commands/index.ts
  • packages/language-server/src/model-change/ModelChanges.ts
  • packages/vscode/src/commands/migrateManualLayouts.ts
  • packages/language-server/src/view-utils/manual-layout.spec.ts
  • packages/layouts/src/manual/applyManualLayout.ts
  • packages/core/src/types/view-common.ts
  • packages/language-server/src/model-change/removeManualLayoutV1.ts
  • packages/core/src/types/view-computed.ts
  • packages/layouts/src/graphviz/GraphvizParser.ts

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/language-server/src/validation/view.ts (1)

7-31: ⚠️ Potential issue | 🟠 Major

Keep a diagnostic for legacy manual-layout blocks.

After this change, V1 manual-layout comments stop being applied and stop producing any validation message here, so existing workspaces can lose layout behavior with no clue why. Even if migration support is intentionally gone, this validator should still surface an error or warning like “ManualLayoutV1 is no longer supported; remove this block” when legacy comment blocks are present.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6ab4922-59c4-4926-acbc-8bbc4f7f73e3

📥 Commits

Reviewing files that changed from the base of the PR and between bc47423 and 4196ad3.

📒 Files selected for processing (1)
  • packages/language-server/src/validation/view.ts

- Add warning diagnostic for legacy @likec4-generated blocks so users
  know V1 is no longer supported and should remove the block
- Consolidate edge property updates to avoid intermediate objects

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/language-server/src/view-utils/manual-layout.ts (1)

11-63: ⚠️ Potential issue | 🟠 Major

Wire applyStylesToManualLayout into the active manual-layout flow and complete edge style synchronization.

This helper is currently unused. The layout pipeline in LikeC4Views.ts calls applyManualLayout(layouted, snapshot) for layoutType === 'manual', bypassing these style updates entirely.

Additionally, edge style synchronization is incomplete. ComputedEdge includes head and tail fields, but the edge sync logic only copies color and line, missing arrow style drifts.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/language-server/src/view-utils/manual-layout.ts` around lines 11 -
63, The manual-layout style updates are never applied and edge arrows aren't
synced: wire applyStylesToManualLayout into the manual layout pipeline by
replacing the current call that uses applyManualLayout(...) when layoutType ===
'manual' (in LikeC4Views.ts) so the returned layouted view passes through
applyStylesToManualLayout(manualLayouted, snapshot/latest) before returning; and
update applyStylesToManualLayout's edge-sync logic to copy latestEdge.head and
latestEdge.tail (in addition to color and line) into the edge object so
ComputedEdge arrow styles are preserved (copy head/tail when they differ,
similar to how color/line are handled).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/language-server/src/view-utils/manual-layout.ts`:
- Around line 45-50: The merge only updates color and line on variable e when
latestEdge differs, but ComputedEdge also carries head and tail styling so
arrowheads can drift; update the merge in manual-layout logic (where latestEdge
and e are compared) to also copy latestEdge.head and latestEdge.tail into e (or
include head/tail in the equality check and assign) so head and tail styling are
synced along with color and line.

---

Outside diff comments:
In `@packages/language-server/src/view-utils/manual-layout.ts`:
- Around line 11-63: The manual-layout style updates are never applied and edge
arrows aren't synced: wire applyStylesToManualLayout into the manual layout
pipeline by replacing the current call that uses applyManualLayout(...) when
layoutType === 'manual' (in LikeC4Views.ts) so the returned layouted view passes
through applyStylesToManualLayout(manualLayouted, snapshot/latest) before
returning; and update applyStylesToManualLayout's edge-sync logic to copy
latestEdge.head and latestEdge.tail (in addition to color and line) into the
edge object so ComputedEdge arrow styles are preserved (copy head/tail when they
differ, similar to how color/line are handled).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a91275ed-2da5-4359-8997-cf3464dc1d31

📥 Commits

Reviewing files that changed from the base of the PR and between 4196ad3 and 8a5041b.

📒 Files selected for processing (2)
  • packages/language-server/src/validation/view.ts
  • packages/language-server/src/view-utils/manual-layout.ts

Comment on lines +45 to 50
if (latestEdge.color !== e.color || latestEdge.line !== e.line) {
e = {
...e,
color: latestEdge.color,
}
}
if (latestEdge.line !== e.line) {
e = {
...e,
line: latestEdge.line,
}
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Sync head and tail edge styling too.

ComputedEdge styling also includes head and tail, so arrow changes in the latest layout will still drift after this merge.

Proposed fix
-    if (latestEdge.color !== e.color || latestEdge.line !== e.line) {
+    if (
+      latestEdge.color !== e.color ||
+      latestEdge.line !== e.line ||
+      latestEdge.head !== e.head ||
+      latestEdge.tail !== e.tail
+    ) {
       e = {
         ...e,
         color: latestEdge.color,
         line: latestEdge.line,
+        head: latestEdge.head,
+        tail: latestEdge.tail,
       }
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (latestEdge.color !== e.color || latestEdge.line !== e.line) {
e = {
...e,
color: latestEdge.color,
}
}
if (latestEdge.line !== e.line) {
e = {
...e,
line: latestEdge.line,
}
if (
latestEdge.color !== e.color ||
latestEdge.line !== e.line ||
latestEdge.head !== e.head ||
latestEdge.tail !== e.tail
) {
e = {
...e,
color: latestEdge.color,
line: latestEdge.line,
head: latestEdge.head,
tail: latestEdge.tail,
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/language-server/src/view-utils/manual-layout.ts` around lines 45 -
50, The merge only updates color and line on variable e when latestEdge differs,
but ComputedEdge also carries head and tail styling so arrowheads can drift;
update the merge in manual-layout logic (where latestEdge and e are compared) to
also copy latestEdge.head and latestEdge.tail into e (or include head/tail in
the equality check and assign) so head and tail styling are synced along with
color and line.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address in another PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davydkov, understood! Would you like me to open a follow-up GitHub issue to track syncing head and tail edge styling in applyStylesToManualLayout?


🧠 Learnings used
Learnt from: CR
Repo: likec4/likec4 PR: 0
File: packages/core/AGENTS.md:0-0
Timestamp: 2026-02-11T10:07:53.330Z
Learning: Applies to packages/core/src/manual-layout/**/*.{ts,tsx,js,jsx} : When changes relate to views (types or models), update View-drifts detection/auto-applying in `src/manual-layout` accordingly. If unsure what leads to layout drifts or can be auto-applied, ask for confirmation.

@davydkov davydkov merged commit 86b577b into main Mar 7, 2026
15 checks passed
@davydkov davydkov deleted the intelligent-brahmagupta branch March 7, 2026 16:36
@likec4-ci likec4-ci bot mentioned this pull request Mar 7, 2026
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.

1 participant