feat(kb): one-vote rating UI (reflect + toggle the user's vote) #77

Merged
vas2000-work merged 2 commits from feat/kb-rating-toggle-client into main 2026-06-06 00:54:30 +02:00
Owner

Client half of the per-user rating change (server: PR #120). Makes the article thumbs reflect and toggle the signed-in user vote instead of blindly incrementing.

  • Adds my_vote: Option<String> to the client KbArticleFeedback model.
  • On load, seeds the thumbs from GET /kb/articles/{id}/vote (counts + the caller my_vote), via an unconditional use_resource (rules-of-hooks safe), into shared rating + my_vote signals so both OverflowActions-rendered copies stay in sync.
  • Clicking a thumb POSTs as before and updates counts + my_vote from the toggle response. The active thumb is highlighted (green up / red down, semibold); clicking the active one clears it, the other switches.

Depends on server PR #120 (toggle endpoints + GET /vote + my_vote). Needs a gate run.

Client half of the per-user rating change (server: PR #120). Makes the article thumbs reflect and toggle the signed-in user vote instead of blindly incrementing. - Adds `my_vote: Option<String>` to the client `KbArticleFeedback` model. - On load, seeds the thumbs from `GET /kb/articles/{id}/vote` (counts + the caller my_vote), via an unconditional use_resource (rules-of-hooks safe), into shared `rating` + `my_vote` signals so both OverflowActions-rendered copies stay in sync. - Clicking a thumb POSTs as before and updates counts + my_vote from the toggle response. The active thumb is highlighted (green up / red down, semibold); clicking the active one clears it, the other switches. Depends on server PR #120 (toggle endpoints + GET /vote + my_vote). Needs a gate run.
feat(kb): one-vote rating UI - reflect and toggle the user vote
Some checks failed
Check / clippy + fmt + tests (pull_request) Has been cancelled
52163c5e6d
Match the new per-user vote API: seed the thumbs state from GET /kb/articles/{id}/vote on load, highlight the user current vote, and update counts + my_vote from the toggle response on click. The active thumb is styled (green up / red down); clicking the active one clears it, the other switches. Shares one counts + my_vote signal across the two OverflowActions-rendered copies. Adds my_vote to the client feedback model.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge branch 'main' into feat/kb-rating-toggle-client
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 43s
cd48d84c19
vas2000-work deleted branch feat/kb-rating-toggle-client 2026-06-06 00:54:30 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!77
No description provided.