34 Commits

Author SHA1 Message Date
Mike Dalessio d611b2cc6c Move comment events when card moves to a new board (#2486)
When a card moves between boards, comment events were staying on the
old board. Now they move with the card.
2026-02-04 15:04:28 -05:00
Mike Dalessio cb61b36715 Allow boosts on cards (#2411)
* Add reactions association to Card model

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>

* Add reactions UI to card detail view

- 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>

* Add boost count to card preview

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>

* Consolidate reaction views for cards and comments

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>

* Fix emoji picker width in card reactions

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>

* Hide boost count where comment count is hidden

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>

* Fix reactions button overlap with zoom button in card footer

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>

* Tighten up previews

* Move card reactions from meta partial to container

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>

* WIP adjust perma page

* Position and style the footer

* Render the stamp in the card body instead of the footer

* Fix undefined local variable in public cards view

Changed `card` to `@card` when rendering the stamp partial.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Preload card reactions to avoid N+1 queries

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>

* Add model tests for card and comment reaction cleanup

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>

* Minor improvements to reactions code

- 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>

* Bump specificity of reaction popup in the card perma

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Andy Smith <andy@37signals.com>
2026-01-23 13:25:55 -05:00
Mike Dalessio 1aea6850f0 Extract Card::Commentable 2026-01-23 10:30:12 -05:00
Rosa Gutierrez ee636f1994 Delete orphaned watches and pins when a card is moved to a private board
For watchers and users with pins that don't have access to the private
board where the card was moved to.
2026-01-14 19:38:15 +01:00
Jorge Manrubia ee80b87c8c Add billing system with Stripe
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Jason Zimdars <jz@37signals.com>
2025-12-16 16:44:20 +01:00
Mike Dalessio 79c9ea2ce1 Remove a bunch of N+1s
related to notification and comment rendering
2025-11-27 11:08:45 -05:00
Mike Dalessio 4976e4a7bb Update Card::Entropic so its scopes work cross-accounts
with an eye towards making the postpone_all_due recurring job work efficiently.
2025-11-17 09:12:41 -05:00
Stanko K.R. 01367c097f Fix skipped tests 2025-11-17 09:12:41 -05:00
Kevin McConnell 59dd8ca549 Make IDs more time-sortable in tests
In order for model ordering to work as expected in tests, we need to
keep two properties:

- Fixtures are all created in the past
- Models sort in the order that they were created

This allows us to do things like this:

    post cards_path, params: { ... }
    created_card = Card.last

When using UUIDv7 PKs rather than sequential integers, we have to make
sure a couple of things happen in order for this still to be true:

- Fixtures should generate deterministic IDs that translate to UUIDs
  that would have been created in the past (i.e. before today)
- Newly created objects must have enough precision in their timestamps
  so that they sort in the order they were created, and their random
  component doesn't come into play.

To solve this, we use the deterministic numeric ID as a number of
milliseconds after an early year. And we ensure that the new timestamps
we create have sub-millisecond precision.
2025-11-17 09:12:40 -05:00
Kevin McConnell 1959e15f7e Fix more tests
These are mainly because the fixture's UUIDs are deterministic rather
than time-sortable, and more places where we need to correct the fixture
IDs as well.
2025-11-17 09:12:31 -05:00
Kevin McConnell c97ea9131f Fix some failing Tests
- Add explicit IDs to fixtures to avoid getting ints
- Remove ordering dependencies in assertions
2025-11-17 09:12:31 -05:00
Stanko K.R. 32d96db7d9 Replace card id with card number 2025-11-17 09:12:15 -05:00
Mike Dalessio 7bd697f75e test: Skip search tests, fix others, and skip a few hard ones 2025-11-17 09:11:42 -05:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Jorge Manrubia 42a8b52fa1 Don´t show draft banner if the card is not filled 2025-11-03 14:47:29 +01:00
Jorge Manrubia 2a79cb413e Remove cacheable concern, inline cache helper 2025-10-31 10:38:52 +01:00
Jorge Manrubia 4daeb2a33b Make sure we clear the column when moving cards to another collection
Or it will be become not accessible
2025-10-03 16:19:42 +02:00
Jorge Manrubia 1bb8de8564 Fix tests 2025-09-29 13:13:40 +02:00
Jorge Manrubia 3167126bda Rename test 2025-07-04 20:03:59 +02:00
Jorge Manrubia 919211244b Review the code to move cards
- Scope accessed records
- Keep consistency by moving events too
2025-07-04 19:56:48 +02:00
Jason Zimdars 5051e5d53d Linter: TrailingWhitespace 2025-05-29 23:27:28 -05:00
Jason Zimdars 922122538a Test granting access 2025-05-29 22:09:33 -05:00
Jorge Manrubia db1a9d8b45 Reapply "Set default "Untitled" title for published cards"
This reverts commit 448989bfa2.
2025-05-01 13:10:58 +02:00
Jorge Manrubia 448989bfa2 Revert "Set default "Untitled" title for published cards"
This reverts commit ca1e002806.
2025-05-01 13:10:36 +02:00
Jorge Manrubia ca1e002806 Set default "Untitled" title for published cards 2025-05-01 13:08:15 +02:00
Jorge Manrubia 2b98db9e66 Flatten out comments and messages
https://37s.fizzy.37signals.com/collections/693169850/cards/999008989#comment_994777841
2025-04-29 19:21:18 +02:00
Jorge Manrubia 18cc24e1d3 Add an event prefix named after the model now that events are generic 2025-04-24 13:20:09 +02:00
David Heinemeier Hansson 7a46fd0948 Stick with open/close as a consistent pair instead of active/close 2025-04-22 12:08:56 +02:00
David Heinemeier Hansson dc2205ee79 Cards have a not-null schema and collections destroy all cards on deletion
This shouldnt be necessary. Maybe remnant of some previous design?
2025-04-21 09:18:42 +02:00
David Heinemeier Hansson cacee0febb Remove anemic scope 2025-04-18 17:18:13 +02:00
David Heinemeier Hansson 6bbf68a4f9 The tenanted db is the account scope 2025-04-12 20:06:34 +02:00
David Heinemeier Hansson 760cbb6c99 Drop boosts
Killed by design.
2025-04-12 18:52:54 +02:00
David Heinemeier Hansson fb733b9a60 No more tracking commenting as an activity for sorting
We are doing away with all the automated activity scoring, but for now
lets just get rid of it for comments.
2025-04-12 10:50:25 +02:00
Jorge Manrubia 723e6d94f5 Rename bubbles => cards 2025-04-09 14:50:58 +02:00