Skip to content

Refactor dialog widgets and enhance multi-variant management - #19

Merged
TanKhoa1709 merged 3 commits into
mainfrom
fix/chore
Aug 15, 2026
Merged

Refactor dialog widgets and enhance multi-variant management#19
TanKhoa1709 merged 3 commits into
mainfrom
fix/chore

Conversation

@TanKhoa1709

Copy link
Copy Markdown
Collaborator

No description provided.

…ty controls

This commit improves code organization in the listing suggestion screen by extracting dialog logic into dedicated widgets and updates the status-based visibility logic for seller products.

Key changes:
- **Dialog Refactoring**:
    - Extracted the "Add Tag" and "Add Specification" logic from `ListingSuggestionScreen` into standalone `_AddTagDialog` and `_AddSpecDialog` widgets.
    - Improved state management and controller disposal within these new dialog components.
    - Simplified the main screen's methods (`_addTag`, `_addSpec`) by offloading UI construction to the new widgets.
- **Data Hygiene**: Added string trimming to tag and specification inputs to prevent leading/trailing whitespace.
- **Visibility Logic**: Updated `SellerProductsScreen` to only show the visibility toggle for listings with `active` or `hidden` status, preventing users from attempting to toggle products that are in `draft` or pending review.
…workflow

This commit introduces comprehensive support for product variants, allowing sellers to manage multiple versions of a product (e.g., different sizes or colors) with specific pricing and stock levels. It also refines the listing publication and category selection experience.

Key changes:
- **Multi-Variant Support**:
    - Expanded `EditVariantSheet` to allow adding and deleting variants in addition to updating price and quantity.
    - Updated `ListingSuggestionScreen` to support defining multiple variants with custom attributes (e.g., "Color: Red") during the initial product creation.
    - Modified `ListingDraft` model to handle lists of variants instead of single price/quantity fields.
- **Searchable Category Selection**:
    - Replaced the standard category dropdown with a searchable bottom sheet (`_CategorySearchBottomSheet`) in both the edit and suggestion screens to improve navigation through large category trees.
- **Listing Workflow Enhancements**:
    - Added "Send for Review" (Gửi duyệt) functionality to the seller product list, allowing drafts to be published directly.
    - Updated `SellerRepository` and `SellerProductsNotifier` to support the new publication flow and variant additions.
    - Improved UI status labels and refined the visual layout of product management cards.
- **UI/UX Refinements**:
    - Standardized variant labels to display attribute pairs (e.g., "Size: L · Color: Blue").
    - Added confirmation dialogs for destructive actions like deleting a variant.
    - Improved form validation for price, quantity, and weight inputs.
@TanKhoa1709
TanKhoa1709 merged commit 1a8c923 into main Aug 15, 2026
1 check passed
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.

1 participant