Repository navigation
feat: dashboards v2 (insight/text tiles, filters, templates) and public share links - #12
Merged
Merged
Conversation
…ic share links
- dashboards + dashboard_tiles tables; /api/v2/dashboards CRUD, list with
search/tags/pinned, one home dashboard per project, soft delete
- tiles: saved-insight or markdown text, grid layout, add/update/delete,
bulk layout save, move between dashboards, duplicate (optionally copying
insights), at most 100 tiles
- dashboard filters (date range incl. relative dates + extra properties)
applied to every insight tile; per-tile cache keyed by insight version and
filters; without filters tiles share the insight's own cache; a failing
tile reports its error without failing the dashboard; person-property tiles
respect the identity module
- built-in templates (web analytics, product analytics) at
/api/v2/dashboard-templates, created via {"template": "..."}
- share links can target a dashboard or a saved insight; new public
GET /api/shared/{token} (password via x-share-password, constant-time
check, lockout after 10 failures); password hashes no longer returned
- legacy /api/v1/dashboards (custom dashboards used by the SDK) unchanged
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 656eaebb14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… read; enforce tile limit on move Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
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.
What and Why
Pulse's dashboards were a JSON blob that nothing rendered, and share links were minted but no route ever read them. This adds PostHog-style dashboards built from saved-insight and text tiles, with dashboard-wide filters, per-tile caching, templates, duplicate and move. It also adds the missing public share-link endpoint for dashboards, insights and legacy links.
Stacked on #11 (base
ayush/saved-insights); retarget tomainonce the stack below merges.Reference followed: PostHog's
DashboardandDashboardTilemodels and API (posthog/models/dashboard*.py,posthog/api/dashboards/):layouts, dashboardfiltersoverriding insight date range and propertiespinned, the project "primary dashboard", duplicate with or without copying insights, and dashboard templatesSharingConfigurationfor public tokensChanges
dashboardsanddashboard_tilestables. A partial unique index allows one home dashboard per project, and aCHECKmakes each tile either an insight or text. It also addsdashboard_idandinsight_idcolumns toshared_dashboards./api/v2/dashboards:/run(refresh),/duplicate(duplicate_insights) and/layouts(bulk PUT)/moveto another dashboard/api/v2/dashboard-templates: "Web analytics" and "Product analytics" (six and five insights). They use relative dates and are created with{"template": "…"}. A unit test runs every template query through the per-kind validators.date_fromanddate_to(relative values allowed) plus extrapropertiesare applied to every insight tile.errorand the rest of the dashboard still renders.identitymodule; without it, only those tiles fail.GET /api/shared/{token}serves the dashboard (all tiles), the insight, or, for legacy module links, a 30-day overview.x-share-passwordheader, is compared in constant time, and locks out for 15 minutes after 10 wrong attempts.password_hashis no longer serialized in API responses./api/v1/dashboards(legacy custom dashboards, used by both SDKs) is unchanged, which is why the new API lives under/api/v2.Reviews and Follow-up
custom_dashboardsrows into v2Files Changed
migrations/032_dashboards_v2.{up,down}.sqlservices/dashboards.rs,routes/dashboards.rs(new)services/sharing.rs,routes/features_ext.rs(share targets)routes/mod.rs,services/mod.rs,main.rsScope and Non-scope
In scope: the dashboards v2 API, templates and public share links. Out of scope: UI, migrating legacy dashboards, and the excluded LLM/account features.
Validation
I ran this end to end against Postgres 18 and checked 34 cases:
Testing
cargo test: 125 passed, including new tests for filter application, template validity and layout validation.Size and Notes
About 1,200 changed lines. Migration 032 only creates tables and adds nullable columns.
🤖 Generated with Claude Code