Skip to content

Add design system analysis: strengths and weaknesses#12

Open
truchot wants to merge 14 commits intomainfrom
claude/analyze-design-system-T7h8q
Open

Add design system analysis: strengths and weaknesses#12
truchot wants to merge 14 commits intomainfrom
claude/analyze-design-system-T7h8q

Conversation

@truchot
Copy link
Copy Markdown
Contributor

@truchot truchot commented Mar 15, 2026

Comprehensive review covering architecture, code quality, testing,
accessibility, documentation, and WordPress integration.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU

claude added 14 commits March 14, 2026 17:03
Comprehensive review covering architecture, code quality, testing,
accessibility, documentation, and WordPress integration.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
7-phase plan covering: bug fixes, WordPress decoupling, void elements,
accessibility, testing, new components, and tooling.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
- FakeButtonDecorator: fix undefined properties ($ringConfig, $borderConfig,
  $textColorConfig), fix $className/$classNames typo, use correct decorator
  methods (setColor + getClassName)
- FakeButtonComponent: replace hardcoded 'Hello World' with proper div[role=button]
- FakeButtonBlockDataMapper: fix wrong namespace and parent class
- FigCaptionComponent: fix type conflict (private string vs parent array),
  use setCaption() instead of shadowing getChildren()
- FigureComponent: fix private -> protected tagName for proper inheritance
- Rename CoumpoundDecorator.php -> CompoundDecorator.php

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
- Replace wp_generate_uuid4() with PHP native random_bytes() in SliderComponent
- Rename wp-block-slider__* CSS classes to ds-slider__* (framework-agnostic)
- Move all BlockDataMappers from Component/ to BlockEditor/ layer:
  HeadingBlockDataMapper, ParagraphBlockDataMapper, ImageCompoundBlockDataMapper,
  ListBlockDataMapper, ListItemBlockDataMapper, FakeButtonBlockDataMapper
- Fix typo: ListIemBlockDataMapper -> ListItemBlockDataMapper
- Update namespaces to match new locations

Components are now fully framework-agnostic. All WordPress integration
stays in the BlockEditor/ layer.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
- Add selfClosing property to TokenComponent for void elements (img, input, etc.)
- ImageComponent now uses selfClosing=true and delegates to parent getMarkup()
- Fix children join separator from ' ' to '' (no spurious spaces)
- Trim trailing space on self-closing tag attributes

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
- ButtonComponent: add aria-disabled=true when disabled
- ImageComponent: throw if setAlt() was never called (from Phase 3)
- LinkComponent: throw if href is empty at render time

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
- Setup PHPUnit 10 with composer, phpunit.xml, and test directory structure
- TokenComponent: 14 tests (classes, attributes, children, markup, XSS, decorators, self-closing)
- ButtonComponent: 7 tests (tag, type, disable/enable, aria-disabled)
- HeadingComponent: 7 tests (default level, valid/invalid levels, content)
- ImageComponent: 6 tests (self-closing, attributes, alt required, decorative alt)
- ImageCompoundComponent: 6 tests (composition, link wrapping, caption)
- LinkComponent: 8 tests (tag, href required, target, rel, children)
- FigCaptionComponent: 3 tests (tag, setCaption replaces, fluent)
- ListComponent: 4 tests (ul/ol, ordered, start attribute)
- SliderSettings: 8 tests (defaults, enable/disable, pagination, controls, toArray)

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
Pipeline:
- render-components.php renders each component as standalone HTML
- capture.mjs (Puppeteer) screenshots each HTML to PNG
- generate.sh orchestrates the full pipeline
- CI job runs on push, commits updated PNGs if they changed

README files created/updated for: Button, Heading, Paragraph, Link,
Image, ImageCompound, Figure, FigCaption, List.

Each README includes a screenshot showing all variants.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
PHPUnit 10 exits with code 1 when --coverage-text is used without
a coverage driver (xdebug). Split the matrix so PHP 8.1-8.3 run
tests without coverage, and PHP 8.4 runs with xdebug + coverage.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
Bugs fixed:
- SliderComponent: used enable() (returns self) instead of isEnable()
  (returns bool) in boolean context — controls/pagination were always
  rendered regardless of settings
- ParagraphDecorator, HeadingDecorator: wrong namespace imports for
  Foundation typography decorators (Foundation\Decorator\ → Foundation\Typography\Decorator\)
- ListDecorator: wrong namespace import for AlignDecorator
  (Foundation\Decorator\ → Foundation\Grid\Decorator\)
- SliderControls: missing use statement for SvgFactory, made
  SvgFactory parameter optional to avoid crash when no SVGs configured

API consistency:
- ButtonComponent: setType/disable/enable now return static (was void)
- ListComponent: ordered/setStart now return static (was void)

Tests added (30 new):
- SliderComponentTest (8): validates controls/pagination only render
  when isEnable() is true — catches the critical bug
- SlideComponentTest (2), SliderContainerTest (3), SliderControlsTest (4)
- ParagraphComponentTest (3), ParagraphDecoratorTest (1)
- HeadingDecoratorTest (1), ListDecoratorTest (1)
- FakeButtonComponentTest (3), SvgFactoryTest (3)
- ButtonComponentTest: added fluent interface test

CI: improved screenshots job with deterministic Chrome path

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
The CI was not running on feature branches — only main, develop, and
release/** were configured as push triggers.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
Revert screenshots job to match original working structure while keeping
the claude/** branch trigger.

https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU
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.

2 participants