Codex commited on
Commit ·
9cfe2aa
1
Parent(s): 0725350
Fix layout spacing and schedule overlap
Browse files- static/admin-v020.js +8 -5
- static/v020.css +3 -8
static/admin-v020.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
segments: [],
|
| 11 |
interaction: null,
|
| 12 |
dragKind: null,
|
| 13 |
-
pixelsPerMinute:
|
| 14 |
},
|
| 15 |
};
|
| 16 |
|
|
@@ -250,11 +250,11 @@
|
|
| 250 |
const isEdge = index === 0 || index === marks.length - 1;
|
| 251 |
const previous = visibleMarks[visibleMarks.length - 1];
|
| 252 |
|
| 253 |
-
if (isEdge && previous && top - previous.top <
|
| 254 |
visibleMarks.pop();
|
| 255 |
}
|
| 256 |
|
| 257 |
-
if (!previous || isEdge || top - (visibleMarks[visibleMarks.length - 1]?.top ?? -Infinity) >=
|
| 258 |
visibleMarks.push({ minute, top, index });
|
| 259 |
}
|
| 260 |
});
|
|
@@ -273,10 +273,13 @@
|
|
| 273 |
});
|
| 274 |
|
| 275 |
segments.forEach((segment, index) => {
|
| 276 |
-
const
|
|
|
|
|
|
|
|
|
|
| 277 |
const block = document.createElement("article");
|
| 278 |
block.className = `schedule-editor-segment ${segment.kind}`;
|
| 279 |
-
block.style.top = `${Math.round((segment.startMinutes - startMinutes) * getEditorPixelsPerMinute())}px`;
|
| 280 |
block.style.height = `${segmentHeight}px`;
|
| 281 |
block.classList.toggle("is-compact", segmentHeight < 88);
|
| 282 |
block.classList.toggle("is-tight", segmentHeight < 56);
|
|
|
|
| 10 |
segments: [],
|
| 11 |
interaction: null,
|
| 12 |
dragKind: null,
|
| 13 |
+
pixelsPerMinute: 2.25,
|
| 14 |
},
|
| 15 |
};
|
| 16 |
|
|
|
|
| 250 |
const isEdge = index === 0 || index === marks.length - 1;
|
| 251 |
const previous = visibleMarks[visibleMarks.length - 1];
|
| 252 |
|
| 253 |
+
if (isEdge && previous && top - previous.top < 42) {
|
| 254 |
visibleMarks.pop();
|
| 255 |
}
|
| 256 |
|
| 257 |
+
if (!previous || isEdge || top - (visibleMarks[visibleMarks.length - 1]?.top ?? -Infinity) >= 42) {
|
| 258 |
visibleMarks.push({ minute, top, index });
|
| 259 |
}
|
| 260 |
});
|
|
|
|
| 273 |
});
|
| 274 |
|
| 275 |
segments.forEach((segment, index) => {
|
| 276 |
+
const minimumHeight = segment.kind === "break" ? 16 : 42;
|
| 277 |
+
const rawHeight = Math.max(Math.round(segment.durationMinutes * getEditorPixelsPerMinute()), minimumHeight);
|
| 278 |
+
const inset = rawHeight > 80 ? 4 : rawHeight > 56 ? 3 : 2;
|
| 279 |
+
const segmentHeight = Math.max(rawHeight - (inset * 2), 16);
|
| 280 |
const block = document.createElement("article");
|
| 281 |
block.className = `schedule-editor-segment ${segment.kind}`;
|
| 282 |
+
block.style.top = `${Math.round((segment.startMinutes - startMinutes) * getEditorPixelsPerMinute()) + inset}px`;
|
| 283 |
block.style.height = `${segmentHeight}px`;
|
| 284 |
block.classList.toggle("is-compact", segmentHeight < 88);
|
| 285 |
block.classList.toggle("is-tight", segmentHeight < 56);
|
static/v020.css
CHANGED
|
@@ -156,6 +156,7 @@ body.planner-interacting * {
|
|
| 156 |
min-height: 0;
|
| 157 |
display: grid;
|
| 158 |
grid-template-rows: minmax(0, 1fr);
|
|
|
|
| 159 |
overflow: hidden;
|
| 160 |
}
|
| 161 |
|
|
@@ -169,7 +170,8 @@ body.planner-interacting * {
|
|
| 169 |
gap: 14px;
|
| 170 |
height: 100%;
|
| 171 |
min-height: 0;
|
| 172 |
-
align-items:
|
|
|
|
| 173 |
}
|
| 174 |
|
| 175 |
.todo-column {
|
|
@@ -182,13 +184,6 @@ body.planner-interacting * {
|
|
| 182 |
border-radius: 28px;
|
| 183 |
}
|
| 184 |
|
| 185 |
-
.todo-column:nth-child(2) {
|
| 186 |
-
transform: translateY(10px);
|
| 187 |
-
}
|
| 188 |
-
|
| 189 |
-
.todo-column:nth-child(3) {
|
| 190 |
-
transform: translateY(24px);
|
| 191 |
-
}
|
| 192 |
|
| 193 |
.column-header {
|
| 194 |
position: relative;
|
|
|
|
| 156 |
min-height: 0;
|
| 157 |
display: grid;
|
| 158 |
grid-template-rows: minmax(0, 1fr);
|
| 159 |
+
align-items: start;
|
| 160 |
overflow: hidden;
|
| 161 |
}
|
| 162 |
|
|
|
|
| 170 |
gap: 14px;
|
| 171 |
height: 100%;
|
| 172 |
min-height: 0;
|
| 173 |
+
align-items: start;
|
| 174 |
+
align-content: start;
|
| 175 |
}
|
| 176 |
|
| 177 |
.todo-column {
|
|
|
|
| 184 |
border-radius: 28px;
|
| 185 |
}
|
| 186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
.column-header {
|
| 189 |
position: relative;
|