Fix long model name display issues in modal and cards

- Add overflow-wrap: anywhere to modal title for proper wrapping of hyphenated names
- Add tooltip to model cards showing full filename on hover

Fixes overlap issues with long filenames like s0r4B35G_Zibv3_Prodigy_ID_Version2_Final_00800
This commit is contained in:
Will Miao
2026-02-23 08:53:33 +08:00
parent e08cae97f1
commit ec76ac649b
2 changed files with 2 additions and 1 deletions

View File

@@ -392,6 +392,7 @@
border: 1px solid transparent; border: 1px solid transparent;
outline: none; outline: none;
flex: 1; flex: 1;
overflow-wrap: anywhere; /* Allow wrapping at any character, including hyphens */
} }
.model-name-content:focus { .model-name-content:focus {

View File

@@ -633,7 +633,7 @@ export function createModelCard(model, modelType) {
` : ''} ` : ''}
<div class="card-footer"> <div class="card-footer">
<div class="model-info"> <div class="model-info">
<span class="model-name">${getDisplayName(model)}</span> <span class="model-name" title="${getDisplayName(model).replace(/"/g, '&quot;')}">${getDisplayName(model)}</span>
<div> <div>
${model.civitai?.name ? `<span class="version-name">${model.civitai.name}</span>` : ''} ${model.civitai?.name ? `<span class="version-name">${model.civitai.name}</span>` : ''}
${hasUsageCount ? `<span class="version-name" title="${translate('modelCard.usage.timesUsed', {}, 'Times used')}">${model.usage_count}×</span>` : ''} ${hasUsageCount ? `<span class="version-name" title="${translate('modelCard.usage.timesUsed', {}, 'Times used')}">${model.usage_count}×</span>` : ''}