()
| 671 | const g = horizontalGap; |
| 672 | const aw = Math.max(0, availableWidth); |
| 673 | const cols = PREVIEW_COLUMNS[currentPreviewTileSize] || PREVIEW_COLUMNS.m; |
| 674 | if (cols <= 0) return PREVIEW_TILE_PX.m; |
| 675 | |
| 676 | // Use fixed column count and scale tile so the row fills available width. |
| 677 | const computed = Math.floor((aw - (cols - 1) * g) / cols); |
| 678 | return Math.max(1, computed); |
| 679 | } |
| 680 | |
| 681 | function getPreviewTileSizePx() { |
| 682 | const grid = document.querySelector('.file-grid'); |
| 683 | if ( |
| 684 | currentGridView === 'preview' && |
| 685 | grid && |
| 686 | typeof grid._previewTilePx === 'number' && |
| 687 | grid._previewTilePx > 0 |
| 688 | ) { |
nothing calls this directly
no test coverage detected