diff --git a/tests/routes/hicad-manufacturing-extension.test.ts b/tests/routes/hicad-manufacturing-extension.test.ts index 35b960e22..50f30e080 100644 --- a/tests/routes/hicad-manufacturing-extension.test.ts +++ b/tests/routes/hicad-manufacturing-extension.test.ts @@ -379,6 +379,10 @@ test.describe('HiCAD manufacturing extension', () => { expect(html).toContain('由壹点AI') expect(html).toContain('/api/favicon?surface=hicad') expect(html).toContain('@page { size: A3 landscape;') + expect(html).toContain( + 'grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) minmax(180px, 1fr)' + ) + expect(html).toContain('h1 { overflow: hidden; margin: 0; font-size: 18px;') }) test('renders the engineering sheet without horizontal clipping', async ({ diff --git a/vendor/zoo-modeling-app/manufacturing.ts b/vendor/zoo-modeling-app/manufacturing.ts index 1994f9fb3..4fbd35482 100644 --- a/vendor/zoo-modeling-app/manufacturing.ts +++ b/vendor/zoo-modeling-app/manufacturing.ts @@ -934,15 +934,16 @@ export function createEngineeringSheetHtml(input: EngineeringSheetInput) { @page { size: A3 landscape; margin: 12mm; } * { box-sizing: border-box; } body { margin: 0; color: #111827; font-family: Arial, "Microsoft YaHei", sans-serif; } - header { display: flex; align-items: end; justify-content: space-between; gap: 24px; border-bottom: 2px solid #111827; padding-bottom: 8px; } - .brand { display: flex; align-items: center; gap: 10px; min-width: 170px; } - .brand-logo { width: 38px; height: 38px; object-fit: contain; } - .brand-name { font-size: 18px; font-weight: 700; white-space: nowrap; } - .title { flex: 1; } - h1 { margin: 0; font-size: 24px; } + header { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) minmax(180px, 1fr); align-items: center; gap: 20px; min-height: 52px; border-bottom: 2px solid #111827; padding: 5px 0 7px; } + .brand { display: flex; align-items: center; gap: 8px; min-width: 0; } + .brand-logo { width: 30px; height: 30px; object-fit: contain; } + .brand-name { overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; } + .title { min-width: 0; text-align: center; } + .title p { margin-top: 2px; color: #4b5563; font-size: 11px; line-height: 1.25; } + h1 { overflow: hidden; margin: 0; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; } h2 { margin: 0 0 8px; font-size: 16px; } p { margin: 4px 0; } - .meta { color: #4b5563; font-size: 12px; text-align: right; } + .meta { color: #4b5563; font-size: 10px; line-height: 1.45; text-align: right; white-space: nowrap; } .sheet-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; margin-top: 14px; } section { break-inside: avoid; } .snapshot-wrap { position: relative; }