Commit Graph

47 Commits

Author SHA1 Message Date
Andy Smith a4303dbe71 Use existing lexxy-content styles instead of rewriting everything 2026-02-12 09:54:21 +01: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
Andy Smith 03ce900c2e Tweak comment history button on mobile 2026-01-09 10:47:39 -06:00
Jason Zimdars 5716303c22 Rename
It feels odd to have a `.system` class in the `.comment` namespace.
Might as well make it really obvious if we're going to rename it
2025-12-22 11:12:46 -06:00
Alexander Zaytsev 5657ee0455 Remove extra space 2025-12-19 09:37:07 +01:00
Alexander Zaytsev e52eba9c4e Rename .comment--system to .system-comment 2025-12-19 09:34:23 +01:00
Alexander Zaytsev cc6b5cba9c Use hash for conditional class 2025-12-19 09:33:07 +01:00
Jason Zimdars ae5cb096f9 Let's just use the class we already have 2025-12-17 20:06:38 -06:00
Alexander Zaytsev 035c5f97a1 Use simpler selectors to target system comments 2025-12-17 10:09:35 +01:00
Jason Zimdars 8659e19671 Collapse and expand system comments 2025-12-16 14:21:48 -06:00
Kevin McConnell e2292a1739 Update cached fragments 2025-12-15 13:23:57 +00:00
Mike Dalessio c6725fdca0 Bust comment view cache
because, unlike ordinary view file changes, the change to Action Text
attachment rendering in e9cb2956 doesn't bust the cache automatically.
2025-12-14 13:05:45 -05:00
Jorge Manrubia 11249949eb Fix: edit comment button disappears when morphing the page
This also replaces the ad-hoc stimulus controller with the pure-css based
solution we recently added.

https://app.fizzy.do/5986089/cards/3243
2025-12-02 07:06:50 +01:00
Jorge Manrubia bddbc0c0ac Make comment body area permanent so that morphing/refresh does not touch it 2025-11-13 16:52:54 +01:00
Andy Smith b2a83f1625 Add Basecamp-style boosts 2025-10-27 16:59:57 -05:00
Andy Smith 6b0fc35627 Revert "Reactions" 2025-10-27 16:16:57 -05:00
Andy Smith 7b432a40f6 Consolidate quick-reactions and reactions 2025-10-27 11:34:35 -05:00
Jorge Manrubia 6af27c91d8 Fix: anchor links to comments not working
The problem was having the turbo frames as targets: their display: contents would make
auto-scrolling not working!

https://fizzy.37signals.com/5986089/cards/2190
2025-10-07 10:11:05 +02:00
Andy Smith 22f9c9d168 WIP 2025-09-10 12:15:31 -05:00
Andy Smith 8e795f183d Update system message to highlight verbs 2025-07-24 13:42:19 -05:00
Jason Zimdars 468a29c9ad Give them screen reader labels
See: https://fizzy.37signals.com/5986089/collections/2/cards/1106
2025-07-16 11:33:33 -05:00
Andy Smith f9c7862fc1 Add hover effect for comment edit button 2025-07-07 10:12:32 -05:00
Andy Smith 95dac275fd Add hover effect to overflow button 2025-07-07 10:07:56 -05:00
Jason Zimdars 8f42086703 Truncation for comment author line 2025-07-03 15:06:15 -05:00
Jason Zimdars 91aa8be4fc Screen reader: Use heading for comments navigation 2025-07-02 14:22:16 -05:00
Andy Smith c7eeb56cfa Clear the comments cache 2025-06-30 16:47:08 -05:00
Jorge Manrubia d7c06702e3 Add controller to retarget links
So that internal links can skip turbo frames, and external links
open in new pages
2025-06-02 12:04:43 +02:00
Jorge Manrubia fa04016cbe Revert "Revert "Replace House with Lexical"" 2025-05-29 14:25:16 +02:00
Jorge Manrubia 08d8b2e5ff Revert "Replace House with Lexical" 2025-05-29 14:22:27 +02:00
Jorge Manrubia 62bef018ea Merge branch 'main' into lexical
* main:
  Don't choke when rendering commands where the card was deleted
  Update tests
  Rework system events
  test: add missing assertions
  dep: bump active_record-tenanted to fix URI support
  Remove hyphen from "Un-do"
  Prevent default when handling keyboard shortcuts
  dep: update AR::Tenanted to support database URIs
  Detect platform and label the correct hotkey shortcut
  Things got too tight
  Don't require TLS for Beamer at the moment
  dep: update dependencies

# Conflicts:
#	Gemfile
#	Gemfile.lock
#	app/assets/stylesheets/comments.css
2025-05-29 12:44:14 +02:00
Jason Zimdars c6c9e0d5fc Rework system events
- Restyle system events so they don't look like comments and aren't attributed to the system user
- Ensure the event creator is included in the description so it's clear who did it.
- Walk back system comment replacement. Yes, it potentially avoids embarassing people when they change their mind, it's also losing data. If two intentional assigments happen in proximity, we've been only showing the latest one,.
2025-05-28 15:26:41 -05:00
Jorge Manrubia de87ff9c70 Refine syntax higlighting 2025-05-23 13:28:26 +02:00
Jorge Manrubia 0693617d83 Some initial work to reuse styles with lexical 2025-05-23 11:53:22 +02:00
Jorge Manrubia 10b2aad647 Replace House with lexical-powered actiontext 2025-05-23 11:41:08 +02:00
Andy Smith beda688d10 Show buttons depending on reaction presence 2025-05-07 15:06:40 -05:00
Andy Smith 3710aa43e4 Stub out overflow reactions 2025-05-07 14:29:29 -05:00
Jason Zimdars dabec3e124 More verbose time stamps 2025-04-30 10:09:31 +02:00
Jorge Manrubia b08326ccbe Merge branch 'main' into plain-text-mentions
* main: (48 commits)
  Improve layout and truncation
  This is annoying
  Fix summary
  Remove index columns
  Same treatment for the events index
  New menu filters and navigates
  Don't test for _Added by_ events
  Indention
  @collection is always available when card scoped
  Style
  Remove check for _Added by..._ line
  The placeholder attribute is on the `house-md` element
  Duh, no before destroy commit, but this is still not right!
  No long transactions!
  Don't display published event in threads
  But feels more essentially part of the User, so list first
  Not related to the other two
  Missing controller
  Style
  Errant `bubbles` => `cards` replacement
  ...

# Conflicts:
#	app/models/card.rb
#	app/models/user.rb
#	db/schema.rb
#	db/schema_cache.yml
2025-04-23 17:24:01 +02:00
Jorge Manrubia ab73417e73 Leverage existing resolve route for comments 2025-04-23 14:34:59 +02:00
Jason Zimdars 72c1fa3b05 Merge branch 'main' into fixes-tues-22
* main:
  Indention
  @collection is always available when card scoped
  Style
  Duh, no before destroy commit, but this is still not right!
  No long transactions!
  But feels more essentially part of the User, so list first
  Not related to the other two
  Style
  Try a slimmer version
  We werent using any of the other avatar methods
  Dont do a lot of work inside a single transaction
  Really liking the new it-style yields in many places
  Bump nokogiri from 1.18.7 to 1.18.8
2025-04-22 15:06:36 -05:00
David Heinemeier Hansson cf3cbccf23 Indention 2025-04-22 21:56:23 +02:00
Jason Zimdars c4864752f4 Card descriptions need styles shared with comments 2025-04-22 13:53:08 -05:00
Jorge Manrubia c75d4cb329 Fix broken permalinks 2025-04-22 15:26:56 +02:00
David Heinemeier Hansson 09dd073cf7 Record lookup works here 2025-04-11 18:47:11 +02:00
David Heinemeier Hansson c8fe83e8f3 Indention 2025-04-11 18:43:52 +02:00
David Heinemeier Hansson 6effc1568f No need for a separate body partial 2025-04-11 18:41:26 +02:00
David Heinemeier Hansson f4ce57e308 Move comments under cards 2025-04-11 16:21:44 +02:00