diff --git a/.gitignore b/.gitignore index 9ffd5ca..b48e78e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,7 @@ yarn-error.log* /dist/ # Composer -vendor/ + composer.lock # Environment files diff --git a/CHANGELOG.md b/CHANGELOG.md index 434ba5c..77afa56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,24 @@ To migrate from 1.x to 2.0.0: - All code examples updated to use new function and filter names - REST API namespace remains `redis-queue/v1` for API stability +### Post-release Adjustments (2.0.0) +These refinements were made after the initial 2.0.0 tag without changing the version number (non‑breaking / UI & internal only): + +#### Added +- Noscript warning block on the Test Jobs admin page to inform users when JavaScript is disabled. + +#### Changed +- Improved test job submission UX: enforce a short minimum "Processing…" state for better visual feedback. +- Replaced previous loading spinner with a subtle button fade animation (no color inversion, preserves native WP button styling). +- More resilient admin asset loading by switching from relative `../../assets/...` URLs to `plugins_url()` (avoids edge cases with path traversal or CDN rewriting). + +#### Fixed +- Admin JS not reliably loading in some environments due to relative path (`../../`) usage from within namespaced class directory. +- Intermittent perception that form submission did "nothing" because the processing state was too brief—now perceptible. + +#### Internal +- Minor housekeeping in admin UI scripts (added lightweight inline preload marker for debugging). + ## [1.2.0] - 2025-10-10 ### Removed - Dropped all legacy global class aliases (previous `class_alias` guards) now that backward compatibility is not required. diff --git a/assets/admin.css b/assets/admin.css index 79735d0..cfedae0 100644 --- a/assets/admin.css +++ b/assets/admin.css @@ -46,37 +46,26 @@ margin-top: 15px; } -.health-item { - display: flex; - justify-content: space-between; - align-items: center; - padding: 10px; - background: #f9f9f9; - border-radius: 4px; -} - -.health-item .label { - font-weight: 600; +/* Button loading state: subtle fade only (keep original colors) */ +.button-primary.loading, +.button.loading { + position: relative; + pointer-events: none; + animation: rq-fade 0.9s ease-in-out infinite; } -.health-item .value { - padding: 4px 8px; - border-radius: 3px; - font-size: 12px; - font-weight: 600; - text-transform: uppercase; -} +@keyframes rq-fade { + 0% { + opacity: 1; + } -.health-item .value.connected, -.health-item .value.ok { - background-color: #d4edda; - color: #155724; -} + 50% { + opacity: 0.45; + } -.health-item .value.disconnected, -.health-item .value.error { - background-color: #f8d7da; - color: #721c24; + 100% { + opacity: 1; + } } /* Stats Boxes */ @@ -258,35 +247,6 @@ display: block; } -/* Loading States */ -.loading { - opacity: 0.6; - pointer-events: none; -} - -.loading::after { - content: ''; - position: absolute; - top: 50%; - left: 50%; - width: 20px; - height: 20px; - margin: -10px 0 0 -10px; - border: 2px solid #f3f3f3; - border-top: 2px solid #3498db; - border-radius: 50%; - animation: spin 1s linear infinite; -} - -@keyframes spin { - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -} /* Responsive Design */ @media (max-width: 768px) { diff --git a/assets/admin.js b/assets/admin.js index 37d5650..d467d8b 100644 --- a/assets/admin.js +++ b/assets/admin.js @@ -475,6 +475,8 @@ var $form = $(this); var $submitButton = $form.find('button[type="submit"]'); var originalText = $submitButton.text(); + var startTime = Date.now(); + var MIN_PROCESSING_MS = 700; // ensure user perceives processing state // Prevent double submission if ($submitButton.prop('disabled')) { @@ -482,7 +484,9 @@ return; } - $submitButton.prop('disabled', true).text(redisQueueAdmin.strings.processing); + $submitButton.prop('disabled', true).addClass('loading').text(redisQueueAdmin.strings.processing); + // Immediate user feedback line + RedisQueueAdmin.showTestResult('Submitting job request...', 'info'); // Get form data var formData = {}; @@ -549,7 +553,15 @@ }, complete: function() { console.log('Job creation request completed'); - $submitButton.prop('disabled', false).text(originalText); + var elapsed = Date.now() - startTime; + var remaining = MIN_PROCESSING_MS - elapsed; + if (remaining > 0) { + setTimeout(function() { + $submitButton.prop('disabled', false).removeClass('loading').text(originalText); + }, remaining); + } else { + $submitButton.prop('disabled', false).removeClass('loading').text(originalText); + } } }); }, @@ -659,7 +671,7 @@ var $output = $('#test-output'); var timestamp = new Date().toLocaleTimeString(); - var resultClass = type === 'success' ? 'success' : 'error'; + var resultClass = (type === 'success') ? 'success' : (type === 'info' ? 'info' : 'error'); var resultHtml = '[' + timestamp + '] ' + message + '\n'; diff --git a/readme.txt b/readme.txt index 3f904d9..573a034 100644 --- a/readme.txt +++ b/readme.txt @@ -115,6 +115,13 @@ The plugin includes fallback mechanisms and graceful error handling. Jobs will f * Complete documentation update to reflect new naming * See CHANGELOG.md for detailed migration guide + * Post-release adjustments (still 2.0.0, non-breaking): + * Improved test job submission feedback: enforced brief minimum "Processing..." state so users perceive action. + * Reworked loading indicator: spinner removed; simple fade animation keeps original button colors. + * Fixed admin JS enqueue path (relative `../../` replaced with `plugins_url()` to avoid edge cases in some setups). + * Added a