A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
Improve error indicators when errors panel is in sidebar (#7746)
Trevor Manzb57bbc35e869
diff --git a/frontend/src/components/editor/chrome/wrapper/footer.tsx b/frontend/src/components/editor/chrome/wrapper/footer.tsxindex f6fa96c8f1..5412ecd2b8 100644--- a/frontend/src/components/editor/chrome/wrapper/footer.tsx+++ b/frontend/src/components/editor/chrome/wrapper/footer.tsx@@ -9,7 +9,7 @@ import { cellErrorCount } from "@/core/cells/cells";import { isConnectingAtom } from "@/core/network/connection";import { useHotkey } from "@/hooks/useHotkey";import { ShowInKioskMode } from "../../kiosk-mode";-import { useChromeActions, useChromeState } from "../state";+import { panelLayoutAtom, useChromeActions, useChromeState } from "../state";import { FooterItem } from "./footer-item";import { AIStatusIcon } from "./footer-items/ai-status";import {@@ -29,11 +29,15 @@ export const Footer: React.FC = () => {const errorCount = useAtomValue(cellErrorCount);const connectionStatus = useAtomValue(connectionStatusAtom);+ const panelLayout = useAtomValue(panelLayoutAtom);// Show issue count: cell errors + connection issues+ // Don't include error count if errors panel is in sidebar (it shows there instead)+ const errorsInSidebar = panelLayout.sidebar.includes("errors");const hasConnectionIssue =connectionStatus === "unhealthy" || connectionStatus === "disconnected";- const issueCount = errorCount + (hasConnectionIssue ? 1 : 0);+ const issueCount =+ (errorsInSidebar ? 0 : errorCount) + (hasConnectionIssue ? 1 : 0);// TODO: Add warning count from diagnostics/linting// This can signal warnings/errors with settings up AI / Copilot etcdiff --git a/frontend/src/components/editor/chrome/wrapper/sidebar.tsx b/frontend/src/components/editor/chrome/wrapper/sidebar.tsxindex d881f05bf7..70532575d5 100644--- a/frontend/src/components/editor/chrome/wrapper/sidebar.tsx+++ b/frontend/src/components/editor/chrome/wrapper/sidebar.tsx@@ -7,7 +7,10 @@ import type { PropsWithChildren } from "react";import { useMemo } from "react";import { ReorderableList } from "@/components/ui/reorderable-list";import { Tooltip } from "@/components/ui/tooltip";-import { notebookQueuedOrRunningCountAtom } from "@/core/cells/cells";+import {+ cellErrorCount,+ notebookQueuedOrRunningCountAtom,+} from "@/core/cells/cells";import { cn } from "@/utils/cn";import { FeedbackButton } from "../components/feedback-button";import { panelLayoutAtom, useChromeActions, useChromeState } from "../state";@@ -108,7 +111,11 @@ export const Sidebar: React.FC = () => {tooltip={panel.tooltip}selected={selectedPanel === panel.type}>- {renderIcon(panel)}+ {panel.type === "errors" ? (+ <ErrorPanelIcon Icon={panel.Icon} />+ ) : (+ renderIcon(panel)+ )}</SidebarItem>)}/>@@ -123,6 +130,15 @@ export const Sidebar: React.FC = () => {);};+const ErrorPanelIcon: React.FC<{ Icon: PanelDescriptor["Icon"] }> = ({+ Icon,+}) => {+ const errorCount = useAtomValue(cellErrorCount);+ return (+ <Icon className={cn("h-5 w-5", errorCount > 0 && "text-destructive")} />+ );+};+const QueuedOrRunningStack = () => {const count = useAtomValue(notebookQueuedOrRunningCountAtom);return (