0.10.2-15 Minor Frotnend callibarations

This commit is contained in:
2026-03-17 08:07:15 +00:00
parent ea096cb33c
commit bcd85ce1de
8 changed files with 26 additions and 14 deletions
@@ -51,8 +51,12 @@ function formatChapterTime(secondsValue) {
return `${minutes}:${String(seconds).padStart(2, '0')}`;
}
function stripHtml(value) {
return String(value || '').replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim();
}
function truncateDescription(value, maxLength = 220) {
const normalized = String(value || '').replace(/\s+/g, ' ').trim();
const normalized = stripHtml(value);
if (!normalized || normalized.length <= maxLength) {
return normalized;
}
@@ -168,6 +172,7 @@ export default function AudiobookConfigPanel({
const statusLabel = getStatusLabel(state);
const statusSeverity = getStatusSeverity(state);
const description = String(metadata?.description || '').trim();
const descriptionStripped = stripHtml(description);
const descriptionPreview = truncateDescription(description);
const posterUrl = String(metadata?.poster || '').trim() || null;
@@ -196,7 +201,7 @@ export default function AudiobookConfigPanel({
<div className="audiobook-description-preview">
<strong>Beschreibung:</strong>
<span>{descriptionPreview}</span>
{description.length > descriptionPreview.length ? (
{descriptionStripped.length > descriptionPreview.length ? (
<Button
type="button"
label="Vollständig anzeigen"
@@ -378,9 +383,11 @@ export default function AudiobookConfigPanel({
style={{ width: 'min(48rem, 92vw)' }}
onHide={() => setDescriptionDialogVisible(false)}
>
<div className="audiobook-description-dialog">
<p>{description || 'Keine Beschreibung vorhanden.'}</p>
</div>
<div
className="audiobook-description-dialog"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: description || '<p>Keine Beschreibung vorhanden.</p>' }}
/>
</Dialog>
</div>
);
+5
View File
@@ -1237,6 +1237,9 @@ body {
border-color: #d9b26d;
background: #fff7e8;
}
.p-fileupload.p-fileupload-content {
padding: 0;
}
.audiobook-upload-status.tone-info {
border-color: #c7b086;
@@ -1353,6 +1356,8 @@ body {
.dashboard-job-expanded-title {
display: grid;
gap: 0.35rem;
flex: 1;
min-width: 0;
}
.playlist-waiting-box {