Skip to content

fix: emit type='related_activity_log' from RelatedActivityLogSource#23

Draft
AsmitNepali wants to merge 1 commit into1.xfrom
fix-related-activity-log-type
Draft

fix: emit type='related_activity_log' from RelatedActivityLogSource#23
AsmitNepali wants to merge 1 commit into1.xfrom
fix-related-activity-log-type

Conversation

@AsmitNepali
Copy link
Copy Markdown
Collaborator

Summary

Closes #11.

RelatedActivityLogSource::makeEntry() previously emitted type='activity_log' — same as ActivityLogSource — so ->ofType(['related_activity_log']) silently matched nothing despite source_priorities.related_activity_log being a real config key. The two axes (entry-type vs priority-key) now agree.

Changes

  • src/Timeline/Sources/RelatedActivityLogSource.php — emit type='related_activity_log'.
  • src/ActivityLogServiceProvider.php — also auto-register ActivityLogRenderer for the related_activity_log type so spatie-diff rendering still works for related-log entries out of the box.
  • tests/Feature/BuilderDedupTest.php — assertion updated to reflect the new winning type when fromActivityLogOf wins dedup.
  • Docs: removed the now-obsolete troubleshooting entry; refreshed the type-taxonomy table in how-it-works.md; updated sources.md, refining-the-timeline.md, filament-ui.md, configuration.md to document four entry types instead of three.

BC note

Filters using ->ofType(['activity_log']) no longer pick up entries from RelatedActivityLogSource. To match both spatie-log sources, pass both keys:

->ofType(['activity_log', 'related_activity_log'])

To distinguish own-log vs related-log at the entry level, $entry->relatedModel is still the right discriminator (null vs Eloquent model).

Test plan

  • vendor/bin/pest — 44 passed
  • Manual verify ->ofType(['related_activity_log']) returns related-log entries on a real subject
  • Confirm built-in renderer still picks up related-log entries in Filament UI

Restores symmetry with the source_priorities config key so
->ofType(['related_activity_log']) actually matches. Auto-registers
ActivityLogRenderer for the new type so diff rendering still works
for related-log entries. Updates docs and dedup test expectation.

Closes #11
@AsmitNepali AsmitNepali self-assigned this Apr 28, 2026
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.

RelatedActivityLogSource emits type='activity_log' — type filter never matches 'related_activity_log'

1 participant