Skip to content

[GIT-240] refactor: hooks consolidation to core hooks#9217

Open
Rahulcheryala wants to merge 21 commits into
git-239/constants-consolidation-packages-constantsfrom
git-240/hooks-consolidation-core-hooks
Open

[GIT-240] refactor: hooks consolidation to core hooks#9217
Rahulcheryala wants to merge 21 commits into
git-239/constants-consolidation-packages-constantsfrom
git-240/hooks-consolidation-core-hooks

Conversation

@Rahulcheryala

Copy link
Copy Markdown
Contributor

Description

Moved hooks from apps/web/ce/hooks to apps/web/core/hooks

Type of Change

  • Code refactoring

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4282e326-22aa-47ab-8ea4-c366b51b92e2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch git-240/hooks-consolidation-core-hooks

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.

@prateekshourya29

Copy link
Copy Markdown
Member

@coderabbitai can you review all these changes.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR details and changed files
gh pr view 9217 --repo makeplane/plane --json title,body,files,additions,deletions,changedFiles

echo "---FILES CHANGED---"
gh pr diff 9217 --repo makeplane/plane

Length of output: 67595


🏁 Script executed:

#!/bin/bash
echo "=== Check AppRailVisibilityProvider in `@/lib/app-rail` ==="
fd "app-rail" apps/web/lib --type f | xargs cat

echo ""
echo "=== Search for any remaining `@/plane-web/hooks` references ==="
rg '`@/plane-web/hooks`' apps/web --type ts --type tsx -n

echo ""
echo "=== Search for use-issue-embed references ==="
rg 'use-issue-embed' apps/web -n --type ts --type tsx

echo ""
echo "=== Check duplicate imports in use-timeline-chart.ts ==="
cat apps/web/core/hooks/use-timeline-chart.ts

Length of output: 2945


🏁 Script executed:

#!/bin/bash
echo "=== Find app-rail files in lib ==="
fd "app-rail" apps/web -t f

echo ""
echo "=== Search for remaining `@/plane-web/hooks` references ==="
rg '`@/plane-web/hooks`' apps/web -n -g '*.ts' -g '*.tsx'

echo ""
echo "=== Search for use-issue-embed references ==="
rg 'use-issue-embed' apps/web -n -g '*.ts' -g '*.tsx'

Length of output: 814


🏁 Script executed:

#!/bin/bash
echo "=== Find lib/app-rail (resolve `@/lib/app-rail` alias) ==="
fd -t f -g "*app-rail*" apps/web

echo ""
echo "=== Check tsconfig path aliases for `@/lib` ==="
fd "tsconfig*" apps/web -t f | head -5 | xargs grep -l '"`@/lib`"' 2>/dev/null || true
rg '"`@/lib`"' apps/web -n -g '*.json' -l

echo ""
echo "=== Check what AppRailVisibilityProvider looks like in core ==="
rg 'AppRailVisibilityProvider' apps/web -n -g '*.ts' -g '*.tsx' -A 5 -B 2

Length of output: 5222



@prateekshourya29 I've reviewed all 80 changed files. Overall, this is a clean and well-executed refactoring — the hook consolidation is consistent and complete. Here's the detailed breakdown:


✅ What's done well

  1. Complete migration: No stale @/plane-web/hooks/... import paths remain anywhere in the codebase.
  2. AppRailVisibilityProvider — no behavioral regression: The old CE wrapper in ce/hooks/app-rail/provider.tsx passed isEnabled={false} to the core provider. The core AppRailVisibilityProvider in core/lib/app-rail/provider.tsx already defaults to isEnabled = false, so importing it directly in layout.tsx is equivalent behavior.
  3. use-issue-embed.tsx — safe deletion: The hook was deleted with no remaining call sites.
  4. use-page.ts now uses relative imports (./use-page-store) instead of the previous cross-layer @/plane-web/hooks/store — cleaner architecture.
  5. pages/index.ts exports are now in alphabetical order — minor but nice.

⚠️ One issue to fix

apps/web/core/hooks/use-timeline-chart.ts — redundant @plane/types imports (Lines 8–10)

Three separate import statements from the same module should be consolidated into one:

// Current (fragmented)
import type { TTimelineTypeCore } from "`@plane/types`";
import type { TTimelineType } from "`@plane/types`";
import { GANTT_TIMELINE_TYPE } from "`@plane/types`";

// Suggested (merged)
import type { TTimelineTypeCore, TTimelineType } from "`@plane/types`";
import { GANTT_TIMELINE_TYPE } from "`@plane/types`";

Or even a single statement if your ESLint/TSC config allows mixing type and value imports:

import { GANTT_TIMELINE_TYPE, type TTimelineTypeCore, type TTimelineType } from "`@plane/types`";

This is a minor style issue introduced when inlining getTimelineStore from the deleted ce/hooks/use-timeline-chart.ts.


Summary

Area Status
Import path migration (@/plane-web/hooks@/hooks) ✅ Complete
AppRailVisibilityProvider behavioral parity ✅ Preserved
use-issue-embed.tsx deletion ✅ Safe
Stale references ✅ None found
@plane/types imports in use-timeline-chart.ts ⚠️ Consolidate

The PR is in great shape — just clean up the duplicate imports and it's good to go!

@Rahulcheryala Rahulcheryala force-pushed the git-239/constants-consolidation-packages-constants branch 2 times, most recently from 21c90c3 to ef3708f Compare June 9, 2026 14:26
@Rahulcheryala Rahulcheryala force-pushed the git-239/constants-consolidation-packages-constants branch from 0ea76ef to b82f376 Compare June 15, 2026 11:49
@Rahulcheryala Rahulcheryala changed the title Git 240/hooks consolidation core hooks [GIT-240] refactor: hooks consolidation to core hooks Jun 15, 2026
@makeplane

makeplane Bot commented Jun 15, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

…ne-extensions) from web/app/ce to web/app/core
@Rahulcheryala Rahulcheryala force-pushed the git-240/hooks-consolidation-core-hooks branch from e84c7f1 to 1ca66f7 Compare June 15, 2026 12:09
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

React Doctor found 60 issues in 30 files · 60 warnings · score 81 / 100 (Needs work) · vs git-239/constants-consolidation-packages-constants

60 warnings

app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx

  • ⚠️ L45 Event logic handled in an effect no-event-handler

app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx

  • ⚠️ L74 JSX element passed as a prop jsx-no-jsx-as-prop
  • ⚠️ L84 JSX element passed as a prop jsx-no-jsx-as-prop

app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx

  • ⚠️ L67 JSX element passed as a prop jsx-no-jsx-as-prop

core/components/editor/document/editor.tsx

  • ⚠️ L19 Import from a barrel file no-barrel-import

core/components/editor/lite-text/editor.tsx

  • ⚠️ L114 Pure function rebuilt every render prefer-module-scope-pure-function

core/components/editor/sticky-editor/editor.tsx

  • ⚠️ L77 Pure function rebuilt every render prefer-module-scope-pure-function

core/components/gantt-chart/chart/main-content.tsx

  • ⚠️ L37 Import from a barrel file no-barrel-import
  • ⚠️ L112 Missing effect dependencies exhaustive-deps
  • ⚠️ L152 Static value rebuilt every render prefer-module-scope-static-value

core/components/inbox/content/issue-root.tsx

  • ⚠️ L136 Missing effect dependencies exhaustive-deps
  • ⚠️ L206 Time or random value in JSX rendering-hydration-mismatch-time

core/components/inbox/modals/create-modal/create-root.tsx

  • ⚠️ L236 Click handler missing keyboard handler click-events-have-key-events
  • ⚠️ L239 Role used instead of HTML tag prefer-tag-over-role

core/components/issues/attachment/attachment-item-list.tsx

  • ⚠️ L103 Missing effect dependencies exhaustive-deps

