From a97f8a42152dc2fd2f71de793f684908a8efe8dc Mon Sep 17 00:00:00 2001 From: Juan Denis Date: Thu, 11 Jun 2026 02:37:40 -0400 Subject: [PATCH] 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 --- .../src/components/databases/ConsoleTab.jsx | 2 +- .../src/components/databases/ResultsGrid.jsx | 17 +++++++- frontend/src/pages/Databases.jsx | 10 +++++ frontend/src/styles/pages/_databases.scss | 40 ++++++++++++++----- 4 files changed, 56 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/databases/ConsoleTab.jsx b/frontend/src/components/databases/ConsoleTab.jsx index 15718d74..0024902c 100644 --- a/frontend/src/components/databases/ConsoleTab.jsx +++ b/frontend/src/components/databases/ConsoleTab.jsx @@ -212,7 +212,7 @@ export default function ConsoleTab({ conn, tabId, active, isAdmin, initialQuery {results && !error && (
- {results.row_count} row{results.row_count === 1 ? '' : 's'} + {results.row_count} row{results.row_count === 1 ? '' : 's'} {results.truncated && ` ยท truncated from ${results.total_rows}`} {results.execution_time}s diff --git a/frontend/src/components/databases/ResultsGrid.jsx b/frontend/src/components/databases/ResultsGrid.jsx index e4ef7e81..ddabbe42 100644 --- a/frontend/src/components/databases/ResultsGrid.jsx +++ b/frontend/src/components/databases/ResultsGrid.jsx @@ -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 {rowIdx + 1} {row.map((cell, cellIdx) => ( - + {cell === null ? 'NULL' : String(cell)} ))} diff --git a/frontend/src/pages/Databases.jsx b/frontend/src/pages/Databases.jsx index 0e324689..1fb17ed4 100644 --- a/frontend/src/pages/Databases.jsx +++ b/frontend/src/pages/Databases.jsx @@ -502,6 +502,16 @@ export default function Databases() {
))} + )} diff --git a/frontend/src/styles/pages/_databases.scss b/frontend/src/styles/pages/_databases.scss index e2f36c6c..afd193e3 100644 --- a/frontend/src/styles/pages/_databases.scss +++ b/frontend/src/styles/pages/_databases.scss @@ -18,8 +18,10 @@ $dbx-sqlite: #3d8fd1; width: 100%; max-width: none; margin: 0; - padding: $space-3; - gap: $space-2; + // flush full-height console (demo `.db-layout`): panes join on 1px borders, + // no outer padding / gaps / card radii + padding: 0; + gap: 0; box-sizing: border-box; overflow: hidden; @@ -92,10 +94,10 @@ $dbx-sqlite: #3d8fd1; align-items: center; justify-content: space-between; gap: $space-3; + min-height: 54px; padding: $space-2 $space-3; background: $bg-card; - border: 1px solid $border-default; - border-radius: $radius-lg; + border-bottom: 1px solid $border-default; flex-shrink: 0; } @@ -169,7 +171,7 @@ $dbx-sqlite: #3d8fd1; .dbx-body { display: grid; grid-template-columns: 280px 1fr; - gap: $space-2; + gap: 0; flex: 1; min-height: 0; overflow: hidden; @@ -189,9 +191,13 @@ $dbx-sqlite: #3d8fd1; flex-direction: column; min-height: 0; background: $bg-card; - border: 1px solid $border-default; - border-radius: $radius-lg; + border-right: 1px solid $border-default; overflow: hidden; + + @media (max-width: $breakpoint-md) { + border-right: none; + border-bottom: 1px solid $border-default; + } } .dbx-tree-search { @@ -380,8 +386,6 @@ $dbx-sqlite: #3d8fd1; min-width: 0; min-height: 0; background: $bg-card; - border: 1px solid $border-default; - border-radius: $radius-lg; overflow: hidden; } @@ -438,6 +442,17 @@ $dbx-sqlite: #3d8fd1; .dbx-tab-title { @include dbx-trunc; } + // demo's `+` new-tab pill at the end of the strip + .dbx-tab-new { + padding: $space-2; + align-self: center; + border-radius: $radius-md; + color: $text-tertiary; + + &:disabled { opacity: 0.4; cursor: not-allowed; } + &:hover:not(:disabled) { background: $bg-hover; color: $text-primary; } + } + .dbx-tab-close { display: flex; align-items: center; @@ -772,6 +787,9 @@ $dbx-sqlite: #3d8fd1; @include dbx-trunc; &:last-child { border-right: none; } &.is-null { color: $text-tertiary; font-style: italic; } + &.is-strv { color: $success; } + &.is-pos { color: $success; } + &.is-neg { color: $warning; } } tbody tr:hover td { background: $bg-hover; } @@ -855,10 +873,10 @@ $dbx-sqlite: #3d8fd1; align-items: center; justify-content: space-between; gap: $space-3; + min-height: 32px; padding: $space-1 $space-3; background: $bg-card; - border: 1px solid $border-default; - border-radius: $radius-lg; + border-top: 1px solid $border-default; flex-shrink: 0; flex-wrap: wrap; }