Skip to content

Commit 3c4ef4f

Browse files
feat(dashboards): put Dashboard under New chat in the sidebar
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S6aTRnkiu7PxYZPNPXYEMV
1 parent 20ff5dc commit 3c4ef4f

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-registry/resource-registry.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ export const MENTION_PREVIEW_DEFAULT_LIMIT = 5
297297
* surface them lands in the right place.
298298
*/
299299
export const RESOURCE_MENU_ORDER: readonly MothershipResourceType[] = [
300+
'dashboard',
300301
'integration',
301302
'task',
302303
'table',
303-
'dashboard',
304304
'file',
305305
'filefolder',
306306
'knowledgebase',

‎apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ export const Sidebar = memo(function Sidebar({ organizationHref }: SidebarProps)
707707
[workspaces, workspaceId]
708708
)
709709

710+
const dashboardsEnabled = useFeatureFlag('dashboards')
710711
const topNavItems = useMemo(
711712
() =>
712713
[
@@ -723,6 +724,14 @@ export const Sidebar = memo(function Sidebar({ organizationHref }: SidebarProps)
723724
(chatEnabled && permissionConfig.hideCopilot && !accessRequestsEnabled),
724725
restricted: chatEnabled && permissionConfig.hideCopilot,
725726
},
727+
{
728+
id: 'dashboards',
729+
label: 'Dashboard',
730+
icon: ChartColumn,
731+
href: `/workspace/${workspaceId}/dashboards`,
732+
hidden: !dashboardsEnabled || (permissionConfig.hideFilesTab && !accessRequestsEnabled),
733+
restricted: permissionConfig.hideFilesTab,
734+
},
726735
{
727736
id: 'integrations',
728737
label: 'Integrations',
@@ -740,12 +749,13 @@ export const Sidebar = memo(function Sidebar({ organizationHref }: SidebarProps)
740749
permissionsLoading,
741750
permissionConfig.hideIntegrationsTab,
742751
permissionConfig.hideCopilot,
752+
permissionConfig.hideFilesTab,
743753
accessRequestsEnabled,
744754
chatEnabled,
755+
dashboardsEnabled,
745756
]
746757
)
747758

748-
const dashboardsEnabled = useFeatureFlag('dashboards')
749759
const workspaceNavItems = useMemo(
750760
() =>
751761
[
@@ -757,14 +767,6 @@ export const Sidebar = memo(function Sidebar({ organizationHref }: SidebarProps)
757767
hidden: permissionConfig.hideTablesTab && !accessRequestsEnabled,
758768
restricted: permissionConfig.hideTablesTab,
759769
},
760-
{
761-
id: 'dashboards',
762-
label: 'Dashboards',
763-
icon: ChartColumn,
764-
href: `/workspace/${workspaceId}/dashboards`,
765-
hidden: !dashboardsEnabled || (permissionConfig.hideFilesTab && !accessRequestsEnabled),
766-
restricted: permissionConfig.hideFilesTab,
767-
},
768770
{
769771
id: 'files',
770772
label: 'Files',
@@ -791,7 +793,6 @@ export const Sidebar = memo(function Sidebar({ organizationHref }: SidebarProps)
791793
].filter((item) => !item.hidden),
792794
[
793795
workspaceId,
794-
dashboardsEnabled,
795796
permissionConfig.hideFilesTab,
796797
permissionConfig.hideKnowledgeBaseTab,
797798
permissionConfig.hideTablesTab,

0 commit comments

Comments
 (0)