Add design system analysis: strengths and weaknesses#12
Open
Add design system analysis: strengths and weaknesses#12
Conversation
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
Runs PHPUnit tests across PHP 8.1-8.4 on push and PR. 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Comprehensive review covering architecture, code quality, testing,
accessibility, documentation, and WordPress integration.
https://claude.ai/code/session_012ewao5pvLz72m45tCVwbpU