Skip to content

chore: merge constants and services#8623

Merged
prateekshourya29 merged 3 commits intopreviewfrom
chore-merge-folders
Feb 10, 2026
Merged

chore: merge constants and services#8623
prateekshourya29 merged 3 commits intopreviewfrom
chore-merge-folders

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Feb 10, 2026

Type of Change

  • Code refactoring

Summary by CodeRabbit

  • Chores
    • Reorganized internal service and constant imports for cleaner module resolution.
    • Simplified project features configuration and streamlined how feature settings are rendered in the UI.
    • Removed several re-export/aggregation layers to reduce indirection.
    • Relaxed internal typing around project feature toggles to improve resilience during rendering.

Copilot AI review requested due to automatic review settings February 10, 2026 14:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Updated many import paths from @/plane-web/* to flattened @/services/* and @/constants/*; removed several CE barrel re-exports and a project feature constants module; refactored project features rendering and relaxed a prop type to any in a project settings helper.

Changes

Cohort / File(s) Summary
WorkspaceService import updates
apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx, apps/web/app/(all)/invitations/page.tsx, apps/web/app/(all)/onboarding/page.tsx, apps/web/app/(all)/workspace-invitations/page.tsx, apps/web/core/components/account/auth-forms/auth-header.tsx, apps/web/core/components/editor/lite-text/editor.tsx, apps/web/core/components/editor/rich-text/description-input/root.tsx, apps/web/core/components/home/widgets/recents/index.tsx, apps/web/core/components/inbox/modals/create-modal/issue-description.tsx, apps/web/core/components/issues/issue-modal/components/description-editor.tsx, apps/web/core/components/onboarding/create-workspace.tsx, apps/web/core/components/onboarding/invitations.tsx, apps/web/core/components/onboarding/invite-members.tsx, apps/web/core/components/onboarding/steps/team/root.tsx, apps/web/core/components/onboarding/steps/workspace/create.tsx, apps/web/core/components/onboarding/steps/workspace/join-invites.tsx, apps/web/core/components/power-k/ui/modal/search-menu.tsx, apps/web/core/components/workspace/create-workspace-form.tsx, apps/web/core/store/global-view.store.ts, apps/web/core/store/issue/workspace/filter.store.ts, apps/web/core/store/issue/workspace/issue.store.ts, apps/web/core/store/member/workspace/workspace-member.store.ts, apps/web/core/store/user/base-permissions.store.ts
Changed import source from @/plane-web/services to @/services/workspace.service; no API/logic changes.
ViewService / EstimateService import updates
apps/web/core/store/project-view.store.ts, apps/web/core/store/issue/project-views/filter.store.ts, apps/web/core/store/estimates/estimate-point.ts, apps/web/core/store/estimates/project-estimate.store.ts, apps/web/ce/store/estimates/estimate.ts
Updated imports: ViewService → @/services/view.service; estimateService → @/services/estimate.service. Only module resolution changed.
ProjectStateService import update
apps/web/core/store/state.store.ts, apps/web/ce/services/project/project-state.service.ts
Switched import to @/services/project/project-state.service (and removed a CE barrel re-export).
Constant import updates
apps/web/ce/components/pages/editor/ai/menu.tsx, apps/web/core/services/ai.service.ts, apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx, apps/web/core/constants/gantt-chart.ts, apps/web/core/store/issue/relation.store.ts
Changed constant imports from @/plane-web/constants/* to @/constants/*; no behavioral changes.
Barrel re-exports removed (CE)
apps/web/ce/constants/project/index.ts, apps/web/ce/constants/project/settings/index.ts, apps/web/ce/services/index.ts, apps/web/ce/services/project/index.ts, apps/web/ce/services/project/project-state.service.ts
Deleted multiple CE barrel files and their export * statements, reducing re-exported public surfaces.
Project features constants removed
apps/web/ce/constants/project/settings/features.tsx
Removed the features constants/types: PROJECT_BASE_FEATURES_LIST, PROJECT_FEATURES_LIST, and related exported types.
Project settings refactor
apps/web/core/components/project/settings/features-list.tsx
Reworked feature rendering to use a local PROJECT_FEATURES_LIST constant, simplified headings/render loop, and adjusted imports accordingly.
React import cleanup
apps/web/core/components/power-k/ui/pages/work-item-selection-page.tsx
Removed default React import; now uses named hooks imports only.
Type relaxation in helper
apps/web/core/components/project/settings/helper.tsx
Changed ProjectFeatureToggle prop featureItem type from TProperties to any and added optional chaining where used.
Miscellaneous small import fixes
apps/web/ce/components/pages/editor/ai/menu.tsx, apps/web/core/services/ai.service.ts, apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx, apps/web/core/constants/gantt-chart.ts
Adjusted various import paths to new @/constants/* or @/services/* locations. No logic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰
I hopped through files and nudged each line,
Paths straightened up, imports now align.
Barrels cleared and features tucked near,
Types relaxed — no need to fear.
A tidy meadow — code feels fine! 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete, containing only the Type of Change checkbox (Code refactoring) but missing the Description, Screenshots, Test Scenarios, and References sections required by the template. Add a detailed description explaining the refactoring scope, provide test scenarios verifying the changes, and include any related issue references.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: merge constants and services' clearly describes the main refactoring objective of consolidating and reorganizing import paths and module structures across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-merge-folders

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates imports so the web app uses core (@/) constants and services directly instead of CE re-export (“plane-web”) indirection, and adds/moves a few shared constants/services into apps/web/core.

Changes:

  • Repointed many @/plane-web/services imports to direct core service modules (e.g. @/services/workspace.service, @/services/view.service).
  • Introduced new core modules for AI/constants, sidebar favorites constants, and an EstimateService.
  • Removed CE re-export shim files (services/constants) that are no longer needed.

Reviewed changes

Copilot reviewed 42 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
apps/web/core/store/user/base-permissions.store.ts Switch WorkspaceService import to core services path.
apps/web/core/store/state.store.ts Switch ProjectStateService import to core services path.
apps/web/core/store/project-view.store.ts Switch ViewService import to core services path.
apps/web/core/store/member/workspace/workspace-member.store.ts Switch WorkspaceService import to core services path.
apps/web/core/store/issue/workspace/issue.store.ts Switch WorkspaceService import to core services path.
apps/web/core/store/issue/workspace/filter.store.ts Switch WorkspaceService import to core services path.
apps/web/core/store/issue/project-views/filter.store.ts Switch ViewService import to core services path.
apps/web/core/store/issue/issue-details/relation.store.ts Switch REVERSE_RELATIONS import to core constants.
apps/web/core/store/global-view.store.ts Switch WorkspaceService import to core services path.
apps/web/core/store/estimates/project-estimate.store.ts Switch estimateService import to new core estimate service.
apps/web/core/store/estimates/estimate-point.ts Switch estimateService import to new core estimate service.
apps/web/core/services/estimate.service.ts New core EstimateService implementation.
apps/web/core/services/ai.service.ts Switch AI_EDITOR_TASKS type import to core constants.
apps/web/core/constants/sidebar-favorites.ts New core sidebar favorites constants (icons + link builders).
apps/web/core/constants/gantt-chart.ts Update TIssueRelationTypes import to CE types source.
apps/web/core/constants/ai.ts New core AI constants (AI_EDITOR_TASKS + LOADING_TEXTS).
apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx Switch sidebar favorites constants import to core constants.
apps/web/core/components/workspace/create-workspace-form.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/project/settings/features-list.tsx Inline project features list (replacing CE constants) and adjust rendering.
apps/web/core/components/power-k/ui/pages/work-item-selection-page.tsx Remove default React import; switch WorkspaceService import to core services path.
apps/web/core/components/power-k/ui/modal/search-menu.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/onboarding/steps/workspace/join-invites.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/onboarding/steps/workspace/create.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/onboarding/steps/team/root.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/onboarding/invite-members.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/onboarding/invitations.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/onboarding/create-workspace.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/issues/issue-modal/components/description-editor.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/inbox/modals/create-modal/issue-description.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/home/widgets/recents/index.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/editor/rich-text/description-input/root.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/editor/lite-text/editor.tsx Switch WorkspaceService import to core services path.
apps/web/core/components/account/auth-forms/auth-header.tsx Switch WorkspaceService import to core services path.
apps/web/ce/store/estimates/estimate.ts Switch estimateService import to new core estimate service.
apps/web/ce/services/project/project-state.service.ts Remove CE re-export shim.
apps/web/ce/services/project/index.ts Remove CE services barrel re-exports.
apps/web/ce/services/index.ts Remove CE services barrel re-exports.
apps/web/ce/constants/project/settings/index.ts Remove CE constants barrel re-export.
apps/web/ce/constants/project/settings/features.tsx Remove CE project features constants/types source.
apps/web/ce/constants/project/index.ts Remove CE constants barrel re-export.
apps/web/ce/components/pages/editor/ai/menu.tsx Switch AI constants import to core constants.
apps/web/app/(all)/workspace-invitations/page.tsx Switch WorkspaceService import to core services path.
apps/web/app/(all)/onboarding/page.tsx Switch WorkspaceService import to core services path.
apps/web/app/(all)/invitations/page.tsx Switch WorkspaceService import to core services path.
apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx Switch WorkspaceService import to core services path.
Comments suppressed due to low confidence (1)

apps/web/core/constants/gantt-chart.ts:7

  • This relative import (../../ce/types) is brittle and bypasses the configured path aliases (@/plane-web/*). Prefer importing CE types via the alias (e.g., @/plane-web/types) for consistency and easier refactors.

Comment on lines +131 to +135
<ProjectFeatureToggle
workspaceSlug={workspaceSlug}
projectId={projectId}
featureItem={featureItem}
value={Boolean(currentProjectDetails?.[featureItem.property as keyof IProject])}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

ProjectFeatureToggle is typed via TProperties (in ./helper.tsx) imported from @/plane-web/constants/project/settings/features, but that module is deleted in this PR. This will cause a TS compile failure; move TProperties to a surviving location (e.g., a core types/constants module) and update ProjectFeatureToggle to import it from there (or define the prop type locally).

Copilot uses AI. Check for mistakes.
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: 2

🤖 Fix all issues with AI agents
In `@apps/web/core/components/project/settings/helper.tsx`:
- Line 41: The onChange currently passes featureItem?.key and
featureItem?.property which can be undefined; update the call site to guard
against a nullish featureItem (e.g., only call handleSubmit when featureItem is
truthy) and pass the non-nullable strings, or alternatively update
handleSubmit's signature to accept (key?: string, property?: string) and handle
undefined inside it; locate the usage of featureItem and the handleSubmit
function in this file and pick one approach so handleSubmit never receives
unexpected undefined values at runtime.
- Line 17: The field featureItem is typed as any which disables checking;
replace that with a precise type (either import the correct TProperties or
define a minimal interface describing the expected shape) and, if it can be
absent, use a union like TProperties | undefined (or the concrete interface |
undefined). Update the declaration where featureItem: any appears and ensure any
usages of featureItem are adjusted for the possibly undefined state (add
null/undefined guards or optional chaining) to satisfy strict TypeScript rules.

workspaceSlug: string;
projectId: string;
featureItem: TProperties;
featureItem: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid any — use a proper type or explicit union with undefined.

Replacing TProperties with any disables all type checking on featureItem, which masks the real issue and contradicts the project's "fully typed" guideline. If the shape of featureItem genuinely varies across editions, define a minimal interface (or import the correct type) and use Type | undefined if it can be absent.

Suggested direction
-  featureItem: any;
+  featureItem: TProperties | undefined;

(Adjust TProperties to whatever the correct imported type is after the constants merge.)

As per coding guidelines, **/*.{ts,tsx}: "Enable TypeScript strict mode and ensure all files are fully typed."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
featureItem: any;
featureItem: TProperties | undefined;
🤖 Prompt for AI Agents
In `@apps/web/core/components/project/settings/helper.tsx` at line 17, The field
featureItem is typed as any which disables checking; replace that with a precise
type (either import the correct TProperties or define a minimal interface
describing the expected shape) and, if it can be absent, use a union like
TProperties | undefined (or the concrete interface | undefined). Update the
declaration where featureItem: any appears and ensure any usages of featureItem
are adjusted for the possibly undefined state (add null/undefined guards or
optional chaining) to satisfy strict TypeScript rules.

<ToggleSwitch
value={value}
onChange={() => handleSubmit(featureItem.key, featureItem.property)}
onChange={() => handleSubmit(featureItem?.key, featureItem?.property)}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

handleSubmit receives undefined when featureItem is nullish.

featureItem?.key and featureItem?.property evaluate to undefined when featureItem is absent, yet handleSubmit expects (string, string). This silently passes bad data (hidden by the any type) and will likely cause bugs downstream.

Guard before calling, or make the handleSubmit signature accept undefined:

Option: guard the call
-      onChange={() => handleSubmit(featureItem?.key, featureItem?.property)}
+      onChange={() => {
+        if (featureItem?.key && featureItem?.property) {
+          handleSubmit(featureItem.key, featureItem.property);
+        }
+      }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onChange={() => handleSubmit(featureItem?.key, featureItem?.property)}
onChange={() => {
if (featureItem?.key && featureItem?.property) {
handleSubmit(featureItem.key, featureItem.property);
}
}}
🤖 Prompt for AI Agents
In `@apps/web/core/components/project/settings/helper.tsx` at line 41, The
onChange currently passes featureItem?.key and featureItem?.property which can
be undefined; update the call site to guard against a nullish featureItem (e.g.,
only call handleSubmit when featureItem is truthy) and pass the non-nullable
strings, or alternatively update handleSubmit's signature to accept (key?:
string, property?: string) and handle undefined inside it; locate the usage of
featureItem and the handleSubmit function in this file and pick one approach so
handleSubmit never receives unexpected undefined values at runtime.

@prateekshourya29 prateekshourya29 merged commit 7793feb into preview Feb 10, 2026
9 checks passed
@prateekshourya29 prateekshourya29 deleted the chore-merge-folders branch February 10, 2026 15:40
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.

2 participants