From f63563ce16458c9a6f78448847d0de594c1a9abe Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 16 Sep 2026 14:00:44 -0400 Subject: [PATCH] fix(frontend): star rating hover via StarInput, retire overlay slider The vendored overlay-slider Stars.svelte never responded under Svelte 5 - a runes port plus an explicit value/oninput rewrite both left it inert, which convicted the mechanism rather than its syntax. Replace it with StarInput.svelte: per-star hover zones with fractional math (preserves the full 0-10 granularity), snapshot-and-revert on mouseleave, commit on click, arrow-key nudging, disabled mode. It reuses the Star SVG leaf so output is pixel-identical, stays dumb (value in/out, no stores) for the planned inline-grid editing, and Rating.svelte keeps owning the words/score math locally. Legacy on:change forwarding and the slider CSS go with the old file. --- frontend/src/helperComponents/Rating.svelte | 37 +----- frontend/src/star-rating/StarInput.svelte | 134 ++++++++++++++++++++ frontend/src/star-rating/Stars.svelte | 63 --------- 3 files changed, 140 insertions(+), 94 deletions(-) create mode 100644 frontend/src/star-rating/StarInput.svelte delete mode 100644 frontend/src/star-rating/Stars.svelte diff --git a/frontend/src/helperComponents/Rating.svelte b/frontend/src/helperComponents/Rating.svelte index 26f89fd..64cc1ea 100644 --- a/frontend/src/helperComponents/Rating.svelte +++ b/frontend/src/helperComponents/Rating.svelte @@ -1,30 +1,9 @@
- -

Rating: {config.score * 2}

-

{ratingInWords[config.score * 2]}

+ +

Rating: {score}

+

{ratingInWords[score]}

diff --git a/frontend/src/star-rating/StarInput.svelte b/frontend/src/star-rating/StarInput.svelte new file mode 100644 index 0000000..95afa20 --- /dev/null +++ b/frontend/src/star-rating/StarInput.svelte @@ -0,0 +1,134 @@ + + + +
+
+ {#each Array(count) as _, i} + + {/each} +
+
+ + diff --git a/frontend/src/star-rating/Stars.svelte b/frontend/src/star-rating/Stars.svelte deleted file mode 100644 index 1f68b3d..0000000 --- a/frontend/src/star-rating/Stars.svelte +++ /dev/null @@ -1,63 +0,0 @@ - - - - -
-
-
- {#each Array(config.countStars) as star, id} - {#if Math.floor(config.score) === id} - - {:else if Math.floor(config.score) > id} - - {:else} - - {/if} - {/each} -
- -
- {#if config.showScore} - - {#if config.scoreFormat} - {config.scoreFormat()} - {:else} - ({((config.score/config.countStars)*100).toFixed(2)}%) - {/if} - - {/if} -
- - \ No newline at end of file