Problem
The current discount settings UI has several UX issues:
- Percentage limit says "0 = no limit" — but percentage discounts can never exceed 100%. A 0% or unlimited percentage makes no sense.
- Mode dropdown is buried — The "Discount Mode" dropdown (percentage/amount/both) is not the primary control. Users see both percentage AND amount fields regardless of mode, which is confusing.
- No smart defaults — New installs should start with sensible defaults, not require configuration.
Current Behavior
Settings page shows:
- Discount Mode: [dropdown: percentage / amount / both]
- Max Discount Percentage: ___% (0 = no limit) ← misleading
- Max Discount Amount: ___ (0 = no limit)
All fields are always visible regardless of mode selection.
Desired Behavior
Layout (top to bottom)
-
Discount Mode (dropdown, first field)
- Percentage Only (default)
- Amount Only
- Both Percentage & Amount
-
Conditional fields (show/hide based on mode):
- If "Percentage Only" → Show only Max Discount Percentage
- If "Amount Only" → Show only Max Discount Amount
- If "Both" → Show both fields
-
Percentage field:
- Label: "Maximum Discount %"
- Placeholder: "25"
- Helper text: "Maximum 100%"
- Validation: 1–100 (not 0)
- Default: 25
-
Amount field:
- Label: "Maximum Discount Amount"
- Placeholder: "500"
- Helper text: "0 = no limit"
- Validation: ≥ 0
-
Approval toggle (existing, keep as-is):
- "Require approval for discounts above threshold"
Defaults
| Setting |
Default Value |
| discount_mode |
percentage |
| discount_requires_approval |
0 (false) |
| discount_max_percentage |
25 |
| discount_max_amount |
0 (no limit) |
Backend Changes
- Validation —
discount_max_percentage should reject values > 100
- Migration — Update default from
50 to 25 for new installs (existing installs keep their value)
Frontend Changes
- Settings page — Reorder fields: mode dropdown first, then conditional percentage/amount fields
- Show/hide logic — Percentage field visible when mode is
percentage or both; Amount field visible when mode is amount or both
- Input validation — Percentage input max=100, min=1
- Helper text — Update from "0 = no limit" to "Maximum 100%" for percentage field
Screenshots / Mockup
┌─────────────────────────────────────┐
│ Discount Settings │
├─────────────────────────────────────┤
│ Discount Mode │
│ ┌─────────────────────────────┐ │
│ │ Percentage Only ▼ │ │
│ └─────────────────────────────┘ │
│ │
│ Maximum Discount % │
│ ┌─────────────────────────────┐ │
│ │ 25 % │ │
│ └─────────────────────────────┘ │
│ Maximum 100% │
│ │
│ ┌─────────────────────────────┐ │
│ │ Require approval for │ │
│ │ discounts above threshold │ │
│ └─────────────────────────────┘ │
└─────────────────────────────────────┘
Related
- Current implementation:
frontend/src/app/settings/page.tsx
- Backend validation:
main/routes/settings.ts
- Default values:
main/db.ts migration v7 (add_discount_settings)
Labels
enhancement, ui/ux, settings
Problem
The current discount settings UI has several UX issues:
Current Behavior
Settings page shows:
All fields are always visible regardless of mode selection.
Desired Behavior
Layout (top to bottom)
Discount Mode (dropdown, first field)
Conditional fields (show/hide based on mode):
Percentage field:
Amount field:
Approval toggle (existing, keep as-is):
Defaults
percentage0(false)250(no limit)Backend Changes
discount_max_percentageshould reject values > 10050to25for new installs (existing installs keep their value)Frontend Changes
percentageorboth; Amount field visible when mode isamountorbothScreenshots / Mockup
Related
frontend/src/app/settings/page.tsxmain/routes/settings.tsmain/db.tsmigration v7 (add_discount_settings)Labels
enhancement,ui/ux,settings