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(homepage): show eight items per project section (#81451)

Matt Puabe4bd7c005a5
diff --git a/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.test.ts b/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.test.ts
index f011f621d3d3..aa4102dfc226 100644
--- a/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.test.ts
+++ b/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.test.ts
@@ -7,8 +7,13 @@ import { maxLogic } from 'scenes/max/maxLogic'
import { urls } from 'scenes/urls'
import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
+import { projectTreeDataLogic } from '~/layout/panel-layout/ProjectTree/projectTreeDataLogic'
import { useMocks } from '~/mocks/jest'
+import { dashboardsModel } from '~/models/dashboardsModel'
+import { recentItemsModel } from '~/models/recentItemsModel'
+import { FileSystemEntry } from '~/queries/schema/schema-general'
import { initKeaTests } from '~/test/init'
+import { DashboardBasicType } from '~/types'
import { aiFirstHomepageLogic } from './aiFirstHomepageLogic'
import { HOMEPAGE_TAB_ID } from './constants'
@@ -75,4 +80,33 @@ describe('aiFirstHomepageLogic', () => {
// The prompt rides along as `ask`, which the new surface's composer seeds and submits.
expect(router.values.searchParams.ask).toEqual(sandboxFlagOn ? 'what is my dau' : undefined)
})
+
+ it('shows up to eight pinned dashboards, recents, and starred items', () => {
+ const createFileSystemEntries = (prefix: string): FileSystemEntry[] =>
+ Array.from({ length: 9 }, (_, index) => ({
+ id: `${prefix}-${index}`,
+ path: `${prefix} ${index}`,
+ type: 'insight',
+ }))
+
+ dashboardsModel.actions.loadDashboardsSuccess({
+ count: 9,
+ next: null,
+ previous: null,
+ results: Array.from({ length: 9 }, (_, index) => ({
+ id: index,
+ name: `Dashboard ${index}`,
+ pinned: true,
+ })) as DashboardBasicType[],
+ })
+ recentItemsModel.actions.loadRecentsSuccess(createFileSystemEntries('Recent'))
+ projectTreeDataLogic.actions.loadShortcutsSuccess([
+ ...createFileSystemEntries('Starred'),
+ { id: 'starred-folder', path: 'Starred folder', type: 'folder' },
+ ])
+
+ expect(logic.values.gridItems.filter((item) => item.kind === 'dashboard')).toHaveLength(8)
+ expect(logic.values.gridItems.filter((item) => item.kind === 'recent')).toHaveLength(8)
+ expect(logic.values.gridItems.filter((item) => item.kind === 'starred')).toHaveLength(8)
+ })
})
diff --git a/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.ts b/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.ts
index e62d62ede1c2..07f26396c853 100644
--- a/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.ts
+++ b/frontend/src/scenes/project-homepage/ai-first/aiFirstHomepageLogic.ts
@@ -57,7 +57,7 @@ export interface HomepageGridItem {
itemType?: string | null
}
-const GRID_LIMIT = 5
+const GRID_LIMIT = 8
const PREVIOUS_HOMEPAGE_KEY = 'ai-first-previous-homepage'