diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..b33124b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,41 @@ +# Repository Guidelines + +## Project Structure & Module Organization +- Theme lives at `site/web/app/themes/nynaeve/`. +- `app/`: PHP (Blocks, Providers, View Composers); `config/`: Sage/Acorn config. +- `resources/`: Tailwind (`css/`), JS (`js/`), Blade views (`views/`), native blocks (`js/blocks/`); block styles live with each block. +- Built assets in `public/build/` (Vite); static assets in `resources/images/`. +- Utilities in `scripts/`; theme docs in `docs/`; `archive/` is deprecated/read-only. + +## Build, Test, and Development Commands +- Install deps: `cd site && composer install`; then `cd site/web/app/themes/nynaeve && composer install && npm install`. +- Dev server (Vite + HMR): `npm run dev`; open `http://imagewize.test/` (HTTPS breaks HMR WebSockets). +- Production build: `npm run build`. +- Quality: `cd site && composer test` (phpcs); `composer pint` or `npm run pint` for formatting. +- Visual/E2E: `npm run pw`. + +## Coding Style & Block Standards +- PHP: PSR-4 under `App\\`, prefer strict types; format with Pint. +- JS/React: ES modules, functional components; block dirs kebab-case (`cta-block-blue`), components PascalCase. +- Blocks: InnerBlocks-first; use real content (no placeholders); no horizontal padding (theme handles spacing); keep styling on containers, not core child blocks. +- `block.json`: namespace/category/textdomain `imagewize`; default align `wide`; button styles via `core/buttons` container class (not individual buttons). +- Blade views in `resources/views`; reuse via `partials/` and `sections/`. CSS is Tailwind-first, custom in `resources/css` or block `style.css`. + +## Block Development Workflow (Trellis VM) +- DB lives in Trellis VM (local MySQL on 3306 conflicts). Run `trellis vm shell --workdir /srv/www/imagewize.com/current` and use `--path=web/wp`. +- Create native block: `wp acorn sage-native-block:create`; ACF block: `wp acorn acf:block MyBlock`. +- Blocks auto-register via ThemeServiceProvider; store under `resources/js/blocks/{block-name}/` with container-only CSS. + +## Testing Guidelines +- Before commits: `composer test`, `composer pint`/`npm run pint`. +- For block/JS edits: `npm run build` once to confirm clean Vite output; use real content to catch layout issues. +- Playwright: `npm run pw` or scoped (e.g., `npm run pw:mobile`). + +## Commit & Pull Request Guidelines +- Commits: short Title-Case (e.g., `Nynaeve Documentation Update`); scope narrowly. +- PRs: include purpose, affected theme paths, manual test commands, linked issues/trellis tickets; add screenshots/GIFs for UI/block changes. + +## Security & Configuration Tips +- Never commit `.env`, vault files, or generated credentials; use `.env.example`. +- Work from Trellis VM for any `wp`/`wp acorn` tasks (DB lives there; host MySQL on 3306 conflicts). Theme path in VM: `/srv/www/imagewize.com/current/web/app/themes/nynaeve`; demo: `/srv/www/demo.imagewize.com/current`. +- Flush caches with `wp cache flush` if changes look stale; prefer repo Playwright script for screenshots. diff --git a/CHANGELOG.md b/CHANGELOG.md index 7198ff2..14654eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to the Nynaeve theme will be documented in this file. For project-wide changes (infrastructure, tooling, cross-cutting concerns), see the [project root CHANGELOG.md](../../../../../CHANGELOG.md). +## [2.0.22] - 2025-12-06 + +### Added +- **Product Detail Field Groups**: New ACF fields for Features, What’s Included, and Pricing Details registered in [app/setup.php](app/setup.php#L203) and rendered as accordion sections on single product pages. +- **Automation Guidance**: Added theme-specific agent docs ([AGENTS.md](AGENTS.md), [CLAUDE.md](CLAUDE.md)) covering structure, commands, block standards, and Trellis VM workflows. + +### Changed +- **Single Product Layout Refresh**: Rebuilt WooCommerce single product template ([content-single-product.php](resources/views/woocommerce/content-single-product.php)) with a simplified hero (title/price/category), streamlined image rendering, short description, and ACF-driven accordion for detailed product info. +- **Product Typography Override**: Enforced dark text color for headings and paragraphs within product content areas in [resources/css/app.css](resources/css/app.css#L768) to keep product pages readable when block color classes are applied. + ## [2.0.21] - 2025-12-03 ### Changed @@ -1145,4 +1155,4 @@ For project-wide changes (infrastructure, tooling, cross-cutting concerns), see ### Fixed - Fixed related-articles block ignoring parent container constraints when resizing browser window - Related articles now properly adapt column count based on available container width rather than viewport width -- Improved tag-based article matching to avoid overly generic results \ No newline at end of file +- Improved tag-based article matching to avoid overly generic results diff --git a/CLAUDE.md b/CLAUDE.md index b369459..16a6558 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -487,6 +487,43 @@ We use **WordPress-native layout approach** with minimal custom CSS. - Adds "Request Quote" buttons on single product pages - Custom REST API endpoint to intercept checkout requests +**Creating Product Content (CRITICAL):** + +When creating or editing WooCommerce product content using Gutenberg blocks: + +❌ **DO NOT** add color classes to text, headings, or paragraphs: +- ❌ `textColor: "primary-accent"` in block attributes +- ❌ `has-primary-accent-color` classes +- ❌ `has-primary-color` classes +- ❌ `has-base-color` or `has-base-accent-color` +- ❌ `has-contrast-color` or `has-text-color` + +✅ **DO** let CSS control all colors automatically: +- ✅ Use only typography attributes (fontFamily, fontSize, fontWeight) +- ✅ Use spacing and layout attributes +- ✅ Headings automatically use contrast color (dark) +- ✅ Paragraphs automatically use main-accent color (readable gray) +- ✅ Cover blocks with dark backgrounds automatically use white text + +**Why:** +- Product page CSS (`app.css`) controls all colors for consistency +- Hardcoded color classes override CSS and break the design system +- Users cannot change colors in the editor when hardcoded +- Color accessibility is managed centrally via CSS variables + +**Example - Clean block markup:** +```html + +
'.strip_tags($categories).'
'; } ?> - -