Skip to content

refactor: move useAppsData to features #28098

Merged
Ryukemeister merged 4 commits intomainfrom
devin/1771576735-decouple-apps-pr1
Mar 12, 2026
Merged

refactor: move useAppsData to features #28098
Ryukemeister merged 4 commits intomainfrom
devin/1771576735-decouple-apps-pr1

Conversation

@Ryukemeister
Copy link
Contributor

What does this PR do?

Part 1 of 3 PRs to decouple Apps Components and eliminate circular dependencies between @calcom/atoms, @calcom/web, and @calcom/features.

This PR breaks two specific dependency cycles:

  1. atoms → web (useAppsData): EventPaymentsTabPlatformWrapper in atoms imported useAppsData from @calcom/web. Moved useAppsData to @calcom/features/apps/hooks/useAppsData.ts — its only dependencies are react-hook-form, @calcom/app-store types, and @calcom/features types, all valid at the features layer.

  2. features → atoms (useIsPlatform): DisconnectIntegrationModal in features imported useIsPlatform from @calcom/atoms. Replaced with an explicit isPlatform prop (defaults to false). Atoms caller now passes isPlatform={true}.

Changes

  • New file: packages/features/apps/hooks/useAppsData.ts (moved from apps/web/modules/apps/hooks/)
  • Modified: DisconnectIntegrationModal — removed useIsPlatform import, added isPlatform prop
  • Updated imports in 3 consumers: EventPaymentsTabPlatformWrapper (atoms), EventAppsTab (web), EventTypeAppSettingsWrapper (web)
  • Added isPlatform={true} to DisconnectIntegrationModal usage in ConferencingAppsViewPlatformWrapper (atoms)

Note: The original apps/web/modules/apps/hooks/useAppsData.ts was not deleted in this PR — it can be removed once confirmed no other references exist. Import reordering in some files is from biome auto-formatting.

Note: ConferencingAppsViewPlatformWrapper.tsx still has pre-existing violations (@calcom/web and @calcom/trpc imports) that will be addressed in follow-up PRs 2 and 3.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox. — N/A (internal refactor, no API changes)
  • I confirm automated tests are in place that prove my fix is effective or that my feature works. — N/A (pure refactor with no logic changes; existing tests cover behavior)

How should this be tested?

This is a pure refactor with no functional changes. Existing behavior should remain identical:

  1. Verify apps data management: Create/edit event types with app integrations (Stripe, conferencing apps) — form state should persist correctly
  2. Verify disconnect modal: Disconnect an app from both web and atoms contexts — modal should show correct behavior (atoms passes app slug, web doesn't)
  3. Run type checks: yarn type-check:ci --force — should pass (pre-existing embed-react errors unrelated)
  4. Run tests: TZ=UTC yarn test — existing tests should pass

Environment variables: None required
Test data: Any user with installed apps (Stripe, Zoom, Google Meet, etc.)

Human Review Checklist

  • Verify useAppsData logic is identical after move (compare old vs new file)
  • Confirm isPlatform prop default (false) correctly replaces useIsPlatform() for web callers
  • Confirm atoms caller passes isPlatform={true} where needed
  • Consider deleting old apps/web/modules/apps/hooks/useAppsData.ts if no other references exist
  • Note: Pre-existing lint violations in ConferencingAppsViewPlatformWrapper.tsx will be fixed in follow-up PRs

Link to Devin run: https://app.devin.ai/sessions/3381ce426a1748ba909e440d155433a1
Requested by: @Ryukemeister

…sPlatform prop in DisconnectIntegrationModal

Co-Authored-By: rajiv@cal.com <sahalrajiv6900@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: rajiv@cal.com <sahalrajiv6900@gmail.com>
@github-actions
Copy link
Contributor

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions bot added Stale and removed Stale labels Feb 28, 2026
@Ryukemeister Ryukemeister marked this pull request as ready for review March 9, 2026 18:50
@Ryukemeister Ryukemeister requested review from a team as code owners March 9, 2026 18:50
@graphite-app graphite-app bot added consumer core area: core, team members only labels Mar 9, 2026
@Ryukemeister Ryukemeister changed the title refactor: move useAppsData to features + replace useIsPlatform with isPlatform prop in DisconnectIntegrationModal refactor: move useAppsData to features Mar 9, 2026
@Ryukemeister Ryukemeister merged commit 972d703 into main Mar 12, 2026
76 of 77 checks passed
@Ryukemeister Ryukemeister deleted the devin/1771576735-decouple-apps-pr1 branch March 12, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only ready-for-e2e size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants