Skip to content

Prefil fields widgets to standard app#17897

Merged
Weiko merged 4 commits intomainfrom
c--prefil-fields-widget-config-to-standard-app
Feb 12, 2026
Merged

Prefil fields widgets to standard app#17897
Weiko merged 4 commits intomainfrom
c--prefil-fields-widget-config-to-standard-app

Conversation

@Weiko
Copy link
Copy Markdown
Member

@Weiko Weiko commented Feb 12, 2026

Context

Prefill the FIELDS widget configuration in standard page layouts during workspace creation, linking each widget to a dedicated view with positioned fields organized into sections (via view field groups)

We wanted something very declarative (by manually setting position and visibility of each field per standard object).
In this PR I've generated all the compute- utils via AI (😨) for position/visibility, we'll probably want to confirm with the product which ordering/visibility we want for each standard object but I feel like this can be merged as it is since it's behind a feature flag and this will unblock the work on the frontend

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 12, 2026

Greptile Overview

Greptile Summary

This PR implements prefilled FIELDS widget configurations for standard page layouts during workspace creation. The implementation introduces a new FIELDS_WIDGET view type and creates dedicated views with positioned fields organized into sections (view field groups) for five standard objects: company, person, opportunity, task, and note.

Key changes:

  • Added FIELDS_WIDGET enum to ViewType with corresponding database migration
  • Created 5 new record page field views (one per standard object) with type FIELDS_WIDGET
  • Generated view field groups (general, additional, other) to organize fields into sections
  • Updated FIELDS widget configuration DTO to include optional viewId for linking to dedicated views
  • Added 191 universal identifiers to standard-object.constant.ts for views, view fields, and view field groups
  • Fixed dependency ordering in workspace migration orchestrator by processing view field groups before view fields

AI-generated code:
As noted in the PR description, the compute utilities for standard objects were generated via AI. The field positioning and visibility choices should be validated with the product team, though this is acceptable since it's behind a feature flag.

Technical implementation:
The implementation follows a declarative approach with hardcoded positions and visibility for each field per standard object. The architecture properly separates concerns with dedicated builder utilities for views, view fields, and view field groups.

Confidence Score: 4/5

  • Safe to merge with minor considerations - AI-generated field configurations need product validation
  • Well-structured implementation with proper migrations and type safety. Score reduced by 1 due to AI-generated compute utilities that need product team validation for field ordering/visibility, and large number of universal identifiers added that should be verified for uniqueness
  • packages/twenty-shared/src/metadata/standard-object.constant.ts - verify all 191 new universal identifiers are unique and follow the correct pattern

Important Files Changed

Filename Overview
packages/twenty-server/src/database/typeorm/core/migrations/common/1770906704231-addFieldsWidgetViewType.ts Added FIELDS_WIDGET enum value to view_type_enum with proper up and down migrations
packages/twenty-shared/src/metadata/standard-object.constant.ts Added universal identifiers for 5 new record page field views, view field groups, and view fields for company, person, opportunity, task, and note objects
packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts Implemented buildFieldsWidgetConfiguration to link FIELDS widgets to dedicated views with viewId configuration
packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/build-standard-flat-view-field-group-metadata-maps.util.ts New builder to generate view field group metadata for standard objects (company, person, opportunity, task, note)
packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-company-view-fields.util.ts Added companyRecordPageFields view fields with field groupings (general, additional, other)
packages/twenty-server/src/engine/workspace-manager/workspace-migration/services/workspace-migration-build-orchestrator.service.ts Reordered view field group processing to occur before view fields (dependency ordering fix)

Sequence Diagram

sequenceDiagram
    participant WS as Workspace Creation
    participant Builder as StandardApplicationBuilder
    participant ViewBuilder as ViewBuilder
    participant VFGBuilder as ViewFieldGroupBuilder
    participant VFBuilder as ViewFieldBuilder
    participant WidgetBuilder as PageLayoutWidgetBuilder
    participant DB as Database

    WS->>Builder: Create workspace metadata
    Builder->>ViewBuilder: Build standard views
    ViewBuilder->>DB: Create FIELDS_WIDGET views
    Note over ViewBuilder,DB: Creates companyRecordPageFields,<br/>personRecordPageFields, etc.
    
    Builder->>VFGBuilder: Build view field groups
    VFGBuilder->>DB: Create field groups (general, additional, other)
    Note over VFGBuilder,DB: Groups created for each view<br/>with positions 0, 1, 2
    
    Builder->>VFBuilder: Build view fields
    VFBuilder->>DB: Create view fields with group assignments
    Note over VFBuilder,DB: Fields linked to groups<br/>with viewFieldGroupId
    
    Builder->>WidgetBuilder: Build FIELDS widgets
    WidgetBuilder->>DB: Create widgets with viewId configuration
    Note over WidgetBuilder,DB: Links FIELDS widget to<br/>dedicated FIELDS_WIDGET view
Loading

Copy link
Copy Markdown
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.

27 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 27 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 12, 2026

🚀 Preview Environment Ready!

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

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

Comment on lines +17 to +20
@Field(() => String, { nullable: true })
@IsOptional()
@IsUUID()
viewId: string | null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is it optional?

If the user wants to create a new Fields widget, we first create the widget in the database, and then create and link a view? I would rather see the opposite pattern.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes it's probably the opposite indeed, I don't see a good reason to do it the other way around 👍

"id": "00000000-0000-0000-0000-000000000102",
},
},
"id": "00000000-0000-0000-0000-000000000126",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

doesn't look stable but OK :) (I think @prastoin introduced some example)

@Weiko Weiko added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit 3075707 Feb 12, 2026
98 of 101 checks passed
@Weiko Weiko deleted the c--prefil-fields-widget-config-to-standard-app branch February 12, 2026 17:11
@twenty-eng-sync
Copy link
Copy Markdown

Hey @Weiko! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

1 similar comment
@twenty-eng-sync
Copy link
Copy Markdown

Hey @Weiko! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants