Draft
Modernize admin SQL query tool to Tailwind CSS + shadcn/ui#315
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: owens1127 <98496129+owens1127@users.noreply.github.com>
Co-authored-by: owens1127 <98496129+owens1127@users.noreply.github.com>
…r logic Co-authored-by: owens1127 <98496129+owens1127@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update admin SQL query tool to modern standards
Modernize admin SQL query tool to Tailwind CSS + shadcn/ui
Feb 6, 2026
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.
The admin SQL query tool at
/admin/querywas using outdated patterns (styled-components, raw HTML elements, deprecated components) inconsistent with the rest of the admin dashboard.Changes
Component Library Migration
Container,CodeTextArea,CancelButton,ErrorMessage,WarningMessage,TableArea,Attribution) with Tailwind utility classes<button>→Buttonwith variants (default,destructive,outline)<input>→Input<select>→SelectwithSelectTrigger,SelectContent,SelectItemTable,TableHeader,TableRow,TableHead,TableBody,TableCellPanel→Card,CardHeader,CardTitle,CardContentBadgefor status indicators (unsaved changes, row count)SQL Editor Enhancement
Replaced plain
<textarea>with CodeMirror 6:Features: SQL syntax highlighting, line numbers, bracket matching, custom dark theme matching admin dashboard aesthetic.
Layout & Structure
PageWrapper,FlexcomponentsAdminPageHeaderfor consistencyUX Improvements
sonnerfor query execution, cancellation, errorsMutation Hook Cleanup
Simplified
useRaidHubAdminQueryAbortController pattern:onErrorcallbackDependencies Added
@codemirror/lang-sql,@codemirror/view,@codemirror/state,codemirrorAll existing functionality preserved: SELECT/EXPLAIN queries, high cost warnings, query cancellation, saved queries (localStorage), column format editing.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkpoint.prisma.io/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/Web-App/Web-App/node_modules/prisma/build/child {"product":"prisma","version":"6.5.0","cli_install_type":"local","information":"","local_timestamp":"2026-02-06T05:54:38Z","project_hash":"e746e93b","cli_path":"/home/REDACTED/work/Web-App/Web-App/node_modules/.bin/prisma","cli_path_hash":"d1777587","endpoi(dns block)/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/Web-App/Web-App/node_modules/prisma/build/child {"product":"prisma","version":"6.5.0","cli_install_type":"local","information":"","local_timestamp":"2026-02-06T05:54:39Z","project_hash":"e746e93b","cli_path":"/home/REDACTED/work/Web-App/Web-App/node_modules/.bin/prisma","cli_path_hash":"d1777587","endpoi(dns block)/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/Web-App/Web-App/node_modules/prisma/build/child {"product":"prisma","version":"6.5.0","cli_install_type":"local","information":"","local_timestamp":"2026-02-06T05:59:00Z","project_hash":"e746e93b","cli_path":"/home/REDACTED/work/Web-App/Web-App/node_modules/.bin/prisma","cli_path_hash":"d1777587","endpoi(dns block)fonts.googleapis.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Web-App/Web-App/node_modules/.bin/next build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Overview
The admin SQL query tool at
/admin/queryuses outdated patterns (styled-components, deprecated components, raw HTML elements) while the rest of the admin dashboard has been modernized with Tailwind CSS and shadcn/ui. This PR should bring the query tool up to the same standard.Files to Change
All files under
src/components/admin/query/andsrc/services/raidhub/useRaidHubAdminQuery.ts, plus the page atsrc/app/admin/query/page.tsx.Current files:
src/components/admin/query/query-dashboard.tsx— main dashboard componentsrc/components/admin/query/query-data-view.tsx— results/error displaysrc/components/admin/query/table/SQLTable.tsx— custom results tablesrc/components/admin/query/table/Cell.tsx— table cell renderersrc/components/admin/query/table/ColumnLabel.tsx— editable column headerssrc/components/admin/query/table/formats.tsx— column format rendererssrc/services/raidhub/useRaidHubAdminQuery.ts— mutation hookRequired Changes
1. Replace
styled-componentswith Tailwind CSSstyled-componentsusage from query tool files (Container,CodeTextArea,CancelButton,ErrorMessage,WarningMessage,TableArea,Attribution)2. Replace raw HTML elements with shadcn/ui components
The project already has these shadcn components installed (in
src/components/ui/and re-exported fromsrc/shad/). Use them:Button(from~/shad/button) with appropriate variants (default,destructive,outline) instead of raw<button>elementsSelect,SelectTrigger,SelectContent,SelectItem(from~/shad/select) instead of raw<select>for the saved query picker and column format selectorInput(from~/shad/inputor~/components/ui/input) instead of raw<input>for the query title fieldCard,CardHeader,CardTitle,CardContent(from~/shad/card) for the results panel instead of the deprecatedPanelcomponentTable,TableHeader,TableRow,TableHead,TableBody,TableCell(from~/shad/table) instead of the customSQLTable+ deprecatedTablecomponent. Seesrc/components/admin/badge/badges-display.tsxandsrc/components/admin/reporting/tabs/instance-info-tab.tsxfor examples of how the shadcn Table is used in the admin dashboard already.Badge(from~/shad/badge) for status indicators like "Unsaved Changes", row count, query costTabs,TabsList,TabsTrigger,TabsContent(from~/shad/tabs) to organize Results vs Explain Plan outputAlertor proper styled containers for error messages and warnings instead of the styled-componentsErrorMessageandWarningMessageTooltip(from~/shad/tooltip) for button descriptions3. Add a proper SQL code editor
Replace the plain
<textarea>with CodeMirror 6 for SQL editing:@codemirror/lang-sql,@codemirror/view,@codemirror/state, and a dark theme like@codemirror/theme-one-dark(or use@uiw/codemirror-theme-vscodefor a VS Code-like dark theme)SqlEditorcomponent that wraps CodeMirror with:onChangecallback<textarea>with monospace font, proper Tailwind styling, and the shadcn design system. But CodeMirror is strongly preferred.4. Remove deprecated component usage
PageWrapperfrom~/components/PageWrapperFlexfrom~/components/__deprecated__/layout/FlexPanelfrom~/components/__deprecated__/PanelTablefrom~/components/Table(the old non-shadcn table)5. Improve the saved queries UX
<select>dropdown with shadcnSelectcomponent for picking saved queriesButtonvariantsBadgecomponent for the "Unsaved Changes" indicator6. Improve results table
SQLTablecomponent with shadcn'sTablecomponentsSelectfor the format pickerInputfor the column label editorBadge7. Clean up the mutation hook (
useRaidHubAdminQuery.ts)onErroror...This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.