Migrate Query OSS Insight to dashboard, deprecate unused Toolpad pages#1534
Migrate Query OSS Insight to dashboard, deprecate unused Toolpad pages#1534Janpot wants to merge 8 commits into
Conversation
Migrates the queryOssInsight tool from the Toolpad app to code-infra-dashboard as a new /query-oss-insight page backed by a server-side /api/oss-insight proxy (OSS Insight does not send CORS headers for our origin). Deprecates auditClosedIssues, auditLabelChanges, communityCore and communityPerMonth: their Toolpad pages are stripped to a notice (keeping their aliases so old URLs don't 404) and the now-orphaned backend functions and resource files are removed.
Deploy previewhttps://deploy-preview-1534--mui-internal.netlify.app/ Bundle sizeTotal Size Change: 0B(0.00%) - Total Gzip Change: 0B(0.00%) Show details for 64 more bundles@mui/internal-docs-infra/abstractCreateDemo parsed: 0B(0.00%) gzip: 0B(0.00%) PerformanceTotal duration: 23.40 ms 🔺+5.44 ms(+30.3%) | Renders: 4 (+0) | Paint: 102.85 ms 🔺+23.35 ms(+29.4%)
1 test within noise — details Check out the code infra dashboard for more information about this PR. |
The SQL textarea grew unbounded with the query, pushing the results grid off-screen. Put the editor and grid in two height-bounded panes: side-by-side on md+, stacked (editor above grid) on small screens, each scrolling internally.
Columns were derived from the first row's keys, so a query returning zero rows rendered 'No columns'. The playground response includes a `fields` schema (in SELECT order) even for an empty result set; use it to build the grid columns so they always show and a zero-row result correctly reads as 'No rows'.
Both the repository slug and SQL are now backed by the URL search params, so a link pre-fills the editor and the input survives reloads. Local drafts keep typing responsive and are committed to the URL on Run. A CopyButton next to Run copies an absolute link encoding the current input.
Running a query no longer mutates the address bar. The URL is only read to seed the inputs; the share-link button is the explicit way to capture the current input into a URL.
The share affordance is now a real link to the current input, so cmd/middle-click opens it in a new tab and right-click can copy the address. Uses a relative href, so the window.origin/clipboard handling is no longer needed.
The textarea height override was a no-op: the field fills the editor pane via the InputBase root (height/alignItems/overflow), and the inner textarea keeps its autosized height regardless. Drop the dead rule and document the rest.
MUI's multiline TextField autosizes to its content, which we had to fight with height/overflow overrides that distorted its padding. A styled native textarea takes a fixed height, fills the editor pane, and scrolls natively with a clean, predictable box model.
Finishes a batch of the Toolpad → code-infra-dashboard migration. Part of the effort tracked in #1305 (comment).
Closes #502.
example
Migrated
/query-oss-insight(view + page + Landing nav entry). It keeps the original UX: enter a repo slug → resolve its OSS Insight repo id → write SQL → run → results in aDataGridPremium.app/api/oss-insight/route.ts(GET ?slug=for repo lookup,POST { repositoryId, sql }to run the query). A proxy is required becauseapi.ossinsight.iodoes not returnaccess-control-allow-originfor our origin, so a direct browser fetch is blocked by CORS. This also matches how the original Toolpad page ran the query as a server function.Deprecated
auditClosedIssues,auditLabelChanges,communityCore,communityPerMonthare no longer used. Following the existing convention (e.g.medianTimeToCompletion), each page is stripped to a markdown notice while keeping itsaliasso old bookmarked URLs don't 404. ThequeryOssInsightToolpad page is likewise replaced with a notice linking to its new dashboard location.The now-orphaned backend code is removed: resource files
queryOssInsight.ts,queryAuditClosedIssues.ts,queryAuditLabelChanges.ts, and the functionsgetRepositoryDetails,PRsOpenandReviewedQuery,PRsPerMonth,ContributorsPerMonthfromfunctions.ts(verified unreferenced by any remaining page).