From ea07ccfa8f74e814c424f6e46cd1477d193242ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 19:45:56 +0000 Subject: [PATCH 1/2] Bump @hotwired/turbo in the npm_and_yarn group across 1 directory Bumps the npm_and_yarn group with 1 update in the / directory: [@hotwired/turbo](https://github.com/hotwired/turbo). Updates `@hotwired/turbo` from 8.0.10 to 8.0.21 - [Release notes](https://github.com/hotwired/turbo/releases) - [Commits](https://github.com/hotwired/turbo/compare/v8.0.10...v8.0.21) --- updated-dependencies: - dependency-name: "@hotwired/turbo" dependency-version: 8.0.21 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 35d5af1..b70326f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1044,9 +1044,9 @@ "@rails/actioncable" "^7.0" "@hotwired/turbo@^8.0.6": - version "8.0.10" - resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-8.0.10.tgz#d95569d259f0daad6e824ee1ada877ff94beb72b" - integrity sha512-xen1YhNQirAHlA8vr/444XsTNITC1Il2l/Vx4w8hAWPpI5nQO78mVHNsmFuayETodzPwh25ob2TgfCEV/Loiog== + version "8.0.21" + resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-8.0.21.tgz#a3e80c01d70048200f64bbe3582b84f9bfac034e" + integrity sha512-fJTv3JnzFHeDxBb23esZSOhT4r142xf5o3lKMFMvzPC6AllkqbBKk5Yb31UZhtIsKQCwmO/pUQrtTUlYl5CHAQ== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" From 19e6a4456759fe687d07a41b9c868cf271b29ad6 Mon Sep 17 00:00:00 2001 From: rsmokeUM Date: Mon, 9 Feb 2026 18:22:03 -0500 Subject: [PATCH 2/2] Enhance EntryDragController with success overlay functionality - Added a new method `showSuccessOverlay` to display a success state on the loading overlay after ranking updates. - Updated the loading overlay styles to reflect the success state with appropriate text and icon. - Introduced a test case for `showSuccessOverlay` to ensure correct behavior and UI updates. These changes improve user feedback during ranking updates, enhancing the overall user experience. --- .../controllers/entry_drag_controller.js | 43 +++++++++++++++++-- .../controllers/entry_drag_controller.spec.js | 26 +++++++++++ 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/app/javascript/controllers/entry_drag_controller.js b/app/javascript/controllers/entry_drag_controller.js index 7251a93..40daaca 100644 --- a/app/javascript/controllers/entry_drag_controller.js +++ b/app/javascript/controllers/entry_drag_controller.js @@ -62,6 +62,15 @@ export default class extends Controller { font-weight: 500; } + .entry-loading-overlay.success { + background: rgba(220, 255, 220, 0.95); + } + + .entry-loading-overlay .success-text { + color: #198754; + font-weight: 500; + } + @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } @@ -279,11 +288,13 @@ export default class extends Controller { throw new Error(data.error || 'Failed to update rankings') } - // Remove loading overlay before refresh - this.removeLoadingOverlay(event.item) + // Show success state so judges see "Ranking recorded" before refresh + this.showSuccessOverlay(event.item) - // Refresh both sections using Turbo - Turbo.visit(window.location.href, { action: "replace" }) + setTimeout(() => { + this.removeLoadingOverlay(event.item) + Turbo.visit(window.location.href, { action: "replace" }) + }, 2500) } catch (error) { console.error('Error updating rankings:', error) // If there's an error, revert the UI update and show error in overlay @@ -474,11 +485,35 @@ export default class extends Controller {
Still working... +
+ Please wait for "Ranking recorded" before closing or navigating away. ` } }, 5000) // Show warning after 5 seconds } + // Helper method to show success state on the overlay before removing it + showSuccessOverlay(element) { + if (!element) return + + const overlay = element.querySelector('.entry-loading-overlay') + if (!overlay) return + + if (this.slowConnectionTimeout) { + clearTimeout(this.slowConnectionTimeout) + this.slowConnectionTimeout = null + } + + overlay.classList.add('success') + const spinnerContainer = overlay.querySelector('.spinner-container') + if (spinnerContainer) { + spinnerContainer.innerHTML = ` + +
Ranking recorded
+ ` + } + } + // Helper method to remove loading overlay removeLoadingOverlay(element, error = false) { if (!element) return diff --git a/spec/javascript/controllers/entry_drag_controller.spec.js b/spec/javascript/controllers/entry_drag_controller.spec.js index 30c54a4..fefb633 100644 --- a/spec/javascript/controllers/entry_drag_controller.spec.js +++ b/spec/javascript/controllers/entry_drag_controller.spec.js @@ -128,6 +128,32 @@ describe("EntryDragController", () => { }) }) + describe("showSuccessOverlay", () => { + it("replaces overlay content with success state and 'Ranking recorded' text", () => { + const card = document.createElement('div') + card.setAttribute('data-entry-id', '42') + card.style.position = 'relative' + card.innerHTML = ` +
+
+
+
Updating...
+
+
+ ` + document.body.appendChild(card) + + controller.showSuccessOverlay(card) + + const overlay = card.querySelector('.entry-loading-overlay') + expect(overlay.classList.contains('success')).toBe(true) + expect(overlay.textContent).toMatch(/Ranking recorded/) + expect(overlay.querySelector('.bi-check-circle-fill')).not.toBeNull() + + document.body.removeChild(card) + }) + }) + describe("UI updates", () => { it("updates counter and rank badges correctly", () => { // Add one entry to rated entries