Skip to content

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

naaa760
Copy link
Contributor

@naaa760 naaa760 commented Jul 24, 2025

I made a PR!

#35564

Changes

  • Removed clipboard copy logic from settings tab navigation.
  • Now, clicking a settings tab only navigates—no more "Copied to clipboard" toast or unwanted clipboard content.

How did you test this code?

  • Manually tested by clicking all settings sidebar tabs and confirming no clipboard or toast appears.
  • Verified navigation still works as expected.

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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() in posthog/api/utils.py for comparing activity timestamps with bookmark dates
  • Refactors ActivityLogSerializer and MyNotificationsSerializer to use this shared utility instead of duplicated inline logic
  • Adds comprehensive unit tests for the new utility function
  • Updates SessionRecordingsPlaylist with FloatingContainerContext 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, and posthog/api/test/test_utils.py need more attention as they contain the unrelated activity log functionality

6 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

)
from posthog.models.filters.filter import Filter
from posthog.test.base import BaseTest
from datetime import datetime, timedelta
Copy link
Contributor

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

naaa760 added 4 commits July 24, 2025 20:05
…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)
@naaa760 naaa760 force-pushed the fix/replay-settings-tab-copy-bug-35564 branch from 62a3d07 to 1a01c72 Compare July 24, 2025 14:38
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.

1 participant