Commit Graph

6215 Commits

Author SHA1 Message Date
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
Rosa Gutierrez ffb2a0b82a Revert "Fix notification click URL by using correct data property"
This reverts commit 4f2308d380.

This was from another branch, shoudln't have been included here.
2026-01-23 19:25:23 +01:00
Mike Dalessio 0d138df952 Guard search indexing with searchable? check
Only index cards and comments if their card is `published?`, using a
new method `searchable?` that is implemented on both Card and Comment.
This prevents draft cards and their comments from being indexed.

When drafts are published, the existing `update_in_search_index`
callback creates the record via `upsert!`, or else ensures unpublished
records are removed from the index.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:13:08 -05:00
Mike Dalessio f6211dbacc Merge pull request #2423 from basecamp/forbid-comments-on-draft-cards
Forbid comments on draft cards
2026-01-23 11:40:46 -05:00
Mike Dalessio 9aa15e9fb2 Forbid comments on draft cards
- Add Card#commentable? method that returns true only for published cards.
- CardsController#create ensures that the card is commentable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 11:28:26 -05:00
Rosa Gutierrez 4f2308d380 Fix notification click URL by using correct data property
The web push payload sends the URL in data.url but the service
worker was looking for data.path, resulting in undefined URLs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:38:45 +01:00
Rosa Gutierrez 26d5701217 Wait for service worker to be active before subscribing
The push subscription requires an active service worker. When
registering a new service worker, we now wait for it to become
active using navigator.serviceWorker.ready before attempting
to subscribe to push notifications.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:38:45 +01:00
Rosa Gutierrez c650cba179 Fix stuck state when permission granted but no subscription
When you had already granted notification permission but hadn't
completed the subscription flow (no service worker or no push
subscription), the UI showed neither the subscribe button nor the
enabled state, leaving you stuck with no way to subscribe, and wrong
instructions to fix it.

Instead, let's just show the button to allow you to subscribe.
2026-01-23 16:38:45 +01:00
Mike Dalessio 1aea6850f0 Extract Card::Commentable 2026-01-23 10:30:12 -05:00
Kevin McConnell d7c9c4f3b0 Remove unnecessary await in push handler
We were `await`ing a synchronous method here, which will have the effect
of deferring its execution, and thus also the `event.waitUntil` call. We
want the latter to happen before control returns from the event.
Removing the unnecessary `await` solves this.

This seems unlikely to be a problem in practice, but all the same, it's
not right :)
2026-01-23 12:12:22 +00:00
Mike Dalessio ffab4cad6f Update models, views, and fixtures for polymorphic reactions
- Reaction: belongs_to :reactable (polymorphic) instead of :comment
- Comment: has_many :reactions with as: :reactable
- Views: use reaction.reactable instead of reaction.comment
- Fixtures: use polymorphic syntax for reactable association

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 12:29:54 -05:00
Andy Smith f9f638a9a7 Return to Board page when clearing filters 2026-01-21 15:05:47 -06:00
Andy Smith 6c8d333bc9 Bump card perma z-index when dialog is open 2026-01-21 14:35:30 -06:00
Andy Smith eccef3b19c Only submit on blur if the input has a value 2026-01-21 14:33:19 -06:00
Andy Smith 9b1dd0bcd9 Merge pull request #2401 from nqst/modal-scroll-block
Prevent page scrolling when modal dialog is open
2026-01-21 14:02:20 -06:00
Andy Smith 72123dc251 Merge pull request #2404 from nqst/dialog-viewport-spacing
Prevent modal dialogs from touching viewport edges
2026-01-21 11:23:01 -06:00
Kevin McConnell 468fe5f16b Only index up to 32KB of search content
To prevent overflowing the columns in the search index tables (and also
just to avoid creating massive indexes), let's limit the searchable
content to the first 32KB.
2026-01-21 09:52:23 +00:00
Alexander Zaytsev 73cf1dede4 Use inline spacing variable 2026-01-20 20:51:01 +01:00
Alexander Zaytsev bfea02ebd0 Actually make it affect larger screens too
And remove a magic number
2026-01-20 10:54:39 +01:00
Alexander Zaytsev aba88cdc3f Use CSS variable for panel size in delete dialogs 2026-01-20 10:40:29 +01:00
Alexander Zaytsev aea90f4b50 Add viewport padding to dialogs on mobile 2026-01-20 10:40:04 +01:00
Alexander Zaytsev 772b378668 Merge branch 'main' into modal-scroll-block 2026-01-19 22:19:51 +01:00
Alexander Zaytsev fa4e77f35e Prevent page scrolling when modal dialog is open 2026-01-19 20:46:49 +01:00
Jay Ohms cc4e19bb20 Remove reference to removed controller 2026-01-19 12:47:11 -05:00
Jay Ohms a9b873f151 Merge branch 'main' into mobile/bridge-components
* main:
  Create popup initial alignment classes
  Fix class typo
  Hide the board selector button if card is closed
  Align board and tag picker dialogs without using math
  Add dialog manager to card perma
  Fix "M" hotkey using stale user from fragment cache
  Add Enable all/Disable all buttons to webhook event selection
  Remove whitespace
  Remove hover styles from disabled menu items

