Commit Graph
5 Commits
Author SHA1 Message Date
s0lrayandPaperclip c822ae1e3c 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 <noreply@paperclip.ing>
2026-03-26 23:57:48 -04:00
s0lrayandPaperclip b50c831d1e Add half-star and 0-star community ratings (THE-122)
Replace integer-only 1-5 stars with 0-5 scale in 0.5 increments.
Each star has left/right click zones for half/full values, plus a
dedicated 0-star button. Backend validation updated to accept the
new range. Half-filled stars rendered via CSS linear-gradient on
background-clip: text.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-26 23:01:21 -04:00
s0lrayandPaperclip 4b1510a8af Replace thumbs up/down voting with 5-star community rating (THE-122)
- HTML: Replace #panel-rating empty span with #star-rating (5 .star-btn
  buttons) + #rating-avg display row
- CSS: Replace .vote-btn/.vote-score styles with .star-btn/.filled/
  .user-rated and #rating-avg styles
- JS: Replace _renderVoteUI/castVote/updateScoreDisplay with
  _renderVoteUI/_castRating/_applyStarFill/_updateRatingDisplay;
  hover highlights 1-N stars, click submits/toggles rating 1-5,
  sessionStorage key changed from vote: to rating:
- Worker: handleVote now accepts { rating: 1-5|null } instead of
  { direction: "up"|"down"|null }; KV keys changed from votes:up/down
  to ratings:sum/count; handleStats returns ratings:{average,count}
  instead of votes:{up,down,score}

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-26 22:55:10 -04:00
s0lrayandPaperclip 7412c6ab19 Add Phase 3 community voting and issue reporting (THE-109, THE-110)
Backend (src/worker.js):
- Add POST /api/vote: upvote/downvote with toggle behavior, one vote per
  session per tool, returns net score
- Add POST /api/report: flag tools as dead_link/paywalled/incorrect_info;
  auto-creates GitHub issue via GitHub API when REPORT_THRESHOLD (3) unique
  reports of the same type are received (requires GITHUB_TOKEN secret)
- Update GET /api/tool-stats to include votes { up, down, score }
- Extract validateCommon() and isRateLimited() helpers to reduce duplication

Frontend (public/js/arf.js):
- Replace static rating placeholder with _renderVoteUI(): renders thumbs
  up/down buttons, reads cached vote from sessionStorage, fetches live score
  async from /api/tool-stats
- Add _castVote(): fires POST /api/vote, updates button active state and
  score display, persists user vote in sessionStorage
- Add _resetReportButtons() and _submitReport(): wire report buttons per
  panel open, POST /api/report, show inline feedback message

HTML (public/index.html):
- Replace static rating span with vote row (thumbs up, score, thumbs down)
- Replace static GitHub report link with three report buttons + feedback div

CSS (public/css/panel.css):
- Add .vote-btn, .vote-score (.positive/.negative/.zero) styles
- Add .report-btn, .panel-report-feedback styles
- Remove old #panel-report-link styles (replaced by button row)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-26 00:56:24 -04:00
s0lrayandPaperclip 9c5d4fa070 Add click tracking Worker and frontend sendBeacon integration (THE-106)
- src/worker.js: Cloudflare Worker entry point handling POST /api/track
  and GET /api/tool-stats, falling through to ASSETS for static files
- wrangler.jsonc: wire main entry point + CLICK_DATA KV binding
  (namespace: osint_framework_kv, id: cdb975e31e)
- public/js/arf.js: fire sendBeacon to /api/track on Open Tool click

Privacy: no IPs stored, no cookies, client-generated session_hash only.
Dedup: one counted click per session per tool (1-hour TTL).
Rate limit: 60 req/min per session_hash (2-min TTL key).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-25 23:20:04 -04:00