mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-04 22:21:21 +09:00
feat(ui): Databases parity pass 2 - flush console + semantic tints (S8.1)
The demo is a flush full-height 3-pane console; the live page was padded floating cards, which is why it did not read as the new design. - de-cardify: .db-explorer padding/gaps -> 0; toolbar/tree-panel/ workspace/statusbar lose radius+outer borders, join on 1px edges - ResultsGrid: demo cellEl semantic tints (NULL italic-ghost, emails/URLs + positive statuses green, negative amber) - tab strip: demo + new-tab pill (opens SQL console on selected source) - result count number bold green Follow-up (S8.1): SQL editor line-number gutter + keyword highlighting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e0e660087e
commit
a97f8a4215
4 files changed
+56
-13
No files matched your search
@@ -212,7 +212,7 @@ export default function ConsoleTab({ conn, tabId, active, isAdmin, initialQuery
|
||||
{results && !error && (
|
||||
<div className="dbx-results-head">
|
||||
<span className="dbx-results-count">
|
||||
{results.row_count} row{results.row_count === 1 ? '' : 's'}
|
||||
<strong>{results.row_count}</strong> row{results.row_count === 1 ? '' : 's'}
|
||||
{results.truncated && ` · truncated from ${results.total_rows}`}
|
||||
</span>
|
||||
<span className="dbx-results-time">{results.execution_time}s</span>
|
||||
|
||||
@@ -2,6 +2,21 @@ import { useMemo, useState } from 'react';
|
||||
import { ChevronUp, ChevronDown, Database } from 'lucide-react';
|
||||
import EmptyState from '../EmptyState';
|
||||
|
||||
// Semantic cell tints (prototype `cellEl`): emails/URLs read as string values,
|
||||
// positive/negative status words get green/amber.
|
||||
const STRING_VALUE = /@|^https?:|\.dev$|\.local$|\.com$/;
|
||||
const POSITIVE_VALUE = /^(publish|running|open|instock|yes|active|true|1)$/i;
|
||||
const NEGATIVE_VALUE = /^(draft|pending|spam|auto-draft|exited|stopped|closed|no|false|0)$/i;
|
||||
|
||||
function cellClass(cell) {
|
||||
if (cell === null) return 'is-null';
|
||||
const s = String(cell);
|
||||
if (STRING_VALUE.test(s)) return 'is-strv';
|
||||
if (POSITIVE_VALUE.test(s)) return 'is-pos';
|
||||
if (NEGATIVE_VALUE.test(s)) return 'is-neg';
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Renders a query/data result set: columns + row arrays. Sorting is client-side
|
||||
// over the rows already returned (a page), matching the old QueryRunner.
|
||||
export default function ResultsGrid({ columns, rows, loading, error, emptyTitle = 'No rows', emptyDescription }) {
|
||||
@@ -90,7 +105,7 @@ export default function ResultsGrid({ columns, rows, loading, error, emptyTitle
|
||||
<tr key={rowIdx}>
|
||||
<td className="dbx-grid-rownum">{rowIdx + 1}</td>
|
||||
{row.map((cell, cellIdx) => (
|
||||
<td key={cellIdx} className={cell === null ? 'is-null' : undefined} title={cell === null ? 'NULL' : String(cell)}>
|
||||
<td key={cellIdx} className={cellClass(cell)} title={cell === null ? 'NULL' : String(cell)}>
|
||||
{cell === null ? 'NULL' : String(cell)}
|
||||
</td>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user