fix inconsistent widget placeholder placement (#15580)

fixes -
https://github.com/twentyhq/twenty/pull/15496#issuecomment-3481636780

and https://discord.com/channels/1130383047699738754/1434971632539009055

- make the pending placeholder to be non-static -- so that it behaves
similarly to compact behavior like other widgets do
- make sure users can't set dashboards to be opened in the side panel --
similar to workflows

before- 


https://github.com/user-attachments/assets/d991db56-1388-4e4b-b743-a63f56b6187a

after- 


https://github.com/user-attachments/assets/9031f2c6-1e3b-4604-a5a0-3124d14484ce
This commit is contained in:
nitin
2025-11-04 15:37:57 +05:30
committed by GitHub
parent 77f04e7306
commit 106c33abec
3 changed files with 7 additions and 6 deletions
@@ -1,5 +1,6 @@
export const canOpenObjectInSidePanel = (objectNameSingular: string) =>
!(
objectNameSingular === 'workflow' ||
objectNameSingular === 'workflowVersion'
objectNameSingular === 'workflowVersion' ||
objectNameSingular === 'dashboard'
);
@@ -20,7 +20,7 @@ describe('createPendingWidgetPlaceholderLayoutItem', () => {
h: 6,
minW: DEFAULT_WIDGET_SIZE.minimum.w,
minH: DEFAULT_WIDGET_SIZE.minimum.h,
static: true,
static: false,
});
});
@@ -51,7 +51,7 @@ describe('createPendingWidgetPlaceholderLayoutItem', () => {
h: 6,
minW: DEFAULT_WIDGET_SIZE.minimum.w,
minH: DEFAULT_WIDGET_SIZE.minimum.h,
static: true,
static: false,
});
});
@@ -78,7 +78,7 @@ describe('createPendingWidgetPlaceholderLayoutItem', () => {
'mobile',
);
expect(desktopResult.static).toBe(true);
expect(mobileResult.static).toBe(true);
expect(desktopResult.static).toBe(false);
expect(mobileResult.static).toBe(false);
});
});
@@ -16,5 +16,5 @@ export const createPendingWidgetPlaceholderLayoutItem = (
h: Math.max(draggedArea.h, DEFAULT_WIDGET_SIZE.default.h),
minW: DEFAULT_WIDGET_SIZE.minimum.w,
minH: DEFAULT_WIDGET_SIZE.minimum.h,
static: true,
static: false,
});