core/components/issues/attachment/attachment-upload.tsx

  • ⚠️ L26 Loading useState forces extra render rendering-usetransition-loading

core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx

  • ⚠️ L34 Loading useState forces extra render rendering-usetransition-loading

core/components/issues/issue-detail/main-content.tsx

  • ⚠️ L31 Import from a barrel file no-barrel-import
  • ⚠️ L173 Time or random value in JSX rendering-hydration-mismatch-time

core/components/issues/issue-layouts/gantt/base-gantt-root.tsx

  • ⚠️ L30 Import from a barrel file no-barrel-import
  • ⚠️ L72 Missing effect dependencies exhaustive-deps
  • ⚠️ L108 Missing effect dependencies exhaustive-deps
  • ⚠️ L118 Time or random value in JSX rendering-hydration-mismatch-time
  • ⚠️ L144 JSX element passed as a prop jsx-no-jsx-as-prop

core/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx

  • ⚠️ L23 Import from a barrel file no-barrel-import

core/components/issues/issue-modal/form.tsx

  • ⚠️ L185 Missing effect dependencies exhaustive-deps
  • ⚠️ L193 Missing effect dependencies exhaustive-deps
  • ⚠️ L193 Missing effect dependencies exhaustive-deps
  • ⚠️ L207 Missing effect dependencies exhaustive-deps
  • ⚠️ L218 Missing effect dependencies exhaustive-deps
  • ⚠️ L345 Missing effect dependencies exhaustive-deps
  • ⚠️ L354 Missing effect dependencies exhaustive-deps
  • ⚠️ L516 Interactive element not focusable interactive-supports-focus
  • ⚠️ L522 Role used instead of HTML tag prefer-tag-over-role

core/components/issues/peek-overview/issue-detail.tsx

  • ⚠️ L33 Import from a barrel file no-barrel-import
  • ⚠️ L169 Time or random value in JSX rendering-hydration-mismatch-time

core/components/issues/peek-overview/root.tsx

  • ⚠️ L215 Missing effect dependencies exhaustive-deps

core/components/pages/editor/editor-body.tsx

  • ⚠️ L46 Import from a barrel file no-barrel-import
  • ⚠️ L200 Chained array iterations js-combine-iterations
  • ⚠️ L247 Click handler missing keyboard handler click-events-have-key-events
  • ⚠️ L247 Interactive element not focusable interactive-supports-focus
  • ⚠️ L249 Role used instead of HTML tag prefer-tag-over-role

core/components/pages/editor/page-root.tsx

  • ⚠️ L23 Import from a barrel file no-barrel-import

core/components/pages/editor/toolbar/options-dropdown.tsx

  • ⚠️ L23 Import from a barrel file no-barrel-import
  • ⚠️ L50 Component defined inside a component no-unstable-nested-components

core/components/pages/header/actions.tsx

  • ⚠️ L17 Import from a barrel file no-barrel-import

core/components/pages/header/root.tsx

  • ⚠️ L22 Import from a barrel file no-barrel-import

core/components/pages/list/block-item-action.tsx

  • ⚠️ L22 Import from a barrel file no-barrel-import

core/components/pages/modals/create-page-modal.tsx

  • ⚠️ L56 Derived value copied into state no-derived-state

core/components/pages/pages-list-view.tsx

  • ⚠️ L14 Import from a barrel file no-barrel-import

10 more warnings not shown.

Reviewed by React Doctor for commit 3e6f7ab. See inline comments for fixes.

@CLAassistant

CLAassistant commented Jun 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Rahulcheryala Rahulcheryala force-pushed the git-240/hooks-consolidation-core-hooks branch from b1def93 to 3e6f7ab Compare June 16, 2026 07:29
Comment thread apps/web/core/components/pages/header/root.tsx
Comment thread apps/web/core/components/pages/pages-list-view.tsx
Comment thread apps/web/core/components/workspace-notifications/root.tsx
Comment thread apps/web/core/components/editor/document/editor.tsx
Comment thread apps/web/core/components/gantt-chart/chart/main-content.tsx
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