Skip to content

Disable implicit views by default#2705

Merged
davydkov merged 2 commits intomainfrom
disable-implicit-views
Mar 6, 2026
Merged

Disable implicit views by default#2705
davydkov merged 2 commits intomainfrom
disable-implicit-views

Conversation

@davydkov
Copy link
Copy Markdown
Member

@davydkov davydkov commented Mar 6, 2026

Summary

Auto-generated scoped views for elements without explicit views are now disabled by default. This feature is now opt-in and must be explicitly enabled by setting "implicitViews": true in the project configuration. Users can restore the previous behavior by adding this setting to their likec4.json.

Checklist

  • I've rebased my branch onto main before creating this PR.
  • My commit messages follow conventional spec
  • I've added tests to cover my changes (updated existing tests)
  • My change requires documentation updates.
  • I've updated the documentation accordingly.

Summary by CodeRabbit

  • Features
    • Implicit scoped views are disabled by default. To restore prior behavior, set implicitViews: true in your project config.
  • Documentation
    • Docs and examples updated to show the feature is disabled by default and how to enable it.
  • Schema
    • Configuration schema description updated to indicate the new default.
  • Tests
    • Tests adjusted to expect only explicit views by default.

Auto-generated scoped views for elements without explicit views are no longer created by default. This feature is now opt-in and must be explicitly enabled by setting "implicitViews": true in the project configuration. Users can restore the previous behavior by adding this setting to their likec4.json.

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

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: b5bd3fe

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

This PR includes changesets to release 19 packages
Name Type
@likec4/language-server Patch
@likec4/config Patch
likec4 Patch
@likec4/playground Patch
@likec4/language-services Patch
@likec4/mcp Patch
@likec4/vite-plugin Patch
likec4-vscode Patch
@likec4/docs-astro Patch
@likec4/style-preset Patch
@likec4/styles Patch
@likec4/core Patch
@likec4/diagram Patch
@likec4/generators Patch
@likec4/layouts Patch
@likec4/log Patch
@likec4/react Patch
@likec4/tsconfig Patch
@likec4/vscode-preview 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 6, 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: 180fb838-24e4-4281-a057-3a502b81114e

📥 Commits

Reviewing files that changed from the base of the PR and between 62250b0 and b5bd3fe.

📒 Files selected for processing (1)
  • packages/likec4/src/drawio-tutorial-export-import.spec.ts

📝 Walkthrough

Walkthrough

Implicit (auto-generated) scoped views are disabled by default; projects must set "implicitViews": true in likec4.json to enable automatic generation. Changes include a changeset, docs updates, schema description update, model-builder conditional change, and adjusted tests.

Changes

Cohort / File(s) Summary
Changeset & Docs
\.changeset/disable-implicit-views-by-default.md, apps/docs/src/content/docs/dsl/Config/index.mdx
Adds a changeset announcing the default change and updates documentation to state implicit views are disabled by default with an example using implicitViews: true.
Config Schema & Metadata
packages/config/src/schema.ts, schemas/likec4-config.schema.json
Updates the implicitViews description to indicate the default is false (metadata only). No type/signature changes.
Model Builder Logic
packages/language-server/src/model/builder/buildModel.ts
Alters the condition to add implicit scoped views from "if implicitViews is not false" to "if implicitViews is true", requiring explicit opt-in.
Tests & Specs
packages/language-server/src/model/__tests__/model-builder.spec.ts, packages/likec4/src/drawio-tutorial-export-import.spec.ts
Adjusts test expectations for view and diagram counts to reflect implicit views being disabled by default.
Manifest
package.json
Minor manifest change referenced by the diff (single-line edit).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through configs, soft and spry,

Where views once bloomed by default on high.
Now a gentle flag must speak true,
"implicitViews: true" — the gate for view.
A tiny hop, a clearer sky. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Disable implicit views by default' accurately summarizes the main change across all modified files: disabling auto-generated implicit views and requiring explicit opt-in configuration.
Description check ✅ Passed The PR description covers the summary of changes and includes most checklist items, but is missing two required checklist items: contribution guidelines review and screen size testing verification.
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 docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch disable-implicit-views

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.

Update expected view counts in drawio-tutorial-export-import.spec.ts
from 5 to 2, reflecting that implicit views are now disabled by default.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@davydkov davydkov merged commit 4d579d6 into main Mar 6, 2026
16 checks passed
@davydkov davydkov deleted the disable-implicit-views branch March 6, 2026 19:34
@likec4-ci likec4-ci bot mentioned this pull request Mar 6, 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