Hi, trying out the new app-builder npx create-twenty-app@latest my-twenty-app and have sucessfully created a data model as code. Cool so far. Now I want to create a defineView to control how the fields are arranged in the side panel.
The docs says fields can be grouped using fieldGroups but neither Claude nor myself can get this to work properly.
Everything gets lumped together in an "other" group. The positioning works though.
How do Claude and I fix this?
export default defineView({
universalIdentifier: ASSIGNMENT_INDEX_VIEW_UID,
name: 'Assignments',
objectUniversalIdentifier: ASSIGNMENT_OBJECT_UID,
key: ViewKey.INDEX,
icon: 'IconBriefcase',
openRecordIn: ViewOpenRecordIn.SIDE_PANEL,
fieldGroups: [
{
universalIdentifier: ASSIGNMENT_VIEW_FIELD_GROUP_MAIN_UID,
name: 'Main content',
position: 0,
isVisible: true,
},
{
universalIdentifier: ASSIGNMENT_VIEW_FIELD_GROUP_META_UID,
name: 'Meta content',
position: 1,
isVisible: true,
},
],
fields: [
// Main content
{
universalIdentifier: ASSIGNMENT_INDEX_VIEW_FIELD_TITLE_UID,
fieldMetadataUniversalIdentifier: ASSIGNMENT_TITLE_FIELD_UID,
viewFieldGroupUniversalIdentifier: ASSIGNMENT_VIEW_FIELD_GROUP_MAIN_UID,
position: 0,
isVisible: true,
size: 260,
},
{
universalIdentifier: ASSIGNMENT_INDEX_VIEW_FIELD_DESCRIPTION_RAW_UID,
fieldMetadataUniversalIdentifier: ASSIGNMENT_DESCRIPTION_RAW_FIELD_UID,
viewFieldGroupUniversalIdentifier: ASSIGNMENT_VIEW_FIELD_GROUP_MAIN_UID,
position: 1,
isVisible: false,
},
...