Action button stack: berlinBirdIdAvatarSize prop for the Berlin Bird ID avatar

Follow-up of #42 (closed) (v1.2.0). The Berlin Bird ID avatar in bbs-action-button.stack was hard-coded to 32px, so it only matched the other buttons by chance. In GlycoUniverse (glycouniverse-platform-2024 !88) it had to be 40px to match the 48px buttons.

Changes

  • New prop berlinBirdIdAvatarSize (integer px, default 32; values below 1 fall back to 32). It sets the badge size and the img width/height.
  • 32 renders exactly as before: class size-8, width="32" height="32". I checked this by rendering a linked user on main and on this branch; the HTML is byte-identical. The existing unchanged-output fixtures still pass.
  • Any other size drops size-8 and sets style="width: Npx; height: Npx" on the badge. Consumers therefore don't need their Tailwind build to scan for dynamic values. Trade-off: a CSP that doesn't allow inline style attributes blocks the inline style. The README says this.
  • Tests cover the default size and a custom size (40). README and CHANGELOG (1.2.1) are updated.

Usage: <x-bbs-action-button.stack :show-if="true" :berlin-bird-id-avatar-size="40" />

Testing

The full PHPUnit suite passes locally (56 tests). In this container it needs an APP_KEY set; without one, 4 unrelated Datetime/Livewire tests error with MissingAppKeyException. The repo has no CI pipeline config, and there is no Pint or static analysis in its dev dependencies.

Not merged or tagged.

Prepared by BBS Copilot

Merge request reports

Loading
Loading