-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: Prevent text copying when clicking replay settings tabs #35570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: Prevent text copying when clicking replay settings tabs #35570
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR addresses a clipboard copying bug in replay settings tabs while also including unrelated activity log refactoring. The main fix removes clipboard copy logic from settingsSceneLogic.ts
that was unintentionally triggering when users clicked on settings tabs, causing unwanted "Copied to clipboard" toasts and clipboard pollution. The navigation functionality is preserved through existing URL routing.
Additionally, the PR includes several activity log-related changes that appear unrelated to the main fix:
- Adds a new utility function
is_activity_unread()
inposthog/api/utils.py
for comparing activity timestamps with bookmark dates - Refactors
ActivityLogSerializer
andMyNotificationsSerializer
to use this shared utility instead of duplicated inline logic - Adds comprehensive unit tests for the new utility function
- Updates
SessionRecordingsPlaylist
withFloatingContainerContext
infrastructure
The activity log changes eliminate code duplication by centralizing timestamp comparison logic that determines if activities are unread based on user bookmark dates. The microsecond precision handling that was previously duplicated across serializers is now consolidated in the utility function.
PR Description Notes:
- The issue reference format should use "Fixes #35564" to automatically close the linked issue
Confidence score: 3/5
- This PR mixes unrelated changes which reduces clarity and makes review more complex
- The main clipboard fix appears solid, but the activity log changes seem disconnected from the stated purpose
- Most changes are low-risk refactoring, but mixing concerns makes it harder to assess the complete impact
- Files
posthog/api/utils.py
,posthog/api/activity_log.py
,posthog/api/my_notifications.py
, andposthog/api/test/test_utils.py
need more attention as they contain the unrelated activity log functionality
6 files reviewed, 1 comment
) | ||
from posthog.models.filters.filter import Filter | ||
from posthog.test.base import BaseTest | ||
from datetime import datetime, timedelta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider moving datetime imports to the top with other standard library imports for better organization
…Serializer.get_unread() method
…cations - Move unread logic to shared is_activity_unread() utility to remove duplication. - Update both MyNotificationsSerializer and ActivityLogSerializer to use shared function. - Add unit tests for before/at/after/None bookmark edge cases. - Remove unrelated frontend changes.
fix(settings): remove clipboard copy on settings tab click (no more accidental 'Copied to clipboard' toast)
fix(settings): remove clipboard copy on settings tab click (no more accidental 'Copied to clipboard' toast)
62a3d07
to
1a01c72
Compare
I made a PR!
#35564
Changes
How did you test this code?