Commit Graph

1509 Commits

Author SHA1 Message Date
Jorge Manrubia 4e09352c09 Bring simple signup flow from the fizzy-saas gem
We skip the QB code and we fill external account ids automatically on creation with a sequence

See:
https://github.com/basecamp/fizzy-saas/pull/7
2025-11-28 15:53:58 +01:00
Jorge Manrubia 2061ab4ab2 Use dedicated sequence record instead of deal with issues with ids and uuids when using the previous approach 2025-11-28 15:53:58 +01:00
Jorge Manrubia 07b4c55185 Auto-increment external_account_id automatically by default to allow upcoming simple signups 2025-11-28 15:53:58 +01:00
Mike Dalessio 3f8d10d679 Merge pull request #1747 from basecamp/flavorjones/perf-20251127
Address some N+1 query situations
2025-11-27 12:46:56 -05:00
Mike Dalessio 09366fc949 style: rubocop fix 2025-11-27 12:34:31 -05:00
Stanko K.R. e3d91f4ba2 Fix join codes skipping user setup
If someone joined an account with the same identity as they were signed in with the old logic would skip the user setup step
2025-11-27 17:59:17 +01:00
Mike Dalessio 50fe973105 Remove N+1 on the cards board. 2025-11-27 11:30:54 -05:00
Mike Dalessio 0ab3aaca72 Preload Event to avoid N+1s on the timeline 2025-11-27 11:27:10 -05:00
Mike Dalessio 79c9ea2ce1 Remove a bunch of N+1s
related to notification and comment rendering
2025-11-27 11:08:45 -05:00
Jason Zimdars 5e971f41af Set entropy to 1 year so cards don't close before they can play 2025-11-27 09:18:33 -06:00
Jason Zimdars 48d9a25820 Fix that 'closed'->'done' change broke this route 2025-11-26 14:58:17 -06:00
Mike Dalessio 9446bc18d2 Simplify Current.with_account and .without_account
Co-authored-by: Jeffrey Hardy <jeff@37signals.com>
2025-11-26 12:31:49 -05:00
Donal McBreen c4498212dc Merge branch 'main' into sqlite
* main: (116 commits)
  Ensure avatar thumbnails are square
  Update useragent to recognize twitterbot/facebot
  Add defensive styles for non-square avatar images
  Update test for copy changes
  Missed commit
  AI: standardize on https://agents.md
  Make it clear this is just notifications, not comprehensive activity
  AI: configure MCP servers for Chrome, Grafana, and Sentry (#1727)
  Allow requests from Google Image Proxy
  Update to basecamp's useragent fork
  Clean up a little bit the CSRF reporting code
  Claude: production observability guidance (#1725)
  Prevent autoscroll to the root columns container to prevent jump on page load
  Include full name string so you can type your name to filter
  Prioritize current user and assigned users in assignment dropdown
  Check and report on Sec-Fetch-Site header for forgery protection
  bundle update
  Bump bootsnap from 1.18.6 to 1.19.0
  Bump rails from `077c3ad` to `17f6e00`
  Fix cards getting stuck in edit mode
  ...
2025-11-26 10:07:41 +00:00
Donal McBreen 9c86205510 Enforce SQLite column limits via CHECK constraints
Patch the sqlite adapter to add CHECK constraints for string and text
column limits. We'll do them inline, so that any column changes
automatically update the constraints.
2025-11-26 09:50:29 +00:00
Kevin McConnell ca5065a378 Ensure avatar thumbnails are square
Previously we were fitting the image inside a 256x256 box while keeping
it's original aspect ratio. But this can lead to images that are
squished and/or pixelated when we try to show them inside a square
container in the app.

Instead we can resize them to be square.
2025-11-26 09:21:46 +00:00
Donal McBreen 97bcdf1853 Enforce column limits via concern
SQLite columns lengths are purely informational, so we'll enforce the
limits via a concern that checks the lengths from the schema.
2025-11-25 15:32:34 +00:00
Donal McBreen c2eb840e2b Use Uuid type directly 2025-11-25 13:47:08 +00:00
Stanko K.R. f64a49dcc0 Determine staff members based on flag
This replaces the old system based on email addresses, the aim is to make it more generic and thus appropriate for OSS/self-hosting

See: https://3.basecamp.com/2914079/buckets/37331921/todos/9302705265#__recording_9320051455
2025-11-25 14:09:31 +01:00
Donal McBreen b571303385 Don't use Current.account for search records
It doesn't actually work, and even if we could make it work reliably
we are better off if the records always know to go to the right shard.

It does make the interface a bit more complicated as we need to select
the right shard class with `for(account_id)`.
2025-11-25 11:34:41 +00:00
Mike Dalessio e0aa1d257e Drop User.system and replace with Account#system_user 2025-11-24 13:23:57 -05:00
Stanko K.R. e85c5736c9 Render system user avatars using redirects 2025-11-24 12:05:32 +01:00
Jason Zimdars 433a19e103 Add an avatar for the System user 2025-11-24 12:04:33 +01:00
Jason Zimdars 0c49d3c2a6 Use "Done" for consistency
Closed is domain language
2025-11-24 12:04:33 +01:00
Jason Zimdars 86932803e4 Clarify not now move actions copy 2025-11-24 12:03:34 +01:00
Jason Zimdars 5fac18d01f Restore auto-postponed events to the timeline 2025-11-24 12:03:34 +01:00
Mike Dalessio 09e6a15c6e Merge pull request #1696 from basecamp/flavorjones/avoid-overlapping-bundles
Prevent overlapping bundles from being created
2025-11-23 10:20:17 -05:00
Jorge Manrubia f0851988a2 Revert tentatively
Kevin got a bunch of dups, need to look into this more calmly https://3.basecamp.com/2914079/buckets/37331921/chats/9301300227
2025-11-23 10:18:39 +01:00
Mike Dalessio db51b616bb Handle notifs created before the current bundle starts_at 2025-11-22 22:38:23 -05:00
Mike Dalessio a29dd89683 Make sure Bundle#ends_at is set before validation
otherwise we risk creating overlapping bundles and not catching it.
2025-11-22 22:19:05 -05:00
Mike Dalessio bcb43305b6 Improve avatar image handling
- redirect avatar image requests to the rails_blob_url, instead of
  streaming them through the web app
- use a thumbnail variant for avatar images
- only put avatar initials behind the stale? check (not the image
  redirect, which would result in browsers rendering broken images when
  an avatar is changed, until max-age expires)
2025-11-21 15:16:46 -05:00
Donal McBreen 2199dcc0c8 Fix name in SQL string 2025-11-21 16:01:05 +00:00
Donal McBreen 6f02cb40b1 Drop unnecessary html_safes 2025-11-21 15:46:31 +00:00
Donal McBreen d09deca038 Fallback to search_records_0, so eager loading has a valid table 2025-11-21 15:35:58 +00:00
Donal McBreen 0989017f62 Fix rubocop 2025-11-21 15:31:00 +00:00
Donal McBreen d48eb523b8 Fix rubocop 2025-11-21 15:30:14 +00:00
Donal McBreen be0ce5efa0 Use dependant delete on fts table 2025-11-21 15:28:25 +00:00
Donal McBreen b1862733dd Merge branch 'main' into sqlite 2025-11-21 15:23:34 +00:00
Donal McBreen 525e53a2f7 Add FTS ActiveRecord model
Needs some special handling for the FTS virtual table format. Set the
primary key to rowid and manually specify the columns.
2025-11-21 15:21:11 +00:00
Jason Zimdars 2382326a13 Merge pull request #1638 from basecamp/expand-activity-columns
Expand activity columns
2025-11-21 09:11:22 -06:00
Donal McBreen 04c9d9268b Remove wrapper methods and kwargs 2025-11-21 14:53:17 +00:00
Donal McBreen eecdb486b7 Remove unused attribute 2025-11-21 14:42:28 +00:00
Donal McBreen bef4b86212 Use card_search_records instead of join class method 2025-11-21 14:42:09 +00:00
Donal McBreen aaf512875e Add search_record has_one 2025-11-21 14:34:41 +00:00
Donal McBreen 32c3bcec9f Merge branch 'main' into sqlite 2025-11-21 14:26:21 +00:00
Donal McBreen ea06b2d46f Simplify and test highlighing 2025-11-21 14:25:38 +00:00
Jorge Manrubia 41905068c0 Bundle after notification is committed to mitigate reading stale data when bundling
Attempt to deal with overlapping bundles being created by notifications created immediately
one after the other.
2025-11-21 14:34:05 +01:00
Donal McBreen 6e749d2b5f Drop for_user 2025-11-21 12:39:47 +00:00
Donal McBreen aebe3f97ed Drop parentheses 2025-11-21 12:37:29 +00:00
Donal McBreen 02da6dbf8f Parameterised queries 2025-11-21 12:36:45 +00:00
Donal McBreen 463a5f089a Consolidate scopes and extract search_fields 2025-11-21 12:31:25 +00:00