Skip to content

refactor: match Bootstrap5 and Bootstrap6 contexts against upstream component, field, variant and state enums; show enums in README.md. - #8

Merged
terabytesoftw merged 1 commit into
mainfrom
refactor/match-bootstrap5-and-bootstrap6-context
Nov 12, 2026
Merged

terabytesoftw merged 1 commit into
mainfrom
refactor/match-bootstrap5-and-bootstrap6-context

Conversation

@terabytesoftw

Copy link
Copy Markdown
Contributor

Pull Request

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bugfix (non-breaking change that fixes an issue)
  • CI/build configuration
  • Dependency update
  • Documentation update
  • New feature (non-breaking change that adds functionality)
  • Performance improvement
  • Refactoring (no functional changes)
  • Tests

Change

Explain the problem and the resulting behavior. Include a before/after example when useful.

Validation

List the checks performed and their results. Explain any relevant checks not run.

Compatibility

Describe any behavior, configuration, dependency, or migration impact. Write "None" when there is no compatibility
impact.

Related issues

Link relevant issues. Use closing keywords only when this PR fully resolves them.

…am component, field, variant and state enums; show enums in `README.md`.
@terabytesoftw terabytesoftw added the bug Something isn't working label Nov 12, 2026
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Component contexts now accept enum values for component names, variants, and states. Existing string-based contexts continue to work, with recipe selection unchanged across Bootstrap 5 and Bootstrap 6.
  • Documentation
    • Quick start examples now demonstrate enum-based contexts and note that plain strings remain supported. Updated examples cover alerts, navigation, dropdowns, and theme selection. Removed rendered HTML output examples.

Bootstrap 5 and Bootstrap 6 now use enum values for component names, states, and variants in recipe dispatch. New parameterized tests compare enum-built contexts with string-built contexts. The README examples and changelog describe the enum usage.

Changes: Enum-backed theme contexts

Layer / File(s) Summary
Theme dispatch and supporting updates
src/Bootstrap5.php, src/Bootstrap6.php, composer.json, ecs.php
Both themes use enum values for existing component and variant dispatch. The ui-awesome/form-model constraint and ECS skip list are updated.
Context parity tests
tests/EnumContextTest.php, tests/Provider/EnumContextProvider.php
Parameterized tests compare recipe names and rendered markup for enum-built and string-built contexts across Bootstrap 5 and Bootstrap 6.
Quick start examples and changelog
README.md, CHANGELOG.md
The README uses enum values in context examples and removes rendered HTML examples. The changelog records the refactor.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related PRs

  • ui-awesome/html-theme#7: Adds toggle recipes and variants that the enum-backed toggle dispatch in this PR also handles.
Merge Risk: Minimal · up to 273e2

This refactor swaps string literals for enum values in the Bootstrap 5 and 6 theme dispatch, and updates the README and changelog. Rendering behavior is intended to stay the same, and no concrete risk was identified.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description is the unfilled PR template. It has checkboxes, including a Bugfix mark, and placeholder section text. It does not describe the changes, validation, or compatibility. The check is leni… Replace the template placeholder text in the Change, Validation, Compatibility, and Related issues sections. Describe the enum-based matching in Bootstrap5 and Bootstrap6, the README enum examples, and the test coverage. Also state whether …
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: Bootstrap5 and Bootstrap6 context matching moves to upstream component, field, variant and state enums, plus README enum docs. The raw summary confirms the src changes…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Bootstrap5 and Bootstrap6 context matching moves to upstream component, field, variant and state enums, plus README enum docs. The raw summary confirms the src changes, the new enum-based tests, and the README updates. The title is long (141 characters), but it stays on topic.

Full details: Description check

Explanation

The description is the unfilled PR template. It has checkboxes, including a Bugfix mark, and placeholder section text. It does not describe the changes, validation, or compatibility. The check is lenient, and the template text relates to the PR type, so it is at most vague. The description is not off-topic.

Resolution

Replace the template placeholder text in the Change, Validation, Compatibility, and Related issues sections. Describe the enum-based matching in Bootstrap5 and Bootstrap6, the README enum examples, and the test coverage. Also state whether the change is a bugfix or a refactor, because the checklist marks Bugfix while the title says refactor.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

I’m a rabbit with enums to greet,
Component names hop into place.
States and variants follow their names,
Two themes resolve contexts the same.
I nibble the docs, then bound away!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5c6dae98-6c4c-4d8e-97ac-bf43e3268907
Commits

Reviewing files that changed from the base of the PR and between f4b36c9 and 273e232.

Files selected for processing: 8

  • CHANGELOG.md
  • README.md
  • composer.json
  • ecs.php
  • src/Bootstrap5.php
  • src/Bootstrap6.php
  • tests/EnumContextTest.php
  • tests/Provider/EnumContextProvider.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

OpenGrep (1.33.0)

ecs.php

[ERROR] 8-8: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

PHPMD (3.0.0)

tests/Provider/EnumContextProvider.php

[error] 23-148: The class EnumContextProvider has a coupling between objects value of 15. Consider to reduce the number of dependencies to 13 or less. (Design Rules)

(CouplingBetweenObjects)

[warning] 46-147: The method contexts() has 102 lines of code. Current threshold is set to 100. Avoid really long methods. (Code Size Rules)

(ExcessiveMethodLength)

tests/EnumContextTest.php

[error] 41-48: Avoid using static access to class '\Testo\Assert' in method 'enumContextResolvesLikeStringContext'. (Clean Code Rules)

(StaticAccess)

[error] 49-56: Avoid using static access to class '\Testo\Assert' in method 'enumContextResolvesLikeStringContext'. (Clean Code Rules)

(StaticAccess)

[error] 57-61: Avoid using static access to class '\Testo\Assert' in method 'enumContextResolvesLikeStringContext'. (Clean Code Rules)

(StaticAccess)

src/Bootstrap6.php

[error] 32-583: The class Bootstrap6 has a coupling between objects value of 14. Consider to reduce the number of dependencies to 13 or less. (Design Rules)

(CouplingBetweenObjects)

src/Bootstrap5.php

[error] 32-591: The class Bootstrap5 has a coupling between objects value of 15. Consider to reduce the number of dependencies to 13 or less. (Design Rules)

(CouplingBetweenObjects)

@terabytesoftw
terabytesoftw merged commit 9d37250 into main Nov 12, 2026
39 checks passed
@terabytesoftw
terabytesoftw deleted the refactor/match-bootstrap5-and-bootstrap6-context branch November 12, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant