Skip to content

Add shared field includes and recently-used blocks palette - #70

Open
helmutkaufmann wants to merge 2 commits into
wintercms:mainfrom
helmutkaufmann:feat/shared-includes
Open

Add shared field includes and recently-used blocks palette#70
helmutkaufmann wants to merge 2 commits into
wintercms:mainfrom
helmutkaufmann:feat/shared-includes

Conversation

@helmutkaufmann

Copy link
Copy Markdown
Contributor

Split out of #68 (closed in favor of smaller, focused PRs).

Summary

  • .block definitions may declare a top-level include: (string or list) to merge fields and config from external plain-YAML files, resolved via File::symbolizePath() ($/, ~/, #/).
  • Included definitions form the base; the block's own definitions override on collision. Multiple includes merge in order, with later includes overriding earlier ones.
  • Nested includes are supported, with a circular-reference guard.
  • Recently-used blocks are pinned to the top of the "Add Block" palette (tracked per-browser in localStorage).

See the README sections "Including shared field definitions" and "Recently used blocks" for usage.

Test plan

  • New tests in tests/classes/BlockManagerTest.php covering merge precedence (including multi-include override order), nested includes, circular-include guarding, and missing-file handling
  • Full plugin test suite passes (php artisan winter:test -p Winter.Blocks)

Block definitions may declare a top-level include: (string or list)
merging fields/config from external YAML files, with base-with-
override precedence, nested include resolution, and cycle detection.
Also bundles the small, related recently-used-blocks palette feature.
resolveIncludes() previously used the running $config[$key] (already
containing earlier includes' merged result) as a tie-breaker alongside
the block's own values, which made the first include always win on a
key collision instead of the last one as documented. Includes are now
merged into a separate accumulator before the block's own values are
applied once at the end.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@helmutkaufmann, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10bca2ca-acda-41d0-9957-1a13754e97c0

📥 Commits

Reviewing files that changed from the base of the PR and between 394377b and a6906b9.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • README.md
  • classes/BlockManager.php
  • formwidgets/blocks/partials/_block.php
  • tests/classes/BlockManagerTest.php
  • tests/fixtures/blocks/includes/_base.yaml
  • tests/fixtures/blocks/includes/_cycle_a.yaml
  • tests/fixtures/blocks/includes/_cycle_b.yaml
  • tests/fixtures/blocks/includes/_order_a.yaml
  • tests/fixtures/blocks/includes/_order_b.yaml
  • tests/fixtures/blocks/includes/_shared.yaml
  • tests/fixtures/blocks/includes/_with_nested.yaml
  • updates/version.yaml

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.

1 participant