From 180ae12f4dee35fd062b344dd2c46fa968536e85 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 4 Jun 2025 06:52:04 -0700 Subject: [PATCH 1/2] feat(web): add sort and star hover functionality --- web/admin.html | 101 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 4 deletions(-) diff --git a/web/admin.html b/web/admin.html index 55c576a..c62a577 100644 --- a/web/admin.html +++ b/web/admin.html @@ -120,7 +120,7 @@
-
+
+
+ + +
`; + const starIcon = isActive ? '⭐' : '☆'; // filled star vs outline star + const color = isActive ? '#fbbf24' : '#9ca3af'; // yellow-400 : gray-400 + return ``; }).join(""); } + addStarHoverBehavior(promptId) { + const starButtons = document.querySelectorAll(`[data-prompt-id="${promptId}"].star-btn`); + const ratingElement = document.querySelector(`[data-id="${promptId}"][data-rating]`); + const currentRating = parseInt(ratingElement?.dataset.rating || 0); + + starButtons.forEach((starBtn, index) => { + const starNum = index + 1; + + starBtn.addEventListener('mouseenter', () => { + // Light up all stars up to this one on hover + starButtons.forEach((btn, i) => { + if (i < starNum) { + btn.textContent = '⭐'; + btn.style.color = '#fcd34d'; // bright yellow on hover + } else { + btn.textContent = '☆'; + btn.style.color = '#9ca3af'; // gray + } + }); + }); + + starBtn.addEventListener('mouseleave', () => { + // Reset to current rating + starButtons.forEach((btn, i) => { + if (i < currentRating) { + btn.textContent = '⭐'; + btn.style.color = '#fbbf24'; // yellow + } else { + btn.textContent = '☆'; + btn.style.color = '#9ca3af'; // gray + } + }); + }); + }); + } + escapeHtml(text) { const div = document.createElement("div"); div.textContent = text; @@ -1376,6 +1467,8 @@ if (ratingElement) { ratingElement.dataset.rating = rating; ratingElement.innerHTML = this.renderStars(rating, promptId); + // Add hover behavior to new stars + this.addStarHoverBehavior(promptId); } try { From b7649754bd6309c33a249975c887893aa51486f6 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 4 Jun 2025 06:53:19 -0700 Subject: [PATCH 2/2] chore: bump version to 3.0.3 in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a2fe09a..57ea585 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "promptmanager" description = "A powerful ComfyUI custom node that extends the standard text encoder with persistent prompt storage, advanced search capabilities, and an automatic image gallery system using SQLite." -version = "3.0.2" +version = "3.0.3" license = {file = "LICENSE"} dependencies = ["# Core dependencies for PromptManager", "# Note: Most dependencies are already included with ComfyUI", "# Already included with Python standard library:", "# - sqlite3", "# - hashlib", "# - json", "# - datetime", "# - os", "# - typing", "# - threading", "# - uuid", "# Required for gallery functionality:", "watchdog>=2.1.0 # For file system monitoring", "Pillow>=8.0.0 # For image metadata extraction (usually included with ComfyUI)", "# Optional dependencies for enhanced search functionality:", "# fuzzywuzzy[speedup]>=0.18.0 # For fuzzy string matching (optional)", "# sqlalchemy>=1.4.0 # For advanced ORM features (optional)", "# Development dependencies (optional):", "# pytest>=6.0.0 # For running tests", "# black>=22.0.0 # For code formatting", "# flake8>=4.0.0 # For linting", "# mypy>=0.910 # For type checking"]