feat(shop): add suggestions#762
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new public-facing “Shop Suggestions” feature to the Rails shop, allowing signed-in users to submit suggestions (with an up-front Stardust fee) and vote on pending suggestions (also costing Stardust), plus admin moderation actions to accept/reject/delete suggestions.
Changes:
- Introduces
ShopSuggestionstate machine + ledger charging/refunds, and a newShopSuggestionVotemodel that charges per vote with daily limits. - Adds new shop UI (index page, card layout, suggestion modal with image upload) and Stimulus controllers for confirm + image dropzone.
- Adds routes/controllers/policies for suggestion listing/creation, voting, and admin moderation actions.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| test/models/user/preference_test.rb | Updates schema comment to reflect current default for streak Slack status preference. |
| test/models/user_test.rb | Updates schema comment formatting / schema header content. |
| test/models/post/ship_event_test.rb | Updates schema comment to reflect removed counters. |
| test/models/lookout_session_test.rb | Updates schema comment to include devlog_id and its FK/index. |
| test/fixtures/users.yml | Updates schema comment formatting / schema header content. |
| test/fixtures/user/preferences.yml | Updates schema comment to reflect current default for streak Slack status preference. |
| test/fixtures/post/ship_events.yml | Updates schema comment to reflect removed counters. |
| db/schema.rb | Applies schema changes for shop suggestions/votes and other recent DB changes. |
| db/migrate/20260702113808_add_discarded_at_to_shop_suggestions.rb | Adds soft-delete timestamp (discarded_at) to shop suggestions. |
| db/migrate/20260618020800_create_shop_suggestion_votes.rb | Creates shop_suggestion_votes table with user + suggestion references. |
| db/migrate/20260618020755_alter_shop_suggestions_for_public_feature.rb | Renames suggestion columns and adds voting/state-related columns + index. |
| config/routes.rb | Adds public suggestions index + nested vote create; replaces old admin suggestion routes with accept/reject/delete actions. |
| app/views/shop/suggestions/index.html.erb | New public suggestions page (header, cost pills, sections, modal trigger). |
| app/views/shop/suggestions/_suggest_modal.html.erb | New modal form for submitting suggestions, including image dropzone. |
| app/views/shop/suggestions/_card.html.erb | New suggestion card UI with vote button and admin action strip. |
| app/policies/shop_suggestion_vote_policy.rb | New Pundit policy for voting. |
| app/policies/shop_suggestion_policy.rb | Adds index? authorization for public suggestions index. |
| app/policies/admin/shop_suggestion_policy.rb | Replaces admin policy methods with action-specific rules (accept/reject/delete). |
| app/models/user/preference.rb | Updates schema comment for preference default. |
| app/models/user.rb | Updates schema comment formatting / schema header content. |
| app/models/shop_suggestion.rb | Adds AASM states, ledger charging/refund hooks, validations, soft-delete helpers, and associations. |
| app/models/shop_suggestion_vote.rb | New model enforcing vote rules + charging Stardust via ledger entry. |
| app/models/post/ship_event.rb | Updates schema comment to reflect removed counters. |
| app/models/mission/step_body.rb | Updates schema comment for functional index on language. |
| app/models/mission/guide_variant.rb | Updates schema comment for functional index on language. |
| app/models/lookout_session.rb | Updates schema comment to include devlog_id and its FK/index. |
| app/javascript/controllers/index.js | Registers new Stimulus controllers (confirm, image-dropzone) and reorders some registrations. |
| app/javascript/controllers/image_dropzone_controller.js | New Stimulus controller for drag/drop image selection + preview. |
| app/javascript/controllers/confirm_controller.js | New Stimulus controller to confirm destructive actions. |
| app/controllers/shop/suggestions_controller.rb | Adds suggestions index action and updates create to render index on validation errors. |
| app/controllers/shop/suggestion_votes_controller.rb | Adds vote creation endpoint with authorization + redirects. |
| app/controllers/admin/shop/suggestions_controller.rb | Adds admin accept/reject/delete endpoints for suggestions. |
| app/assets/stylesheets/pages/shop/_suggestions.scss | Adds full styling for suggestions page, cards, and modal. |
| app/assets/stylesheets/application.scss | Includes the new suggestions stylesheet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
what's this do?
show it works
ai?