Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(today): dashboards and notebooks always open in views (#116203)

Adam Leith68699c28b9ab
diff --git a/frontend/src/layout/today/TodayViewsSidebar.tsx b/frontend/src/layout/today/TodayViewsSidebar.tsx
index b4b67e4384ac..b3ea06ec22f9 100644
--- a/frontend/src/layout/today/TodayViewsSidebar.tsx
+++ b/frontend/src/layout/today/TodayViewsSidebar.tsx
@@ -65,6 +65,8 @@ export function TodayViewsSidebar(): JSX.Element {
const path = removeProjectIdIfPresent(location.pathname)
const failedTypes = recentViews.failedTypes
const showAll = matchesPaneQuery('All views', recentQuery)
+ const showAllDashboards = matchesPaneQuery('All dashboards', recentQuery)
+ const showAllNotebooks = matchesPaneQuery('All notebooks', recentQuery)
const retryButton = (size: 'sm' | 'xs'): JSX.Element => (
<Button
@@ -115,6 +117,34 @@ export function TodayViewsSidebar(): JSX.Element {
dataAttr="today-views-all"
/>
)}
+ {showAllDashboards && (
+ <TodayPaneRow
+ value="all-dashboards"
+ label="All dashboards"
+ icon={
+ <ProductIconWrapper colorOverride={[VIEW_TYPE_INFO.dashboard.color]}>
+ <ViewTypeIcon type="dashboard" />
+ </ProductIconWrapper>
+ }
+ to={urls.dashboards()}
+ active={path === urls.dashboards()}
+ dataAttr="today-views-all-dashboards"
+ />
+ )}
+ {showAllNotebooks && (
+ <TodayPaneRow
+ value="all-notebooks"
+ label="All notebooks"
+ icon={
+ <ProductIconWrapper colorOverride={[VIEW_TYPE_INFO.notebook.color]}>
+ <ViewTypeIcon type="notebook" />
+ </ProductIconWrapper>
+ }
+ to={urls.notebooks()}
+ active={path === urls.notebooks()}
+ dataAttr="today-views-all-notebooks"
+ />
+ )}
{recentUnavailable || !recentReady ? (
recentUnavailable ? (
<div className="TodayPane__state">
diff --git a/frontend/src/layout/today/todayShellLogic.ts b/frontend/src/layout/today/todayShellLogic.ts
index def0654fb656..771a2c840d50 100644
--- a/frontend/src/layout/today/todayShellLogic.ts
+++ b/frontend/src/layout/today/todayShellLogic.ts
@@ -82,6 +82,7 @@ export function railPaneForPath(pathname: string): TodayRailPane | null {
if (isUnder(path, '/ai') || isUnder(path, '/spaces')) {
return 'spaces'
}
+ // Notebooks and dashboards are views, list pages included, so they never open the Products pane.
if (
isUnder(path, urls.views()) ||
isUnder(path, '/canvases') ||
diff --git a/frontend/src/layout/today/todayToolsLogic.ts b/frontend/src/layout/today/todayToolsLogic.ts
index 4225676ffaf0..bd20c4191b24 100644
--- a/frontend/src/layout/today/todayToolsLogic.ts
+++ b/frontend/src/layout/today/todayToolsLogic.ts
@@ -6,11 +6,13 @@ import { ToolGroup, groupTools, toolMatchesSearch } from 'scenes/tools/toolsUtil
import { FileSystemImport } from '~/queries/schema/schema-general'
import { todayRecentsLogic } from './todayRecentsLogic'
+import { railPaneForPath } from './todayShellLogic'
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface todayToolsLogicValues {
recentToolHrefs: string[] // todayRecentsLogic
tools: FileSystemImport[] // toolsLogic
+ productTools: FileSystemImport[]
recentTools: FileSystemImport[]
search: string
toolGroups: ToolGroup[]
@@ -26,8 +28,9 @@ export interface todayToolsLogicActions {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface todayToolsLogicMeta {
__keaTypeGenInternalSelectorTypes: {
- toolGroups: (tools: FileSystemImport[], search: string) => ToolGroup[]
- recentTools: (recentToolHrefs: string[], tools: FileSystemImport[], search: string) => FileSystemImport[]
+ productTools: (tools: FileSystemImport[]) => FileSystemImport[]
+ toolGroups: (productTools: FileSystemImport[], search: string) => ToolGroup[]
+ recentTools: (recentToolHrefs: string[], productTools: FileSystemImport[], search: string) => FileSystemImport[]
}
}
@@ -44,12 +47,18 @@ export const todayToolsLogic = kea<todayToolsLogicType>([
actions({ setSearch: (search: string) => ({ search }) }),
reducers({ search: ['', { setSearch: (_, { search }) => search }] }),
selectors({
+ // Tools whose pages open another pane, like dashboards and notebooks under Views, stay out of Products.
+ productTools: [
+ (s) => [s.tools],
+ (tools: FileSystemImport[]): FileSystemImport[] =>
+ tools.filter((tool) => !tool.href || railPaneForPath(tool.href.split('?')[0]) !== 'views'),
+ ],
toolGroups: [
- (s) => [s.tools, s.search],
+ (s) => [s.productTools, s.search],
(tools: FileSystemImport[], search: string): ToolGroup[] => groupTools(tools, search),
],
recentTools: [
- (s) => [s.recentToolHrefs, s.tools, s.search],
+ (s) => [s.recentToolHrefs, s.productTools, s.search],
(hrefs: string[], tools: FileSystemImport[], search: string): FileSystemImport[] =>
hrefs
.flatMap((href) => tools.find((tool) => tool.href === href) ?? [])