[WEB-4409] refactor: event constants#7276
Conversation
|
Pull Request Linked with Plane Work Items
Comment Automatically Generated by Plane |
WalkthroughThis change centralizes and restructures event tracking constants and payload utilities, consolidating scattered event name constants into grouped objects and updating all usage sites accordingly. It introduces new core event tracker modules, refactors store interfaces and class names, and ensures all event tracking calls use the new, organized event key structure throughout the codebase. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as UI Component
participant Tracker as Event Tracker Store
participant Constants as Event Constants/Core
participant Analytics as Analytics Provider
UI->>Constants: Import grouped event constants (e.g., WORK_ITEM_TRACKER_EVENTS)
UI->>Tracker: Call captureEvent(eventKey, payload)
Tracker->>Analytics: Send event with standardized key and payload
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 (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
web/core/components/workspace-notifications/sidebar/notification-card/options/read.tsx (1)
30-46: Fix event tracking logic for read/unread actions.The function handles both marking as read and unread, but always logs the
all_marked_readevent regardless of the actual action performed. This creates inaccurate analytics data.Consider updating the event tracking logic to reflect the actual action:
const handleNotificationUpdate = async () => { try { const request = data.read_at ? markNotificationAsUnRead : markNotificationAsRead; await request(workspaceSlug); - captureEvent(NOTIFICATION_EVENT_TRACKER_KEYS.all_marked_read, { + captureEvent(data.read_at ? "Notification marked unread" : NOTIFICATION_EVENT_TRACKER_KEYS.all_marked_read, { issue_id: data?.data?.issue?.id, tab: currentNotificationTab, state: "SUCCESS", });Note: You may need to add an appropriate constant for the unread action in
NOTIFICATION_EVENT_TRACKER_KEYS.
🧹 Nitpick comments (13)
web/core/components/workspace/sidebar/user-menu-item.tsx (1)
52-54: Capture payload is missing “state” / “element” fields used elsewhereMost tracker invocations in the codebase include at least
state(SUCCESS/FAILED) and often anelementfield.
For consistency with the rest of the analytics pipeline – and to make downstream dashboards simpler – consider expanding the payload:-captureEvent(SIDEBAR_EVENT_TRACKER_KEYS.click, { - destination: itemKey, -}); +captureEvent(SIDEBAR_EVENT_TRACKER_KEYS.click, { + destination: itemKey, + element: "Sidebar", // keeps schema homogeneous + state: "SUCCESS", +});web/core/components/modules/delete-module-modal.tsx (1)
55-72: Consider capturing failure metadataSuccess and failure events share the same event key (
MODULE_EVENT_TRACKER_KEYS.delete). That’s fine, but the failure branch doesn’t include the error message, making root-cause analysis harder.captureModuleEvent({ eventName: MODULE_EVENT_TRACKER_KEYS.delete, - payload: { ...data, state: "FAILED" }, + payload: { + ...data, + state: "FAILED", + error: errors?.error ?? "Unknown", // propagate useful context + }, });web/core/components/project/member-list-item.tsx (1)
48-50: No failure event recordedOnly the successful leave path is tracked. To keep success/failure ratios accurate, mirror the success call inside the
.catchofleaveProject(and similarly forremoveMemberFromProject)..catch((err) => setToast({ // existing toast }) +).catch(() => { + captureEvent(MEMBER_EVENT_TRACKER_KEYS.project.leave, { + state: "FAILED", + element: "Project settings members page", + }); })web/core/components/project-states/create-update/create.tsx (1)
47-53: Differentiate success vs failure event keys for cleaner analyticsBoth the success and failure branches report the identical event key
STATE_EVENT_TRACKER_KEYS.create. Down-stream dashboards will now need to filter on thestatefield to separate successes from failures, which is easy to overlook and can muddy conversion funnels.
Consider introducing a dedicatedcreate_failed(or similar) key inSTATE_EVENT_TRACKER_KEYSand using that here for the failure path.Also applies to: 64-70
web/core/components/pages/modals/delete-page-modal.tsx (1)
48-55: Use distinct keys for success & failure to avoid double-counting deletesSimilar to the state-create flow, both branches emit
PAGE_EVENT_TRACKER_KEYS.delete. If you ever chart “page deleted” counts you’ll be aggregating successes plus failures unless you remember to excludestate:"FAILED". A separatedelete_failedkey (or prefix both keys with an outcome) keeps the raw event stream self-describing.Also applies to: 67-73
web/core/components/home/root.tsx (1)
41-44: Optional: capture a matching failure event
captureEventis invoked only on.then. IfupdateTourCompleted()rejects, analytics will lack visibility into tour-completion failures.
Emitting a complementary event inside the.catch(e.g.,PRODUCT_TOUR_EVENT_TRACKER_KEYS.completewithstate:"FAILED") preserves parity with the rest of the codebase.web/core/components/workspace/settings/members-list-item.tsx (1)
48-51: Event may be dropped due to immediate navigation
router.pushtriggers a route change beforecaptureEventhas a chance to flush its network call, risking a lost analytics hit.
IfcaptureEventis asynchronous, await it (or call a sync wrapper) before navigating.- router.push(getWorkspaceRedirectionUrl()); - captureEvent(MEMBER_EVENT_TRACKER_KEYS.workspace.leave, { + await captureEvent(MEMBER_EVENT_TRACKER_KEYS.workspace.leave, { state: "SUCCESS", element: "Workspace settings members page", }); + router.push(getWorkspaceRedirectionUrl());web/core/components/project/form.tsx (1)
114-116: Includechanged_propertiesin failure payload for parityOn success you record
changed_properties, but on failure you omit it. Having the attempted-to-change fields is often useful when debugging why an update failed. Consider re-using the samechanged_propertiesarray you already computed.- payload: { ...payload, state: "FAILED", element: "Project general settings" }, + payload: { + ...payload, + changed_properties, + state: "FAILED", + element: "Project general settings", + },web/core/components/onboarding/tour/root.tsx (1)
115-116: Send a minimal payload for consistency with other event capturesOther parts of the codebase (e.g. workspace/project delete flows) attach
{ state: "SUCCESS" | "FAILED" }or similar metadata. To keep your analytics schema uniform, consider supplying at least astatefield forstart/skip.-captureEvent(PRODUCT_TOUR_EVENT_TRACKER_KEYS.start); +captureEvent(PRODUCT_TOUR_EVENT_TRACKER_KEYS.start, { state: "SUCCESS" }); ... -captureEvent(PRODUCT_TOUR_EVENT_TRACKER_KEYS.skip); +captureEvent(PRODUCT_TOUR_EVENT_TRACKER_KEYS.skip, { state: "SKIPPED" });Also applies to: 125-126
web/core/components/project-states/state-delete-modal.tsx (1)
44-45: Use bracket notation for reserved word propertydelete
deleteis a reserved keyword. Whileobject.deleteworks, some linters/TS configs complain. Bracket notation avoids false positives.-eventName: STATE_EVENT_TRACKER_KEYS.delete, +eventName: STATE_EVENT_TRACKER_KEYS["delete"],Also applies to: 67-68
web/core/components/workspace/delete-workspace-form.tsx (1)
68-69: Prefer bracket access fordeletekeySame rationale as above—avoids keyword clashes and keeps eslint happy.
-eventName: WORKSPACE_EVENT_TRACKER_KEYS.delete, +eventName: WORKSPACE_EVENT_TRACKER_KEYS["delete"],Also applies to: 88-89
web/core/components/workspace/views/delete-view-modal.tsx (1)
40-43: Bracket notation fordeletekey improves lint compatibilityMinor style suggestion to silence reserved-keyword warnings.
-captureEvent(GLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYS.delete, { +captureEvent(GLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYS["delete"], { ... });Also applies to: 46-49
packages/constants/src/event-tracker/core.ts (1)
29-29: Use strict equality comparison.Replace loose equality (
==) with strict equality (===) for better type safety and consistency.- project_visibility: payload.network == 2 ? "Public" : "Private", + project_visibility: payload.network === 2 ? "Public" : "Private",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (61)
packages/constants/src/event-tracker.ts(0 hunks)packages/constants/src/event-tracker/core.ts(1 hunks)packages/constants/src/index.ts(1 hunks)web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx(3 hunks)web/app/(all)/accounts/forgot-password/page.tsx(4 hunks)web/app/(all)/invitations/page.tsx(3 hunks)web/app/(all)/onboarding/page.tsx(2 hunks)web/app/(all)/sign-up/page.tsx(2 hunks)web/app/(home)/page.tsx(2 hunks)web/ce/components/projects/create/root.tsx(2 hunks)web/core/components/account/auth-forms/password.tsx(3 hunks)web/core/components/account/auth-forms/unique-code.tsx(2 hunks)web/core/components/cycles/analytics-sidebar/sidebar-header.tsx(3 hunks)web/core/components/cycles/delete-modal.tsx(3 hunks)web/core/components/cycles/list/cycle-list-item-action.tsx(5 hunks)web/core/components/cycles/modal.tsx(5 hunks)web/core/components/home/root.tsx(2 hunks)web/core/components/inbox/content/issue-root.tsx(4 hunks)web/core/components/inbox/modals/create-modal/create-root.tsx(3 hunks)web/core/components/issues/issue-detail-widgets/relations/helper.tsx(4 hunks)web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx(3 hunks)web/core/components/issues/issue-detail/root.tsx(12 hunks)web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx(2 hunks)web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx(4 hunks)web/core/components/issues/issue-layouts/properties/all-properties.tsx(10 hunks)web/core/components/issues/issue-layouts/quick-add/root.tsx(2 hunks)web/core/components/issues/issue-modal/base.tsx(5 hunks)web/core/components/issues/peek-overview/root.tsx(18 hunks)web/core/components/modules/analytics-sidebar/root.tsx(5 hunks)web/core/components/modules/delete-module-modal.tsx(3 hunks)web/core/components/modules/modal.tsx(5 hunks)web/core/components/modules/module-card-item.tsx(3 hunks)web/core/components/modules/module-list-item-action.tsx(3 hunks)web/core/components/onboarding/create-workspace.tsx(3 hunks)web/core/components/onboarding/invitations.tsx(3 hunks)web/core/components/onboarding/invite-members.tsx(4 hunks)web/core/components/onboarding/profile-setup.tsx(6 hunks)web/core/components/onboarding/tour/root.tsx(3 hunks)web/core/components/pages/modals/create-page-modal.tsx(3 hunks)web/core/components/pages/modals/delete-page-modal.tsx(3 hunks)web/core/components/project-states/create-update/create.tsx(3 hunks)web/core/components/project-states/create-update/update.tsx(3 hunks)web/core/components/project-states/options/delete.tsx(3 hunks)web/core/components/project-states/state-delete-modal.tsx(3 hunks)web/core/components/project/delete-project-modal.tsx(3 hunks)web/core/components/project/form.tsx(3 hunks)web/core/components/project/leave-project-modal.tsx(3 hunks)web/core/components/project/member-list-item.tsx(2 hunks)web/core/components/project/send-project-invitation-modal.tsx(3 hunks)web/core/components/workspace-notifications/sidebar/header/options/root.tsx(2 hunks)web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx(2 hunks)web/core/components/workspace-notifications/sidebar/notification-card/options/read.tsx(2 hunks)web/core/components/workspace/create-workspace-form.tsx(6 hunks)web/core/components/workspace/delete-workspace-form.tsx(3 hunks)web/core/components/workspace/settings/members-list-item.tsx(2 hunks)web/core/components/workspace/settings/workspace-details.tsx(3 hunks)web/core/components/workspace/sidebar/user-menu-item.tsx(2 hunks)web/core/components/workspace/views/delete-view-modal.tsx(2 hunks)web/core/components/workspace/views/header.tsx(2 hunks)web/core/components/workspace/views/modal.tsx(5 hunks)web/core/store/event-tracker.store.ts(2 hunks)
💤 Files with no reviewable changes (1)
- packages/constants/src/event-tracker.ts
🧰 Additional context used
🧠 Learnings (27)
packages/constants/src/index.ts (2)
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/read.tsx:11-12
Timestamp: 2024-11-28T07:02:15.514Z
Learning: Some components are still in core and have not been moved yet, so their import paths remain the same.
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/archive.tsx:11-14
Timestamp: 2024-11-28T07:02:54.664Z
Learning: When components are still located in `core`, it's appropriate for files to import them using `@/components/...`, and the migration to the new import paths is not necessary in such cases.
web/core/components/workspace/sidebar/user-menu-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/`.
web/core/components/workspace-notifications/sidebar/header/options/root.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/project-states/options/delete.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/workspace-notifications/sidebar/notification-card/options/archive.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/modules/delete-module-modal.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/issues/issue-layouts/quick-add/root.tsx (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
web/core/components/inbox/modals/create-modal/create-root.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/ce/components/projects/create/root.tsx (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
web/core/components/project/send-project-invitation-modal.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/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx (1)
Learnt from: mathalav55
PR: makeplane/plane#6452
File: web/helpers/issue.helper.ts:6-6
Timestamp: 2025-01-24T09:37:19.339Z
Learning: In the Plane codebase, `ISSUE_DISPLAY_FILTERS_BY_LAYOUT` and `ISSUE_DISPLAY_FILTERS_BY_PAGE` are two distinct constants serving different purposes - one for layout-level filters and another for page-level filters. They are not interchangeable and should coexist.
web/core/components/modules/module-list-item-action.tsx (1)
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/read.tsx:11-12
Timestamp: 2024-11-28T07:02:15.514Z
Learning: Some components are still in core and have not been moved yet, so their import paths remain the same.
web/core/components/project/delete-project-modal.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/issues/issue-detail-widgets/relations/helper.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/project/form.tsx (2)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
Learnt from: vamsikrishnamathala
PR: makeplane/plane#6820
File: web/core/hooks/use-timezone-converter.tsx:19-39
Timestamp: 2025-03-26T07:22:45.741Z
Learning: In the Plane project, the `getProjectUTCOffset` function in the timezone converter hook is designed to return undefined when there is no difference between the project's timezone and UTC (when offset is 0).
web/core/components/account/auth-forms/password.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/cycles/delete-modal.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/app/(all)/accounts/forgot-password/page.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/onboarding/invite-members.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/issues/issue-layouts/properties/all-properties.tsx (2)
Learnt from: mathalav55
PR: makeplane/plane#6452
File: web/helpers/issue.helper.ts:6-6
Timestamp: 2025-01-24T09:37:19.339Z
Learning: In the Plane codebase, `ISSUE_DISPLAY_FILTERS_BY_LAYOUT` and `ISSUE_DISPLAY_FILTERS_BY_PAGE` are two distinct constants serving different purposes - one for layout-level filters and another for page-level filters. They are not interchangeable and should coexist.
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
web/core/components/issues/issue-detail/issue-detail-quick-actions.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/inbox/content/issue-root.tsx (2)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
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/issues/issue-layouts/kanban/base-kanban-root.tsx (1)
Learnt from: mathalav55
PR: makeplane/plane#6452
File: web/helpers/issue.helper.ts:6-6
Timestamp: 2025-01-24T09:37:19.339Z
Learning: In the Plane codebase, `ISSUE_DISPLAY_FILTERS_BY_LAYOUT` and `ISSUE_DISPLAY_FILTERS_BY_PAGE` are two distinct constants serving different purposes - one for layout-level filters and another for page-level filters. They are not interchangeable and should coexist.
web/core/components/issues/peek-overview/root.tsx (2)
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".
Learnt from: mathalav55
PR: makeplane/plane#6452
File: web/helpers/issue.helper.ts:6-6
Timestamp: 2025-01-24T09:37:19.339Z
Learning: In the Plane codebase, `ISSUE_DISPLAY_FILTERS_BY_LAYOUT` and `ISSUE_DISPLAY_FILTERS_BY_PAGE` are two distinct constants serving different purposes - one for layout-level filters and another for page-level filters. They are not interchangeable and should coexist.
web/core/components/modules/module-card-item.tsx (1)
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/read.tsx:11-12
Timestamp: 2024-11-28T07:02:15.514Z
Learning: Some components are still in core and have not been moved yet, so their import paths remain the same.
web/core/components/issues/issue-detail/root.tsx (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
web/core/components/issues/issue-modal/base.tsx (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
🧬 Code Graph Analysis (56)
web/app/(all)/sign-up/page.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
AUTH_EVENT_TRACKER_KEYS(215-225)
web/core/components/workspace-notifications/sidebar/notification-card/options/read.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
NOTIFICATION_EVENT_TRACKER_KEYS(240-243)
web/app/(all)/onboarding/page.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
USER_EVENT_TRACKER_KEYS(245-248)
web/core/components/project-states/state-delete-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
STATE_EVENT_TRACKER_KEYS(191-195)
web/core/components/workspace/sidebar/user-menu-item.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
SIDEBAR_EVENT_TRACKER_KEYS(256-258)
web/app/(home)/page.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
AUTH_EVENT_TRACKER_KEYS(215-225)
web/core/components/workspace-notifications/sidebar/header/options/root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
NOTIFICATION_EVENT_TRACKER_KEYS(240-243)
web/core/components/cycles/analytics-sidebar/sidebar-header.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
CYCLE_EVENT_TRACKER_KEYS(162-168)
web/core/components/project/member-list-item.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/core/components/account/auth-forms/unique-code.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
AUTH_EVENT_TRACKER_KEYS(215-225)
web/core/components/pages/modals/create-page-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PAGE_EVENT_TRACKER_KEYS(197-201)
web/core/components/project-states/options/delete.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
STATE_EVENT_TRACKER_KEYS(191-195)
web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
NOTIFICATION_EVENT_TRACKER_KEYS(240-243)
web/core/components/workspace/settings/members-list-item.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/core/components/project/leave-project-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/core/components/pages/modals/delete-page-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PAGE_EVENT_TRACKER_KEYS(197-201)
web/core/components/workspace/views/delete-view-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
GLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYS(233-238)
web/core/components/project-states/create-update/create.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
STATE_EVENT_TRACKER_KEYS(191-195)
web/core/components/modules/delete-module-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MODULE_EVENT_TRACKER_KEYS(170-181)
web/core/components/issues/issue-layouts/quick-add/root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)
web/core/components/inbox/modals/create-modal/create-root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)
web/core/components/modules/modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MODULE_EVENT_TRACKER_KEYS(170-181)
web/ce/components/projects/create/root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PROJECT_EVENT_TRACKER_KEYS(156-160)
web/core/components/project/send-project-invitation-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
GLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYS(233-238)
web/core/components/home/root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PRODUCT_TOUR_EVENT_TRACKER_KEYS(227-231)
web/core/components/modules/module-list-item-action.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MODULE_EVENT_TRACKER_KEYS(170-181)
web/core/components/project/delete-project-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PROJECT_EVENT_TRACKER_KEYS(156-160)
web/core/components/workspace/delete-workspace-form.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORKSPACE_EVENT_TRACKER_KEYS(150-154)
web/app/(all)/invitations/page.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/core/components/onboarding/invitations.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/core/components/cycles/modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
CYCLE_EVENT_TRACKER_KEYS(162-168)
web/core/components/issues/issue-detail-widgets/relations/helper.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)
web/core/components/onboarding/tour/root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PRODUCT_TOUR_EVENT_TRACKER_KEYS(227-231)
web/core/components/project/form.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
PROJECT_EVENT_TRACKER_KEYS(156-160)
web/core/components/workspace/settings/workspace-details.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORKSPACE_EVENT_TRACKER_KEYS(150-154)
web/core/components/project-states/create-update/update.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
STATE_EVENT_TRACKER_KEYS(191-195)
web/core/components/account/auth-forms/password.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
AUTH_EVENT_TRACKER_KEYS(215-225)
web/core/components/workspace/views/header.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
GLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYS(233-238)
web/core/components/cycles/delete-modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
CYCLE_EVENT_TRACKER_KEYS(162-168)
web/core/components/modules/analytics-sidebar/root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MODULE_EVENT_TRACKER_KEYS(170-181)
web/app/(all)/accounts/forgot-password/page.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
AUTH_EVENT_TRACKER_KEYS(215-225)
web/core/components/onboarding/invite-members.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MEMBER_EVENT_TRACKER_KEYS(203-213)
web/core/components/issues/issue-layouts/properties/all-properties.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)
web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx (3)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)packages/ui/src/toast/index.tsx (1)
setToast(63-190)packages/i18n/src/store/index.ts (1)
t(211-232)
web/core/components/cycles/list/cycle-list-item-action.tsx (2)
web/core/hooks/store/use-cycle.ts (1)
useCycle(7-11)packages/constants/src/event-tracker/core.ts (1)
CYCLE_EVENT_TRACKER_KEYS(162-168)
web/core/components/onboarding/profile-setup.tsx (1)
packages/constants/src/event-tracker/core.ts (2)
USER_EVENT_TRACKER_KEYS(245-248)ONBOARDING_EVENT_TRACKER_KEYS(250-254)
web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)
web/core/components/onboarding/create-workspace.tsx (2)
packages/constants/src/event-tracker/core.ts (2)
WORKSPACE_EVENT_TRACKER_KEYS(150-154)ONBOARDING_EVENT_TRACKER_KEYS(250-254)packages/i18n/src/store/index.ts (1)
t(211-232)
web/core/components/issues/peek-overview/root.tsx (4)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)web/ce/store/issue/issue-details/activity.store.ts (1)
fetchActivities(123-159)web/core/services/issue/issue_archive.service.ts (1)
restoreIssue(43-49)packages/i18n/src/store/index.ts (1)
t(211-232)
web/core/components/modules/module-card-item.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
MODULE_EVENT_TRACKER_KEYS(170-181)
web/core/components/workspace/views/modal.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
GLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYS(233-238)
web/core/store/event-tracker.store.ts (1)
packages/constants/src/event-tracker/core.ts (1)
WORKSPACE_EVENT_TRACKER_KEYS(150-154)
web/core/components/issues/issue-detail/root.tsx (3)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)packages/ui/src/toast/index.tsx (1)
setToast(63-190)packages/i18n/src/store/index.ts (1)
t(211-232)
web/core/components/issues/issue-modal/base.tsx (1)
packages/constants/src/event-tracker/core.ts (1)
WORK_ITEM_EVENT_TRACKER_KEYS(183-189)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (71)
web/core/components/workspace-notifications/sidebar/notification-card/options/read.tsx (1)
6-6: LGTM: Import refactoring is consistent.The import change from individual constant to grouped
NOTIFICATION_EVENT_TRACKER_KEYSaligns with the systematic refactoring across the codebase.web/core/components/inbox/modals/create-modal/create-root.tsx (2)
7-7: LGTM: Import refactoring is consistent.The import change from
ISSUE_CREATEDtoWORK_ITEM_EVENT_TRACKER_KEYSaligns with the systematic refactoring to consolidate event constants.
170-178: LGTM: Event tracking calls updated correctly.Both success and failure event tracking calls have been correctly updated to use
WORK_ITEM_EVENT_TRACKER_KEYS.create, maintaining consistency in the refactoring pattern.Also applies to: 187-195
web/app/(all)/onboarding/page.tsx (2)
7-7: LGTM: Import refactoring is consistent.The import change from
USER_ONBOARDING_COMPLETEDtoUSER_EVENT_TRACKER_KEYSaligns with the systematic refactoring to consolidate event constants.
76-76: LGTM: Event tracking call updated correctly.The event name has been correctly updated to use
USER_EVENT_TRACKER_KEYS.onboarding_complete, maintaining consistency with the refactoring pattern.web/core/components/cycles/delete-modal.tsx (2)
7-7: LGTM: Import refactoring is consistent.The import change from
CYCLE_DELETEDtoCYCLE_EVENT_TRACKER_KEYSaligns with the systematic refactoring to consolidate event constants.
52-55: LGTM: Event tracking calls updated correctly.Both success and failure event tracking calls have been correctly updated to use
CYCLE_EVENT_TRACKER_KEYS.delete, maintaining consistency in the refactoring pattern.Also applies to: 67-70
web/ce/components/projects/create/root.tsx (2)
6-6: LGTM: Import refactoring is consistent.The import change from
PROJECT_CREATEDtoPROJECT_EVENT_TRACKER_KEYSaligns with the systematic refactoring to consolidate event constants.
77-80: LGTM: Event tracking call updated correctly.The event name has been correctly updated to use
PROJECT_EVENT_TRACKER_KEYS.create, maintaining consistency with the refactoring pattern.web/core/components/cycles/analytics-sidebar/sidebar-header.tsx (2)
8-8: Import looks goodThe switch to the namespaced
CYCLE_EVENT_TRACKER_KEYSkeeps the import list tidy and prevents constant bloat. No further action required.
70-83: 👍 Consistent event key usageBoth success and failure branches now reference the same
CYCLE_EVENT_TRACKER_KEYS.updateconstant, eliminating the risk of divergent event names.
No issues spotted.web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx (1)
34-38: Archiving and un-archiving are logged as the same event
NOTIFICATION_EVENT_TRACKER_KEYS.archiveis emitted whether the user is archiving or un-archiving.
If the analytics model needs to distinguish these actions, add a dedicated key (e.g.unarchive) or include an explicit flag:- captureEvent(NOTIFICATION_EVENT_TRACKER_KEYS.archive, { - issue_id: data?.data?.issue?.id, - tab: currentNotificationTab, - state: "SUCCESS", - }); + captureEvent( + NOTIFICATION_EVENT_TRACKER_KEYS.archive, // or NOTIFICATION_EVENT_TRACKER_KEYS.unarchive + { + issue_id: data?.data?.issue?.id, + tab: currentNotificationTab, + action: data.archived_at ? "UNARCHIVE" : "ARCHIVE", + state: "SUCCESS", + } + );web/core/components/workspace-notifications/sidebar/header/options/root.tsx (1)
5-5: LGTM! Event constant refactoring implemented correctly.The import and usage have been correctly updated to use the new grouped event constants. The change from
NOTIFICATIONS_READtoNOTIFICATION_EVENT_TRACKER_KEYS.all_marked_readmaintains the same functionality while improving code organization.Also applies to: 53-53
web/core/components/project/leave-project-modal.tsx (1)
11-11: LGTM! Consistent event constant refactoring.The changes correctly update both the import and all usage instances. The nested structure
MEMBER_EVENT_TRACKER_KEYS.project.leaveprovides better semantic meaning and organization compared to the previous individual constant.Also applies to: 67-70, 78-81
web/app/(all)/sign-up/page.tsx (1)
9-9: LGTM! Auth event constant refactoring applied correctly.The change from
NAVIGATE_TO_SIGNINtoAUTH_EVENT_TRACKER_KEYS.navigate.sign_infollows the consistent refactoring pattern and improves the semantic organization of authentication-related events.Also applies to: 57-57
web/app/(all)/invitations/page.tsx (1)
12-12: LGTM! Member event constant refactoring implemented consistently.Both success and failure event captures have been updated to use
MEMBER_EVENT_TRACKER_KEYS.accept, maintaining consistency throughout the invitation acceptance flow. The grouping of member-related events improves code organization.Also applies to: 89-97, 115-120
web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx (1)
16-16: LGTM! Global view event constant refactoring applied correctly.The change from
GLOBAL_VIEW_UPDATEDtoGLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYS.updatemaintains the same functionality while organizing global view events into a cohesive group. The import and usage are both updated consistently.Also applies to: 117-122
web/core/components/project/form.tsx (1)
6-6: Centralised constant import looks goodImporting
PROJECT_EVENT_TRACKER_KEYSfrom the consolidated constants module is in line with the new pattern and keeps event names type-safe.web/core/components/onboarding/tour/root.tsx (1)
8-8: 👍 Switched to namespaced event keysThe new import aligns with the refactor and avoids scattered literal strings.
web/core/components/workspace/views/delete-view-modal.tsx (1)
7-7: Import update LGTMThe new grouped constant import reflects the refactor correctly.
web/core/components/pages/modals/create-page-modal.tsx (1)
3-3: LGTM! Event constant refactoring is consistent.The import and usage have been correctly updated to use the new grouped event constants. The change from
PAGE_CREATEDtoPAGE_EVENT_TRACKER_KEYS.createmaintains the same functionality while improving code organization.Also applies to: 66-66, 77-77
packages/constants/src/index.ts (1)
28-28: LGTM! Export path correctly updated.The export path has been properly updated to reference the new core event tracker module, maintaining consistency with the overall refactoring.
web/core/components/project/send-project-invitation-modal.tsx (1)
9-9: LGTM! Member event constant refactoring is consistent.The import and both event tracking calls have been correctly updated to use the new grouped structure. The change from
PROJECT_MEMBER_ADDEDtoMEMBER_EVENT_TRACKER_KEYS.project.addmaintains functionality while improving code organization.Also applies to: 89-89, 102-102
web/core/components/modules/module-card-item.tsx (1)
15-15: LGTM! Module event constant refactoring is consistent.The import and both event tracking calls have been correctly updated to use the grouped constants. The changes from individual constants to
MODULE_EVENT_TRACKER_KEYS.favoriteandMODULE_EVENT_TRACKER_KEYS.unfavoritemaintain functionality while improving code organization.Also applies to: 82-82, 113-113
web/app/(home)/page.tsx (1)
9-9: LGTM! Auth event constant refactoring is consistent.The import and event tracking call have been correctly updated to use the new grouped structure. The change from
NAVIGATE_TO_SIGNUPtoAUTH_EVENT_TRACKER_KEYS.navigate.sign_upmaintains functionality while improving code organization.Also applies to: 66-66
web/core/components/onboarding/invite-members.tsx (2)
3-3: Good cleanup: removed unused import.Removing the unused
useRefimport improves code cleanliness.
23-23: LGTM: Event constants refactoring is consistent.The migration from
MEMBER_INVITEDtoMEMBER_EVENT_TRACKER_KEYS.invitemaintains the same event tracking functionality while improving code organization through namespaced constants.Also applies to: 314-314, 334-334
web/core/components/project/delete-project-modal.tsx (1)
9-9: LGTM: Consistent with event constants refactoring.The migration from
PROJECT_DELETEDtoPROJECT_EVENT_TRACKER_KEYS.deletemaintains the same tracking behavior while following the new organized constant structure.Also applies to: 66-66, 77-77
web/core/components/modules/module-list-item-action.tsx (1)
14-14: LGTM: Module event constants properly refactored.The consolidation of
MODULE_FAVORITEDandMODULE_UNFAVORITEDintoMODULE_EVENT_TRACKER_KEYS.favoriteandMODULE_EVENT_TRACKER_KEYS.unfavoriteimproves organization while maintaining the same event tracking functionality.Also applies to: 71-71, 102-102
web/core/components/issues/issue-layouts/quick-add/root.tsx (1)
9-9: LGTM: Issue event constants successfully migrated to work item abstraction.The transition from
ISSUE_CREATEDtoWORK_ITEM_EVENT_TRACKER_KEYS.createprovides better abstraction and consistency with the new event tracking structure.Also applies to: 140-140, 147-147
web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx (1)
8-8: LGTM: Member invitation events consistently refactored.The migration from
MEMBER_INVITEDtoMEMBER_EVENT_TRACKER_KEYS.inviteis consistent with the refactoring pattern applied across the codebase and maintains the same tracking functionality.Also applies to: 55-55, 73-73
web/core/components/workspace/views/header.tsx (1)
11-11: LGTM: Clean refactor to grouped event constantsThe refactor properly consolidates the individual
GLOBAL_VIEW_OPENEDconstant into theGLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYSobject structure. The usage correctly references.openproperty, maintaining the same event tracking functionality while improving code organization.Also applies to: 80-80
web/core/components/modules/modal.tsx (1)
7-7: LGTM: Consistent refactor across all module event trackingThe refactor correctly consolidates
MODULE_CREATEDandMODULE_UPDATEDconstants into theMODULE_EVENT_TRACKER_KEYSobject. All four event tracking calls are consistently updated to use.createand.updateproperties, maintaining proper event tracking for both success and failure scenarios.Also applies to: 67-67, 78-78, 98-98, 109-109
web/core/components/workspace/views/modal.tsx (1)
7-7: LGTM: Proper consolidation of global view event constantsThe refactor successfully consolidates
GLOBAL_VIEW_CREATEDandGLOBAL_VIEW_UPDATEDinto theGLOBAL_VIEW_TOUR_EVENT_TRACKER_KEYSobject. All event tracking calls are correctly updated to use.createand.updateproperties, ensuring consistent event tracking across both success and failure scenarios for view operations.Also applies to: 50-50, 65-65, 90-90, 104-104
web/core/components/project-states/options/delete.tsx (1)
7-7: LGTM: Correct refactor of state event trackingThe refactor properly consolidates the
STATE_DELETEDconstant into theSTATE_EVENT_TRACKER_KEYSobject. Both event tracking calls correctly use the.deleteproperty, maintaining consistent event tracking for both successful and failed state deletion operations.Also applies to: 49-49, 59-59
web/core/components/workspace/settings/workspace-details.tsx (1)
8-13: LGTM: Successful refactor of workspace event trackingThe refactor correctly consolidates the
WORKSPACE_UPDATEDconstant into theWORKSPACE_EVENT_TRACKER_KEYSobject structure. The import is properly updated and both event tracking calls consistently use the.updateproperty, preserving the same event tracking behavior for workspace update success and failure scenarios.Also applies to: 70-70, 85-85
web/app/(all)/accounts/forgot-password/page.tsx (1)
12-12: LGTM! Event tracking constants refactor implemented correctly.The refactor properly consolidates individual authentication event constants into the grouped
AUTH_EVENT_TRACKER_KEYSobject. All import and usage changes are consistent with the new structure defined in the core event tracker module.Also applies to: 74-74, 85-85, 123-123
web/core/components/project-states/create-update/update.tsx (1)
5-5: LGTM! State event tracking refactor implemented correctly.The refactor successfully replaces the individual
STATE_UPDATEDconstant with the groupedSTATE_EVENT_TRACKER_KEYS.updatekey. The change is consistent and maintains the same event tracking functionality while improving code organization.Also applies to: 47-47, 77-77
web/core/components/issues/issue-detail-widgets/relations/helper.tsx (1)
5-5: LGTM! Work item event tracking refactor implemented correctly.The refactor properly consolidates individual issue event constants (
ISSUE_UPDATED,ISSUE_DELETED) into the groupedWORK_ITEM_EVENT_TRACKER_KEYSobject. All event tracking calls are correctly updated to use the new nested structure (update,delete).Also applies to: 44-44, 59-59, 78-78, 85-85
web/core/components/cycles/modal.tsx (1)
7-7: LGTM! Cycle event tracking refactor implemented correctly.The refactor successfully consolidates individual cycle event constants (
CYCLE_CREATED,CYCLE_UPDATED) into the groupedCYCLE_EVENT_TRACKER_KEYSobject. All event tracking calls in both success and error scenarios are correctly updated to use the new structure.Also applies to: 67-67, 78-78, 92-92, 103-103
web/core/components/onboarding/invitations.tsx (1)
5-5: LGTM! Member event tracking refactor implemented correctly.The refactor properly replaces the individual
MEMBER_ACCEPTEDconstant with the groupedMEMBER_EVENT_TRACKER_KEYS.acceptkey. Both success and error event tracking scenarios in the invitation submission flow are correctly updated.Also applies to: 53-53, 66-66
web/core/components/account/auth-forms/password.tsx (1)
9-9: LGTM! Event constants successfully refactored to use grouped structure.The authentication event tracking constants have been properly updated from individual constants to the new
AUTH_EVENT_TRACKER_KEYSobject. All event tracking calls are consistently updated and the import is correct.Also applies to: 80-80, 88-88, 157-161
web/core/store/event-tracker.store.ts (1)
15-15: LGTM! Workspace event constant properly refactored.The workspace creation event tracking has been correctly updated to use
WORKSPACE_EVENT_TRACKER_KEYS.createfrom the new grouped constants structure.Also applies to: 118-118
web/core/components/inbox/content/issue-root.tsx (1)
7-7: LGTM! Work item event constants properly updated.The issue deletion and archiving event tracking has been correctly updated to use the new
WORK_ITEM_EVENT_TRACKER_KEYSstructure. The terminology change from "ISSUE_" to "WORK_ITEM_" aligns with the broader codebase terminology.Also applies to: 108-108, 120-120, 159-159, 166-166
web/core/components/issues/issue-layouts/properties/all-properties.tsx (1)
10-10: LGTM! Comprehensive update to work item event tracking.All issue property update event tracking has been consistently updated to use
WORK_ITEM_EVENT_TRACKER_KEYS.updatefrom the new grouped constants structure. The changes are applied uniformly across all property handlers (state, priority, labels, assignees, modules, cycles, dates, estimates).Also applies to: 112-112, 127-127, 142-142, 157-157, 182-182, 198-198, 212-212, 229-229, 245-245
web/core/components/modules/analytics-sidebar/root.tsx (1)
9-15: LGTM! Module and module link events properly refactored.The module event tracking has been correctly updated to use the new
MODULE_EVENT_TRACKER_KEYSstructure, including the proper nested structure for module link operations (MODULE_EVENT_TRACKER_KEYS.link.create,MODULE_EVENT_TRACKER_KEYS.link.update,MODULE_EVENT_TRACKER_KEYS.link.delete).Also applies to: 83-83, 89-89, 101-101, 115-115, 127-127
web/core/components/onboarding/create-workspace.tsx (2)
7-12: LGTM! Event constants refactor correctly implemented.The import and usage updates properly map to the new grouped constants structure. The event tracking functionality remains unchanged while improving code organization.
Also applies to: 77-77, 82-82, 90-90, 94-94
271-274: LGTM! Minor formatting improvement.The multiline span wrapper for the placeholder text improves readability.
web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx (2)
16-16: LGTM! Event constants refactor correctly implemented.The mapping from
ISSUE_DELETEDtoWORK_ITEM_EVENT_TRACKER_KEYS.deletepreserves the event tracking functionality while aligning with the new grouped constants structure.Also applies to: 213-213
155-155: LGTM! useEffect dependency optimization.Removing ref dependencies from the dependency arrays is appropriate since ref.current changes don't trigger re-renders and these effects don't need to re-run when refs change.
Also applies to: 184-184
web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx (2)
12-12: LGTM! Event constants refactor correctly implemented.The mappings to
WORK_ITEM_EVENT_TRACKER_KEYS.deleteandWORK_ITEM_EVENT_TRACKER_KEYS.archiveare correct and maintain the existing event tracking functionality.Also applies to: 107-107, 119-119, 132-132, 138-138
112-112: LGTM! Catch block simplification.Removing the unused error parameter in catch blocks is a minor cleanup improvement.
Also applies to: 136-136
web/core/components/onboarding/profile-setup.tsx (1)
9-9: LGTM! Comprehensive event constants refactor correctly implemented.All event tracking calls have been properly updated to use the new grouped constants:
USER_DETAILS→USER_EVENT_TRACKER_KEYS.add_detailsE_ONBOARDING_STEP_1→ONBOARDING_EVENT_TRACKER_KEYS.step_1E_ONBOARDING_STEP_2→ONBOARDING_EVENT_TRACKER_KEYS.step_2The changes are consistent across all usage sites and preserve the existing functionality.
Also applies to: 146-146, 150-150, 162-162, 164-164, 186-186, 188-188, 208-208, 212-212, 224-224, 226-226
web/core/components/issues/issue-modal/base.tsx (1)
6-6: LGTM! Event constants refactor correctly implemented for issue operations.The mappings to
WORK_ITEM_EVENT_TRACKER_KEYS.createandWORK_ITEM_EVENT_TRACKER_KEYS.updateare correct and consistently applied across both success and failure scenarios for issue creation and update operations.Also applies to: 244-244, 260-260, 306-306, 319-319
web/core/components/issues/peek-overview/root.tsx (3)
12-12: LGTM: Import updated to use grouped event keys.The import correctly switches from individual constants to the consolidated
WORK_ITEM_EVENT_TRACKER_KEYSobject, aligning with the refactoring objectives.
85-85: LGTM: Event tracking calls consistently updated.All
captureIssueEventcalls now correctly use the grouped event keys (WORK_ITEM_EVENT_TRACKER_KEYS.update,WORK_ITEM_EVENT_TRACKER_KEYS.delete, etc.) instead of individual constants, maintaining consistency across the refactor.Also applies to: 96-96, 112-112, 125-125, 136-136, 142-142, 157-157, 168-168, 179-179, 194-194, 208-208, 223-223, 250-250, 260-260, 286-286, 309-309, 313-313, 323-323
334-334: LGTM: Translation function correctly added to dependency array.Adding
tto the dependency array is appropriate since the translation function is used within theissueOperationsobject for toast messages.web/core/components/cycles/list/cycle-list-item-action.tsx (3)
10-10: LGTM: Import updated to use cycle event keys.The import correctly switches to
CYCLE_EVENT_TRACKER_KEYSfor cycle-related event tracking.
64-64: LGTM: Code cleanup removes unused destructured properties.Removing unused properties (
updateCycleDetailsfromuseCycleandcontrol,getValuesfromuseForm) improves code cleanliness without affecting functionality.Also applies to: 77-77
109-109: LGTM: Event tracking calls updated consistently.The
captureEventcalls now correctly useCYCLE_EVENT_TRACKER_KEYS.favoriteandCYCLE_EVENT_TRACKER_KEYS.unfavoriteinstead of individual constants.Also applies to: 139-139
web/core/components/workspace/create-workspace-form.tsx (3)
6-6: LGTM: Import updated to use workspace event keys.The import correctly switches to
WORKSPACE_EVENT_TRACKER_KEYSfor workspace-related event tracking.
75-75: LGTM: Event tracking calls updated consistently.The
captureWorkspaceEventcalls now correctly useWORKSPACE_EVENT_TRACKER_KEYS.createfor both success and failure scenarios.Also applies to: 92-92
138-138: LGTM: Minor formatting improvements.The regex formatting, error message JSX structure, and placeholder text formatting improvements enhance code readability without changing functionality.
Also applies to: 201-203, 225-228
web/core/components/issues/issue-detail/root.tsx (4)
11-11: LGTM: Import updated to use work item event keys.The import correctly switches to
WORK_ITEM_EVENT_TRACKER_KEYSfor issue-related event tracking.
99-99: LGTM: Event tracking calls consistently updated.All
captureIssueEventcalls now correctly use the grouped event keys (WORK_ITEM_EVENT_TRACKER_KEYS.update,WORK_ITEM_EVENT_TRACKER_KEYS.delete,WORK_ITEM_EVENT_TRACKER_KEYS.archive) instead of individual constants.Also applies to: 110-110, 135-135, 147-147, 157-157, 164-164, 174-174, 189-189, 203-203, 218-218, 244-244, 254-254, 280-280, 290-290, 309-309
182-182: LGTM: Catch blocks simplified appropriately.Removing the unused
errorparameter from catch blocks improves code cleanliness since the error wasn't being used within those blocks.Also applies to: 211-211, 252-252, 288-288
334-334: LGTM: Translation function correctly added to dependency array.Adding
tto the dependency array is appropriate since the translation function is used within theissueOperationsobject.packages/constants/src/event-tracker/core.ts (4)
1-13: LGTM: Type definitions properly exported.The
IssueEventPropsandEventPropstypes are well-defined and provide clear interfaces for event tracking functionality.
15-143: LGTM: Payload construction functions are comprehensive.The payload functions for workspace, project, cycle, module, page, and project state events are well-structured and extract relevant properties for analytics tracking.
150-258: LGTM: Event key constants are well-organized.The grouped event key objects provide a clean, namespaced approach to event tracking constants. The hierarchical structure (e.g.,
MODULE_EVENT_TRACKER_KEYS.link.create) improves organization and discoverability.
110-110: Fix reference error: constant used before declaration.
WORK_ITEM_EVENT_TRACKER_KEYS.updateis referenced beforeWORK_ITEM_EVENT_TRACKER_KEYSis declared (line 183). This will cause a ReferenceError at runtime.Move the constant declaration before its usage or use a string literal instead:
- if (eventName === WORK_ITEM_EVENT_TRACKER_KEYS.update) { + if (eventName === "Work item updated") {Alternatively, move the
WORK_ITEM_EVENT_TRACKER_KEYSdeclaration to the top of the file before thegetIssueEventPayloadfunction.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/ce/store/event-tracker.store.ts (1)
1-2: Avoid an unnecessary runtime dependency onRootStoreAfter removing the explicit constructor,
RootStoreis referenced only as a type. Converting the import to a type-only import (or dropping it entirely if unused) prevents an avoidable circular runtime import while keeping full type safety.-import { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/plane-web/store/root.store";(If you adopt the previous suggestion and delete the constructor, the
RootStoresymbol is no longer needed at all—feel free to drop the line instead of converting it.)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
web/ce/store/event-tracker.store.ts(1 hunks)web/core/hooks/store/use-event-tracker.ts(1 hunks)web/core/store/event-tracker.store.ts(3 hunks)web/core/store/root.store.ts(3 hunks)web/ee/store/event-tracker.store.ts(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- web/core/hooks/store/use-event-tracker.ts
- web/ee/store/event-tracker.store.ts
- web/core/store/root.store.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- web/core/store/event-tracker.store.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
web/ce/store/event-tracker.store.ts (1)
web/core/store/event-tracker.store.ts (1)
ICoreEventTrackerStore(19-36)
🪛 Biome (1.9.4)
web/ce/store/event-tracker.store.ts
[error] 8-10: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (62)
packages/constants/src/event-tracker/core.ts(1 hunks)packages/constants/src/event-tracker/index.ts(1 hunks)web/app/(all)/[workspaceSlug]/(projects)/header.tsx(2 hunks)web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx(3 hunks)web/app/(all)/accounts/forgot-password/page.tsx(4 hunks)web/app/(all)/invitations/page.tsx(3 hunks)web/app/(all)/onboarding/page.tsx(2 hunks)web/app/(all)/sign-up/page.tsx(2 hunks)web/app/(home)/page.tsx(2 hunks)web/ce/components/projects/create/root.tsx(2 hunks)web/core/components/account/auth-forms/password.tsx(3 hunks)web/core/components/account/auth-forms/unique-code.tsx(2 hunks)web/core/components/cycles/analytics-sidebar/sidebar-header.tsx(3 hunks)web/core/components/cycles/delete-modal.tsx(3 hunks)web/core/components/cycles/list/cycle-list-item-action.tsx(5 hunks)web/core/components/cycles/modal.tsx(5 hunks)web/core/components/home/root.tsx(2 hunks)web/core/components/inbox/content/issue-root.tsx(4 hunks)web/core/components/inbox/modals/create-modal/create-root.tsx(3 hunks)web/core/components/issues/issue-detail-widgets/relations/helper.tsx(4 hunks)web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx(3 hunks)web/core/components/issues/issue-detail/root.tsx(12 hunks)web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx(2 hunks)web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx(4 hunks)web/core/components/issues/issue-layouts/properties/all-properties.tsx(10 hunks)web/core/components/issues/issue-layouts/quick-add/root.tsx(2 hunks)web/core/components/issues/issue-modal/base.tsx(5 hunks)web/core/components/issues/peek-overview/root.tsx(18 hunks)web/core/components/modules/analytics-sidebar/root.tsx(5 hunks)web/core/components/modules/delete-module-modal.tsx(3 hunks)web/core/components/modules/modal.tsx(5 hunks)web/core/components/modules/module-card-item.tsx(3 hunks)web/core/components/modules/module-list-item-action.tsx(3 hunks)web/core/components/onboarding/create-workspace.tsx(3 hunks)web/core/components/onboarding/invitations.tsx(3 hunks)web/core/components/onboarding/invite-members.tsx(4 hunks)web/core/components/onboarding/profile-setup.tsx(6 hunks)web/core/components/onboarding/tour/root.tsx(3 hunks)web/core/components/pages/modals/create-page-modal.tsx(3 hunks)web/core/components/pages/modals/delete-page-modal.tsx(3 hunks)web/core/components/project-states/create-update/create.tsx(3 hunks)web/core/components/project-states/create-update/update.tsx(3 hunks)web/core/components/project-states/options/delete.tsx(3 hunks)web/core/components/project-states/state-delete-modal.tsx(3 hunks)web/core/components/project/delete-project-modal.tsx(3 hunks)web/core/components/project/form.tsx(3 hunks)web/core/components/project/leave-project-modal.tsx(3 hunks)web/core/components/project/member-list-item.tsx(2 hunks)web/core/components/project/send-project-invitation-modal.tsx(3 hunks)web/core/components/workspace-notifications/sidebar/header/options/root.tsx(2 hunks)web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx(2 hunks)web/core/components/workspace-notifications/sidebar/notification-card/options/read.tsx(2 hunks)web/core/components/workspace/create-workspace-form.tsx(6 hunks)web/core/components/workspace/delete-workspace-form.tsx(3 hunks)web/core/components/workspace/settings/members-list-item.tsx(2 hunks)web/core/components/workspace/settings/workspace-details.tsx(3 hunks)web/core/components/workspace/sidebar/user-menu-item.tsx(2 hunks)web/core/components/workspace/views/delete-view-modal.tsx(2 hunks)web/core/components/workspace/views/header.tsx(2 hunks)web/core/components/workspace/views/modal.tsx(5 hunks)web/core/lib/posthog-provider.tsx(2 hunks)web/core/store/event-tracker.store.ts(5 hunks)
✅ Files skipped from review due to trivial changes (4)
- web/app/(all)/[workspaceSlug]/(projects)/header.tsx
- web/core/components/workspace/settings/members-list-item.tsx
- web/core/lib/posthog-provider.tsx
- packages/constants/src/event-tracker/index.ts
🚧 Files skipped from review as they are similar to previous changes (57)
- web/core/components/project/leave-project-modal.tsx
- web/core/components/modules/delete-module-modal.tsx
- web/core/components/inbox/modals/create-modal/create-root.tsx
- web/app/(all)/onboarding/page.tsx
- web/app/(all)/invitations/page.tsx
- web/app/(all)/sign-up/page.tsx
- web/core/components/pages/modals/create-page-modal.tsx
- web/core/components/project/member-list-item.tsx
- web/ce/components/projects/create/root.tsx
- web/core/components/cycles/delete-modal.tsx
- web/core/components/modules/module-card-item.tsx
- web/core/components/project-states/create-update/create.tsx
- web/core/components/workspace/views/delete-view-modal.tsx
- web/core/components/workspace/delete-workspace-form.tsx
- web/core/components/account/auth-forms/unique-code.tsx
- web/core/components/cycles/analytics-sidebar/sidebar-header.tsx
- web/core/components/workspace/sidebar/user-menu-item.tsx
- web/core/components/modules/module-list-item-action.tsx
- web/core/components/project/send-project-invitation-modal.tsx
- web/core/components/modules/modal.tsx
- web/core/components/project/form.tsx
- web/core/components/workspace/views/header.tsx
- web/core/components/cycles/modal.tsx
- web/core/components/issues/issue-detail-widgets/relations/helper.tsx
- web/core/components/account/auth-forms/password.tsx
- web/core/components/project-states/state-delete-modal.tsx
- web/core/components/onboarding/invite-members.tsx
- web/core/components/home/root.tsx
- web/app/(home)/page.tsx
- web/core/components/project/delete-project-modal.tsx
- web/core/components/issues/issue-layouts/quick-add/root.tsx
- web/core/components/issues/issue-layouts/properties/all-properties.tsx
- web/core/components/onboarding/invitations.tsx
- web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx
- web/core/components/onboarding/create-workspace.tsx
- web/core/components/modules/analytics-sidebar/root.tsx
- web/core/components/project-states/options/delete.tsx
- web/core/components/workspace-notifications/sidebar/header/options/root.tsx
- web/core/components/workspace/settings/workspace-details.tsx
- web/core/components/issues/issue-modal/base.tsx
- web/core/components/workspace-notifications/sidebar/notification-card/options/read.tsx
- web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx
- web/core/components/pages/modals/delete-page-modal.tsx
- web/core/components/cycles/list/cycle-list-item-action.tsx
- web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx
- web/core/components/workspace/create-workspace-form.tsx
- web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx
- web/core/components/onboarding/tour/root.tsx
- web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx
- web/core/components/inbox/content/issue-root.tsx
- web/core/components/project-states/create-update/update.tsx
- web/core/store/event-tracker.store.ts
- web/core/components/onboarding/profile-setup.tsx
- web/core/components/workspace/views/modal.tsx
- web/core/components/issues/peek-overview/root.tsx
- web/app/(all)/accounts/forgot-password/page.tsx
- web/core/components/issues/issue-detail/root.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
packages/constants/src/event-tracker/core.ts (2)
145-259: Excellent organization and structure of event constants.The grouped event constants provide significant improvements:
- Domain-based organization: Constants are logically grouped by feature area (workspace, project, cycle, etc.)
- Consistent naming patterns: All groups follow the
*_TRACKER_EVENTSconvention- Hierarchical structure: Related sub-events are properly nested (e.g.,
MODULE_TRACKER_EVENTS.link)- Descriptive naming: Event names clearly indicate their purpose and context
This structure will make event tracking more maintainable and discoverable across the codebase.
1-259: Strong refactoring effort with excellent organization.This file successfully centralizes event tracking functionality and provides much better organization than scattered individual constants. The grouped approach will significantly improve maintainability and discoverability.
Key strengths:
- Clear separation between types, utilities, and constants
- Logical grouping of related event constants
- Consistent naming conventions throughout
Please address the identified issues (duplicate types, logic error in state payload, and type safety improvements) to ensure production readiness.
* refactor: event constants * fix: cycle event keys * chore: store extension * chore: update events naming convention --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
Description
This PR refactors how event constants are defined.
Type of Change
Summary by CodeRabbit
Refactor
Chores