fix(ui): unify HF file selection UI, remove cloud icon, add select-all, cleanup dead code (#965, #977)

- Unify single-URL and multi-URL HF repo flows to use the same batch
  preview interface (remove separate repoFileStep)
- Remove unnecessary cloud icon from HF batch preview items
- Use formatFileSize() instead of hardcoded MB text
- Change default selection to unchecked (no preselected files)
- Add select all / deselect all checkbox with dynamic Next button
- Clean up dead CSS, HTML template, and JS methods from removed
  repoFileStep
- Add selectAll i18n key with translations for all 10 locales
- Fix batch progress bar name fallback for HF items
This commit is contained in:
Will Miao
2026-06-30 23:28:35 +08:00
parent e8913f4481
commit 7cf785b72f
13 changed files with 130 additions and 172 deletions

View File

@@ -823,87 +823,6 @@
background: var(--lora-surface);
}
/* HF Repo File Explorer Step */
.hf-repo-header {
margin-bottom: var(--space-2);
font-size: 0.95em;
color: var(--text-color);
opacity: 0.8;
}
.repo-file-list {
max-height: 360px;
overflow-y: auto;
margin: var(--space-2) 0;
display: flex;
flex-direction: column;
gap: 6px;
}
.repo-file-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
cursor: pointer;
transition: var(--transition-base);
background: var(--bg-color);
}
.repo-file-item:hover {
border-color: var(--lora-accent);
box-shadow: var(--shadow-sm);
}
.repo-file-item.selected {
border: 2px solid var(--lora-accent);
background: oklch(var(--lora-accent) / 0.05);
}
.repo-file-item .repo-file-checkbox {
width: 18px;
height: 18px;
cursor: pointer;
accent-color: var(--lora-accent);
flex-shrink: 0;
padding: 0;
border: none;
}
.repo-file-icon {
font-size: 1.2em;
color: var(--text-color);
opacity: 0.6;
width: 24px;
text-align: center;
flex-shrink: 0;
}
.repo-file-name {
flex: 1;
font-weight: 500;
font-size: 0.95em;
word-break: keep-all;
overflow-wrap: anywhere;
min-width: 0;
}
.repo-file-meta {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.85em;
color: var(--text-color);
opacity: 0.6;
white-space: nowrap;
}
.repo-file-size {
font-variant-numeric: tabular-nums;
}
.hf-badge {
display: inline-block;
padding: 1px 6px;
@@ -915,9 +834,6 @@
margin-left: 4px;
}
[data-theme="dark"] .repo-file-item {
background: var(--lora-surface);
}
/* Checkbox inside HF batch preview items */
.batch-preview-checkbox {
@@ -929,4 +845,42 @@
padding: 0;
border: none;
margin: 0;
}
}
/* Select All toolbar in batch preview */
.batch-preview-select-all {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-bottom: 1px solid var(--border-color);
background: var(--lora-surface);
cursor: pointer;
position: sticky;
top: 0;
z-index: 1;
}
.batch-preview-select-all input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
accent-color: var(--lora-accent);
flex-shrink: 0;
padding: 0;
border: none;
margin: 0;
}
.batch-preview-select-all label {
cursor: pointer;
font-size: 0.9em;
color: var(--text-color);
font-weight: 500;
margin: 0;
user-select: none;
}
[data-theme="dark"] .batch-preview-select-all {
background: var(--lora-surface);
}