fix(web): keep printed cut-list rows together
Build CutList image / build-and-push (push) Successful in 22s

This commit is contained in:
aj
2026-08-03 01:51:11 +00:00
parent 3ccaddef0c
commit 25af9e3ba8
3 changed files with 19 additions and 1 deletions
@@ -24,4 +24,16 @@ public class ResultsLengthDisplayTests
Assert.Contains("cut-part-badge-divider", markup); Assert.Contains("cut-part-badge-divider", markup);
Assert.Contains("Show feet + inches", markup); Assert.Contains("Show feet + inches", markup);
} }
[Fact]
public void Printed_cut_list_rows_are_kept_together()
{
var sourcePath = Path.GetFullPath(
Path.Combine(AppContext.BaseDirectory, "../../../../CutList.Web/wwwroot/css/report.css"));
var css = File.ReadAllText(sourcePath);
Assert.Contains(".cutlist-material-card tbody tr", css);
Assert.Contains("break-inside: avoid", css);
Assert.Contains("page-break-inside: avoid", css);
}
} }
+6
View File
@@ -373,6 +373,12 @@
padding: 0 !important; padding: 0 !important;
} }
/* Keep each stock-bar result, its cuts, and its waste on one printed page. */
.cutlist-material-card tbody tr {
break-inside: avoid;
page-break-inside: avoid;
}
/* Reduce spacing */ /* Reduce spacing */
.mb-4 { .mb-4 {
margin-bottom: 0.5rem !important; margin-bottom: 0.5rem !important;
+1 -1
View File
@@ -22,7 +22,7 @@ class CutBadgeFormatTests(unittest.TestCase):
self.assertIn('class="cut-part-badge-name"', cut_rows) self.assertIn('class="cut-part-badge-name"', cut_rows)
self.assertIn('class="cut-part-badge-length"', cut_rows) self.assertIn('class="cut-part-badge-length"', cut_rows)
self.assertIn('@item.Name', cut_rows) self.assertIn('@item.Name', cut_rows)
self.assertIn('@ArchUnits.FormatFromInches(item.Length)', cut_rows) self.assertIn('@FormatResultLength(item.Length)', cut_rows)
self.assertNotIn('$"{item.Name} (', cut_rows) self.assertNotIn('$"{item.Name} (', cut_rows)
def test_length_section_has_a_darker_background_than_the_part_number_section(self) -> None: def test_length_section_has_a_darker_background_than_the_part_number_section(self) -> None: