refactor: app category metadata to use Record<AppCategories, AppCategoryEntry> for exhaustive type safety#29558
refactor: app category metadata to use Record<AppCategories, AppCategoryEntry> for exhaustive type safety#29558SinghaAnirban005 wants to merge 1 commit into
Conversation
|
Welcome to Cal.diy, @SinghaAnirban005! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
📝 WalkthroughWalkthroughThis PR introduces a centralized, typed configuration for app categories to standardize metadata across the codebase. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/web/modules/apps/installed/[category]/installed-category-view.tsx (1)
23-23: ⚡ Quick winUse a type-only import for
ActiveAppCategoryKeys(Line 23).
ActiveAppCategoryKeysis only used in type positions, so it should be imported withtypeto match repository TS rules.Proposed fix
-import { APP_CATEGORY_ENTRIES, ActiveAppCategoryKeys } from "`@calcom/app-store/_utils/getAppCategories`"; +import { APP_CATEGORY_ENTRIES, type ActiveAppCategoryKeys } from "`@calcom/app-store/_utils/getAppCategories`";As per coding guidelines: “Use
import type { X }for TypeScript type imports”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/modules/apps/installed/`[category]/installed-category-view.tsx at line 23, The import currently brings in ActiveAppCategoryKeys as a value; change it to a type-only import by using the TypeScript `type` modifier — e.g. replace the existing import of ActiveAppCategoryKeys with `type ActiveAppCategoryKeys` (either inline: `import { APP_CATEGORY_ENTRIES, type ActiveAppCategoryKeys } from "`@calcom/app-store/_utils/getAppCategories`";` or as a separate `import type { ActiveAppCategoryKeys } from "...";`) so the symbol is imported only for type positions.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/web/modules/apps/installed/`[category]/installed-category-view.tsx:
- Line 23: The import currently brings in ActiveAppCategoryKeys as a value;
change it to a type-only import by using the TypeScript `type` modifier — e.g.
replace the existing import of ActiveAppCategoryKeys with `type
ActiveAppCategoryKeys` (either inline: `import { APP_CATEGORY_ENTRIES, type
ActiveAppCategoryKeys } from "`@calcom/app-store/_utils/getAppCategories`";` or as
a separate `import type { ActiveAppCategoryKeys } from "...";`) so the symbol is
imported only for type positions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 82924076-723c-4b7e-bfce-d75c37653323
📒 Files selected for processing (2)
apps/web/modules/apps/installed/[category]/installed-category-view.tsxpackages/app-store/_utils/getAppCategories.ts
What does this PR do?
This PR replaces the
AppCategoryEntry[]array ingetAppCategorieswith aRecord<AppCategories, AppCategoryEntry>as the canonical source of category metadataand secondly removes the redundant icon mapping in
installed-category-view.tsxVideo Demo (if applicable):
Screencast.from.2026-04-11.20-32-09.webm
Mandatory Tasks (DO NOT REMOVE)