Fix download filename and icon wrapping in versions list

Wrap filename link and media-archive icon in a flex container
with white-space: nowrap to keep them on a single line.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-22 18:08:40 +01:00
parent bb8f44bfac
commit 6fe3a88592
2 changed files with 29 additions and 12 deletions

View File

@@ -167,6 +167,19 @@ code.file-hash {
display: none;
}
/* Version download link - keep filename and icon on single line */
.version-download-link {
display: inline-flex;
align-items: center;
white-space: nowrap;
}
.version-download-link .dashicons-media-archive {
color: #2271b1;
flex-shrink: 0;
margin-left: 5px;
}
#versions-table .dashicons-media-archive {
color: #2271b1;
vertical-align: middle;

View File

@@ -157,12 +157,14 @@ final class VersionAdminController
$filename = $version->getDownloadFilename();
if ($effectiveUrl):
?>
<span class="version-download-link">
<a href="<?php echo esc_url($effectiveUrl); ?>" target="_blank">
<?php echo esc_html($filename ?: wp_basename($effectiveUrl)); ?>
</a>
<?php if ($version->getAttachmentId()): ?>
<span class="dashicons dashicons-media-archive" title="<?php esc_attr_e('Uploaded file', 'wc-licensed-product'); ?>"></span>
<?php endif; ?>
</span>
<?php else: ?>
<em><?php esc_html_e('No download file', 'wc-licensed-product'); ?></em>
<?php endif; ?>
@@ -386,12 +388,14 @@ final class VersionAdminController
$filename = $version->getDownloadFilename();
if ($effectiveUrl):
?>
<span class="version-download-link">
<a href="<?php echo esc_url($effectiveUrl); ?>" target="_blank">
<?php echo esc_html($filename ?: wp_basename($effectiveUrl)); ?>
</a>
<?php if ($version->getAttachmentId()): ?>
<span class="dashicons dashicons-media-archive" title="<?php esc_attr_e('Uploaded file', 'wc-licensed-product'); ?>"></span>
<?php endif; ?>
</span>
<?php else: ?>
<em><?php esc_html_e('No download file', 'wc-licensed-product'); ?></em>
<?php endif; ?>