adds chat panel to generate dashboards flow#110725
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Removed error notification for failed dashboard generation
- Added useEffect that calls addErrorMessage when sessionStatus is 'error' or isError is true, restoring the missing error notification.
- ✅ Fixed: Stuck updating state when backend responds quickly
- Updated transition detection to also trigger when session data changes while already in terminal state (completed → completed), preventing stuck updating state.
Or push these changes by commenting:
@cursor push 0807ea206f
Preview (0807ea206f)
diff --git a/static/app/views/dashboards/createFromSeer.tsx b/static/app/views/dashboards/createFromSeer.tsx
--- a/static/app/views/dashboards/createFromSeer.tsx
+++ b/static/app/views/dashboards/createFromSeer.tsx
@@ -113,6 +113,7 @@
const [dashboard, setDashboard] = useState<DashboardDetails>(EMPTY_DASHBOARD);
const [isUpdating, setisUpdating] = useState(false); // State tracks if dashboard is being updated from user chat input
const prevSessionStatusRef = useRef<string | null>(null);
+ const prevSessionRef = useRef<NonNullable<SeerExplorerResponse['session']> | null>(null);
const {data, isError} = useApiQuery<SeerExplorerResponse>(
makeSeerExplorerQueryKey(organization.slug, seerRunId),
@@ -137,14 +138,27 @@
const sessionStatus = session?.status ?? null;
useEffect(() => {
+ if (sessionStatus === 'error' || isError) {
+ addErrorMessage(t('Failed to generate dashboard'));
+ }
+ }, [sessionStatus, isError]);
+
+ useEffect(() => {
const prevStatus = prevSessionStatusRef.current;
+ const prevSession = prevSessionRef.current;
prevSessionStatusRef.current = sessionStatus;
+ prevSessionRef.current = session;
const wasTerminal = prevStatus === 'completed' || prevStatus === 'error';
const isTerminal = sessionStatus === 'completed' || sessionStatus === 'error';
- // Only trigger Dashboard rerender when transition from updating state to completed state
- if (!wasTerminal && isTerminal && session) {
+ // Trigger Dashboard rerender when:
+ // 1. Transition from updating state to completed state (!wasTerminal && isTerminal)
+ // 2. Session data changed while already in terminal state (for fast backend responses)
+ const shouldUpdate =
+ (!wasTerminal && isTerminal) || (wasTerminal && isTerminal && session !== prevSession);
+
+ if (shouldUpdate && session) {
if (isUpdating) {
setisUpdating(false);
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
84c5a6d to
fbf6662
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…enerate-dashboard-chat
narsaynorath
left a comment
There was a problem hiding this comment.
Looks good to me, just some future improvement suggestions I noticed when using it. Also it would be nice if the text prompt you give it optimistically added itself to the blocks without waiting for the POST request to come back with some stuff, so it feels more immediate
| dashboard={dashboard} | ||
| dashboards={[]} | ||
| /> | ||
| <DashboardChatPanel |
There was a problem hiding this comment.
Maybe we can style this with absolute positioning or something so it doesn't push the footer down. Can be a follow up.
| } | ||
| }, [isUpdating]); | ||
|
|
||
| // Scroll chat to bottom when new blocks arrive |
There was a problem hiding this comment.
It would be nice if it scrolled to the bottom when it's opened as well. e.g. when it auto opens after I type into it when it's closed, I have to wait until the new block or scroll down


Adds a chat panel to the seer generate dashboards flow that accepts user prompts for further dashboard modification
DashboardDetailto rerender ondashboardprop change on preview mode. This is for rerendering on receiving new generated dashboards.DashboardChatPanelcomponent to handle user input and chat history displayCreateFromSeercomponent to handle interactivity and generated dashboard reloading