Commit Graph

107 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
Jay Ohms e379721c2f Merge branch 'main' into mobile-app/prepare-webviews
* main: (107 commits)
  Document the new sign in method
  Replace handle_ naming
  Use same constant for fake magic links
  Replace FakeMagicLink with a temporary object
  Tidy up session_token
  Clean up interfaces
  Split tests by controller or responsibility
  Simplify auth logic
  Fix due to unit test when creating with invalid emails
  Restore sessions_controller test on creating invalid email address
  Move magic link api tests to their own files
  Rename test to clarify what they're about
  Cleanup session creation
  Update to always return a pending auth token for JSON responses.
  Update API test for cross code
  Change test expectation on single tenant mode account creation
  Add unit tests for the new endpoints
  Pass a server token when creating a magic link via API
  Simplify code a bit
  Simplify session create logic for both html and json
  ...
2025-12-19 13:52:04 -05:00
Jason Zimdars a56f200e1f Show comments on preview cards 2025-12-18 10:29:36 -06:00
Adrien Maston 86ec2959fb Move pins perma panel out of turbo frame 2025-12-17 12:55:58 +01:00
Adrien Maston 92e63d80cc Make my/pins perma mobile-friendly 2025-12-17 12:30:08 +01:00
Jorge Manrubia 0278fe6ae4 Revert "Mobile app / Scoped stylesheets" (#1698)
This reverts commit 39c1906e67.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 17:20:18 +01:00
Adrien Maston 041ac0c28e Add conditional stylesheets for mobile apps 2025-11-24 11:52:56 +01:00
Jason Zimdars 3625585a9d Adjust unread indicator to include unread count 2025-11-12 11:15:25 -06:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Andy Smith aafe8ffa80 Don't goof with mobile 2025-10-31 11:34:42 -05:00
Andy Smith 2a8445c63e Make pinned timestamp have a consistent font weight 2025-10-29 13:58:47 -05:00
Jason Zimdars 66f362ecd2 Ensure bottom bar items are included in view transition calc
This avoids poping layer artifacts
2025-10-28 16:42:58 -05:00
Jason Zimdars 940db09063 Refactor to remove workflows styles 2025-10-13 18:06:14 -05:00
Andy Smith cafb17d21f Tray toggle height should match card size 2025-10-10 16:38:38 -05:00
Jason Zimdars 0ff0ed796f Fix that pins were still hoverable and clickable when hidden 2025-10-06 13:29:31 -05:00
Andy Smith e37cbe6d7f Dynamic height for pins based on viewport height 2025-10-01 14:28:38 -05:00
Jason Zimdars 038be0b9ff Simply search placeholder, shortcut, and shortcut indicator 2025-10-01 10:53:31 -05:00
Jason Zimdars f64d1715d8 Tighten up Fizzy bar, simplify try toggles 2025-10-01 09:54:17 -05:00
Andy Smith 82bac33f41 Tidy up the expander 2025-09-23 15:15:41 -05:00
Jason Zimdars 741cc74a9e Hide in pinned cards 2025-09-09 23:03:03 -05:00
Jason Zimdars 30b668d908 Tweak tray item vertical spacing 2025-09-09 15:55:04 -05:00
Andy Smith d4f048df9b Fix timestamp alignment on pinned cards 2025-08-27 11:37:09 -05:00
Jason Zimdars 3bebbfd4d4 Slide trays away 2025-08-22 07:33:26 +02:00
Andy Smith 52fc86bda7 Remove unused class 2025-08-19 17:12:05 -05:00
Andy Smith 7213d53e88 Don't position the toggle button on top of the dialog 2025-08-19 10:53:11 -05:00
Andy Smith c354ac4ac2 Fox wonky notification position 2025-08-19 10:33:36 -05:00
Andy Smith ac564f252f Tweak empty tray hat position when transitioning 2025-08-18 14:05:28 -05:00
Andy Smith 267a5f11fa Stack meta info on mobile 2025-08-11 15:54:59 -05:00
Jason Zimdars 7d47a0038b We need to do this slightly differently 2025-07-30 16:24:36 -05:00
Jason Zimdars 6227cf9a8b Keyboard arrow through pins and notifications 2025-07-30 16:07:55 -05:00
Jason Zimdars 133ef1405d Navigate the notifications list on the Index 2025-07-29 17:27:29 -05:00
Jason Zimdars e2f464a55a Allow hat to be displayed on mobile when there are no notifications
@andyra I'm not sure what the original intent was but it seems useful to show the hat when toggling the notifications dialog on mobile, just like it does on desktop. It's the easiest way to get to old notifications and settings. All this seemed to do was prevent that.
2025-07-29 13:59:31 -05:00
Jason Zimdars c47ea67045 Use larger text when space allows
- Use black text for labels so the buttons don't appear disabled
- Larger icons
2025-07-29 13:55:57 -05:00
Jason Zimdars 8a5c44f2f8 Correct colors for trays in mobile in light themes 2025-07-28 17:29:10 -05:00
Jason Zimdars 362c174b8b Try a light theme for the fizzy bar 2025-07-25 10:27:55 -05:00
Andy Smith e722cc63a6 Make room for pin clear button when dialog is expanded 2025-07-23 15:50:51 -05:00
Jason Zimdars c777fc3804 Fix that tray toggle was nearly invisible in dark mode 2025-07-14 10:55:58 -05:00
Andy Smith 8d60592ccd Merge pull request #720 from basecamp/notification-links
Notification links
2025-07-10 17:04:31 -05:00
Jason Zimdars aa32b482ae Revert "Adjust borders"
This reverts commit 14979f3000.
2025-07-10 16:06:58 -05:00
Jason Zimdars 14979f3000 Adjust borders 2025-07-10 14:48:50 -05:00
Jason Zimdars 0d1c0f4e75 Try using env safe insets to avoid overlapping elements on mobile 2025-07-10 14:26:58 -05:00
Andy Smith 073dfd2ae1 Tweak the hat padding 2025-07-10 11:34:08 -05:00
Andy Smith 5162677c44 Align dialog, shrink hat, canvas background 2025-07-10 11:20:37 -05:00
Andy Smith 0491cd0818 More subtle styles 2025-07-08 15:00:06 -05:00
Andy Smith dcfa8357de Clarify notification actions 2025-07-08 14:49:12 -05:00
Andy Smith c338132b6f Clean odds and ends 2025-07-07 16:57:35 -05:00
Andy Smith ef2e9cf428 Remove actions markup and CSS 2025-07-07 16:41:47 -05:00
Andy Smith 4f77ca0f27 Get Pins working on mobile and desktop 2025-07-07 16:40:22 -05:00
Andy Smith 524feedbfd WIP 2025-07-07 16:06:31 -05:00
Andy Smith a27987bd8e Add a button to remove pins from tray 2025-07-07 15:29:00 -05:00