Two-way feedback threads between users and admins - #42
Draft
bastislack wants to merge 2 commits into
Draft
Conversation
* Add reusable local Supabase dev stack (#31) Use declarative schemas for future migrations * chore: Remove delete grant (#32) * fix: Mirror actual prod state of tricks in local db (#35) * feat: Port consistency slider from old Highline Freestyle app (#28) * feat: Port consistency slider from old Highline Freestyle app * fix: Make sure first and last label in consistency slider have enough padding from the edges of the screen * fix: Use declarative schema * chore: Add delete-trick grant (#34) * Allow users to provide feedback (#29) * feat (Draft): Allow users to provide feedback * feat: Allow users to provide feedback * Quick user switch in local-db mode * Add multiple attachments + download them * chore: Remove stale draft feedback SQL superseded by migration * fix: hide feedback icon when logged out (#36) * feat: Long press trick-card to change consistency (#37)
Feedback was write-only: a user sent a message and admins could mark it reviewed or dismissed, with no way to ask a follow-up question or explain anything back. Users couldn't even read their own submissions, since the only select policy on `feedback` was the admin one. Feedback is now a thread. The `feedback` row is the head; every message, including the user's first one, lives in `feedback_messages`. Status tracks who owes a response — `new` (waiting on an admin), `answered` (waiting on the user), `reviewed`/`dismissed` (terminal, read-only, attachments purged) — and moves through the `bump_feedback_thread` trigger rather than user UPDATE grants, so a user can't resolve their own thread. Users get a `/feedback/mine` list and thread view, reachable from the home app bar (now badged with an unread count) and from their profile. Admins reply inline on the existing admin screen, which now also shows who submitted the thread. Admin replies are text-only for now: the storage policies scope uploads to `<int_id>/`, so an admin-attached file would sit in a folder the user can't read. Widening that means repathing attachments per thread. Verified against a scratch database on the local Supabase cluster: all migrations apply in order, the backfill preserves existing feedback rows, status transitions behave, and the RLS boundaries hold (owner reads only their own threads, can't forge an author, can't reply once closed, can't change status; strangers see nothing; admins see and answer everything).
✅ Deploy Preview for lively-torte-533cc3 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
allow admins + users to communicate on given feedback. This helps when the feedback is actually a question that requires an answer.