Skip to content

feat(dashboards): add section headers#10

Open
lordspline wants to merge 2 commits into
masterfrom
capy/dashboard-section-headers
Open

feat(dashboards): add section headers#10
lordspline wants to merge 2 commits into
masterfrom
capy/dashboard-section-headers

Conversation

@lordspline

@lordspline lordspline commented Jun 17, 2026

Copy link
Copy Markdown

Problem

Dashboards currently support text tiles, but not a first-class way to add lightweight section breaks. Users organizing dense dashboards need a section header that behaves like a dashboard tile without introducing a new dashboard model or migration.

Changes

  • Add an Add → Section header flow that reuses the generated dashboard text-tile create/update APIs and persists as marked text tile content with transparent background.
  • Render section headers as plain text title/description rows with a transparent divider treatment, full-width default placement, mobile-friendly height, edit/duplicate/delete support, and dashboard-template serialization.
  • Extend text tile create/update serializers with transparent_background, regenerate dashboard/MCP API types, and report text tile creation through the existing dashboard tile added action path.
  • Screenshots/video captured locally in the agent session: section-header-treatment-a.png, section-header-treatment-b.png, section-header-browser-before.png, section-header-browser-after-add.png, section-header-browser-after-drag.png, section-header-dashboard-flow.mp4.

How did you test this code?

I’m an agent. I tested with:

  • pnpm --filter=@posthog/frontend format
  • pnpm --filter=@posthog/frontend typescript:check
  • hogli test frontend/src/lib/components/Cards/TextCard/textCardSectionHeader.test.ts frontend/src/lib/components/Cards/TextCard/TextCard.test.tsx frontend/src/lib/components/Cards/TextCard/textCardModalLogic.test.ts frontend/src/scenes/dashboard/DashboardHeader.test.tsx frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsx frontend/src/scenes/dashboard/dashboardLogic.test.ts frontend/src/scenes/dashboard/dashboardUtils.test.ts frontend/src/scenes/dashboard/tileLayouts.test.ts
  • hogli test posthog/api/test/dashboards/test_dashboard.py::TestDashboard::test_create_text_tile_adds_markdown_tile_to_dashboard posthog/api/test/dashboards/test_dashboard.py::TestDashboard::test_create_text_tile_reports_tile_added_event posthog/api/test/dashboards/test_dashboard.py::TestDashboard::test_create_text_tile_requires_edit_permissions posthog/api/test/dashboards/test_dashboard.py::TestDashboard::test_update_text_tile_updates_body_and_layout posthog/api/test/dashboards/test_dashboard.py::TestDashboard::test_update_text_tile_requires_edit_permissions posthog/api/test/dashboards/test_dashboard.py::TestDashboard::test_duplicate_text_tile_within_dashboard_preserves_section_header_fields posthog/api/test/dashboards/test_dashboard.py::TestDashboard::test_create_from_template_json_can_provide_text_tile
  • Browser verification on a seeded dashboard: add a section header, name it, drag it to a new row, edit it, and confirm the stored layout changed.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

No docs update included.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Captain Capy implemented this as a fork experiment inspired by issue PostHog#58307. I prototyped a transparent divider treatment and a subtle accent-band treatment against realistic dashboard fixtures, then chose the transparent divider because it fits existing dashboard/text-tile visual language without competing with chart cards.

The implementation intentionally avoids a new dashboard model or migration. It uses existing text tile persistence with a marker in the body, transparent_background, generated dashboard APIs, and layout defaults to preserve section-header behavior across creation, editing, duplication, templates, and responsive dashboards.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@lordspline lordspline added the capy Generated by capy.ai label Jun 17, 2026 — with Capy AI
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant