fix: emit type='related_activity_log' from RelatedActivityLogSource#23
Draft
AsmitNepali wants to merge 1 commit into1.xfrom
Draft
fix: emit type='related_activity_log' from RelatedActivityLogSource#23AsmitNepali wants to merge 1 commit into1.xfrom
AsmitNepali wants to merge 1 commit into1.xfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #11.
RelatedActivityLogSource::makeEntry()previously emittedtype='activity_log'— same asActivityLogSource— so->ofType(['related_activity_log'])silently matched nothing despitesource_priorities.related_activity_logbeing a real config key. The two axes (entry-type vs priority-key) now agree.Changes
src/Timeline/Sources/RelatedActivityLogSource.php— emittype='related_activity_log'.src/ActivityLogServiceProvider.php— also auto-registerActivityLogRendererfor therelated_activity_logtype 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 whenfromActivityLogOfwins dedup.how-it-works.md; updatedsources.md,refining-the-timeline.md,filament-ui.md,configuration.mdto document four entry types instead of three.BC note
Filters using
->ofType(['activity_log'])no longer pick up entries fromRelatedActivityLogSource. To match both spatie-log sources, pass both keys:To distinguish own-log vs related-log at the entry level,
$entry->relatedModelis still the right discriminator (null vs Eloquent model).Test plan
vendor/bin/pest— 44 passed->ofType(['related_activity_log'])returns related-log entries on a real subject