Commit Graph

29 Commits

Author SHA1 Message Date
Mike Dalessio 11df9c3589 Fix back navigation from activity page to cards (#2727)
Three changes needed to support navigating back from a card to the
activity page:

- Add root_path to the prefer_referrer allowlist on the card show page
- Switch event links from HTML target="_top" to data-turbo-frame="_top"
  so Turbo handles the navigation and turbo:before-visit fires to save
  the referrer
- Normalize trailing slashes in the referrer path comparison so
  /account_id and /account_id/ both match

ref: https://app.fizzy.do/5986089/cards/2390
2026-03-18 22:03:36 -04:00
Mike Dalessio 248fc5d3e7 Fix back navigation from filter views to cards (#2725)
* test: update sign_in_as system test helper to be more generic

and support fixture users with more than one board

* test: backfill a test for the card "back link"

when coming from a board filter page

* Fix back navigation to filter views from cards

When navigating from a filter view to a card, the back link now shows
the filter's label and navigates back to the filter URL instead of the
card's board.

The turbo-navigation Stimulus controller stores the page title alongside
the referrer URL in sessionStorage. On the card show page, a
referrerBackLink target rewrites the back link's href and label from the
stored values. This is scoped only to the card show page to avoid
navigation loops in multi-level deep pages.

* Add referrer allowlist to prevent stale referrer rewrites

The back link is only rewritten when the stored referrer's path matches
an allowlist of paths passed via prefer_referrer. This prevents stale
referrers from unrelated pages (e.g., settings) from overriding the
card's back link.

* Move back link navigation tests to dedicated system test file

Extract back link tests from smoke_test.rb into their own file since
they test specific JavaScript behavior that needs regression coverage.
Move sign_in_as helper to ApplicationSystemTestCase for reuse.

* Move markdown paste tests to dedicated system test file
2026-03-18 17:03:13 -04:00
Mike Dalessio fc18ba8e07 Add system tests for markdown paste in Lexxy editor
Test that pasting markdown with block separators produces extra spacing
between blocks, and that single line breaks are preserved.
2026-03-17 10:31:53 -04:00
Stanko K.R. 36ee253a1a Stack notifications everywhere
We had client-side notification stacking in the tray since launch, but now we want to stack notifications in the notifications page, in API responses and in email bundles.
2026-02-12 10:29:50 +01:00
Mike Dalessio 51df4af6ba Add test coverage for the image lightbox
because we're about to mess with it.
2025-12-13 16:00:54 -05:00
Jorge Manrubia ffb357becf Merge pull request #1742 from basecamp/latest-lexxy
Update lexxy to latest
2025-12-06 10:31:19 +01:00
Mike Dalessio 4602cd3cdd Add verified_at timestamp to use for spam prevention
User are marked as verified after a join code is redeemed. The user is
redirected to Users::VerificationsController, either:

- after submitting a valid magic link code,
- or immediately after redeeming the join code (if they're already
  authenticated with the correct identity)

Account owners are automatically verified when the account is
created (because they have already provided a magic link code at that
point).

This sets up for later commits that will backfill existing users and
require verification before sending notification emails.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:51:44 -05:00
Mike Dalessio fa549a370b Add a system test for joining an account
Reworked the magic link stimulus controller, because the system test
was causing double-submission of the form (because the event was
bubbling up). I think that change simplifies the form and will still
work well for iOS devices.
2025-12-05 21:51:44 -05:00
Jorge Manrubia 80a0eb3a4d Fix system test 2025-12-05 11:30:58 +01:00
Jorge Manrubia b55bd70a8a Make system test stable
We need to wait for the request to materialize before checking the DB
2025-11-18 10:20:02 +01:00
Mike Dalessio 0a76d10184 Add test for dragging cards
See fix in ec25d73c
2025-11-17 09:12:41 -05:00
Mike Dalessio 954d094d18 Fix the stacked notifications to respect time-sortable uuid 2025-11-17 09:12:41 -05:00
Kevin McConnell 59dd8ca549 Make IDs more time-sortable in tests
In order for model ordering to work as expected in tests, we need to
keep two properties:

- Fixtures are all created in the past
- Models sort in the order that they were created

This allows us to do things like this:

    post cards_path, params: { ... }
    created_card = Card.last

When using UUIDv7 PKs rather than sequential integers, we have to make
sure a couple of things happen in order for this still to be true:

- Fixtures should generate deterministic IDs that translate to UUIDs
  that would have been created in the past (i.e. before today)
- Newly created objects must have enough precision in their timestamps
  so that they sort in the order they were created, and their random
  component doesn't come into play.

To solve this, we use the deterministic numeric ID as a number of
milliseconds after an early year. And we ensure that the new timestamps
we create have sub-millisecond precision.
2025-11-17 09:12:40 -05:00
Mike Dalessio 3f2eee38ba test: skip the test failing related to UUIDs and notif grouping 2025-11-17 09:12:36 -05:00
Jorge Manrubia 8f4b6926f5 Fiz test 2025-11-13 09:41:45 +01:00
Jason Zimdars 7d095c87b1 Simplify label, try showing the hotkey outside the button when we have room 2025-11-11 17:54:56 -06:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Stanko K.R. 875515b51d Skip the menu screen if there is just one account 2025-11-04 17:52:31 +01:00
Jorge Manrubia 5775702159 Fix smoke tests 2025-11-04 17:20:04 +01:00
Mike Dalessio e682f2742d test: Fix the flaky smoke test on attachments 2025-11-03 15:12:39 -05:00
David Heinemeier Hansson b1c8dc1e64 Need even more grace to ensure success 2025-11-02 13:56:31 +01:00
David Heinemeier Hansson 3bba72bf19 Wait a little to ensure attachments have loaded 2025-11-02 08:19:22 +01:00
Stanko Krtalić 98755844a1 Remove the internal API
* Bind sessions to identities
* Remove references to the identity token
* Move email changes to identity
* Move account menu into a turbo-frame
* Create tenants from a tenanted route
2025-10-31 16:26:08 +01:00
Stanko K.R. 201c3e27d3 Update tests for the Internal API 2025-10-31 16:26:08 +01:00
Jason Zimdars 1c8a9fdc67 Update tests 2025-10-23 07:54:46 -07:00
Jorge Manrubia 48d4a65c7d Fix test 2025-09-29 17:48:29 +02:00
Jorge Manrubia fa4106c13e Fix test 2025-09-29 17:45:36 +02:00
Mike Dalessio 5dec991d7c Introduce a few system tests
Primarily I'm trying to exercise active storage and action cable /
turbo streams, both of which have been brittle when making changes to
tenanting.
2025-09-13 13:18:32 -04:00
Kevin McConnell 564a0f48ae New Rails app 2024-06-21 13:19:56 +01:00