Skip to content

[WOOMOB-3739] Prepare Product Detail for the Compose cutover (1/3) - #16393

Open
hichamboushaba wants to merge 5 commits into
feature/store-design-system-migrationfrom
issue/woomob-3739-product-detail-prerequisites
Open

[WOOMOB-3739] Prepare Product Detail for the Compose cutover (1/3)#16393
hichamboushaba wants to merge 5 commits into
feature/store-design-system-migrationfrom
issue/woomob-3739-product-detail-prerequisites

Conversation

@hichamboushaba

@hichamboushaba hichamboushaba commented Aug 8, 2026

Copy link
Copy Markdown
Member

Description

Part 1 of 3. Followed by #16394 and #16395.

Part of WOOMOB-3739 — does not close the ticket.

This is part 1 of 3 in the Product Detail Compose migration stack. It adds the prerequisites without changing the production Product Detail rendering route:

  • aligns the shared View-hosted design-system toolbar with the Compose app bar contract, including title metrics, control placement, outlined buttons, and overflow styling;
  • preserves persisted Add Product state across restoration and review refreshes; and
  • maps legacy Product Detail cards into immutable UI models with stable keys and current callbacks.

The toolbar bridge is reusable by later View-hosted screen migrations. Product-specific Share behavior remains in the final cutover PR.

Test Steps

  1. Compare the Compose and XML toolbars in the light image below; verify their height, centered title, control spacing, outlined button geometry, and overflow icon match.
  2. Repeat the comparison in the dark image and verify the colors and contrast match.
  3. Create and save a product draft, recreate Product Detail after making another edit, and press Back; confirm the restored edit is retained and the discard-changes dialog appears.

Images/gif

Light Dark
Light Compose and XML toolbar comparison Dark Compose and XML toolbar comparison
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@dangermattic

dangermattic commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@hichamboushaba hichamboushaba added type: enhancement A request for an enhancement. feature: product details Related to adding or editing products, includes product settings. labels Aug 8, 2026
@hichamboushaba hichamboushaba added this to the 25.5 milestone Aug 8, 2026
@hichamboushaba hichamboushaba added category: design Layout and style elements in the UI or user interface, including color and animations. category: parity Match what's supported by the other platform. category: unit tests Related to unit testing. compose Uses Jetpack Compose framework labels Aug 8, 2026
@wpmobilebot

wpmobilebot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

App Icon📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Build Number778
Version25.4-rc-1
Application IDcom.woocommerce.android.prealpha
Commit8791976
Installation URL5bug7jni7o6oo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@hichamboushaba
hichamboushaba force-pushed the feature/store-design-system-migration branch from 62e0338 to e903c9f Compare August 9, 2026 12:43
Use AppCompat's public overflow layout flag to apply the shared outlined icon contract while preserving its menu semantics.
Restore the stored server baseline from the draft's persisted remote ID after recreation. Refresh only products with a valid remote ID so review returns are safe across start modes.
Map legacy property cards into immutable UI snapshots with stable semantic keys, current callbacks, preserved ordering, and a terminal empty state for offline cache misses.
@hichamboushaba
hichamboushaba force-pushed the issue/woomob-3739-product-detail-prerequisites branch from 191f78b to 89ec3b6 Compare August 9, 2026 12:53
@hichamboushaba
hichamboushaba marked this pull request as ready for review August 10, 2026 10:33

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Code Review - No issues found. The changes look good.

The refreshProduct() / restoreStoredProduct() refactor is a solid defensive improvement: it removes the previous unconditional navArgs.mode as ProductDetailFragment.Mode.ShowProduct cast (a latent ClassCastException when refresh ran in the Add flow) and now handles every Mode branch explicitly, guarding against the sentinel DEFAULT_ADD_NEW_PRODUCT_ID. The new ProductDetailUiMapper / ProductDetailUiModel immutable mapping is clean and well covered by unit tests (order preservation, stable/unique keys, callback wiring, snapshot immutability). The WooDesignSystemToolbar visual polish (title font padding, overflow-button outlined styling, vertical centering, border width) is backed by Robolectric tests including RTL. All referenced resources (woo_ds_ic_regular_ellipsis_24dp, woo_ds_toolbar_icon_button_tint) exist.

PR housekeeping
  • The new ProductDetailUiMapper and ProductDetailUiModel classes are not yet referenced by any production UI (only by tests) — appears to be intentional scaffolding for a follow-up; just flagging so it isn't left orphaned.
  • Applied repo-specific AGENTS.md / CLAUDE.md guidance (store-app MVVM patterns, Kotlin conventions) when reviewing.

Automatic review · claude-opus-4-8 · Workflow run

How to reply to a finding

Reply on this review (or inline at the line the finding refers to) with one of:

  • @claude addressed - I made the change. Bot verifies against the next diff before marking resolved.
  • @claude rejected: <reason> - Will not fix; reason gets quoted on the next review.
  • @claude not-applicable - Finding does not apply (wrong file, already covered elsewhere, etc.).

The bot honours these on the next review pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: design Layout and style elements in the UI or user interface, including color and animations. category: parity Match what's supported by the other platform. category: unit tests Related to unit testing. compose Uses Jetpack Compose framework feature: product details Related to adding or editing products, includes product settings. type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants