Compare commits

..

2 Commits

Author SHA1 Message Date
xRangerDE
19555ce872 release: 4.6.131 .clip-modal-duration-value.invalid modifier
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 10:00:03 +02:00
xRangerDE
72029e0c94 cleanup: .clip-modal-duration-value.invalid modifier — 2 inline color assigns gone
updateClipDuration in renderer.ts was setting the duration-display element's color to one of two hardcoded hex values inline: #00c853 (green) when the selection was valid and #ff4444 (red) when end <= start. Both colors are already exposed in CSS as var(--success) and var(--error), and the base .clip-modal-duration-value rule was already setting #00c853 — so the green inline assignment was redundant.

Switched the base rule to use var(--success) for theme consistency, added a .clip-modal-duration-value.invalid modifier that flips to var(--error), and the renderer now toggles the .invalid class instead of poking at .style.color directly. Two inline style assignments + an if/else branch gone; the JS read more clearly as "set text + flip validity class".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 09:59:50 +02:00
4 changed files with 15 additions and 11 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "twitch-vod-manager",
"version": "4.6.130",
"version": "4.6.131",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "twitch-vod-manager",
"version": "4.6.130",
"version": "4.6.131",
"license": "MIT",
"dependencies": {
"axios": "^1.6.0",

View File

@ -1,6 +1,6 @@
{
"name": "twitch-vod-manager",
"version": "4.6.130",
"version": "4.6.131",
"description": "Twitch VOD Manager - Download Twitch VODs easily",
"main": "dist/main.js",
"author": "xRangerDE",

View File

@ -1288,13 +1288,11 @@ function updateClipDuration(): void {
const duration = endSec - startSec;
const durationDisplay = byId('clipDurationDisplay');
if (duration > 0) {
durationDisplay.textContent = formatSecondsToTime(duration);
durationDisplay.style.color = '#00c853';
} else {
durationDisplay.textContent = UI_TEXT.clips.invalidDuration;
durationDisplay.style.color = '#ff4444';
}
const isValid = duration > 0;
durationDisplay.classList.toggle('invalid', !isValid);
durationDisplay.textContent = isValid
? formatSecondsToTime(duration)
: UI_TEXT.clips.invalidDuration;
updateFilenameExamples();
}

View File

@ -318,12 +318,18 @@ body {
}
.clip-modal-duration-value {
color: #00c853;
color: var(--success);
font-weight: 600;
font-family: 'Consolas', 'Segoe UI Mono', monospace;
font-size: 14px;
}
/* updateClipDuration flips this class when end <= start so the value
reads as a clear "Ungueltig!" / error message in red. */
.clip-modal-duration-value.invalid {
color: var(--error);
}
.clip-modal-hint {
color: var(--text-secondary);
font-size: 12px;