199ocero / activity-timeline

Add timelines to custom pages or infolist entries effortlessly. Plus, it teams up smoothly with Spatie Activitylog for easy tracking.
https://filamentphp.com/plugins/jaocero-activity-timeline
MIT License
63 stars 16 forks source link

Add support for tooltips for the `ActivityDate` entry #16

Closed sprtk-ches closed 8 months ago

sprtk-ches commented 8 months ago
  1. Adds support for tooltips to the date template (I can add support for the rest of the entries if needed)
  2. Allows overriding the date field when a user supplies a getStateUsing closure to allow custom values for that part of the activity log. However, this is probably a breaking change so I'm open to suggestions on how to implement this.

image

199ocero commented 8 months ago

Hello @sprtk-ches , awesome this is good! But can you also add this in read me and explain what this use for so that users will know this functionality. Thank youu! I will review it once you added it.

sprtk-ches commented 8 months ago

Hello @sprtk-ches , awesome this is good! But can you also add this in read me and explain what this use for so that users will know this functionality. Thank youu! I will review it once you added it.

@199ocero 🤔 I'm really not sure about the 2nd change. For example, someone with the following code

ActivityDate::make('created_at')
    ->getStateUsing(fn ($record) => $record->created_at)
    ->date('F j, Y')

might expect that the created_at value will be formatted with the given format, but it won't.

I think it would be better to focus this PR on adding tooltip support, and I'll create another PR for the getStateUsing change and post it to the Discord channel for people to have a look. What do you think?

199ocero commented 8 months ago

Yes @sprtk-ches that would be better. Make this for tooltip and make another PR for state and will see where it goes. Thank youu! Oh and just make sure to edit also the read me for the tooltip.

199ocero commented 8 months ago

Hey @sprtk-ches any update for this? I will close this for now if no updates. Thank youu!