Skip to content

feat(shop): add suggestions#762

Merged
transcental merged 14 commits into
mainfrom
shop-suggestions
Jul 14, 2026
Merged

feat(shop): add suggestions#762
transcental merged 14 commits into
mainfrom
shop-suggestions

Conversation

@transcental

Copy link
Copy Markdown
Member

what's this do?

show it works

ai?

Copilot AI review requested due to automatic review settings July 2, 2026 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ShopSuggestion state machine + ledger charging/refunds, and a new ShopSuggestionVote model 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.

Comment thread app/controllers/admin/shop/suggestions_controller.rb
Comment thread app/controllers/admin/shop/suggestions_controller.rb
Comment thread app/views/shop/suggestions/index.html.erb Outdated
Comment thread app/models/shop_suggestion_vote.rb
Comment thread app/controllers/shop/suggestions_controller.rb Outdated
Comment thread app/controllers/shop/suggestions_controller.rb
Comment thread app/models/shop_suggestion.rb
Comment thread app/assets/stylesheets/pages/shop/_suggestions.scss
Comment thread app/models/shop_suggestion.rb
transcental and others added 2 commits July 2, 2026 13:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@transcental transcental marked this pull request as draft July 2, 2026 12:53
@transcental transcental marked this pull request as ready for review July 14, 2026 14:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@transcental transcental requested a review from Copilot July 14, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@transcental transcental added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 613e1f1 Jul 14, 2026
13 checks passed
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