Skip to content

Conversation

martmull
Copy link
Contributor

@martmull martmull commented Oct 13, 2025

Protected by IS_APPLICATION_ENABLED featureFlag

Add 2 sections Application and Functions in settings

image

A settings/applications route listing all installed applications

image

A settings/applications/<application_is> details setting page listing all objects, serverlessFunctions and agents created by the application:

image

Add trigger section in serverless function details (readonly for now)

image

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR introduces a comprehensive application extensibility feature by adding Applications and Functions sections to the Twenty CRM settings interface. The changes are protected by the IS_APPLICATION_ENABLED feature flag and establish a complete application management system.

Key Changes:

  • Backend GraphQL API: Added Application entity with resolvers for findManyApplications and findOneApplication, including proper relationships to serverless functions, agents, and objects
  • Frontend UI Components: Created new settings pages at /settings/applications and /settings/applications/:applicationId with reusable table components for displaying applications and their associated resources
  • Navigation Integration: Added Applications section to settings navigation with proper feature flag protection and permissions
  • Code Refactoring: Extracted table logic from existing components into reusable modules (e.g., SettingsObjectTable) and simplified serverless function management by removing versioning/publishing functionality
  • GraphQL Fragments: Introduced comprehensive fragments for Application and Object metadata to support efficient data fetching across multiple queries

The implementation follows established patterns in the codebase with proper internationalization, search functionality, and consistent styling. The feature enables users to view installed applications and drill down into their details, including associated objects, serverless functions, and AI agents.

Important Files Changed

Changed Files
Filename Score Overview
packages/twenty-server/src/engine/core-modules/application/application.service.ts 1/5 Critical logical error where findOneApplication ignores the applicationId parameter and only filters by workspaceId
packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx 2/5 New application details component with early returns without loading states and lack of error handling
packages/twenty-front/src/modules/applications/graphql/queries/findManyApplications.ts 3/5 GraphQL query with structural inconsistency where fragment is included but not properly used
packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionCodeEditorTab.tsx 4/5 Significant simplification removing publish/reset functionality, only retaining test capability
packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx 4/5 Removed versioning functionality and restructured code handling with faster debounce timing
packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationTableRow.tsx 4/5 New table row component with unused variables (theme and StyledIconContainer)
packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx 4/5 New applications listing page with type assertion that could mask type safety issues
packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTable.tsx 4/5 Refactored to accept data as props instead of fetching directly, making it more reusable
packages/twenty-front/src/pages/settings/data-model/SettingsObjectTable.tsx 4/5 New extracted table component with some duplicated filtering logic for active/inactive objects
packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationsTable.tsx 4/5 New searchable table component following established patterns with proper internationalization
packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx 4/5 Consolidated function and application settings under single feature flag with new lazy-loaded components
packages/twenty-server/src/engine/core-modules/application/dtos/application.dto.ts 4/5 New ApplicationDTO with minor validation concerns for universalIdentifier and array fields
packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionCodeEditor.tsx 4/5 Removed code validation functionality as part of component simplification
packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctions.tsx 4/5 Added data fetching and container structure, moving from component-level to prop-based data flow
packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionTestTab.tsx 4/5 Added optional isTesting prop to control button state and provide visual feedback
packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionServerlessFunction.tsx 5/5 Fixed object spreading bug in code state updates to prevent file loss
packages/twenty-front/src/modules/object-metadata/graphql/queries.ts 5/5 Refactored to use GraphQL fragment pattern reducing query size from 109 to 22 lines
packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx 5/5 Extracted complex table logic into separate component for better separation of concerns
packages/twenty-front/src/modules/object-metadata/graphql/fragment.ts 5/5 New comprehensive GraphQL fragment for object metadata supporting application introspection
packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts 5/5 Updated test mocks to include new IS_APPLICATION_ENABLED feature flag
packages/twenty-server/src/engine/core-modules/application/application.resolver.ts 5/5 Added new GraphQL query resolvers with proper feature flag protection and workspace scoping
packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx 5/5 Added Applications section to navigation with proper feature flag control and reordering
packages/twenty-front/src/modules/applications/graphql/queries/findOneApplication.ts 5/5 New GraphQL query for fetching single application following standard patterns
packages/twenty-front/src/pages/settings/applications/constants/SettingsApplicationTableMetadata.ts 5/5 Table metadata definition following established patterns with proper internationalization
packages/twenty-server/src/engine/metadata-modules/agent/agent.resolver.ts 5/5 Removed unused repository injection, keeping resolver thin and using service layers
packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDetailSkeletonLoader.tsx 5/5 New skeleton loader following established patterns with proper theming and responsive layout
packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx 5/5 Added optional withSearchBar prop for component reusability while maintaining backward compatibility
packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-feature-flags.util.ts 5/5 Added IS_APPLICATION_ENABLED feature flag to development seeder configuration
packages/twenty-ui/src/display/icon/components/TablerIcons.ts 5/5 Added IconPuzzle2 export following alphabetical ordering and established patterns
packages/twenty-front/src/generated/graphql.ts 5/5 Generated GraphQL types including new Application type and feature flag definitions
packages/twenty-front/src/modules/applications/graphql/fragments/applicationFragment.ts 5/5 New GraphQL fragment combining related entity fragments for efficient Application queries
packages/twenty-shared/src/types/SettingsPath.ts 5/5 Added Applications and ApplicationDetail paths following existing navigation patterns
packages/twenty-server/src/engine/core-modules/feature-flag/enums/feature-flag-key.enum.ts 5/5 Added IS_APPLICATION_ENABLED feature flag following established naming conventions
packages/twenty-front/codegen-metadata.cjs 5/5 Added applications module GraphQL files to codegen configuration for type generation
packages/twenty-server/src/engine/core-modules/application/application.exception.ts 5/5 Added APPLICATION_NOT_FOUND exception code following existing pattern
packages/twenty-ui/src/display/index.ts 5/5 Auto-generated export addition for IconPuzzle2 component

Confidence score: 2/5

  • This PR contains critical bugs that will cause application lookup failures and poor user experience with incomplete loading states
  • Score lowered due to logical error in findOneApplication service method that ignores the application ID parameter, GraphQL query structural inconsistencies, missing error handling in UI components, and early returns without proper loading states
  • Pay close attention to packages/twenty-server/src/engine/core-modules/application/application.service.ts and packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx which contain critical issues that must be fixed before merging

Sequence Diagram

sequenceDiagram
    participant User
Loading

Additional Comments (2)

  1. packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx, line 406 (link)

    logic: The isFunctionSettingsEnabled prop is still defined in the type but no longer used in the component parameters, creating a mismatch between the type definition and actual usage.

  2. packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx, line 87 (link)

    logic: Potential runtime error if formValues.code[SOURCE_FOLDER_NAME] is undefined when Object.keys() is called

Context used:

  • Context from dashboard - Avoid using fragments when there is only one child component in a return statement. (source)

36 files reviewed, 16 comments

Edit Code Review Agent Settings | Greptile

@martmull martmull force-pushed the 1518-extensibility-front-add-an-application-section-in-settings branch from 4a8086a to 771b163 Compare October 13, 2025 10:04
Copy link
Contributor

github-actions bot commented Oct 13, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:43517

This environment will automatically shut down when the PR is closed or after 5 hours.

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.

[Extensibility] [front] Add an Application section in Settings

1 participant