Product catalog management
The product catalog dashboard gives store staff one place to review product records and prepare catalog changes. It combines a searchable product table with filters, paging, editing, duplication, and an add-product drawer that checks product details and image choices before submission. See the wider dashboard experiences page for the shared dashboard frame and related work areas.
For adjacent dashboard context, see analytics and commerce, operations and work management, people and customer management, content and communication views, and specialized monitoring.
Catalog management surface
The /dashboard/products page is a focused catalog work area. It keeps the table and its controls in the main view while the add-product action opens a right-side drawer, so staff can add a record without leaving the catalog context. The product view is currently a client-side demo surface, so changes apply to the current session and do not persist after a page reload.
The catalog record centers on the fields that staff need to manage store availability:
- Product name and SKU identify the item.
- Category and status place it in the catalog structure.
- Price and stock describe its current offer and inventory position.
- Units sold provide sales context in the table.
References: src/…/page.tsx• L6-25 src/…/data.ts• L1-15 src/…/product-form.tsx• L42-73
Catalog table
The catalog table turns each product record into a scan-friendly row. It exposes identity, classification, availability, commercial values, and row actions together so a user can find an item and move directly to an edit or duplicate action.
Table presentation
The table presents the product name, SKU, category, status, inventory, price, and units sold. Status uses distinct labels for Active, Draft, and Archived records. Inventory also signals out-of-stock and low-stock conditions, which lets staff spot supply issues without opening a product.
The table supports these navigation and selection behaviors:
- Search matches the product name, SKU, or category.
- Status and category filters narrow the visible records.
- A clear action removes the active filters and returns to the first page.
- Page selection supports bulk row selection within the visible page.
- Pagination supports 10, 25, 50, or 100 rows per page.
- The table keeps its header visible while users scan rows.
- An empty result state explains that the user can change the search or clear filters.
The table footer shows the current result range and selected-row count. Page-size changes and filter changes return the user to the first page so the table does not remain on an invalid result page.
This diagram shows how catalog records move from the local product set into the filtered and paged table view.
flowchart LR
A[Product records] --> B[Search and filters]
B --> C[Filtered rows]
C --> D[Page size and page selection]
D --> E[Catalog table]
E --> F[Edit or duplicate action]
References: src/…/products.tsx• L19-67 src/…/products-table.tsx• L35-197 src/…/products-columns.tsx• L27-139
Product row actions
The product name and the row action menu both open the edit view for the selected record. Duplicate creates a new draft copy with a new identifier and SKU, resets its sold count, and places it at the top of the catalog. The dashboard then clears the table filters so the new draft is visible.
References: src/…/products-columns.tsx• L79-89 src/…/products-columns.tsx• L141-178 src/…/products.tsx• L23-38
Product editing
Editing uses a focused dialog for an existing product. The dialog preserves the product identity and sales count while allowing staff to change the name, SKU, category, status, price, and stock. A valid save updates the matching table row, closes the dialog, resets filters, and reports that the change was saved for the current demo session.
The edit flow follows a short sequence:
- The user opens a product from its name or action menu.
- The dialog loads the current product values.
- The user changes catalog, price, or inventory fields.
- The form checks the required values and SKU uniqueness.
- A valid record replaces the old row in the current catalog view.
The edit dialog and the add-product drawer serve different entry points. Editing is for changing an existing table record, while the drawer is for validating a richer new-product submission that includes a description and images.
References: src/…/product-form.tsx• L21-73 src/…/products.tsx• L125-136
Product creation drawer
The add-product drawer is the entry point for a new catalog submission. It opens from the Products page, keeps the form scrollable inside the drawer, and separates the product details from the final validation action. Closing the drawer resets its fields so a later opening starts with a new product form.
The drawer collects the following product information:
| Group | Purpose |
|---|---|
| Name and description | Define the product shown to customers and staff |
| Images | Select optional product media and preview the selected files |
| SKU | Provide a stable catalog identifier |
| Category and status | Place the product in the catalog and set its lifecycle state |
| Price and stock | Set the offer value and available quantity |
The current submit control is labeled Validate product. A valid submission reports that the product details are valid; the drawer does not itself add the record to the catalog table.
This diagram shows the add-product path from the page action through validation and the resulting status message.
flowchart TD
A[Products page] --> B[Add product drawer]
B --> C[Enter product details]
C --> D[Select optional images]
D --> E[Validate product]
E -->|Invalid| F[Show field error]
E -->|Valid| G[Show valid product status]
References: src/…/page.tsx• L16-25 src/…/add-product-drawer.tsx• L60-105 src/…/add-product-drawer.tsx• L259-271
Product validation
Validation checks the new-product form when fields lose focus and again when the user submits it. The rules protect the catalog contract at the point where a record is prepared: names and descriptions must have content, SKUs must use a limited character set, category and status must use the supported values, and numeric fields must stay within their allowed ranges.
The main validation rules are:
- Name: 1 to 100 characters after trimming.
- Description: 1 to 2,000 characters after trimming.
- SKU: 1 to 40 characters using letters, numbers, hyphens, or underscores.
- Images: no more than five valid files, with each file non-empty and at most 5 MB.
- Price: a non-negative value with up to two decimal places, capped at $1,000,000.
- Stock: a non-negative whole number, capped at 1,000,000.
- Category and status: one of the supported catalog values.
Field errors appear beside the affected input. A valid submit shows a status message instead of creating a persistent catalog record.
References: src/…/add-product-drawer.tsx• L27-56 src/…/add-product-drawer.tsx• L104-147 src/…/add-product-drawer.tsx• L229-261
Product image selection
The image field lets a user choose optional product media and review each selected file before validation. The browser file picker accepts JPG, PNG, and WebP images, and the field removes duplicate selections while keeping the chosen order. The first accepted image is marked as the cover image in the preview.
Selected files appear as image previews when valid. Invalid files remain visible with an error state so the user can understand the rejection and remove one file or clear the full set. The field limits the selection to five images and five megabytes per image, matching the form-level validation rules.
References: src/…/product-images-field.tsx• L22-56 src/…/product-images-field.tsx• L58-97 src/…/product-images-field.tsx• L98-139
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the product fields, category values, and status values aligned between the catalog data, table columns, edit dialog, and add-product schema.
- Keep image picker limits and preview rejection messages aligned with the add-product validation rules.
- Keep search fields aligned with the product attributes that users expect to find.
- Keep duplicate-product behavior aligned with SKU uniqueness, draft status, sold-count reset, and filter reset behavior.
- Keep the drawer's validation result distinct from catalog persistence until a real save path is introduced.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A duplicate product keeps the original SKU | The new draft can conflict with the catalog identity rule | Generate a new SKU and validate it as a distinct record |
| A filter changes without resetting the page | The table can show an empty page even when matching products exist | Reset the page index when search, category, or status changes |
| Image picker limits differ from schema limits | The preview can accept files that final validation rejects, or the reverse | Keep file type, count, and size rules shared between the field and schema |
| Invalid SKU or numeric input reaches save handling | The catalog can contain unusable identifiers or values | Block submission and show the field-level validation error |
| The drawer is treated as a persistence flow | Users may expect a validated product to appear in the table after submission | Preserve the current distinction between validation success and catalog save |
Key files
| File | Why to read it |
|---|---|
| src/…/page.tsx | Defines the product-management page and connects the add action to the catalog view. |
| src/…/products.tsx | Coordinates local catalog state, filtering, editing, duplication, and table updates. |
| src/…/products-table.tsx | Defines table layout, empty results, selection summary, page sizes, and pagination. |
| src/…/products-columns.tsx | Defines the product fields shown in each row and the available row actions. |
| src/…/product-form.tsx | Shows the existing-product edit flow and its save checks. |
| src/…/add-product-drawer.tsx | Defines new-product fields, validation, and the drawer workflow. |
| src/…/product-images-field.tsx | Defines image selection, preview, rejection, removal, and cover-image order. |
| src/…/data.ts | Defines the catalog record shape and supported category and status values. |