feat(dashboards): add section header tile to the add menu#19
Open
lordspline wants to merge 4 commits into
Open
feat(dashboards): add section header tile to the add menu#19lordspline wants to merge 4 commits into
lordspline wants to merge 4 commits into
Conversation
…tile type composed on the text‑ Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-trip safely - await the dashboard update via its success/failure actions so a failed save keeps the modal open and toasts, instead of closing optimistically - reset the new-section form after a successful save so the shared keyed logic reopens empty - preserve inline markdown in title/description across edits by serializing marks back to source - reject descriptions that would parse as block markdown (lists, headings, quotes, thematic breaks) instead of corrupting them, and stop stripping non-block characters like #growth - require the canonical signature (h2 + optional paragraph + trailing divider) so ordinary transparent text cards no longer route through the section editor Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Replace the global update-action bridge with a request-specific api.update await so the form lifecycle can't be settled by a concurrent dashboard update (layout save, sharing toggle). On failure it rejects and keeps the modal open; on success it syncs dashboardsModel exactly as the loader would. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PostHog dashboards expose Insight, Text card, and Button tiles via the Add menu, but there's no first-class way to group tiles into labeled sections. The documented workaround — add a Text card, type a markdown heading, toggle transparent background, then resize to full width and drag into place — works but isn't discoverable. This adds a first-class Section header tile, inspired by PostHog/posthog#58307.
Changes
A Section header is not a new model, migration, or DB field — it is an ordinary transparent text tile whose markdown body is a heading, an optional description paragraph, and a trailing
---divider. This reuses the existing text-tile persistence and rendering end to end:transparent_background = true, and places the tile full-width (w=12) on a new row by default — no resizing or dragging needed.TextCardrenders it unchanged: transparent (no card border/background), a bold heading, the description, and a full-width hairline divider (the trailing---) that separates the section from the tiles below.dashboard section header savedevent mirroring the existing tile events.Two visual treatments were prototyped against a realistic seeded dashboard before implementation — heading + description with a bottom divider vs. without. The divider treatment was chosen because it reads more clearly as a section break and matches PostHog's divider-heavy visual language.
Why no schema change
Investigation confirmed the existing representation (
Text.body+DashboardTile.transparent_background+layouts) reliably preserves every required behavior — creation, full-width placement, editing round-trip, duplication, deletion, and serialization — so no new field or migration was added.How did you test this code?
I am an agent; these are the automated checks I actually ran (no manual testing claimed):
sectionHeaderMarkdown.test.ts(compose/parse/detection, escaping and shape safety) andsectionHeaderModalLogic.test.ts(default full-width/new-row layout, narrowxslayout, create/edit payloads, validation, analytics) — 36 tests passing.test_dashboard_section_headers.py— creation + full-width transparent persistence, serialization, in-place editing, dashboard duplication, soft delete, and a non-editor403permission check — 6 tests passing.oxlintclean on the changed files;tsgotypecheck reports no errors.Automatic notifications
Docs update
No user-facing docs change required for this fork experiment.
🤖 Agent context
Autonomy: Human-driven (agent-assisted) — directed by the requesting user.
Built with Capy (Captain agent plus automated desktop verification). Key decisions:
---rather than a renderer-level treatment, so the existingTextCardrenders sections with zero rendering changes and existing dashboards are untouched.& ( ) : -> % - # >round-trip verbatim.onClickand a formhtmlType="submit").Agent-authored — requires human review; do not self-merge.