Commit Graph

6515 Commits

Author SHA1 Message Date
Rosa Gutierrez 0948533da7 Rename push to process on PushTarget for clearer semantics
"Push to target" reads naturally - we push the notification to the
target. "Target processes" also makes sense - the target receives
and handles the notification in its own way.

- Add class method PushTarget.process(notification) that instantiates
  and calls the instance method
- Rename instance method from push to process
- Add private push_to helper in Pushable for readable iteration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 3621df8f0f Consolidate push jobs into single Notification::PushJob
Replace separate WebPushJob and NativePushJob with a single PushJob
that calls notification.push, which iterates over registered targets.
Each target handles its own delivery - Web pushes synchronously via
the pool, Native enqueues device-level jobs via deliver_later_to.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 4f19c42958 Move category and high_priority to payload classes
Use polymorphism instead of case statements in Native push target:
- DefaultPayload#category returns "default", #high_priority? returns false
- EventPayload#category returns "assignment"/"comment"/"card" based on action
- MentionPayload#category returns "mention", #high_priority? returns true

This simplifies the Native push target by delegating source-specific
logic to the appropriate payload classes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 9299300dbf Move push priority concerns from Event and Mention into Native push target 2026-02-25 19:31:13 +01:00
Fernando Olivares c7d0559191 Change priority notification level for mentions and assignments 2026-02-25 19:31:13 +01:00
Rosa Gutierrez b5205ce6b2 Rename Push to PushTarget for better readability
PushTarget#push reads more naturally than Push#push. The push target
is the thing that pushes notifications to a specific destination.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 06c9ece058 Move payload method to Notification and make accessors public
The notification now owns its payload via #payload method in Pushable,
allowing direct access like notification.payload.title. Push classes
simply use the notification's payload rather than building it themselves.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 1d2ed91e89 Extract payload building into dedicated classes
Separates notification payload construction from push delivery by
introducing DefaultPayload, EventPayload, and MentionPayload classes
that encapsulate the title, body, and URL generation for each
notification type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 05819f84a2 Refactor notification push system with registry pattern
Replace NotificationPusher with a cleaner architecture:

- Add Notification::Pushable concern with push target registry
- Add Notification::Push base class with template methods
- Add Notification::Push::Web for web push (OSS)
- Add Notification::Push::Native for native push (SaaS)
- Add Notification::WebPushJob and Notification::NativePushJob

Key design:
- Registry pattern: Notification.register_push_target(:web)
- Template method: push calls should_push? then perform_push
- Subclasses override should_push? (with super) and perform_push
- Each target handles its own job enqueueing

Also:
- Add Notification#pushable? for checking push eligibility
- Add Notification#identity delegation to user
- Reorganize tests to match new class structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Tidy up saas engine a bit more
2026-02-25 19:31:13 +01:00
Fernando Olivares 7e0470a692 Send the URL instead of path in notifications 2026-02-25 19:31:13 +01:00
Fernando Olivares 3c54cd84fc Add native push notification infrastructure
- Add action_push_native gem and SaaS configuration
- Add device registration API and UI
- Add User::Devices concern
- Add NotificationPusher::Native for push delivery
- Add tests and fixtures for native push
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 628a43ef61 Small native API changes: include identity ID, return empty signup completion body
Include identity.id in the my/identity.json response and return an
empty body from the CREATE signup/completions.json endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 14:34:09 +01:00
Adrien Maston bab9d1d34a Merge pull request #2594 from basecamp/mobile/fix-card-background-image
Mobile / Fix card background image
2026-02-25 11:20:27 +01:00
Adrien Maston 7fa0504057 Merge pull request #2605 from basecamp/mobile/fix-clipped-stalled-bubble
Mobile / Fix clipped stalled bubble
2026-02-25 10:20:53 +01:00
Adrien Maston 10c24b7734 Tweak translation 2026-02-24 17:48:24 +01:00
Adrien Maston 26282e3435 Use safe inset 2026-02-24 17:21:59 +01:00
Adrien Maston 88235a2737 Merge pull request #2602 from basecamp/fix-watching-overflow-dialog
Fix "watching" overflow dialog
2026-02-24 16:33:40 +01:00
Rosa Gutierrez 60b3c9c772 Fix duplicate push notification for mention and comment event
Event notifiers used the `mentionees` DB association to exclude mentioned
users from comment/card notifications. Since mentions are created async
via Mention::CreateJob, a race condition meant the mentionee list could
be empty when the event notification job ran first, causing the user to
receive both a comment and a mention push notification.

