Merge pull request #323 from buster-so/nate/add-langfuse-tracing

link to langfuse
This commit is contained in:
Nate Kelley 2025-05-13 14:30:25 -06:00 committed by GitHub
commit ba93fa9c39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 1 deletions

View File

@ -64,7 +64,7 @@ test.describe.serial('Pie chart styling updates', async () => {
await page.getByTestId('edit-chart-button').getByRole('button').click();
await page.waitForTimeout(255);
await page.getByTestId('edit-chart-button').getByRole('button').click();
await page.waitForTimeout(55);
await page.waitForTimeout(255);
await page.getByTestId('segmented-trigger-results').click();
await page.waitForTimeout(555);
await page.waitForLoadState('networkidle');
@ -75,7 +75,11 @@ test.describe.serial('Pie chart styling updates', async () => {
await expect(page.getByRole('textbox', { name: 'New chart' })).toHaveValue(
'Top 10 Products by Revenue (Last 4 Quarters)'
);
await page.waitForTimeout(555);
await page.getByTestId('edit-chart-button').getByRole('button').click();
await page.waitForLoadState('networkidle');
await page.waitForLoadState('domcontentloaded');
await page.waitForLoadState('load');
await expect(page.getByText('Edit chart')).toBeVisible();
await page
.locator('div')

View File

@ -8,6 +8,9 @@ import { ChatLayoutContextProvider, useChatLayoutContext } from '../ChatLayoutCo
import { ChatContextProvider } from '../ChatContext/ChatContext';
import { DEFAULT_CHAT_OPTION_SIDEBAR_SIZE } from '../ChatLayoutContext/config';
import { useMount } from '@/hooks';
import { useHotkeys } from 'react-hotkeys-hook';
import { CREATE_LANGFUSE_SESSION_URL } from '@/routes/externalRoutes';
import { useBusterNotifications } from '@/context/BusterNotifications';
interface ChatSplitterProps {
children?: React.ReactNode;
@ -15,6 +18,7 @@ interface ChatSplitterProps {
export const ChatLayout: React.FC<ChatSplitterProps> = ({ children }) => {
const appSplitterRef = useRef<AppSplitterRef>(null);
const { openErrorNotification } = useBusterNotifications();
const [mounted, setMounted] = useState(false);
const chatLayoutProps = useChatLayoutContext({ appSplitterRef });
@ -30,6 +34,23 @@ export const ChatLayout: React.FC<ChatSplitterProps> = ({ children }) => {
setMounted(true); //we need to wait for the app splitter to be mounted because this is nested in the app splitter
});
useHotkeys(
'meta+l',
(e) => {
e.stopPropagation();
const chatId = chatLayoutProps.chatId;
if (!chatId) {
openErrorNotification('No chat id found');
return;
}
const link = CREATE_LANGFUSE_SESSION_URL(chatId);
window.open(link, '_blank');
},
{
preventDefault: true
}
);
return (
<ChatLayoutContextProvider chatLayoutProps={chatLayoutProps}>
<ChatContextProvider>

View File

@ -2,3 +2,5 @@ export const BUSTER_HOME_PAGE = 'https://buster.so';
export const BUSTER_DOCS_URL = 'https://docs.buster.so';
export const BUSTER_GETTING_STARTED_URL = 'https://www.buster.so/get-started';
export const BUSTER_DOCS_QUICKSTART = 'https://docs.buster.so/docs/getting-started/quickstart';
export const CREATE_LANGFUSE_SESSION_URL = (chatId: string) =>
`https://us.cloud.langfuse.com/project/clt828pud00004hn8abr822q8/sessions/${chatId}`;