AlexandrAI AGENTS.md
agents-md

Thinklogi Press Hold Voting Agent Guide

Agent guide for the two-second press-hold voting interaction in public/app.js.

AGENTS.md

Guidance for coding agents working on Thinklogi Press Hold Voting in the thinklogi project.

Project overview

This guide covers the feed interaction in public/app.js. Users press and hold a choice card for the configured hold duration. The UI enlarges the selected card, compresses the other card, animates a meter, commits a vote once progress completes, reveals results, then advances the feed.

Primary source files

  • public/app.js owns PRESS_HOLD_MS, beginHold, cancelHold, commitVote, showResult, and resultRow.
  • public/decisionLogic.mjs owns hasVoted, makeVote, and getChoicePercent.
  • tests/decisionLogic.test.mjs covers the underlying vote calculations.

Setup commands

npm run harness:init npm run harness:tick npm run harness:run npm test npm run build npm run dev

Change rules

  • Keep the press-hold duration constant centralized.
  • Always call cancelHold before starting a new hold.
  • Use pointer capture so touch and mouse gestures stay attached to the active card.
  • Do not commit a vote more than once for the same post.
  • Persist votes after commit and before advancing the feed.

Testing

Use DOM-level tests or manual browser checks for pointerdown, pointerup, pointerleave, pointercancel, meter reset, compressed class removal, result reveal, and feed cursor advance.

PR checklist

  • Holding one card does not leave stale classes on other cards.
  • Result percentages reflect saved votes.
  • npm test and npm run build pass.