Skip to content

Add audit timestamps to edit pages with Ahoy event tracking#1033

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-date-info-to-edit-pages
Open

Add audit timestamps to edit pages with Ahoy event tracking#1033
Copilot wants to merge 4 commits intomainfrom
copilot/add-date-info-to-edit-pages

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

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

Edit pages lacked visibility into resource creation/modification history. Users couldn't see when records were created or last updated, or track change history without navigating to separate admin tools.

How did you approach the change?

Shared partial for audit metadata (app/views/shared/_audit_info.html.erb)

  • Displays created_at and updated_at timestamps with user attribution
  • Supports multiple association patterns: created_by, updated_by, or fallback to user
  • Links to Ahoy events filtered by resource_type and resource_id (admin-only)
  • Positioned bottom-right with subtle styling

Controller enhancement (app/controllers/admin/ahoy_activities_controller.rb)

  • Added resource_type and resource_id filtering to events index
  • Enables direct navigation from edit pages to filtered event history

Rollout

  • Applied to 25 edit pages across all major resource types

Example rendering:

Created: Feb 15, 2026 at 4:30 PM by John Doe 📊
Last updated: Feb 15, 2026 at 5:45 PM by Jane Smith 📊

Anything else to add?

Time format uses %-l to avoid leading spaces in single-digit hours. Authorization check (allowed_to?(:index?, :ahoy_activity)) restricts Ahoy links to admins only.


💡 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.

Copilot AI and others added 3 commits February 15, 2026 16:44
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
…ller

Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Copilot AI changed the title [WIP] Add created_at and last updated_at to edit pages Add audit timestamps to edit pages with Ahoy event tracking Feb 15, 2026
Copilot AI requested a review from maebeale February 15, 2026 16:50
@maebeale maebeale marked this pull request as ready for review February 15, 2026 21:37
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