Refactor dialog widgets and enhance multi-variant management - #19
Merged
Conversation
…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.
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.
No description provided.