-
Notifications
You must be signed in to change notification settings - Fork 908
Allow boosts on cards #2411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Allow boosts on cards #2411
Conversation
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
e708426 to
5311261
Compare
Member
Author
|
Ideally I'd like QA to kick this one around before we ship it. |
5311261 to
99bad11
Compare
99bad11 to
cb79413
Compare
Contributor
|
Nice, @flavorjones! I'm going to try moving reactions around a bit, as I think they're kinda getting in the way of the footer. Not sure I'll be able to do much better, but I'll take a swing. |
Adds `has_many :reactions` to Card, matching the implementation in Comment. This allows cards to be reacted to directly with emoji reactions. The association: - Orders reactions chronologically - Uses polymorphic `:reactable` interface - Deletes reactions when card is destroyed Includes test coverage for the new association. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create Cards::ReactionsController with turbo stream responses - Add card reactions views (reactions list, new form, menu partial) - Position reaction button flush-right when no reactions exist - Show reactions on bottom-left when present, with button inline - Handle narrow viewports by flowing button below meta section - Add controller tests for card reactions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Display reaction count alongside comment count on card tiles in board columns. Introduces a .card__counts wrapper to group both counts with proper positioning on all viewport sizes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract shared views to app/views/reactions/ using polymorphic routing. Both card and comment reactions now render the same partials, with a helper to compute the correct path prefix for nested routes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Override .card .popup { inline-size: 260px } for the reaction popup
so the emoji grid displays without horizontal scrollbar.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add .card__boosts alongside .card__comments in: - Tray view (display: none) - Cards with background images (opacity toggle on hover) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a card has a background image, the footer contains both a reactions button and a zoom button. Previously they would overlap because the reactions button was absolutely positioned to the bottom-right. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes two issues: 1. Reactions were duplicated each time a card was assigned because the turbo stream replaced the meta div with the full perma/meta partial, which included reactions outside the replaced element. 2. Draft cards incorrectly showed the boost button because the meta partial was shared between published and draft containers. Moving reactions to _container.html.erb (published cards only) fixes both issues and keeps the meta partial focused on meta content. Fixes https://app.fizzy.do/5986089/cards/3837 Fixes https://app.fizzy.do/5986089/cards/3835 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed `card` to `@card` when rendering the stamp partial. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Include reactions and their reacters in the preloaded scope, matching what we already do for comments. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test that: - Creating a card reaction touches the card's last_active_at - Reactions are deleted when their parent comment is destroyed - Reactions are deleted when their parent card is destroyed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use size instead of count in boosts partial to avoid extra SQL query on already-loaded collection - Add else clause to reaction_path_prefix_for to raise ArgumentError for unknown reactable types instead of silently returning nil Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
74e88a7 to
37914c1
Compare
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.
Note: this PR builds on #2416
Summary
Add "boost" reactions to cards, parallel to comment reactions. Users can now react to cards directly from the card
detail view, and boost counts appear on card previews in board columns.
Implementation
Polymorphic reactions: Migrated
Reactionfrombelongs_to :commenttobelongs_to :reactable, polymorphic: true. Migration backfills existing data and removescomment_idcolumn.Card reactions:
Cardgetshas_many :reactions, as: :reactableCards::ReactionsControllermirrors the existingCards::Comments::ReactionsControllerresources :reactionsnested undercardsConsolidated views: Extracted shared reaction views to
app/views/reactions/, eliminating duplication betweencard and comment reactions. Added
ReactionsHelper#reaction_path_prefix_forto handle nested route differenceswith polymorphic paths.
UI:
.card__countswrapperScreenshots
Perma shows the boost count:
Card detail before any boosts:
Card detail when adding a boost:
Card detail with boosts:
ref: https://app.fizzy.do/5986089/cards/1280