Add full shell, replaceable Omics adapter and bilingual interaction
Implement approved specification #32 and tickets #33-#37. Keep host authentication server-verified and pin session interaction language. Compile scoped base selectors for browser compatibility and retain full gutters during CSS pruning.
This commit is contained in:
@@ -3,6 +3,7 @@ import { SqlViewer, type SqlBlock } from "./SqlViewer";
|
||||
import { PreviewGrid } from "./PreviewGrid";
|
||||
import { statusBadgeClass } from "./statusBadge";
|
||||
import type { CteResultV2 } from "./artifactV2";
|
||||
import { useI18n } from "../i18n";
|
||||
|
||||
const CHIP = "rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground/90";
|
||||
|
||||
@@ -19,6 +20,7 @@ function testStatus(status: string): SqlBlock["testStatus"] {
|
||||
}
|
||||
|
||||
export function CteResultViewer({ result }: { result: CteResultV2 }) {
|
||||
const { t } = useI18n();
|
||||
const hasPreviewRows = (result.preview?.rows?.length ?? 0) > 0;
|
||||
const descriptions = (result.columns ?? []).map((c) => c.description ?? "");
|
||||
const showColumns = descriptions.some((d) => d.trim() !== "");
|
||||
@@ -37,12 +39,12 @@ export function CteResultViewer({ result }: { result: CteResultV2 }) {
|
||||
CTE {result.index}/{result.total}
|
||||
</Badge>
|
||||
<span className="font-mono text-sm font-semibold">{result.name}</span>
|
||||
<Badge variant="outline" className={statusBadgeClass(result.status)}>{statusLabel(result.status)}</Badge>
|
||||
<Badge variant="outline" className={statusBadgeClass(result.status)}>{t(statusLabel(result.status))}</Badge>
|
||||
{result.execution_ms !== undefined && (
|
||||
<span className="text-xs text-muted-foreground">{result.execution_ms} ms</span>
|
||||
)}
|
||||
{result.row_sample !== undefined && (
|
||||
<span className="text-xs text-muted-foreground">{result.row_sample} rows</span>
|
||||
<span className="text-xs text-muted-foreground">{t(result.row_sample === 1 ? "{count} row" : "{count} rows", { count: result.row_sample })}</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -75,7 +77,7 @@ export function CteResultViewer({ result }: { result: CteResultV2 }) {
|
||||
{hasPreviewRows ? (
|
||||
<PreviewGrid columns={result.preview!.columns} rows={result.preview!.rows} />
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">No preview rows</p>
|
||||
<p className="text-sm text-muted-foreground">{t("No preview rows")}</p>
|
||||
)}
|
||||
|
||||
{showColumns && (
|
||||
|
||||
Reference in New Issue
Block a user