# Conflicts:
#	app/views/cards/_container.html.erb
2026-01-19 12:02:42 -05:00
Adrien Maston e9ebf8e9a5 Fix bad formatting on bridge page title attr 2026-01-19 17:42:05 +01:00
Jay Ohms b5985efdd1 Use private functions for bridge components 2026-01-19 10:05:48 -05:00
Adrien Maston e87dc10761 Setup focus handling on touch target's connect callback
... to support lazy loaded dialog content
2026-01-19 15:34:23 +01:00
Adrien Maston 511396144a Setup proper focus handling for mobile on the card perma's board picker 2026-01-19 15:33:12 +01:00
Adrien Maston 44732a345b Move dialog focus handling into the dialog controller
... instead of a separate dialog focus controller
2026-01-19 11:42:43 +01:00
Andy Smith 036768fede Create popup initial alignment classes 2026-01-16 14:30:47 -06:00
Andy Smith ac481d34ff Merge pull request #2366 from nqst/popup-disabled-buttons-no-pointer-events
Popups: remove hover styles from disabled menu items
2026-01-16 14:19:57 -06:00
Andy Smith df8f88f773 Fix class typo 2026-01-16 14:12:19 -06:00
Andy Smith 6a7ca930cf Hide the board selector button if card is closed 2026-01-16 14:07:00 -06:00
Andy Smith 19ce79965b Align board and tag picker dialogs without using math 2026-01-16 14:00:04 -06:00
Andy Smith e5eb1080f6 Add dialog manager to card perma 2026-01-16 13:24:23 -06:00
Andy Smith 6b7f9b0bac Merge pull request #2377 from robzolkos/webhook-select-all
Add Enable all/Disable all buttons to webhook event selection
2026-01-16 13:01:21 -06:00
Mike Dalessio 6b8a571fd3 Merge pull request #2383 from basecamp/flavorjones/3722-self-assign
Fix "M" hotkey to not use stale user ID from the fragment cache
2026-01-16 13:47:18 -05:00
Mike Dalessio 2527f07365 Fix "M" hotkey using stale user from fragment cache
Add a SelfAssignmentsController to resolve the current user at request
time, avoiding the use of an incorrect user id baked into a cached URL.

ref: #2211 originally added the "M" hotkey
ref: https://app.fizzy.do/5986089/cards/3722
2026-01-16 13:41:33 -05:00
Jay Ohms 600ee87d51 Merge branch 'main' into mobile/bridge-components
* main:
  Solve problem when Action Text raises on missing attachables
  Solve problem when Action Text raises on missing attachables
  Completing a step removes stalled status from UI
  Bump Bootsnap to v1.21.1
  Use correct class selectors to target cards with  background images
  Update lexxy to latest
  Hide table button for now
  Table CSS tweaks
  Update to Lexxy 0.7.0beta
  Revert "Wrap tables in div"
  Wrap tables in div
  CSS updates for `<table>` support
  Update to latest Lexxy
  Show only active subscriptions
  Add paid accounts stats to admin dashboard
  Keep URLs in webhook events absolute
  Delete orphaned watches and pins when a card is moved to a private board
2026-01-16 12:44:55 -05:00
Jorge Manrubia 99a8d12c9d Merge pull request #2382 from basecamp/attachment-take-2
Solve problem when Action Text raises on missing attachables
2026-01-16 17:36:10 +01:00
Jorge Manrubia 4ab1e3ff7d Solve problem when Action Text raises on missing attachables
Reverts the previous patch. The problem was that I hadn't update
 Lexxy in the saas version https://github.com/basecamp/lexxy/pull/596
2026-01-16 17:32:41 +01:00
Mike Dalessio 8ada756f33 Merge pull request #2380 from basecamp/flavorjones/3688-step-status
Completing a step removes stalled status from UI
2026-01-16 10:48:44 -05:00
Jorge Manrubia c8d5c38e4c Solve problem when Action Text raises on missing attachables
I created this https://github.com/basecamp/lexxy/pull/596 to address this for good but
it is still happening in production.

Locally I don't manage to reproduce the issue.

This will be solved for good once we go back to vanilla action text with the new
Rails adapter, so I will go with this is a temporary patch for now.
2026-01-16 16:38:40 +01:00
Mike Dalessio 9c76002bc1 Completing a step removes stalled status from UI
Add `updatedAt` to stalled bubble options so JS can check if the card
was recently updated, matching the `Card::Stallable#stalled?`
logic. Refresh the bubble via Turbo Stream when a step is updated.

This should have been part of #1625

Fixes https://app.fizzy.do/5986089/cards/3668
2026-01-16 09:58:21 -05:00
Rob Zolkos 4321ed86aa Add Enable all/Disable all buttons to webhook event selection
Makes it easier to quickly select or deselect all webhook event types when configuring a webhook. Uses the existing toggle-class Stimulus controller.
2026-01-15 21:09:23 -05:00
Andy Smith ff050505d5 Use correct class selectors to target cards with background images 2026-01-15 12:27:29 -06:00
Jorge Manrubia f9d85570e6 Hide table button for now 2026-01-15 16:37:27 +01:00
Zoltan Hosszu b28a88c185 Table CSS tweaks 2026-01-15 16:34:56 +01:00
Zoltan Hosszu 1a9b59ebb1 Revert "Wrap tables in div"
This reverts commit 2a2feb469eac7fe8b3957d11c6bc147cb63be51a.
2026-01-15 16:34:56 +01:00