Skip to content

feat(ratings): proxy the "didn't use it" feedback endpoints [Rating page for assets (My Downloads)] - #49

Merged
Tweekazoid merged 4 commits into
mainfrom
claude/didnt-use
Sep 1, 2026
Merged

feat(ratings): proxy the "didn't use it" feedback endpoints [Rating page for assets (My Downloads)]#49
Tweekazoid merged 4 commits into
mainfrom
claude/didnt-use

Conversation

@PetrDlouhy

Copy link
Copy Markdown
Contributor

What

Local proxy endpoints for the add-on's new "Didn't use it" feedback control, backed by the server API shipped in Blendkit-server#3674:

  • POST /ratings/get_not_used_reasonsGET /api/v1/enums/not-used-reasons/ — the shared, admin-managed reason choices.
  • POST /ratings/get_didnt_useGET /api/v1/assets/{id}/didnt-use — the user's flag state for one asset.
  • POST /ratings/send_didnt_usePUT/DELETE on the same — set the flag (optional reason_id; optional replace_rating, which deletes the user's quality/working-hours ratings after the UI warned that the pick replaces them) or clear it.

All three follow the existing SendRating task pattern (task channel, getHeaders, ParseFailedHTTPResponse). The send error path parses the response body and forwards the server's detail sentence instead of the raw JSON — the add-on renders it inline under the control.

apispec entries added; docs/API.md + docs/openapi.json regenerated via go generate ./....

Testing

go build, go vet, go test ./... green; exercised end-to-end against devel through the add-on branch (BlenderKit/blenderkit claude/didnt-use) — flag set/change/undo, replace-rating flow, and the 403/409 error sentences.

🤖 Generated with Claude Code

Three new local endpoints backing the add-on's "Didn't use it" control
(server API: enums/not-used-reasons + assets/{id}/didnt-use):

- POST /ratings/get_not_used_reasons - the shared reason choices
- POST /ratings/get_didnt_use - the user's flag state for one asset
- POST /ratings/send_didnt_use - set (optional reason, optional
  replace_rating which deletes the user's score ratings after the UI
  warned about the swap) or clear the flag

Error responses hand the add-on the server's detail sentence instead of
the raw JSON body - the add-on shows it inline under the control.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PetrDlouhy PetrDlouhy self-assigned this Sep 1, 2026
@Tweekazoid

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

@Tweekazoid
Tweekazoid merged commit e01a2d3 into main Sep 1, 2026
@Tweekazoid
Tweekazoid deleted the claude/didnt-use branch September 1, 2026 21:43
Tweekazoid added a commit to BlenderKit/Blendkit that referenced this pull request Sep 1, 2026
… for assets (My Downloads)] (#2292)

* feat(ratings): "Didn't use it" feedback in the rating UI

The My downloads page's "I didn't use this asset" flag, now also in the
add-on - a dropdown at the bottom of every ratings UI (fast-rate popup,
sidebar panel, asset detail):

- One menu for every state: pick a reason to flag (choices are the
  server's shared admin-managed set, fetched once per session), the
  current reason wears a checkmark, undo lives at the bottom.
- Rating and flag are mutually exclusive (server-enforced). A rated
  asset's menu warns "This replaces your rating"; the pick then deletes
  the scores server-side (replace_rating) and the cleared numbers are
  remembered session-locally - the hint over the disabled rating rows
  names them and "Undo - restore my rating" re-rates, which also drops
  the flag server-side. Rating a flagged asset clears the flag, locally
  mirrored.
- Server refusals (undownloaded asset, conflicts) land as red text
  inline under the control - the corner report overlay is out of the
  popup's sight. The server's detail sentence is extracted even from a
  Client that passes the raw JSON body through.
- handle_get_rating_task now skips unknown rating types (historic
  competition/nodevember votes) instead of crashing the task timer.

bk_client submodule bumped to the endpoints' commit
(BlenderKit/bk_client#49).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(ratings): update "Didn't use it" text to "I didn't use this asset" for clarity

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Tweekazoid <miki.hons@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants