Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

What is the goal of this PR and why is this important?

Separate email confirmation tracking (auth.confirm) from welcome flow completion tracking. Previously, only confirmation was tracked; now we can distinguish users who confirmed email vs. those who completed the welcome process (with or without setting password).

How did you approach the change?

Added auth.welcome_instructions_completed event tracking in WelcomeController#update:

  • Tracked when user sets password (alongside existing auth.password_set)
  • Tracked when user skips password setup

Event flow:

# User visits invite link
# → auth.confirm (via User callback on confirmed_at change)

# User sets password
# → auth.password_set + auth.welcome_instructions_completed

# User skips password  
# → auth.welcome_instructions_completed only

Updated tests to verify both tracking scenarios using allow + expect pattern to handle multiple LifecycleBuffer.push calls.

Anything else to add?

The three events (auth.confirm, auth.password_set, auth.welcome_instructions_completed) are now independently trackable, enabling funnel analysis from invitation → confirmation → completion.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • vite
    • Triggering command: /usr/local/bin/ruby /usr/local/bin/ruby bin/rails assets:precompile 2067.pid -I 6_64-linux runtime-runc/mob-I /cc1 io.containerd.rugrep /usr/local/inclu-q -I /cc1 -I . de/ruby-4.0.0/x8-dD /usr/bin/as 6_64-linux io.containerd.ru--norc by/backward as (dns block)
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/welcome_spec.rb --format documentation (dns block)
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/welcome_spec.rb --format progress /run/containerd/io.containerd.runtime.v2.task/moby/800952a3bd2a06c26f55977954e6f0d43b4931b086189399cf66ec998f38c4e9/7f4a346c1a83f6421280059c95b727dacd7b7fab302cc021e54442328392338c.pid 800952a3bd2a06c26f55977954e6f0d43b4931b086189399cf66ec998f38c4e9 6c26f55977954e6fbash (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

add "Invite" buttons to Confirmed status column on users index. when a user is confirmed, show the green confirm check circle icon. when they are not confirmed, show the "Invite" button.

the button should send a welcome email to each user.
the welcome email should have a button in the email that goes to a Welcome endpoint that has welcome test and Set password (and password confirmation).
the welcome endpoint confirms the user's email (even if they don't set their password).

auth.confirm ahoy event should get created, like it does with regular reset_password (i think this is a user callback rn anyway so ahppens automatically after confirm?).if it doesn't already exist, that gets created when user clicks the link from their email.

add tests.

make the email the same format as the existing password reset email.

add a "Resend Invite" button to user edit top of page buttons.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@maebeale
Copy link
Collaborator

@copilot make sure welcome_instructions is using the welcome_controller and there's no logic in controller. there seem to be multiple ahoy events being created. default to the user callback. make sure a notification is being created for the devise mailer for welcome_instructions.

Copy link
Contributor Author

Copilot AI commented Feb 10, 2026

@copilot make sure welcome_instructions is using the welcome_controller and there's no logic in controller. there seem to be multiple ahoy events being created. default to the user callback. make sure...

Fixed in commit 2d5c48d:

  1. ✅ Removed AhoyTracking module from WelcomeController - no logic in controller
  2. ✅ Added track_confirmation callback in User model - uses the user callback pattern
  3. ✅ Fixed event tracking to use Analytics::LifecycleBuffer.push (not AhoyTracker)
  4. ✅ Single auth.confirm event now tracked via User model callback when confirmed_at changes
  5. ✅ Notification already being created via DeviseMailer after_action :create_notification_record with kind "welcome_invitation"

All welcome_spec tests passing (16 examples, 0 failures)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • vite
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/welcome_spec.rb --format documentation bcd5aa0a1341a7ab475c456ab126e05a2dbac8cb1f42b7e290c1d11778f77101 6_64-linux 05a2dbac8cb1f42b7e290c1d11778f77101/log.json by/backward 2dbac8cb1f42b7e2--no-pager echo comp�� /liblto_plugin.s-- linux-gnu/12/ltoveth7553fb6 mBnpXu.res elf_x86_64 05a2dbac8cb1f42b7e290c1d11778f77101/0467b5e3d310daf628f55a35e3276054c5d5c6ccd80f315c283805c9b1cf--log --as-needed de/ruby-4.0.0 (dns block)
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/welcome_spec.rb --format documentation -j ACCEPT 05a2dbac8cb1f42b7e290c1d11778f77101/log.json by/backward s-through=-lc s-through=-lgcc (dns block)
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/welcome_spec.rb:12 --format documentation --backtrace p-bin/sh ntime.v2.task/mosh -plugin-opt=-pas-c -plugin-opt=-pasvite build --mode test /usr/lib/gcc/x86_64-linux-gnu/12--mode -qui�� runtime-runc/moby . io.containerd.runtime.v2.task/moby/bcd5aa0a1341a--systemd-cgroup /usr/local/inclubash ntime.v2.task/mo/usr/bin/runc 2dbac8cb1f42b7e2--root make (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add Invite buttons to Confirmed status column on users index Add Invite buttons to Confirmed status column on users index Feb 10, 2026
Copilot AI changed the title Add Invite buttons to Confirmed status column on users index Separate auth.confirm from welcome instructions completion tracking Feb 10, 2026
Copilot AI and others added 15 commits February 10, 2026 20:17
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
…r event tracking

- Remove AhoyTracking module from WelcomeController
- Add track_confirmation callback to User model to track auth.confirm event
- Make track_auth_event public in User model
- Update WelcomeController to use user.track_auth_event instead of controller tracking
- Fix form scope in welcome view to properly namespace user parameters
- Fix redirect path to users_path after password set
- Add verify_authorized override to skip authorization check for public welcome pages

All welcome_spec tests now passing

Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
- Add auth.welcome_instructions_completed event tracking when user completes welcome flow
- Track this event both when user sets password AND when they skip password setup
- Keep auth.confirm tracking separate (tracked when confirmed_at changes via User callback)
- Add tests for auth.welcome_instructions_completed event in both scenarios

Event flow now:
1. User visits invite link → auth.confirm tracked (via User model callback)
2. User sets password → auth.password_set + auth.welcome_instructions_completed tracked
3. User skips password → only auth.welcome_instructions_completed tracked

This separates email confirmation tracking from welcome flow completion tracking

Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
@maebeale maebeale force-pushed the copilot/add-invite-buttons-to-user-index branch from 03f576b to dd98f81 Compare February 11, 2026 01:17
@maebeale maebeale marked this pull request as ready for review February 11, 2026 11:54
community_news_index_path,
data: { turbo_frame: "_top"},
class: "text-primary font-medium hover:underline" %>
class: "text-primary font-medium hover:underline", data: { turbo: false } %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this solves an error in test

<%= link_to "Read all news",
community_news_index_path,
class: "text-primary font-medium hover:underline" %>
class: "text-primary font-medium hover:underline", data: { turbo: false } %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this solves an error in test

<a href="<%= root_url %>" target="_blank">
<%= image_tag(
"logo-color.png",
"logo-circle.png",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the logo for all mailers w this pr

<div class="flex items-center justify-center">

<div class="w-full max-w-md bg-white rounded-2xl shadow-lg mt-8 p-8">
<%= render "layouts/mailer/logo" %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using a mailer logo on a show page is suspect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants