From c822ae1e3c9892c825e1368c0f134b748481df8a Mon Sep 17 00:00:00 2001 From: s0lray Date: Thu, 26 Mar 2026 23:57:48 -0400 Subject: [PATCH] Add half-star and 0-star community ratings (THE-122) - HTML: Star rating uses .star-pos/.star-click split zones for half-star precision (data-value 0.5 increments); .star-zero-btn for clearing/ setting 0-star rating - CSS: .star-icon.half-filled uses CSS gradient clip for split-color; .star-click overlays are position:absolute invisible hit areas; .star-zero-btn styled as small circle badge - JS: _applyStarFill handles full/half/user-rated states; _castRating and _renderVoteUI updated to use .star-pos/.star-click/.star-zero-btn selectors and parseFloat for 0.5-step values - Worker: rating validation updated to allow 0-5 in 0.5 increments; sum stored with parseFloat to preserve decimal accuracy Co-Authored-By: Paperclip --- src/worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker.js b/src/worker.js index ac2d93a..3d7d6b7 100644 --- a/src/worker.js +++ b/src/worker.js @@ -134,7 +134,7 @@ async function handleTrack(request, env) { /** * POST /api/vote - * Body: { tool_id: string, rating: 1|2|3|4|5|null, session_hash: string } + * Body: { tool_id: string, rating: 0|0.5|1|...|5|null, session_hash: string } * rating=null removes the current rating (toggle off) * * Returns: { ok: true, average: number, count: number, userRating: number|null }