Skip to content

fix: strip newlines from implicit view titles#2683

Merged
davydkov merged 3 commits into
mainfrom
fix-title-newlines
Mar 4, 2026
Merged

fix: strip newlines from implicit view titles#2683
davydkov merged 3 commits into
mainfrom
fix-title-newlines

Conversation

@davydkov

@davydkov davydkov commented Mar 4, 2026

Copy link
Copy Markdown
Member

Summary

Fixes "View title cannot contain newlines" error when using implicit views with elements that have multi-line titles.

When implicitViews generates titles from element titles (e.g., Auto / ${element.title}), any newlines in the element title would cause validation to fail. Now newlines are replaced with spaces to ensure valid view titles.

Fixes

Test Plan

Summary by CodeRabbit

  • Bug Fixes

    • Fixed runtime error in implicit views when element titles contain newlines. Newline characters are now automatically replaced with spaces.
  • Chores

    • Added changeset generator documentation for internal release processes.

davydkov and others added 3 commits March 4, 2026 11:30
When implicit views derive titles from element titles, newlines in the element
title caused validation to fail with "View title cannot contain newlines". Now
newlines are replaced with spaces to ensure valid view titles.

Fixes #2669, #2672

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Mar 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6ffb6ca

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/playground Patch
@likec4/language-services Patch
likec4 Patch
@likec4/mcp Patch
@likec4/vite-plugin Patch
likec4-vscode Patch
@likec4/docs-astro Patch
@likec4/style-preset Patch
@likec4/styles Patch
@likec4/config 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

@davydkov davydkov enabled auto-merge March 4, 2026 10:37
@davydkov davydkov disabled auto-merge March 4, 2026 10:37
@davydkov davydkov merged commit 026ef4a into main Mar 4, 2026
14 of 15 checks passed
@davydkov davydkov deleted the fix-title-newlines branch March 4, 2026 10:37
@coderabbitai

coderabbitai Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR fixes a runtime error in implicit view generation where multi-line element titles cause view title validation failures. The fix sanitizes newline characters to spaces in auto-generated implicit view titles, and includes a test case to verify the behavior.

Changes

Cohort / File(s) Summary
Changeset & Documentation
.changeset/fix-implicit-view-title-newlines.md, .claude/agents/changeset-generator.agent.md, .github/agents/changeset-generator.agent.md
New changeset documenting the patch release and new agent workflow documentation for generating changesets from Git changes, defining a four-step process for identifying, mapping, summarizing, and creating changeset files.
Implicit View Title Sanitization
packages/language-server/src/model/builder/buildModel.ts, packages/language-server/src/model/__tests__/model-builder-view-folders.spec.ts
Core fix replaces newline characters with spaces when constructing implicit view titles. New test case verifies that implicit views strip newlines from element titles, asserting generated titles normalize multi-line text correctly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #2648: Introduced the implicit scoped view auto-generation feature that this PR fixes by sanitizing view titles when elements have multi-line text.

Poem

🐰 Newlines begone, a simple fix so fine,
Auto-views now strip those breaks in line,
Multi-line titles rest in peace,
Implicit views work without cease! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers the summary, fixes linked issues, and test plan but does not follow the provided template structure with checklist items. Consider completing the template checklist to document verification of contribution guidelines, rebasing, conventional commits, test coverage, and documentation updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: fixing implicit view title generation by stripping newlines from element titles.
Linked Issues check ✅ Passed The code changes directly address the root cause identified in issues #2669 and #2672 by sanitizing newlines in implicit view titles during generation.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the issue: a changeset entry, an agent documentation file, test coverage, and the core fix to strip newlines from implicit view titles.
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 fix-title-newlines

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.

@likec4-ci likec4-ci Bot mentioned this pull request Mar 4, 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.

"View title cannot contain newlines" with implicitViews (v1.50) on large projects View title cannot contain newlines

1 participant