Commit Graph

90 Commits

Author SHA1 Message Date
Mike Dalessio 851f13a934 Render inline code in card titles (#2518)
* Remove unused marked JS dependency

* Remove unused redcarpet dependency

* Render inline code in card titles

Add card_html_title helper that HTML-escapes input then converts
backtick-wrapped text to <code> elements. Apply to card titles in
board preview, card detail, public views, and notification emails.
Style inline code elements in titles to match description styling.

Co-authored-by: Andy Smith <andy@37signals.com>

---------

Co-authored-by: Andy Smith <andy@37signals.com>
2026-02-12 12:07:40 -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 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
Jason Zimdars 6e90a6dbfb Add hotkeys for triaging cards in columns
Hover to select items
2025-12-19 14:33:47 -06:00
Jason Zimdars a56f200e1f Show comments on preview cards 2025-12-18 10:29:36 -06:00
Jorge Manrubia a380492b32 Animate the column height with a stimulus controller so that it does not depend to the server to update when you D&D 2025-12-04 19:15:38 +01:00
Jorge Manrubia 95b2d6ffe6 Make cards activable via keyboard 2025-11-20 11:41:37 +01:00
Jorge Manrubia 0726da2708 Things more or less working 2025-11-20 11:29:09 +01:00
Kevin McConnell a764a08863 Use card number as ID when dragging
Because the endpoints are `CardScoped` by number, we should also use the
number here for consistency.
2025-11-17 09:12:41 -05:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
David Heinemeier Hansson d3028262af Spacing 2025-10-30 16:47:17 +01:00
Jason Zimdars 940db09063 Refactor to remove workflows styles 2025-10-13 18:06:14 -05:00
Andy Smith 8db9862eb1 Use hide avatars from tabindex on preview 2025-10-02 15:36:13 -05:00
Jorge Manrubia 4103e0c346 Adapt public collections/cards to the new columns model 2025-09-28 18:33:06 +02:00
Jorge Manrubia b94af96e8f Merge branch 'collapsing-columns' into collapsing-columns+domain
# Conflicts:
#	app/helpers/cards_helper.rb
2025-09-26 18:48:48 +02:00
Jorge Manrubia 26e5e6ae9e Render a collection resource (WIP) 2025-09-25 16:12:17 +02:00
Andy Smith 399791bddb Card design tweaks 2025-09-24 11:24:23 -05:00
Jorge Manrubia 2f6a639682 Prepare entropy code for the new auto postpone approach 2025-09-24 16:22:42 +02:00
Jorge Manrubia 346e0ef121 Proper cache invalidation for all the columns 2025-09-18 12:08:40 +02:00
Jorge Manrubia 690734d8ab Fix several caching issues when viewing card permas 2025-09-18 10:58:09 +02:00
Jorge Manrubia 4e72566856 Flatten card resource
We only need the parent collection for creating cards. Carrying it in the
rest of actions is a hassle.
2025-09-10 11:24:23 +02:00
Andy Smith 8f86b25a54 Ensure card__link is visible on cards with backgrounds 2025-08-12 15:20:21 -05:00
Andy Smith 54ecd47c77 Use stage preview when previewing 2025-08-12 15:15:11 -05:00
Jason Zimdars cf4c6dba9c Indicate cards with attachments in the description 2025-07-03 15:56:25 -05:00
Jason Zimdars 25a33fb9c8 Merge branch 'main' into card-steps
* main: (22 commits)
  Fix that stage should be visible above card background
  Indicate opens menu
  Hide dialog targets from screen readers when closed
  Mark up as heading for screen reader navigation
  Copy for screen readers
  Don't hide the input so it's accessible to screen readers
  Point skip links to correct anchor, don't navigate with turbo
  There aren't any `li` children so just use `div`
  Use headings for screen reader navigation
  Use `h3` for individual cards in collection view
  Make collection title `h1` for screen reader navigation
  Esc should not propagate when closing dialogs
  squash! Remove session controller actions other than delete
  Screen reader: Use heading for comments navigation
  Remove the invitation codes for now
  Remove session controller actions other than delete
  Correct label for field
  Style
  Screen reader: De-duplicate links for each person in account settings
  Account.signal_account is no longer optional
  ...
2025-07-02 16:09:49 -05:00
Jason Zimdars 70d6a7190f Use h3 for individual cards in collection view 2025-07-02 14:42:53 -05:00
Jason Zimdars f02215c5b7 Add steps to cards 2025-07-01 20:05:20 -05:00
Jason Zimdars c59a99fa68 Only display workflows when the card is in Doing 2025-06-19 13:35:20 -05:00
Jorge Manrubia 6907d07d07 Don't choke when a card is missing its stage
This can happen if the stage was destroyed
2025-06-19 08:25:48 +02:00
Jason Zimdars 975bbe2385 Render stage inline so it doesn't overlap collection name
Allows truncation of collection name to fit stage name
2025-06-17 15:11:21 -05:00
Jason Zimdars 73b3442e96 Make cards resilient to long collection names 2025-06-16 19:53:55 -05:00
Jorge Manrubia 50b20c4099 Make sure you can't drag drafts 2025-06-13 10:25:48 +02:00
Jorge Manrubia 303a3faea1 Merge pull request #607 from basecamp/drag-and-drop-cards
Drag and drop cards to move between doing/considering
2025-06-13 10:04:59 +02:00
Jorge Manrubia 69263766ec Make sure that only cards in do/considering are draggable
Not in complete, not in the event timeline
2025-06-13 10:02:31 +02:00
Jorge Manrubia f58aaadba5 Drag and drop cards to move between doing/considering 2025-06-12 11:57:53 +02:00
Andy Smith 4beeb60484 Closing cards on mobile 2025-06-11 11:42:36 -05:00
Jason Zimdars c7cc4fb286 Zoom background on perma 2025-06-09 16:30:12 -05:00
Jorge Manrubia a6ffbf7ec6 Rename method 2025-06-04 14:56:19 +02:00
Jorge Manrubia db86d17880 Refactor to introduce an entropy model
Instead of keeping two tracks of similar logic (auto-reconsider / auto-close).
2025-06-04 14:40:02 +02:00
Jorge Manrubia e8249d2405 Consider the new default settings for previews 2025-06-04 13:13:45 +02:00
Jason Zimdars acfc7da551 Merge pull request #548 from basecamp/change-collection
Change collection
2025-06-03 08:56:00 -05:00
Jason Zimdars 902a99ca56 Merge branch 'main' into change-collection
* main: (25 commits)
  Add controller to retarget links
  Use more complete regexp
  dep: bundle update
  refactor: Extract a Card::Entropy concern
  Autolink emails and URLs at rendering time
  Remove the "mirror" storage service
  Update production storage to write to the Pure blob store
  Clean up the purestorage config, and add explanatory comments.
  Drop the action_text_markdowns table
  Mount mission control under `/admin/jobs`
  dep: add mission_control-jobs
  Flip the storage mirror to write to Pure as the primary
  Production mirrors Active Storage to `:purestorage`
  Make sure Sentry is configured for the beta env.
  Update lexical
  update lexical
  update lexical
  Create a distinct "beta" environment
  Revert "Patch for cards missing description"
  Add a kamal "ssh" alias
  ...
2025-06-02 09:34:01 -05:00
Jorge Manrubia 51dcf8b25f Invalidate card caches when editing workflows
https://37s.fizzy.37signals.com/collections/2/cards/607
2025-06-02 13:08:54 +02:00
Mike Dalessio 28ed744d0c refactor: Extract a Card::Entropy concern
to encompass behavior related to auto-closing and auto-reconsidering.

Note that putting this code in a single place reveals an asymmetry
between the actions:

- Auto-closing period is an optional attribute of a collection
- Auto-reconsidering period is hard-coded to 30 days for all collections
2025-06-01 16:50:12 -04:00
Andy Smith 68906321e8 Card shadow tweaks 2025-05-30 13:11:36 -05:00
Jason Zimdars c4ca5d34e4 Allow cards to be moved to another collection 2025-05-29 21:41:29 -05:00
Andy Smith f5dc923b43 Merge branch 'main' into tray-updates
* main:
  Tighten cards
  Stub recently closed filter
  Introduce a list style for all but the first six completed cards
2025-05-21 09:49:33 -05:00
Jason Zimdars f5e3e58be4 Tighten cards 2025-05-20 18:11:18 -05:00
Andy Smith 5a8da321fe Merge branch 'main' into tray-updates 2025-05-20 15:58:30 -05:00
Andy Smith 04d01d7d10 Merge notification styles into a card variant 2025-05-20 13:50:53 -05:00