style: improve filter modal aesthetics for large screens (Task 11.4)

- Drug modal: size 70%, sm chips in 4-col SimpleGrid layout
- Trust modal: size lg, md chips in vertical Stack layout
- Directorate modal: size 70%, larger badges and text
- CSS: modal title full-width, chip nowrap, scroll padding
This commit is contained in:
Andrew Charlwood
2026-02-07 00:37:47 +00:00
parent 59f6cbafaa
commit caf7ada287
3 changed files with 41 additions and 28 deletions
+14 -18
View File
@@ -652,26 +652,22 @@ User feedback after Phase 10 completion. Four layout/aesthetics issues on both P
- **Checkpoint**: Patient Pathways chart uses all available vertical space below the filter bar ✓ - **Checkpoint**: Patient Pathways chart uses all available vertical space below the filter bar ✓
### 11.4 Filter modals — improve aesthetics for large screens ### 11.4 Filter modals — improve aesthetics for large screens
- [ ] In `dash_app/components/modals.py`: - [x] In `dash_app/components/modals.py`:
- Drug modal: increase chip `size` from `"xs"` to `"sm"` or `"md"` for readability. Increase modal `size` from `"lg"` to `"xl"` or a fixed width (e.g., `"70%"` or `900px`). Add `dmc.SimpleGrid` or `dmc.Group(wrap="wrap")` with consistent gap to fix spacing/layout of chips. - Drug modal: chip `size` "xs" → "sm", modal `size` "lg" → "70%", added `dmc.SimpleGrid(cols=4)` layout
- Trust modal: increase chip `size` from `"xs"` to `"sm"`. Increase modal `size` from `"sm"` to `"md"`. Use `dmc.Stack` for vertical layout of trust chips (7 items don't need wrapping). - Trust modal: chip `size` "xs" → "md", modal `size` "sm" → "lg", added `dmc.Stack(gap="xs")` vertical layout
- Directorate modal: review accordion spacing and text sizes. Ensure indication items and drug badges are clearly readable. - Directorate modal: modal `size` "xl" → "70%", drug fragment badge "sm" → "md", directorate text "sm" → "md", count badge "xs" → "sm"
- [ ] In `dash_app/assets/nhs.css`, add/update modal CSS: - [x] In `dash_app/assets/nhs.css`: padding-right on scroll container, white-space: nowrap on chip labels, .mantine-Modal-title width: 100%
- Ensure `.modal-chips-scroll` has appropriate max-height and padding - [x] **Used frontend-developer agent** for UX review: recommended 4-col SimpleGrid for drugs, Stack for trusts, percentage-based modal widths, specific size bumps per component
- Chip labels should use the project font (Source Sans 3) at readable size - [x] Verify: App starts cleanly, 20 callbacks, no regressions
- Fix any broken text wrapping or extra whitespace between chip options - **Checkpoint**: All three filter modals are visually polished and proportionally sized for large screens ✓
- Consider responsive modal sizing (percentage-based width) so large screens get proportionally larger modals
- [ ] **Use the frontend-developer agent** to review the modal layout for optimal aesthetics with 42 drugs, 7 trusts, 19 directorates × 163 indications. The agent should recommend chip sizing, grid layout, spacing, and responsive behavior for large screens (1920px+).
- [ ] Verify: Modals look polished — no broken text, consistent spacing, chips are readable at all screen sizes
- **Checkpoint**: All three filter modals are visually polished and proportionally sized for large screens
### Phase 11 Completion Criteria ### Phase 11 Completion Criteria
- [ ] "Clear All Filters" button is left-aligned next to filter buttons - [x] "Clear All Filters" button is left-aligned next to filter buttons
- [ ] Trust Comparison charts are readable with no overspill - [x] Trust Comparison charts are readable with no overspill
- [ ] Patient Pathways chart fills available viewport height - [x] Patient Pathways chart fills available viewport height
- [ ] Filter modals are aesthetically polished with readable chip sizes - [x] Filter modals are aesthetically polished with readable chip sizes
- [ ] `python run_dash.py` starts cleanly - [x] `python run_dash.py` starts cleanly
- [ ] No regressions in existing functionality - [x] No regressions in existing functionality
--- ---
+5
View File
@@ -341,9 +341,14 @@ body {
.modal-chips-scroll { .modal-chips-scroll {
max-height: 60vh; max-height: 60vh;
overflow-y: auto; overflow-y: auto;
padding-right: 8px;
} }
.modal-chips-scroll .mantine-Chip-label { .modal-chips-scroll .mantine-Chip-label {
font-family: 'Source Sans 3', Arial, sans-serif; font-family: 'Source Sans 3', Arial, sans-serif;
white-space: nowrap;
}
.mantine-Modal-title {
width: 100%;
} }
.modal-drug-badge { .modal-drug-badge {
cursor: pointer; cursor: pointer;
+20 -8
View File
@@ -35,7 +35,7 @@ def _make_directorate_accordion_item(directorate: str, indications: dict[str, li
frag, frag,
id={"type": "drug-fragment", "index": f"{directorate}|{search_term}|{frag}"}, id={"type": "drug-fragment", "index": f"{directorate}|{search_term}|{frag}"},
variant="light", variant="light",
size="sm", size="md",
className="modal-drug-badge", className="modal-drug-badge",
style={"cursor": "pointer"}, style={"cursor": "pointer"},
) )
@@ -54,10 +54,10 @@ def _make_directorate_accordion_item(directorate: str, indications: dict[str, li
dmc.Group( dmc.Group(
gap="xs", gap="xs",
children=[ children=[
dmc.Text(directorate.title(), fw=600, size="sm"), dmc.Text(directorate.title(), fw=600, size="md"),
dmc.Badge( dmc.Badge(
str(len(indications)), str(len(indications)),
size="xs", size="sm",
variant="light", variant="light",
color="gray", color="gray",
), ),
@@ -82,7 +82,7 @@ def make_drug_modal():
id="drug-modal", id="drug-modal",
opened=False, opened=False,
centered=True, centered=True,
size="lg", size="70%",
title=dmc.Group( title=dmc.Group(
justify="space-between", justify="space-between",
style={"width": "100%"}, style={"width": "100%"},
@@ -112,12 +112,19 @@ def make_drug_modal():
multiple=True, multiple=True,
value=[], value=[],
children=[ children=[
dmc.Chip(drug, value=drug, size="xs") dmc.SimpleGrid(
cols=4,
spacing="sm",
verticalSpacing="xs",
children=[
dmc.Chip(drug, value=drug, size="sm")
for drug in drugs for drug in drugs
], ],
), ),
], ],
), ),
],
),
dmc.Space(h=12), dmc.Space(h=12),
dmc.Group( dmc.Group(
justify="flex-end", justify="flex-end",
@@ -143,7 +150,7 @@ def make_trust_modal():
id="trust-modal", id="trust-modal",
opened=False, opened=False,
centered=True, centered=True,
size="sm", size="lg",
title=dmc.Group( title=dmc.Group(
justify="space-between", justify="space-between",
style={"width": "100%"}, style={"width": "100%"},
@@ -164,10 +171,15 @@ def make_trust_modal():
multiple=True, multiple=True,
value=[], value=[],
children=[ children=[
dmc.Chip(trust, value=trust, size="xs") dmc.Stack(
gap="xs",
children=[
dmc.Chip(trust, value=trust, size="md")
for trust in trusts for trust in trusts
], ],
), ),
],
),
dmc.Space(h=12), dmc.Space(h=12),
dmc.Group( dmc.Group(
justify="flex-end", justify="flex-end",
@@ -200,7 +212,7 @@ def make_directorate_modal():
id="directorate-modal", id="directorate-modal",
opened=False, opened=False,
centered=True, centered=True,
size="xl", size="70%",
title=dmc.Text("Browse by Directorate", fw=600, size="lg"), title=dmc.Text("Browse by Directorate", fw=600, size="lg"),
overlayProps={"backgroundOpacity": 0.55, "blur": 3}, overlayProps={"backgroundOpacity": 0.55, "blur": 3},
children=[ children=[