UI Bug Fix: Expand CMS Popup Modal Width to Reduce Height
Last Updated: 16/07/2026
Type: UI Layout Fix β CMS Modal Dimension Adjustments
Screen: CMS Admin Panel β Service Create/Edit Modal (Spa Services) & all configuration modals
Severity: π Medium β UX polishing to optimize data entry layouts, preventing excessive vertical scrolling
Feedback Screenshot:
1. Identified Spacing Issueβ
On the Service Edit/Create modal in the CMS:
- The popup modal container is set to a narrow width (approx.
600px). - Because of this narrow width, form elements (such as the branch checklist, price input, duration, buffers, description, and status checkboxes) are forced to stack vertically in single or double columns.
- This creates an excessively tall modal (large height) that requires vertical scrolling to access fields like the "Save" (LΖ°u service) button at the bottom.
2. Redesign & Spacing Specificationsβ
To optimize readability and form structure, the modal width must be increased, allowing fields to sit side-by-side in multi-column layouts, which reduces the overall height of the box.
2.1 Modal Dimension Target Specsβ
- Width: Increase the modal container width from
600pxto960px(standard Desktop Medium/Large modal width). - Height: Remove explicit/restrictive height caps and let the content flow naturally across horizontal columns. Limit maximum height to
90vhwith an inner scrollable body if needed.
2.2 Proportional Multi-Column Grid Redesignβ
By utilizing a grid system (e.g. 12-column Grid or Flexbox rows), we reorganize the inputs to span horizontally:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Sα»a service Spa X β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β TΓͺn service (flex: 2) NhΓ³m dα»ch vα»₯ (flex: 1) β
β [ Body Massage 90 phΓΊt ] [ Body Massage ] β
β β
β SKU (flex: 1) Danh mα»₯c (flex: 1) β
β [ GL-BODY-MASSAGE-90 ] [ Massage βΌ ] β
β β
β Chi nhΓ‘nh Γ‘p dα»₯ng (3-column grid check list) β
β [ ] Gold Lotus HΖ°ng [ ] Gold Lotus ThαΊ£o Δiα»n [ ] Gold Oriental Spa 1 β
β [ ] Gold Oriental 2 [ ] Gold Oriental 3 [ ] Gold Meat House β
β β
β GiΓ‘ trΖ°α»c thuαΊΏ Thα»i lượng Buffer trΖ°α»c Buffer sau β
β [ 495000 ] [ 90 ] [ 10 ] [ 10 ] β
β β
β MΓ΄ tαΊ£ β
β [ Golden Lotus Body Massage 90 phΓΊt... ] β
β β
β HΓ¬nh ΔαΊ‘i diα»n (Thumbnail) CαΊ§n therapist / phΓ²ng / bαΊt β
β [ πΌοΈ Asset ΔΓ£ chα»n ] [β
] Therapist [β
] PhΓ²ng [β
] β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β [Huα»·] [LΖ°u service]β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3. Style Adjustments (CSS / SCSS)β
3.1 Before (Tall & Narrow Layout)β
// β WRONG β Restrictive width causing vertical stacking
.cms-modal-dialog {
max-width: 600px; // β Too narrow
.form-row {
display: flex;
flex-direction: column; // Stacks all fields vertically
margin-bottom: 12px;
}
.branch-checklist {
display: grid;
grid-template-columns: repeat(2, 1fr); // β 2-column checklist stretches vertically
}
}
3.2 After (Wide & Balanced Layout)β
// β
CORRECT β Wider modal with multi-column input groups
.cms-modal-dialog {
width: 90%;
max-width: 960px; // β
Wider desktop modal width
margin: 30px auto;
.modal-body {
max-height: 80vh;
overflow-y: auto; // Fallback inner scrollbar
padding: 24px;
}
// Flexbox rows for horizontal field alignments
.form-row-grid-4 {
display: grid;
grid-template-columns: repeat(4, 1fr); // price, duration, buffers side-by-side
gap: 16px;
margin-bottom: 16px;
}
.form-row-grid-2 {
display: grid;
grid-template-columns: 2fr 1fr; // e.g. Name (2/3 width) and Group (1/3 width)
gap: 16px;
margin-bottom: 16px;
}
// Branch checklist distributed across 3 or 4 columns
.branch-checklist {
display: grid;
grid-template-columns: repeat(3, 1fr); // β
3 columns reduces vertical list size
gap: 12px;
padding: 12px;
background-color: #F9F9F9;
border-radius: 6px;
margin-bottom: 16px;
}
}
Technical Checklistβ
- Locate the Modal dialog component file for the Service Manager view (typically
ServiceEditModal.tsxor similar). - Update the modal wrapper component props (or CSS class) to set
width: 960pxor a wide config token. - Re-layout the branch checklist to display in
3 columns(or4 columnsdepending on viewport space). - Group the numerical inputs (GiΓ‘ trΖ°α»c thuαΊΏ, Thα»i lượng, Buffer trΖ°α»c, Buffer sau) on a single horizontal row (
grid-template-columns: repeat(4, 1fr)). - Group the Name and Group selector inputs in a
2:1grid ratio. - Group the checkbox switches (CαΊ§n therapist, CαΊ§n phΓ²ng, Δang bαΊt) on a single horizontal row.
- Verify scrolling: ensure that on smaller monitor resolutions, the modal fits the height constraints gracefully by utilizing
max-height: 85vhandoverflow-y: auto.