Skip to content

Commit bbb082c

Browse files
Add support for lazy batches (#278)
1 parent 82b562d commit bbb082c

13 files changed

Lines changed: 381 additions & 214 deletions

File tree

app/assets/sass/components/_mammogram-images.scss

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,18 @@
2222
}
2323

2424
// View wrapper — one per standard mammogram view (e.g. RCC, RMLO)
25-
.app-mammogram-view--right,
26-
.app-mammogram-view--left {
27-
// Spacing between consecutive views
28-
&:not(:last-child) {
29-
@include nhsuk-responsive-margin(4, "bottom");
30-
}
25+
// .app-mammogram-views is the flex container we own; gap handles spacing between views
26+
.app-mammogram-views {
27+
display: flex;
28+
flex-direction: column;
29+
gap: 16px;
3130

32-
// Spacing between multiple images of the same view
33-
.app-mammogram-thumbnail__image-wrapper + .app-mammogram-thumbnail__image-wrapper {
34-
@include nhsuk-responsive-margin(4, "top");
31+
@include nhsuk-media-query($from: tablet) {
32+
gap: 24px;
3533
}
3634
}
3735

38-
// Headings (view label text e.g. "1× RCC") align towards centre
36+
// Right align text for images on the left as images get 'bookmatched' - aligned to inner edge.
3937
.app-mammogram-view--right h3 {
4038
text-align: right;
4139
}
@@ -45,18 +43,29 @@
4543
display: inline-grid;
4644
grid-template-columns: auto auto;
4745
gap: 8px;
46+
47+
// Match the tighter grid gap for same-view images within the reading layout
48+
.app-mammogram-thumbnail {
49+
gap: 8px;
50+
}
4851
}
4952

5053
// Right and left breast thumbnail columns
51-
.app-mammogram-thumbnail--right {
54+
.app-mammogram-thumbnail {
5255
display: flex;
5356
flex-direction: column;
57+
gap: 16px;
58+
59+
@include nhsuk-media-query($from: tablet) {
60+
gap: 24px;
61+
}
62+
}
63+
64+
.app-mammogram-thumbnail--right {
5465
align-items: flex-end;
5566
}
5667

5768
.app-mammogram-thumbnail--left {
58-
display: flex;
59-
flex-direction: column;
6069
align-items: flex-start;
6170
}
6271

@@ -116,7 +125,7 @@
116125
z-index: 1;
117126
}
118127

119-
// Labels align to outer edge - right breast labels on left, left breast labels on right
128+
// Labels align to outer edge - right breast labels on left, left breast labels on right - so they're bookmatched.
120129
.app-mammogram-thumbnail--right .app-mammogram-thumbnail__label {
121130
left: 4px;
122131
}
@@ -126,6 +135,7 @@
126135
}
127136

128137
// Missing image placeholder
138+
// Shown before an image has loaded in or where a standard view wasn't taken.
129139
.app-mammogram-thumbnail__missing {
130140
width: 100%;
131141
height: 100%;
@@ -138,11 +148,13 @@
138148
}
139149

140150
.app-mammogram-thumbnail__missing-text {
151+
// TODO: should we be doing something better for font sizing here?
141152
font-size: 16px;
142153
color: nhsuk-colour("grey-2");
143154
}
144155

145156
// Spinner shown briefly while an image loads during streaming
157+
// TODO: is there a standard NHS spinner we should be using here?
146158
@keyframes mammogram-spin {
147159
to {
148160
transform: rotate(360deg);

app/assets/sass/components/_reading.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@
5555
}
5656
}
5757

58+
// Placeholder row tag — indicates a future case not yet loaded into the batch
59+
.app-placeholder-tag {
60+
display: inline-block;
61+
height: 22px;
62+
width: 200px;
63+
border-radius: 4px;
64+
background-color: nhsuk-colour("grey-4");
65+
}
66+
5867
// Toast message shown after giving an opinion
5968
.app-reading-opinion-banner {
6069
background-color: nhsuk-colour("blue");

app/data/session-data-defaults.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ const defaultSettings = {
108108
showRemaining: 'true',
109109
autoOpenPacsViewer: 'false',
110110
enableOpinionDelay: 'true',
111-
secondReaderComparison: 'early' // 'early' | 'late' | 'off'
111+
secondReaderComparison: 'early', // 'early' | 'late' | 'off'
112+
lazyBatches: 'true',
113+
defaultBatchTargetSize: '25'
112114
}
113115
}
114116

0 commit comments

Comments
 (0)