Skip to content

feat(dashboards): Sim-built workspace dashboard behind a rollout flag - #8305

Open
TheodoreSpeaks wants to merge 45 commits into
stagingfrom
codex/research-sim-dashboards
Open

TheodoreSpeaks wants to merge 45 commits into
stagingfrom
codex/research-sim-dashboards

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds table-backed dashboards behind the default-off dashboards flag, which can target specific organizations. A dashboard is YAML that selects authorized table queries and lays out metrics, ECharts charts, tables, text, and tabs. Aggregation runs on the server with bounded results and timeouts.
  • One dashboard per workspace, built by Sim.
    • The sidebar's Dashboard item sits under New chat and opens it directly: there's no list, header, folders, create, rename, or move.
    • Until Sim saves the first one, the page shows an empty state.
    • Dashboards live in their own dashboard table with their own id; a unique index on workspace_id keeps one per workspace. Dropping it later allows several.
  • Agent: Mothership reads and saves the dashboard with dashboards get / dashboards set.
    • The first save creates it.
    • Replacing existing content requires expectedRevision, so a concurrent edit is never overwritten.
  • Entitlements: Sim sends an entitlements list with every Mothership turn (lib/mothership/entitlements.ts), restoring the registry v1.0.0 removed.
    • dashboards is the first entitlement. Mothership hides gated commands, skills, and prompt text when one is absent.
    • Sim still enforces the flag on every operation.
  • Rendering: shared time-range and timezone controls, drag-to-zoom, synchronized hover, responsive layout, and animated metrics. Conditional percent aggregates reuse the table filter grammar.
  • Storage: reads and saves go through a small repository; saves are audited as dashboard.created / dashboard.updated. Dashboards are not files, so Files, search, and pickers are untouched.
  • New icon: a Dashboard EMCN icon drawn on the shared sidebar icon grid.

Companion: https://github.com/simstudioai/mothership/pull/531

Type of Change

  • New feature

Testing

  • Repository conflict and revision behavior verified against real PostgreSQL (lib/dashboards/repository.integration.ts)
  • Dashboard, Mothership, uploads, file search, forks, Chat, and sidebar suites pass (5,758 tests), plus packages/db (104)
  • Type-check, lint, all audits, block registry, docs manifest, and check:migrations pass
  • End-to-end Mothership build against a local stack not yet re-run on the table-backed version

Rollout

  • One migration: 0392_dashboard creates the dashboard table (new table, no backfill, no script migrations).
  • Forks do not copy the dashboard yet: its YAML references table ids that change in a fork, so copying needs id remapping.
  • Deploy the companion worker before enabling the flag. It needs its 0013_run_entitlements migration.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 30, 2026 12:19am UTC

Request Review

@github-actions github-actions Bot added the requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep label Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

⚠️ Cross-repo companion check

One or more companion PRs aren't merged into staging yet. Merging this without them will leave copilot and sim out of sync — merge them in lockstep.

  • ❌ simstudioai/mothership#531 — OPEN, not merged (targets staging) — feat(dashboards): entitlements and the workspace dashboard commands

TheodoreSpeaks and others added 2 commits September 26, 2026 12:33
Dashboards are now ordinary workspace files, handled like Sim pages, instead
of a separate resource. Creating or uploading `<Name>.dashboard` drops the
suffix and stamps `text/x-sim-dashboard`; the type is sticky across content
writes. The file viewer renders it live behind the `dashboards` flag, and the
public share viewer shows a workspace-only notice.

- Remove the dashboard resource: sidebar page, API routes, hooks, contracts,
  application layer, Mothership dashboards/dashboard_folders tools, resource
  tags, and the per-turn dashboardsEnabled payload.
- Revert the file discovery column (0385) and drop the dashboard folder
  resource enum (0384); dashboards never shipped, so no backfill.
- Chat panel decides previewability and tab/picker icons from the file type,
  not the name, so extensionless dashboards render and get the chart icon.
- Renderer: authored left label columns are kept intact, horizontal bar
  frames grow with row count, and hovered rows get a label-and-bar highlight.
