tage 1A — Description-only product edit implemented #3

Merged
mtkell merged 1 commits from feat/description-only-edit into main 2026-04-11 15:09:35 +00:00
Owner

PR Summary — feat/description-only-edit (Stage 1A)

Objective

Allow updating product description only, extending the publishing workflow with the next single-field edit capability per the master development brief (Stage 1 → Stage 1A).

Inspection findings

Inspected the existing price-only and name-only edit implementations on main. The established narrow pattern is consistent across all layers:

  • Domain: one new method on ProductPublishingRepository
  • Application: one use case class + one ActionResult class + one controller method with per-row updating/dedup/feedback
  • Data: parallel fake and WP repo implementations; WP repo keeps WooCommerce payload logic internal
  • Presentation: inline edit widget in ProductPreviewPanel (edit/save/cancel), wired through ProductPublishingPage with snack bar feedback

Baseline on main: 195 feature_wordpress tests, 10 kell_web dashboard tests, dart analyze clean. Three narrow edit capabilities landed (status, price, name).

Implementation

Mirrored the name-only edit pattern exactly for description:

Layer Change
Domain Added updateProductDescription(String id, String description) to ProductPublishingRepository
Application New UpdateProductDescription use case; DescriptionActionResult class; updateDescription(), lastDescriptionResult, consumeDescriptionResult() on controller
Data – Fake FakeProductPublishingRepository.updateProductDescription — updates description + lastModified, throws StateError for unknown id
Data – WP WordpressProductPublishingRepository.updateProductDescription — PATCH via WooCommerceApiClient with {'description': ...} payload
Presentation Multi-line inline description editor in ProductPreviewPanel (edit icon → TextField with save/cancel); ProductPublishingPage wires onDescriptionChanged; showDescriptionActionSnackBar added
Barrel feature_wordpress.dart exports UpdateProductDescription

No generic update API introduced. No rich text editor. WooCommerce details remain inside WP repo only. Strict package boundaries preserved.

Changed files

feature_wordpress package (10 files)

  • lib/src/domain/product_publishing_repository.dart — contract update
  • lib/src/application/update_product_description.dart — new use case
  • lib/src/application/product_publishing_controller.dart — result class + method
  • lib/src/data/fake_product_publishing_repository.dart — fake impl
  • lib/src/data/wordpress_product_publishing_repository.dart — WP impl
  • lib/src/presentation/widgets/product_preview_panel.dart — inline edit UI
  • lib/src/presentation/product_publishing_page.dart — wiring + snack bar consumption
  • lib/src/presentation/widgets/status_action_snack_bar.dart — description snack bar
  • lib/feature_wordpress.dart — barrel export
  • test/product_publishing_controller_test.dart — 5 new description tests
  • test/fake_product_publishing_repository_test.dart — 5 new description tests
  • test/widgets/product_preview_panel_test.dart — 6 new description editing tests
  • test/widgets/product_publishing_page_test.dart — stub fix

kell_web app (1 file)

  • test/dashboard/application/dashboard_controller_test.dart — stub fix

Validation

Check Result
dart analyze No issues found
feature_wordpress tests 212/212 passed (was 195 on main; +17 new)
kell_web dashboard tests 5/5 passed

Next slice

Stage 1B — Category-only product edit (feat/category-only-edit): Allow updating product category only using a simple constrained UI, reusing the same narrow single-field edit pattern. No taxonomy subsystem.

## PR Summary — `feat/description-only-edit` (Stage 1A) ### Objective Allow updating product description only, extending the publishing workflow with the next single-field edit capability per the master development brief (Stage 1 → Stage 1A). ### Inspection findings Inspected the existing price-only and name-only edit implementations on `main`. The established narrow pattern is consistent across all layers: - **Domain**: one new method on `ProductPublishingRepository` - **Application**: one use case class + one `ActionResult` class + one controller method with per-row updating/dedup/feedback - **Data**: parallel fake and WP repo implementations; WP repo keeps WooCommerce payload logic internal - **Presentation**: inline edit widget in `ProductPreviewPanel` (edit/save/cancel), wired through `ProductPublishingPage` with snack bar feedback Baseline on `main`: 195 feature_wordpress tests, 10 kell_web dashboard tests, `dart analyze` clean. Three narrow edit capabilities landed (status, price, name). ### Implementation Mirrored the name-only edit pattern exactly for description: | Layer | Change | |---|---| | **Domain** | Added `updateProductDescription(String id, String description)` to `ProductPublishingRepository` | | **Application** | New `UpdateProductDescription` use case; `DescriptionActionResult` class; `updateDescription()`, `lastDescriptionResult`, `consumeDescriptionResult()` on controller | | **Data – Fake** | `FakeProductPublishingRepository.updateProductDescription` — updates description + lastModified, throws `StateError` for unknown id | | **Data – WP** | `WordpressProductPublishingRepository.updateProductDescription` — PATCH via `WooCommerceApiClient` with `{'description': ...}` payload | | **Presentation** | Multi-line inline description editor in `ProductPreviewPanel` (edit icon → TextField with save/cancel); `ProductPublishingPage` wires `onDescriptionChanged`; `showDescriptionActionSnackBar` added | | **Barrel** | `feature_wordpress.dart` exports `UpdateProductDescription` | No generic update API introduced. No rich text editor. WooCommerce details remain inside WP repo only. Strict package boundaries preserved. ### Changed files **`feature_wordpress` package (10 files)** - `lib/src/domain/product_publishing_repository.dart` — contract update - `lib/src/application/update_product_description.dart` — new use case - `lib/src/application/product_publishing_controller.dart` — result class + method - `lib/src/data/fake_product_publishing_repository.dart` — fake impl - `lib/src/data/wordpress_product_publishing_repository.dart` — WP impl - `lib/src/presentation/widgets/product_preview_panel.dart` — inline edit UI - `lib/src/presentation/product_publishing_page.dart` — wiring + snack bar consumption - `lib/src/presentation/widgets/status_action_snack_bar.dart` — description snack bar - `lib/feature_wordpress.dart` — barrel export - `test/product_publishing_controller_test.dart` — 5 new description tests - `test/fake_product_publishing_repository_test.dart` — 5 new description tests - `test/widgets/product_preview_panel_test.dart` — 6 new description editing tests - `test/widgets/product_publishing_page_test.dart` — stub fix **`kell_web` app (1 file)** - `test/dashboard/application/dashboard_controller_test.dart` — stub fix ### Validation | Check | Result | |---|---| | `dart analyze` | **No issues found** | | `feature_wordpress` tests | **212/212 passed** (was 195 on main; +17 new) | | `kell_web` dashboard tests | **5/5 passed** | ### Next slice **Stage 1B — Category-only product edit** (`feat/category-only-edit`): Allow updating product category only using a simple constrained UI, reusing the same narrow single-field edit pattern. No taxonomy subsystem.
mtkell added 1 commit 2026-04-11 15:08:37 +00:00
Validate Docs / validate-docs (push) Successful in 56s Details
8d1a01581a
tage 1A — Description-only product edit implemented
mtkell merged commit cebac4c32f into main 2026-04-11 15:09:35 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mtkell/kell_creations#3
No description provided.