[WEB-4405] chore: project settings events#7362
Conversation
|
Caution Review failedThe pull request is closed. """ WalkthroughThis update introduces event tracking for various project settings UI components, including labels, estimates, automations, and feature toggles. New constants for tracker elements and events are added, and tracking calls are integrated into relevant user actions to capture analytics data. No public interfaces or control flows are altered. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI_Component
participant EventTracker
User->>UI_Component: Triggers action (e.g., toggle, create, delete)
UI_Component->>UI_Component: Perform original logic (update, delete, etc.)
UI_Component->>EventTracker: captureElementAndEvent/captureSuccess (with metadata)
EventTracker-->>UI_Component: Event logged
UI_Component->>User: Show toast/feedback
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (2)
apps/web/ce/components/estimates/estimate-list-item-buttons.tsx (1)
42-42: Use optional chaining for cleaner code.The conditional call can be simplified using optional chaining as suggested by the static analysis tool.
- onClick={() => onDeleteClick && onDeleteClick(estimateId)} + onClick={() => onDeleteClick?.(estimateId)}packages/constants/src/event-tracker/core.ts (1)
273-284: Addas constfor type-safety (optional)Other ELEMENTS objects (
CYCLE_TRACKER_ELEMENTS,MODULE_TRACKER_ELEMENTS, …) are frozen withas const; doing the same here keeps the typing uniform and prevents accidental value mutation.-export const PROJECT_SETTINGS_TRACKER_ELEMENTS = { +export const PROJECT_SETTINGS_TRACKER_ELEMENTS = { … -}; +} as const;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
apps/web/ce/components/estimates/estimate-list-item-buttons.tsx(2 hunks)apps/web/core/components/automation/auto-archive-automation.tsx(4 hunks)apps/web/core/components/automation/auto-close-automation.tsx(3 hunks)apps/web/core/components/estimates/delete/modal.tsx(3 hunks)apps/web/core/components/estimates/empty-screen.tsx(2 hunks)apps/web/core/components/estimates/estimate-disable-switch.tsx(3 hunks)apps/web/core/components/labels/label-block/label-item-block.tsx(3 hunks)apps/web/core/components/labels/project-setting-label-item.tsx(2 hunks)apps/web/core/components/labels/project-setting-label-list.tsx(4 hunks)apps/web/core/components/project/settings/features-list.tsx(3 hunks)packages/constants/src/event-tracker/core.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (6)
apps/web/ce/components/estimates/estimate-list-item-buttons.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/`.
apps/web/core/components/labels/project-setting-label-item.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/`.
apps/web/core/components/project/settings/features-list.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".
apps/web/core/components/labels/label-block/label-item-block.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/`.
apps/web/core/components/labels/project-setting-label-list.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: prateekshourya29
PR: makeplane/plane#7188
File: web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/header.tsx:40-45
Timestamp: 2025-06-18T09:46:08.566Z
Learning: When reviewing breadcrumb components that accept projectId or similar props, check if empty strings are being passed during loading states, which can result in invalid URLs. The preferred approach is to handle these loading states internally within the component rather than requiring each consumer to manage the loading logic.
apps/web/core/components/automation/auto-archive-automation.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: prateekshourya29
PR: makeplane/plane#7094
File: web/core/store/user/base-permissions.store.ts:196-201
Timestamp: 2025-05-28T09:53:44.635Z
Learning: All role enums in this codebase (EUserPermissions, EUserWorkspaceRoles, EUserProjectRoles) use the same consistent numeric values: ADMIN = 20, MEMBER = 15, GUEST = 5. None of these enums have a value of 0, so truthy checks work correctly with these enum values.
🧬 Code Graph Analysis (10)
apps/web/ce/components/estimates/estimate-list-item-buttons.tsx (2)
packages/constants/src/event-tracker/core.ts (1)
PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)packages/ui/src/tooltip/tooltip.tsx (1)
Tooltip(36-110)
apps/web/core/components/labels/project-setting-label-item.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)PROJECT_SETTINGS_TRACKER_EVENTS(284-297)
apps/web/core/components/project/settings/features-list.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PROJECT_TRACKER_EVENTS(25-30)
apps/web/core/components/labels/label-block/label-item-block.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
PROJECT_SETTINGS_TRACKER_EVENTS(284-297)PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)
apps/web/core/components/estimates/estimate-disable-switch.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)PROJECT_SETTINGS_TRACKER_EVENTS(284-297)
apps/web/core/components/estimates/empty-screen.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)PROJECT_SETTINGS_TRACKER_EVENTS(284-297)
apps/web/core/components/estimates/delete/modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PROJECT_SETTINGS_TRACKER_EVENTS(284-297)
apps/web/core/components/labels/project-setting-label-list.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)PROJECT_SETTINGS_TRACKER_EVENTS(284-297)
apps/web/core/components/automation/auto-archive-automation.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)PROJECT_SETTINGS_TRACKER_EVENTS(284-297)
apps/web/core/components/automation/auto-close-automation.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
PROJECT_SETTINGS_TRACKER_ELEMENTS(273-283)PROJECT_SETTINGS_TRACKER_EVENTS(284-297)
🪛 Biome (1.9.4)
apps/web/ce/components/estimates/estimate-list-item-buttons.tsx
[error] 42-42: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (12)
apps/web/ce/components/estimates/estimate-list-item-buttons.tsx (2)
4-4: LGTM: Tracking import added correctly.The import for
PROJECT_SETTINGS_TRACKER_ELEMENTSis correctly added to support the new tracking attributes.
35-35: LGTM: Tracking attributes added to both buttons.The
data-ph-elementattributes are correctly added to both the edit and delete buttons using the appropriate constantPROJECT_SETTINGS_TRACKER_ELEMENTS.ESTIMATES_LIST_ITEM.Also applies to: 43-43
apps/web/core/components/labels/project-setting-label-item.tsx (1)
5-5: LGTM: Tracking imports added correctly.The necessary imports for tracking constants and helper functions are properly added.
Also applies to: 8-8
apps/web/core/components/estimates/delete/modal.tsx (3)
6-6: LGTM: Tracking imports added correctly.The necessary imports for tracking constants and helper functions are properly added.
Also applies to: 9-9
40-45: LGTM: Success tracking properly placed.The success tracking call is correctly placed after the actual deletion operation completes, ensuring accurate analytics data.
54-59: LGTM: Error tracking properly implemented.The error tracking call is correctly placed in the catch block to capture failed deletion attempts.
apps/web/core/components/labels/label-block/label-item-block.tsx (2)
6-6: LGTM: Tracking imports added correctly.The necessary imports for tracking constants and helper functions are properly added.
Also applies to: 15-15
104-104: LGTM: Tracking attribute added correctly.The
data-ph-elementattribute is properly added to the delete button using the appropriate constant.apps/web/core/components/project/settings/features-list.tsx (2)
5-5: LGTM: Tracking imports added correctly.The necessary imports for tracking constants and helper functions are properly added.
Also applies to: 11-11
53-60: LGTM: Success tracking properly implemented.The tracking call is correctly placed in the
.then()handler, ensuring it only executes after the project update succeeds. The event name and payload structure are appropriate for feature toggle tracking.apps/web/core/components/estimates/estimate-disable-switch.tsx (1)
35-43: Well-implemented event tracking for async operations.The tracking calls are correctly placed after the actual
updateProjectoperation completes, properly capturing both success and error states. This demonstrates the right pattern for tracking async operations.Also applies to: 54-62
packages/constants/src/event-tracker/core.ts (1)
29-30: Confirm event-key naming pattern
feature_toggledis the first past-tense key insidePROJECT_TRACKER_EVENTS, whereas the existing keys use the infinitive (create,update,delete).
If consistency is important for downstream analytics queries, consider switching tofeature_toggle(to match the pattern) or migrating the other three keys to past-tense.
apps/web/core/components/automation/auto-archive-automation.tsx
Outdated
Show resolved
Hide resolved
* chore: workspace events * fix: refactor --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
Description
Implemented posthog events for project settings
Summary by CodeRabbit
New Features
Bug Fixes
Chores