Skip to content

Commit 5a75269

Browse files
Restore compact docker folder row spacing while keeping vertical centering
1 parent 4963285 commit 5a75269

4 files changed

Lines changed: 47 additions & 14 deletions

File tree

209 KB
Binary file not shown.

folderview.plus.plg

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66
<!ENTITY launch "Settings/FolderViewPlus">
77
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
88
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/main/folderview.plus.plg">
9-
<!ENTITY version "2026.03.08.1">
10-
<!ENTITY md5 "76df551e15cc106d3888dde47b74fdbc">
9+
<!ENTITY version "2026.03.08.2">
10+
<!ENTITY md5 "69d5630da626645d1501eb5910717063">
1111
]>
1212

1313
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" icon="folder-open-o" support="https://github.com/alexphillips-dev/FolderView-Plus/issues" min="7.0.0">
1414
<CHANGES>
1515

16+
###2026.03.08.2
17+
- Tighten Docker row-height syncing to restore compact spacing:
18+
- keep natural height on main folder rows (with preview content),
19+
- only sync explicit height on fixed-column clone rows,
20+
- clear prior forced main-row heights and remove extra minimum height on folder label wrapper.
21+
1622
###2026.03.08.1
1723
- Replace Docker folder left-column centering strategy with height-sync + flex alignment:
1824
- remove absolute-position centering for folder name block,

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/docker.js

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,48 @@ const getRenderedRowHeight = (row) => {
8686
return Math.max(Math.round(rectHeight), Math.round(offsetHeight), 0);
8787
};
8888

89+
const rowHasFolderPreview = (row) => {
90+
return !!(row && row.querySelector && row.querySelector('div.folder-preview'));
91+
};
92+
8993
const syncFolderRowsHeight = (rows) => {
9094
if (!rows || !rows.length) {
9195
return 0;
9296
}
93-
let maxHeight = 0;
97+
let baseHeight = 0;
9498
rows.forEach((row) => {
95-
maxHeight = Math.max(maxHeight, getRenderedRowHeight(row));
99+
if (rowHasFolderPreview(row)) {
100+
baseHeight = Math.max(baseHeight, getRenderedRowHeight(row));
101+
}
96102
});
97-
if (maxHeight <= 0) {
103+
if (baseHeight <= 0) {
104+
rows.forEach((row) => {
105+
baseHeight = Math.max(baseHeight, getRenderedRowHeight(row));
106+
});
107+
}
108+
if (baseHeight <= 0) {
98109
return 0;
99110
}
111+
100112
rows.forEach((row) => {
101-
row.style.setProperty('height', `${maxHeight}px`, 'important');
113+
const shouldSyncHeight = !rowHasFolderPreview(row);
114+
if (shouldSyncHeight) {
115+
row.style.setProperty('height', `${baseHeight}px`, 'important');
116+
} else {
117+
row.style.removeProperty('height');
118+
}
102119
Array.from(row.children || []).forEach((td) => {
103120
if (td && td.tagName === 'TD') {
104-
td.style.setProperty('height', `${maxHeight}px`, 'important');
121+
if (shouldSyncHeight) {
122+
td.style.setProperty('height', `${baseHeight}px`, 'important');
123+
} else {
124+
td.style.removeProperty('height');
125+
}
105126
td.style.setProperty('vertical-align', 'middle', 'important');
106127
}
107128
});
108129
});
109-
return maxHeight;
130+
return baseHeight;
110131
};
111132

112133
const applyFolderCellCentering = (cell, rowHeight = 0) => {
@@ -127,14 +148,16 @@ const applyFolderCellCentering = (cell, rowHeight = 0) => {
127148
return false;
128149
}
129150

130-
const height = Number.isFinite(rowHeight) && rowHeight > 0 ? Math.round(rowHeight) : getRenderedRowHeight(cell.parentElement);
151+
const height = Number.isFinite(rowHeight) && rowHeight > 0 ? Math.round(rowHeight) : 0;
131152
cell.style.setProperty('vertical-align', 'middle', 'important');
132153
cell.style.setProperty('position', 'static', 'important');
133154
cell.style.setProperty('display', 'table-cell', 'important');
134155
cell.style.setProperty('padding-top', '0px', 'important');
135156
cell.style.setProperty('padding-bottom', '0px', 'important');
136157
if (height > 0) {
137158
cell.style.setProperty('height', `${height}px`, 'important');
159+
} else {
160+
cell.style.removeProperty('height');
138161
}
139162

140163
sub.style.setProperty('position', 'relative', 'important');
@@ -144,10 +167,12 @@ const applyFolderCellCentering = (cell, rowHeight = 0) => {
144167
sub.style.setProperty('transform', 'none', 'important');
145168
sub.style.setProperty('display', 'flex', 'important');
146169
sub.style.setProperty('align-items', 'center', 'important');
147-
sub.style.setProperty('min-height', '48px', 'important');
170+
sub.style.setProperty('min-height', '0', 'important');
148171
sub.style.setProperty('width', '100%', 'important');
149172
if (height > 0) {
150173
sub.style.setProperty('height', `${Math.max(0, height - 2)}px`, 'important');
174+
} else {
175+
sub.style.removeProperty('height');
151176
}
152177

153178
return true;
@@ -172,16 +197,17 @@ const forceAllFolderRowsVerticalCenter = () => {
172197
const syncedHeight = syncFolderRowsHeight(rows);
173198
rows.forEach((row) => {
174199
handledRows.add(row);
200+
const rowHeight = rowHasFolderPreview(row) ? 0 : syncedHeight;
175201
row.querySelectorAll('td.ct-name.folder-name').forEach((cell) => {
176-
applyFolderCellCentering(cell, syncedHeight);
202+
applyFolderCellCentering(cell, rowHeight);
177203
});
178204
});
179205
});
180206

181207
document.querySelectorAll('td.ct-name.folder-name').forEach((cell) => {
182208
const parentRow = cell.parentElement;
183209
if (!handledRows.has(parentRow)) {
184-
applyFolderCellCentering(cell, getRenderedRowHeight(parentRow));
210+
applyFolderCellCentering(cell, rowHasFolderPreview(parentRow) ? 0 : getRenderedRowHeight(parentRow));
185211
}
186212
});
187213
};
@@ -195,8 +221,9 @@ const forceFolderRowVerticalCenter = (id) => {
195221
}
196222
const syncedHeight = syncFolderRowsHeight(rows);
197223
rows.forEach((row) => {
224+
const rowHeight = rowHasFolderPreview(row) ? 0 : syncedHeight;
198225
row.querySelectorAll('td.ct-name.folder-name').forEach((cell) => {
199-
applyFolderCellCentering(cell, syncedHeight);
226+
applyFolderCellCentering(cell, rowHeight);
200227
});
201228
});
202229
};

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/styles/docker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ td.ct-name.folder-name > .folder-name-sub {
4949
left: auto;
5050
right: auto;
5151
transform: none;
52-
min-height: 48px;
52+
min-height: 0;
5353
width: 100%;
5454
}
5555

0 commit comments

Comments
 (0)