Skip to content

Commit bcbad6b

Browse files
fix(dashboards): named heading sizes and no redundant dashboard name lookups
The dashboard name is fixed, so resource tabs and chat chips no longer fetch the dashboard to title it; dashboard headings use named text sizes.
1 parent 3a32c9d commit bcbad6b

4 files changed

Lines changed: 4 additions & 33 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ import type {
9595
// ConnectServiceAccountModal, and that edge would pull the modal into this
9696
// chunk and defeat the lazy() split below.
9797
import { useServiceAccountConnectTarget } from '@/app/workspace/[workspaceId]/integrations/components/connect-service-account-modal/use-service-account-connect'
98-
import { useFeatureFlag } from '@/app/workspace/[workspaceId]/providers/feature-flags-provider'
9998
import { useOptionalWorkspaceHostContext } from '@/app/workspace/[workspaceId]/providers/workspace-host-provider'
10099
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
101100
import { BrandIcon } from '@/blocks/brand-icon'
@@ -105,7 +104,6 @@ import {
105104
useWorkspaceCredential,
106105
useWorkspaceCredentials,
107106
} from '@/hooks/queries/credentials'
108-
import { useWorkspaceDashboard } from '@/hooks/queries/dashboards'
109107
import {
110108
usePersonalEnvironment,
111109
useSavePersonalEnvironment,
@@ -1995,10 +1993,6 @@ function WorkspaceResourceDisplayContent({
19951993
const { data: tables = [] } = useTablesList(workspaceId)
19961994
const { data: files = [] } = useWorkspaceFiles(workspaceId)
19971995
const { data: knowledgeBases = [] } = useKnowledgeBasesQuery(workspaceId)
1998-
const dashboardsEnabled = useFeatureFlag('dashboards')
1999-
const { data: dashboardData } = useWorkspaceDashboard(workspaceId, {
2000-
enabled: dashboardsEnabled && data.type === 'dashboard',
2001-
})
20021996

20031997
const resource = useMemo<WorkspaceResourceRef>(() => {
20041998
const fileFromPath =
@@ -2011,11 +2005,7 @@ function WorkspaceResourceDisplayContent({
20112005
? (tables.find((table) => table.id === data.id)?.name ??
20122006
fallbackWorkspaceResourceTitle(data.type))
20132007
: data.type === 'dashboard'
2014-
? ((dashboardData?.dashboard?.id === data.id
2015-
? dashboardData?.dashboard?.name
2016-
: undefined) ??
2017-
data.title ??
2018-
fallbackWorkspaceResourceTitle(data.type))
2008+
? (data.title ?? fallbackWorkspaceResourceTitle(data.type))
20192009
: data.type === 'file'
20202010
? (files.find((file) => file.id === data.id)?.name ??
20212011
fileFromPath?.name ??
@@ -2037,7 +2027,6 @@ function WorkspaceResourceDisplayContent({
20372027
data.path,
20382028
data.title,
20392029
data.type,
2040-
dashboardData,
20412030
files,
20422031
knowledgeBases,
20432032
tables,

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ import type {
4949
MothershipResource,
5050
MothershipResourceType,
5151
} from '@/app/workspace/[workspaceId]/home/types'
52-
import { useFeatureFlag } from '@/app/workspace/[workspaceId]/providers/feature-flags-provider'
53-
import { useWorkspaceDashboard } from '@/hooks/queries/dashboards'
5452
import { useFolders } from '@/hooks/queries/folders'
5553
import { useKnowledgeBasesQuery } from '@/hooks/queries/kb/knowledge'
5654
import { useTablesList } from '@/hooks/queries/tables'
@@ -163,11 +161,7 @@ function useResourceNameLookup(
163161
workspaceId: string | undefined,
164162
resources: MothershipResource[]
165163
): Map<string, string> {
166-
const dashboardsEnabled = useFeatureFlag('dashboards')
167164
const enabled = resources.length > 0
168-
const { data: dashboardData } = useWorkspaceDashboard(workspaceId ?? '', {
169-
enabled: dashboardsEnabled && resources.some((resource) => resource.type === 'dashboard'),
170-
})
171165
const owners = [
172166
...new Set(
173167
resources
@@ -210,22 +204,10 @@ function useResourceNameLookup(
210204
}
211205
for (const t of tables ?? []) map.set(`table:${t.id}`, t.name)
212206
for (const file of files ?? []) map.set(`file:${file.id}`, file.name)
213-
if (dashboardData?.dashboard)
214-
map.set(`dashboard:${dashboardData.dashboard.id}`, dashboardData.dashboard.name)
215207
for (const kb of knowledgeBases ?? []) map.set(`knowledgebase:${kb.id}`, kb.name)
216208
for (const folder of folders ?? []) map.set(`folder:${folder.id}`, folder.name)
217209
return map
218-
}, [
219-
enabled,
220-
workflows,
221-
tables,
222-
files,
223-
dashboardData,
224-
knowledgeBases,
225-
folders,
226-
ownedWorkflows,
227-
owners,
228-
])
210+
}, [enabled, workflows, tables, files, knowledgeBases, folders, ownedWorkflows, owners])
229211
}
230212

231213
interface ResourceTabsProps {

‎apps/sim/components/dashboards/dashboard-panel.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export function DashboardPanel({ block, defaults, workspaceId, range, now }: Das
147147
) : (
148148
<h2
149149
className={cn(
150-
'@min-[1000px]/dashboard:text-[24px] text-[20px] text-[var(--text-primary)] leading-tight tracking-[-0.02em]',
150+
'@min-[1000px]/dashboard:text-2xl text-[var(--text-primary)] text-xl leading-tight tracking-[-0.02em]',
151151
timeSeries ? 'mb-3' : 'mb-5'
152152
)}
153153
>

‎apps/sim/components/dashboards/dashboard-preview.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function DashboardView({ spec, workspaceId, dashboardId }: DashboardViewProps) {
100100
<div className='mx-auto flex w-full max-w-[1120px] flex-col gap-6'>
101101
<header className='grid @min-[1000px]/dashboard:grid-cols-[minmax(0,1fr)_auto] grid-cols-1 items-start gap-4'>
102102
<div className='flex min-w-0 flex-col gap-1'>
103-
<h1 className='@min-[1000px]/dashboard:text-[32px] text-[28px] text-[var(--text-primary)] leading-tight tracking-[-0.02em]'>
103+
<h1 className='@min-[1000px]/dashboard:text-3xl text-2xl text-[var(--text-primary)] leading-tight tracking-[-0.02em]'>
104104
{spec.title}
105105
</h1>
106106
{description && (

0 commit comments

Comments
 (0)