Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3423,6 +3423,7 @@ export function useChat(
? { viewId: (c.currentView ? c.currentView.viewId : c.viewId) ?? undefined }
: {}),
...('fileId' in c && c.fileId ? { fileId: c.fileId } : {}),
...(c.kind === 'dashboard' ? { dashboardId: c.dashboardId } : {}),
...('folderId' in c && c.folderId ? { folderId: c.folderId } : {}),
...(c.kind === 'skill' && 'skillId' in c ? { skillId: c.skillId } : {}),
...(c.kind === 'integration' && 'blockType' in c ? { blockType: c.blockType } : {}),
Expand Down
4 changes: 3 additions & 1 deletion apps/sim/components/charts/time-series-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ export function TimeSeriesChart({ label, option, ...config }: TimeSeriesChartPro
const valuesRef = useRef<HTMLDivElement>(null)
const edges = useScrollEdges(valuesRef, { axis: 'x' })
const [readout, setReadout] = useState<ChartReadout | null>(null)
const hasValues = Boolean(readout?.values.length)
return (
<div className='h-full min-w-0'>
<div
role={hasValues ? 'group' : undefined}
className='mb-2 flex h-8 min-w-0 items-center justify-between gap-4 text-sm tabular-nums'
aria-label={`${label} values`}
aria-label={hasValues ? `${label} values` : undefined}
>
<div
ref={valuesRef}
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/lib/dashboards/repository.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ describe('dashboard repository in PostgreSQL', () => {
})

it('updates only at the expected revision and advances it', async () => {
const current = (await getWorkspaceDashboard('ws-a'))!
const current = (await insertWorkspaceDashboard('ws-c', 'first', 'user-1'))!
const updated = await updateDashboardContent(current.id, 'edited', 'user-2', current.revision)
expect(updated).toMatchObject({
content: 'edited',
revision: current.revision + 1,
updatedBy: 'user-2',
})
expect(await updateDashboardContent(current.id, 'stale', 'user-3', current.revision)).toBeNull()
expect((await getWorkspaceDashboard('ws-a'))?.content).toBe('edited')
expect((await getWorkspaceDashboard('ws-c'))?.content).toBe('edited')
})
})
14 changes: 14 additions & 0 deletions apps/sim/lib/mothership/chat/display-message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,20 @@ describe('display-message', () => {
])
})

it('keeps the dashboard id of a reopened dashboard mention', () => {
const display = toDisplayMessage({
id: 'msg-dashboard',
role: 'user',
content: '@Dashboard',
timestamp: '2024-01-01T00:00:00.000Z',
contexts: [{ kind: 'dashboard', label: 'Dashboard', dashboardId: 'dashboard-1' }],
})

expect(display.contexts).toEqual([
{ kind: 'dashboard', label: 'Dashboard', dashboardId: 'dashboard-1' },
])
})

it.each(['pending', 'executing', 'awaiting_approval'])(
'shows a %s row of a stored message as interrupted, not running',
(state) => {
Expand Down
1 change: 1 addition & 0 deletions apps/sim/lib/mothership/chat/display-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ function toDisplayContexts(
...(c.tableId ? { tableId: c.tableId } : {}),
...(c.viewId ? { viewId: c.viewId } : {}),
...(c.fileId ? { fileId: c.fileId } : {}),
...(c.dashboardId ? { dashboardId: c.dashboardId } : {}),
...(c.folderId ? { folderId: c.folderId } : {}),
...(c.chatId ? { chatId: c.chatId } : {}),
...(c.blockType ? { blockType: c.blockType } : {}),
Expand Down
Loading