Skip to content

[WEB-4405] chore: project settings events#7362

Merged
sriramveeraghanta merged 3 commits intopreviewfrom
chore-project-settings-events
Jul 10, 2025
Merged

[WEB-4405] chore: project settings events#7362
sriramveeraghanta merged 3 commits intopreviewfrom
chore-project-settings-events

Conversation

@gakshita
Copy link
Collaborator

@gakshita gakshita commented Jul 8, 2025

Description

Implemented posthog events for project settings

Summary by CodeRabbit

  • New Features

    • Added event tracking for various user actions in project settings, including toggling features, managing labels, and handling estimates and automations.
    • Introduced new UI element and event identifiers for improved analytics and telemetry.
  • Bug Fixes

    • No user-facing bugs were addressed in this release.
  • Chores

    • Enhanced internal event tracking capabilities for better monitoring of user interactions within project settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 8, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

This 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

File(s) Change Summary
packages/constants/src/event-tracker/core.ts Added new event and element constants for project settings tracking.
apps/web/ce/components/estimates/estimate-list-item-buttons.tsx Added data attribute for tracking to estimate list item buttons.
apps/web/core/components/automation/auto-archive-automation.tsx
auto-close-automation.tsx
Enhanced toggle handlers to include event tracking for automation toggles.
apps/web/core/components/estimates/delete/modal.tsx
estimate-disable-switch.tsx
empty-screen.tsx
Added event tracking calls for estimate deletion, toggle, and empty state create actions.
apps/web/core/components/labels/label-block/label-item-block.tsx
project-setting-label-item.tsx
project-setting-label-list.tsx
Integrated event tracking for label actions (delete, edit, create) and added tracking attributes to UI elements.
apps/web/core/components/project/settings/features-list.tsx Added event tracking for feature toggle actions.

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
Loading

Possibly related PRs

Suggested labels

ready to merge

Suggested reviewers

  • gakshita
  • prateekshourya29

Poem

🐇
A hop, a skip, a toggle tracked,
Now every click and button's backed.
With labels, estimates, features too,
Analytics bloom as actions ensue.
The rabbit logs with nimble cheer,
"Your settings' journeys are crystal clear!"
🥕
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50722ae and cac954c.

📒 Files selected for processing (1)
  • packages/constants/src/event-tracker/core.ts (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@makeplane
Copy link

makeplane bot commented Jul 8, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: Add as const for type-safety (optional)

Other ELEMENTS objects (CYCLE_TRACKER_ELEMENTS, MODULE_TRACKER_ELEMENTS, …) are frozen with as 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

📥 Commits

Reviewing files that changed from the base of the PR and between a4ec80c and 55d6841.

📒 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_ELEMENTS is correctly added to support the new tracking attributes.


35-35: LGTM: Tracking attributes added to both buttons.

The data-ph-element attributes are correctly added to both the edit and delete buttons using the appropriate constant PROJECT_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-element attribute 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 updateProject operation 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_toggled is the first past-tense key inside PROJECT_TRACKER_EVENTS, whereas the existing keys use the infinitive (create, update, delete).
If consistency is important for downstream analytics queries, consider switching to feature_toggle (to match the pattern) or migrating the other three keys to past-tense.

@sriramveeraghanta sriramveeraghanta merged commit 2e75ff7 into preview Jul 10, 2025
3 of 5 checks passed
@sriramveeraghanta sriramveeraghanta deleted the chore-project-settings-events branch July 10, 2025 11:35
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* chore: workspace events

* fix: refactor

---------

Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
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.

3 participants