[WEB-4405] chore: profile settings events#7313
Conversation
…e/plane into fix-workspace-events
fix: workspace events
* chore: update event tracker helper types * refactor: cycle events * refactor: cycle events * refactor: cycle event tracker * chore: update tracker elements * chore: check for closest element with data-ph-element attribute --------- Co-authored-by: Prateek Shourya <prateekshourya@Prateeks-MacBook-Pro.local>
…into refactor-event-trackers
* chore: update event tracker helper types * refactor: cycle events * refactor: cycle events * refactor: cycle event tracker * refactor: module tracker event and element * chore: update tracker element * chore: revert unnecessary changes --------- Co-authored-by: Prateek Shourya <prateekshourya@Prateeks-MacBook-Pro.local>
…into refactor-event-trackers
…s and sidebar related events
refactor: global views, product tour, notifications, onboarding, users and sidebar related events
* chore: member-tracker-events * fix: constants
* chore: state events * fix: refactor
* chore: project-events * fix: refactor
* added events for most page events * refactor: simplify lock button event handling in PageLockControl --------- Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com> Co-authored-by: M. Palanikannan <73993394+Palanikannan1437@users.noreply.github.com>
Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
|
Prateek Shourya seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Warning Rate limit exceeded@gakshita has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 38 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughThis update introduces comprehensive event tracking for profile settings actions and UI elements. It adds new tracking constants and integrates event capture calls across various profile-related components, including account deactivation, API token management, theme selection, notification preferences, language/timezone, and start-of-week settings. No existing logic is altered. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI_Component
participant EventTracker
User->>UI_Component: Interacts (e.g., click, submit, toggle)
UI_Component->>EventTracker: captureClick/captureSuccess/captureError (with event & element)
EventTracker-->>UI_Component: Logs event
UI_Component-->>User: Updates UI (if applicable)
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Pull Request Linked with Plane Work Items
Comment Automatically Generated by Plane |
…re-profile-settings-events
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
web/core/components/api-token/delete-token-modal.tsx (1)
62-78: Fix duplicate catch blocks in promise chain.The promise chain has two separate
.catch()blocks, which means the second catch block (lines 69-77) for event tracking will never execute because the first catch block (lines 62-68) already handles the error.Combine both error handling and event tracking in a single catch block:
.catch((err) => { + captureError({ + eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_deleted, + payload: { + token: tokenId, + }, + error: err as Error, + }); setToast({ type: TOAST_TYPE.ERROR, title: t("workspace_settings.settings.api_tokens.delete.error.title"), message: err?.message ?? t("workspace_settings.settings.api_tokens.delete.error.message"), - }) - ) - .catch((err) => { - captureError({ - eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_deleted, - payload: { - token: tokenId, - }, - error: err as Error, - }); - }) + }); + })
🧹 Nitpick comments (1)
web/core/components/profile/notification/email-notification-form.tsx (1)
131-140: Consider adding consistent tracking to the issue_completed toggle.The
issue_completedtoggle doesn't includecaptureClicktracking like the other toggles (property_change, state_change, comment, mention). This inconsistency might affect analytics completeness.If this omission is intentional, consider adding a comment explaining why. Otherwise, add tracking for consistency:
<ToggleSwitch value={value} onChange={(newValue) => { onChange(newValue); + captureClick({ + elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.ISSUE_COMPLETED_TOGGLE, + }); handleSettingChange("issue_completed", newValue); }} size="sm" />Note: This assumes the constant
ISSUE_COMPLETED_TOGGLEexists inPROFILE_SETTINGS_TRACKER_ELEMENTS.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
packages/constants/src/event-tracker/core.ts(1 hunks)web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx(5 hunks)web/core/components/account/deactivate-account-modal.tsx(3 hunks)web/core/components/api-token/delete-token-modal.tsx(3 hunks)web/core/components/api-token/modal/create-token-modal.tsx(4 hunks)web/core/components/api-token/token-list-item.tsx(3 hunks)web/core/components/core/theme/custom-theme-selector.tsx(2 hunks)web/core/components/profile/form.tsx(5 hunks)web/core/components/profile/notification/email-notification-form.tsx(6 hunks)web/core/components/profile/preferences/language-timezone.tsx(3 hunks)web/core/components/profile/start-of-week-preference.tsx(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx (2)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".
web/core/components/profile/form.tsx (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
web/core/components/profile/preferences/language-timezone.tsx (1)
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".
🧬 Code Graph Analysis (6)
web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx (2)
web/helpers/event-tracker.helper.ts (1)
captureClick(52-54)packages/constants/src/event-tracker/core.ts (1)
PROFILE_SETTINGS_TRACKER_ELEMENTS(287-305)
web/core/components/api-token/token-list-item.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PROFILE_SETTINGS_TRACKER_ELEMENTS(287-305)
web/core/components/core/theme/custom-theme-selector.tsx (2)
web/helpers/event-tracker.helper.ts (1)
captureElementAndEvent(139-146)packages/constants/src/event-tracker/core.ts (2)
PROFILE_SETTINGS_TRACKER_ELEMENTS(287-305)PROFILE_SETTINGS_TRACKER_EVENTS(272-286)
web/core/components/profile/form.tsx (2)
web/helpers/event-tracker.helper.ts (1)
captureSuccess(112-114)packages/constants/src/event-tracker/core.ts (2)
PROFILE_SETTINGS_TRACKER_EVENTS(272-286)PROFILE_SETTINGS_TRACKER_ELEMENTS(287-305)
web/core/components/profile/start-of-week-preference.tsx (3)
web/helpers/event-tracker.helper.ts (1)
captureElementAndEvent(139-146)packages/constants/src/event-tracker/core.ts (2)
PROFILE_SETTINGS_TRACKER_ELEMENTS(287-305)PROFILE_SETTINGS_TRACKER_EVENTS(272-286)packages/ui/src/toast/index.tsx (1)
setToast(63-190)
web/core/components/profile/preferences/language-timezone.tsx (3)
web/helpers/event-tracker.helper.ts (1)
captureElementAndEvent(139-146)packages/constants/src/event-tracker/core.ts (2)
PROFILE_SETTINGS_TRACKER_ELEMENTS(287-305)PROFILE_SETTINGS_TRACKER_EVENTS(272-286)packages/ui/src/toast/index.tsx (1)
setToast(63-190)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (15)
packages/constants/src/event-tracker/core.ts (1)
272-305: LGTM! Well-structured tracking constants.The new profile settings tracking constants are well-organized, follow established naming conventions, and provide comprehensive coverage for profile settings interactions. The categorization by functionality (Account, Preferences, Notifications, PAT) makes them easy to understand and maintain.
web/core/components/api-token/token-list-item.tsx (2)
5-5: Import addition looks good.The import of
PROFILE_SETTINGS_TRACKER_ELEMENTSis correctly added for the tracking attribute.
35-35: Element tracking attribute properly implemented.The
data-ph-elementattribute is correctly added to the delete button using the appropriate constant, enabling proper tracking of user interactions with the delete functionality.web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx (2)
7-7: Tracking imports properly added.The imports for tracking constants and helper function are correctly added.
Also applies to: 18-18
58-63: Click tracking consistently implemented.The
captureClickcalls are properly implemented across all buttons that open the create token modal. Good differentiation between header and empty state buttons using different element identifiers, which will provide valuable analytics insights.Also applies to: 79-84, 96-101
web/core/components/core/theme/custom-theme-selector.tsx (1)
7-7: Tracking imports correctly added.The imports for tracking constants and helper function are properly added.
Also applies to: 13-13
web/core/components/api-token/modal/create-token-modal.tsx (2)
6-6: Tracking imports properly added.The imports for tracking constants and helper functions are correctly added.
Also applies to: 16-16
71-87: Event tracking correctly implemented for async operation.The tracking calls are properly placed within the promise success and error handlers, ensuring accurate capture of the actual operation outcomes. Good use of payload data (token ID) for success cases, which will be valuable for analytics.
web/core/components/account/deactivate-account-modal.tsx (1)
6-6: Event tracking implementation looks good!The tracking calls are properly placed within the success and error handlers, and the import statements are correctly added.
Also applies to: 11-11, 40-42, 53-55
web/core/components/profile/form.tsx (1)
352-359: Data attributes for element tracking are correctly implemented.The
data-ph-elementattributes on both the "Save Changes" and "Deactivate Account" buttons are properly added using the standardized constants.Also applies to: 384-390
web/core/components/profile/preferences/language-timezone.tsx (1)
2-2: Event tracking implementation is well-structured.The tracking calls are properly placed within the success and error handlers for both timezone and language updates. The use of
captureElementAndEventeffectively combines UI element tracking with business event tracking, and the payload structure is appropriate for each scenario.Also applies to: 6-6, 22-33, 41-49, 60-71, 79-87
web/core/components/profile/start-of-week-preference.tsx (4)
6-10: LGTM! Clean import organization.The tracking constants are properly imported and will provide type safety for the event tracking implementation.
14-14: Good addition of the event tracking helper.The
captureElementAndEventimport is correctly placed and necessary for the tracking functionality being added.
37-48: Excellent event tracking implementation for success case.The tracking call is well-structured with:
- Proper element identification using the constants
- Meaningful payload including the updated value
- Appropriate SUCCESS state indication
- Good placement before user notification
This provides valuable analytics data for understanding user behavior.
56-64: Consistent error tracking implementation.The error case tracking maintains consistency with the success case while appropriately excluding payload data. The ERROR state indication will help identify issues with profile updates.
* feat: event tracker helper * feat: track click events for `data-ph-element` * fix: handled click events * fix: handled name * chore: tracker element updates * chore: remove export * chore: tracker element type * chore: track element and event helper. * chore: minor improvements * chore: minor refactors * fix: workspace events * fix: added slug * fix: changes nomenclature * fix: nomenclature * chore: update event tracker helper types * fix: data id * refactor: cycle events (#7290) * chore: update event tracker helper types * refactor: cycle events * refactor: cycle events * refactor: cycle event tracker * chore: update tracker elements * chore: check for closest element with data-ph-element attribute --------- Co-authored-by: Prateek Shourya <prateekshourya@Prateeks-MacBook-Pro.local> * Refactor module events (#7291) * chore: update event tracker helper types * refactor: cycle events * refactor: cycle events * refactor: cycle event tracker * refactor: module tracker event and element * chore: update tracker element * chore: revert unnecessary changes --------- Co-authored-by: Prateek Shourya <prateekshourya@Prateeks-MacBook-Pro.local> * refactor: global views, product tour, notifications, onboarding, users and sidebar related events * chore: member tracker events (#7302) * chore: member-tracker-events * fix: constants * refactor: update event tracker constants * refactor: auth related event trackers (#7306) * Chore: state events (#7307) * chore: state events * fix: refactor * chore: project events (#7305) * chore: project-events * fix: refactor * fix: removed hardcoded values * fix: github redirection event * chore: project page tracker events (#7304) * added events for most page events * refactor: simplify lock button event handling in PageLockControl --------- Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com> Co-authored-by: M. Palanikannan <73993394+Palanikannan1437@users.noreply.github.com> * chore: minor cleanup and import fixes * refactor: added tracker elements for buttons (#7308) Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com> * fix: event type * refactor: posthog group event * chore: removed instances of event tracker (#7309) * refactor: remove event tracker stores and hooks * refactor: remove event tracker store * fix: build errors * clean up event tracker payloads * chore: profile settings events * fix: refactor --------- Co-authored-by: Prateek Shourya <prateekshourya@Prateeks-MacBook-Pro.local> Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com> Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com> Co-authored-by: M. Palanikannan <73993394+Palanikannan1437@users.noreply.github.com> Co-authored-by: Vamsi Krishna <46787868+vamsikrishnamathala@users.noreply.github.com> Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
Description
Implemented posthog events for profile settings
Summary by CodeRabbit
New Features
Bug Fixes
Style
Documentation
Chores