Skip to content

Commit 3d756d1

Browse files
committed
fix: AD5X printer detection and UI refinements
Fixes: - Added AD5X and ad5x to 5M family printer detection (was only checking for "5M" or "Pro", causing AD5X to be incorrectly identified as legacy and failing to prompt for check code) - Fixed oversized icons by constraining SVG dimensions to 16x16px for: * .add-printer-btn icons * .discovery-tab-btn icons * .btn icons - Fixed saved printer card text alignment by making .printer-info a flex column with proper spacing The AD5X is now correctly identified as a 5M family printer requiring dual API connection with check code prompt.
1 parent 6c23cf3 commit 3d756d1

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

src/webui/static/features/printer-discovery.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,14 @@ async function connectToDiscoveredPrinter(
235235
): Promise<void> {
236236
try {
237237
// Determine printer type based on model
238-
const type = model.includes('5M') || model.includes('Pro') ? 'new' : 'legacy';
239-
240-
// If new printer, prompt for check code
238+
// 5M family includes: 5M, 5M Pro, AD5X, AD5X Pro
239+
const is5MFamily = model.includes('5M') ||
240+
model.includes('Pro') ||
241+
model.includes('AD5X') ||
242+
model.includes('ad5x');
243+
const type = is5MFamily ? 'new' : 'legacy';
244+
245+
// If 5M family printer, prompt for check code
241246
let checkCode: string | undefined;
242247
if (type === 'new') {
243248
checkCode = prompt('Enter the printer check code (8 digits):') || undefined;

src/webui/static/webui.css

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,11 @@ body {
16191619
transition: all 0.2s;
16201620
}
16211621

1622+
.add-printer-btn svg {
1623+
width: 16px;
1624+
height: 16px;
1625+
}
1626+
16221627
.add-printer-btn:hover {
16231628
background: var(--primary-hover);
16241629
}
@@ -1644,6 +1649,11 @@ body {
16441649
margin-bottom: -2px;
16451650
}
16461651

1652+
.discovery-tab-btn svg {
1653+
width: 16px;
1654+
height: 16px;
1655+
}
1656+
16471657
.discovery-tab-btn:hover {
16481658
background: rgba(255, 255, 255, 0.05);
16491659
}
@@ -1701,8 +1711,15 @@ body {
17011711
border-left: 3px solid #4caf50;
17021712
}
17031713

1714+
.printer-info {
1715+
display: flex;
1716+
flex-direction: column;
1717+
gap: 4px;
1718+
flex: 1;
1719+
}
1720+
17041721
.printer-info h4 {
1705-
margin: 0 0 8px 0;
1722+
margin: 0;
17061723
color: var(--text-color);
17071724
font-size: 16px;
17081725
}
@@ -1713,6 +1730,11 @@ body {
17131730
font-size: 14px;
17141731
}
17151732

1733+
.printer-info small {
1734+
color: var(--text-color-secondary);
1735+
font-size: 12px;
1736+
}
1737+
17161738
.badge {
17171739
display: inline-block;
17181740
padding: 4px 8px;
@@ -1782,6 +1804,11 @@ body {
17821804
font-size: 14px;
17831805
}
17841806

1807+
.btn svg {
1808+
width: 16px;
1809+
height: 16px;
1810+
}
1811+
17851812
.btn-primary {
17861813
background: var(--primary-color);
17871814
color: white;

0 commit comments

Comments
 (0)