fix: compact device sizing and deploy configuration
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reduce device node height by removing minimum port height and tightening card gaps. Fix deployment by correcting Angular outputPath for Docker build context and adding frontend.context to service.yaml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -38,7 +38,10 @@
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:application",
|
||||
"options": {
|
||||
"outputPath": "../dist",
|
||||
"outputPath": {
|
||||
"base": "dist",
|
||||
"browser": ""
|
||||
},
|
||||
"index": "src/index.html",
|
||||
"browser": "src/main.ts",
|
||||
"polyfills": [
|
||||
|
||||
@ -51,14 +51,12 @@ function getDeviceSize(
|
||||
) {
|
||||
return { width: SPLICE_SIZE, height: SPLICE_SIZE };
|
||||
}
|
||||
const portHeight = Math.max(portCount * 22, 60);
|
||||
const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 6) + 8 : 0;
|
||||
const bodyHeight = cardCount > 0 && portCount > 0
|
||||
? cardsHeight + portHeight
|
||||
: Math.max(portHeight, cardsHeight);
|
||||
const portHeight = portCount * 22;
|
||||
const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 4) + 4 : 0;
|
||||
const bodyHeight = cardsHeight + portHeight;
|
||||
return {
|
||||
width: DEVICE_MIN_WIDTH,
|
||||
height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 10),
|
||||
height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 6),
|
||||
};
|
||||
}
|
||||
|
||||
@ -116,7 +114,7 @@ export function buildGraphData(
|
||||
|
||||
const hasCards = deviceCards.length > 0;
|
||||
const cardsEndY = hasCards
|
||||
? DEVICE_HEADER_HEIGHT + deviceCards.length * (CARD_HEIGHT + 6) + 8
|
||||
? DEVICE_HEADER_HEIGHT + deviceCards.length * (CARD_HEIGHT + 4) + 4
|
||||
: 0;
|
||||
|
||||
const leftDevicePorts = devicePorts.filter(
|
||||
@ -225,7 +223,7 @@ export function buildGraphData(
|
||||
).indexOf(card);
|
||||
|
||||
const cardX = parentPos.x + 10;
|
||||
const cardY = parentPos.y + DEVICE_HEADER_HEIGHT + 8 + cardIndex * (CARD_HEIGHT + 6);
|
||||
const cardY = parentPos.y + DEVICE_HEADER_HEIGHT + 4 + cardIndex * (CARD_HEIGHT + 4);
|
||||
|
||||
const portItems = cardPorts.map((port) => {
|
||||
const resolvedSide = portSideMap.get(port.id) ?? port.side;
|
||||
|
||||
@ -36,15 +36,12 @@ function getDeviceSize(device: Device, portCount: number, cardCount: number): {
|
||||
}
|
||||
|
||||
// Dynamic height based on port count + header + cards
|
||||
const portHeight = Math.max(portCount * 22, 60);
|
||||
const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 6) + 8 : 0;
|
||||
// When device has both cards and ports, stack them vertically to avoid overlap
|
||||
const bodyHeight = cardCount > 0 && portCount > 0
|
||||
? cardsHeight + portHeight
|
||||
: Math.max(portHeight, cardsHeight);
|
||||
const portHeight = portCount * 22;
|
||||
const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 4) + 4 : 0;
|
||||
const bodyHeight = cardsHeight + portHeight;
|
||||
return {
|
||||
width: DEVICE_MIN_WIDTH,
|
||||
height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 10),
|
||||
height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 6),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user