Use `scan_mentionees` instead, which scans the rich text body directly
for mentioned users without depending on Mention records existing yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:56:27 +01:00
Adrien Maston bd4cfbfd10 Change display on [open] dialog 2026-02-24 15:49:47 +01:00
Adrien Maston 7b93ec35b4 Merge pull request #2598 from basecamp/mobile/tweak-card-draft
Mobile / Tweak card draft
2026-02-24 14:56:31 +01:00
Denis Svara 3a14e3e338 Merge pull request #2599 from basecamp/mobile/path-config-setup
Mobile: Path config endpoint
2026-02-24 14:52:09 +01:00
Adrien Maston bf98b1a6d7 Adjust closed stamp position on perma 2026-02-24 12:44:13 +01:00
Denis Švara c0c78152c9 Add ios path config. 2026-02-24 11:26:07 +01:00
Denis Švara e00a51b6c2 Add android path config. 2026-02-24 11:26:00 +01:00
Denis Švara db9f67589c Implement ClientConfigurationsController for mobile client path config. 2026-02-24 11:25:07 +01:00
Adrien Maston b76f608c67 Simplify
Remove shadows and backgrounds
2026-02-24 11:22:20 +01:00
Stanko K.R. 2f9d4533c5 Relativize absolute links to the instance on export 2026-02-24 08:22:01 +01:00
Stanko K.R. 4eadce8ffe Automatically update account slugs in links 2026-02-24 08:11:47 +01:00
Stanko K.R. 55779f8ac4 Organize the record sets better 2026-02-24 07:36:51 +01:00
Stanko K.R. d8ed2f44b8 Reconcile card count after import 2026-02-24 07:36:20 +01:00
Jay Ohms d17acd39ef Merge pull request #2595 from basecamp/mobile/board-pull-to-refresh
Prevent pull-to-refresh gesture from conflicting with side scrolling on board perma
2026-02-23 11:43:24 -05:00
Adrien Maston e08413a2dd Merge pull request #2581 from basecamp/mobile/share
Mobile / Share
2026-02-23 17:13:44 +01:00
Jay Ohms 0ecc7527ca Prevent pull-to-refresh gesture conflicting with side scrolling on the board perma on Android 2026-02-23 11:02:10 -05:00
Adrien Maston a4f1a6b106 Coding style 2026-02-23 16:11:52 +01:00
Adrien Maston 0b229c701b Rename event 2026-02-23 16:10:54 +01:00
Adrien Maston 73068bc2cf Restrict top positioning of closed stamp to perma 2026-02-23 12:42:02 +01:00
Adrien Maston 5c7b3a8acb Keep reactions in static positioning on card perma
... and remove no longer needed styles
2026-02-23 12:41:38 +01:00
Fernando 8d2075b653 Merge pull request #2580 from basecamp/fix-hyphenated-search
Fix hyphenated search
2026-02-20 12:14:38 -06:00
Andy Smith cd80893957 Handle two column layout on mobile 2026-02-20 11:55:36 -06:00
Andy Smith dc0452fd0e Use flex instead of grid to better support single sections 2026-02-20 11:54:16 -06:00
Andy Smith 25adfbbcb0 Merge pull request #2584 from basecamp/settings-overflow-fix
Make generic scrollable list class for settings
2026-02-20 11:47:31 -06:00
Rosa Gutierrez 3e5233239b Fix push notification not firing on notification creation
- Rails only applies the last callback when `after_create_commit` and
  `after_update_commit` reference the same method name [1]:

> However, if you use the `after_create_commit` and the
`after_update_commit` callback with the same method name, it will only
allow the last callback defined to take effect, as they both internally
alias to `after_commit` which overrides previously defined callbacks
with the same method name.

- Push notifications were never sent when a notification was first
  created — only when the source was updated
- Replaced the two callbacks with a single `after_save_commit`, which
  fires on both create and update, with the
  `source_id_previously_changed?` guard (true for both new records and
  source changes)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

[1] https://guides.rubyonrails.org/active_record_callbacks.html#aliases-for-after-commit
2026-02-20 18:37:33 +01:00
Andy Smith 17d869cf08 Cleanup unused classes 2026-02-20 11:09:15 -06:00
Andy Smith f835c211af Make generic scrollable list class for settings 2026-02-20 11:05:26 -06:00
Adrien Maston 1d07e10650 Replace additional date by optional description 2026-02-20 17:18:53 +01:00
Adrien Maston 4e53000bc3 Add bridged share button to board and card permas 2026-02-20 13:03:33 +01:00
Adrien Maston 9569032403 Move helper to bridge helper file 2026-02-20 13:03:28 +01:00
Rosa Gutierrez bb6f2963b4 Revert commits accidentally pushed to main
Revert "Add bridged share button to board and card permas"
This reverts commit 069e165b43.

Revert "Move helper to bridge helper file"
This reverts commit 1ee37f046c.
2026-02-20 12:58:39 +01:00
Adrien Maston 069e165b43 Add bridged share button to board and card permas 2026-02-20 12:49:00 +01:00
Adrien Maston 1ee37f046c Move helper to bridge helper file 2026-02-20 12:46:00 +01:00