- Simplify the create-dashboard skill around one validated example.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6aTRnkiu7PxYZPNPXYEMV
Resolves conflicts in the feature-flag and skill use-case tests (moved onto
staging's central mocks) and the tab strip widths. Adapts the branch's
dashboard and analytics tests to staging's test-pattern audit, scopes the
table operation delegation invariant to operations that admit delegated
principals, and hides the rollout-gated create-dashboard built-in from the
organization composer when the dashboards flag is off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6aTRnkiu7PxYZPNPXYEMV
@TheodoreSpeaks TheodoreSpeaks changed the title feat(dashboards): add table-backed dashboard resources feat(dashboards): table-backed dashboard files behind a rollout flag Sep 26, 2026
@TheodoreSpeaks
TheodoreSpeaks marked this pull request as ready for review September 26, 2026 19:45
@TheodoreSpeaks
TheodoreSpeaks requested a review from a team as a code owner September 26, 2026 19:45
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds dashboard feature behind a rollout flag.

The PR appears safe to merge, though the search-migration integration test should keep its replay isolated from shared test-database rows.

Summary

This PR adds a default-off, one-per-workspace dashboard backed by YAML, authorized table analytics, and a revision-checked save path. It also adds dashboard rendering, Mothership entitlement and resource support, and the dashboard database migration.

  • The latest change removes a table from a search-migration test fixture; the resulting public-schema fallback is the new finding.
  • The previously reported findings are resolved or were explicitly left as-is.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  UI[Workspace dashboard] --> Read[Dashboard read]
  Read --> DB[(Dashboard table)]
  UI --> Analytics[Authorized table analytics]
  Agent[Mothership dashboard commands] --> Save[Revision-checked save]
  Save --> DB
Loading

Reviews (29) · Last reviewed commit: "chore(db): drop leftover script-migratio..."

Comment thread apps/sim/lib/workflows/skills/builtin-skills.ts Outdated
Comment thread apps/sim/components/charts/echarts-view.test.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 86 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/lib/charts/option.ts
Comment thread apps/sim/lib/charts/summary.ts Outdated
Comment thread apps/sim/lib/charts/time-series.ts
Comment thread apps/sim/lib/table/analytics/query.ts
Comment thread apps/sim/components/dashboards/dashboard-controls.tsx
Comment thread apps/sim/lib/charts/bar-row-highlight.ts Outdated
- Size horizontal bar `.chart` previews by category count like dashboard panels.
- Keep the ECharts label column for percentage bar widths, resolve percentage
  grid insets for the row highlight, and keep the time axis on the queried range.
- Show small readout values with significant digits instead of rounding to 0.
- Pass the dashboard's timezone-adjusted today to the range calendar.
- Decide the Chat panel's Markdown mode from the file record.
- Replace mock-call assertions in the EChartsView tests with DOM behavior.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6aTRnkiu7PxYZPNPXYEMV
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 86 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/charts/option.ts Outdated
Comment thread apps/sim/lib/charts/bar-row-highlight.ts Outdated
… resizes

Unstacked bar series sit side by side in a category row, so grouped charts keep
the ECharts label column and their rows fit every bar slot. The row highlight
redraws the active row after each render, so a resize moves it with the plot.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6aTRnkiu7PxYZPNPXYEMV
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 137 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/components/dashboards/dashboard-panel.tsx Outdated
…lookups

The dashboard name is fixed, so resource tabs and chat chips no longer fetch
the dashboard to title it; dashboard headings use named text sizes.
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 137 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

Comment thread apps/sim/app/workspace/[workspaceId]/dashboards/loading.tsx Outdated
Comment thread apps/sim/components/dashboards/dashboard-feature-gate.tsx Outdated
Mothership's create-dashboard skill now carries the dashboard syntax like
every other worker skill, so the builtin-create-dashboard workspace skill,
its source, and its flag gating are removed.
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 132 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 132 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 131 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

This branch was successfully deployed

1 active deployment
Preview — 51f665ec Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant