Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ function App() {
{sidebarVisible && (
<Separator
id="sidebar-resizer"
className="relative flex items-center justify-center transition-colors group w-[2px] mx-[-1px] cursor-col-resize z-50 hover:bg-accent/40 hover:w-[4px] hover:mx-[-2px] active:bg-accent active:w-[4px] active:mx-[-2px] bg-background"
aria-label="Resize sidebar"
className="group relative z-50 flex w-2 shrink-0 cursor-col-resize items-center justify-center bg-background transition-colors hover:bg-accent/10 focus-visible:bg-accent/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent active:bg-accent/20"
>
<div className="absolute bg-border-strong group-hover:bg-accent transition-colors w-[1px] h-full" />
<div className="h-full w-px bg-border-strong transition-colors group-hover:w-0.5 group-hover:bg-accent group-focus-visible:bg-accent" />
</Separator>
)}

Expand Down Expand Up @@ -227,9 +228,10 @@ function App() {
{rightVisible && (
<Separator
id="right-resizer"
className="relative flex items-center justify-center transition-colors group w-[2px] mx-[-1px] cursor-col-resize z-50 hover:bg-accent/40 hover:w-[4px] hover:mx-[-2px] active:bg-accent active:w-[4px] active:mx-[-2px] bg-background"
aria-label="Resize right panel"
className="group relative z-50 flex w-2 shrink-0 cursor-col-resize items-center justify-center bg-background transition-colors hover:bg-accent/10 focus-visible:bg-accent/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent active:bg-accent/20"
>
<div className="absolute bg-border-strong group-hover:bg-accent transition-colors w-[1px] h-full" />
<div className="h-full w-px bg-border-strong transition-colors group-hover:w-0.5 group-hover:bg-accent group-focus-visible:bg-accent" />
</Separator>
)}

Expand Down
10 changes: 5 additions & 5 deletions src/components/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@ export const DataTable = ({
className="border-collapse text-xs"
style={{ tableLayout: 'fixed', fontFamily: dataTableAppearance.fontFamily, fontSize: `${dataTableAppearance.fontSize}px` }}
>
<thead className="sticky top-0 z-10 bg-sidebar border-b border-border shadow-sm">
<thead className="workspace-grid-header sticky top-0 z-10">
{table.getHeaderGroups().map(headerGroup => (
<tr key={headerGroup.id}>
{showLineNumbers && (
<th
className="px-3 py-2 text-left font-semibold text-text-muted truncate"
className="px-3 py-2 text-left font-semibold text-text-secondary truncate"
style={{ width: 48, minWidth: 48, maxWidth: 48, ...headerCellStyle, ...rowNumberStyle }}
>
#
Expand All @@ -508,7 +508,7 @@ export const DataTable = ({
<th
key={header.id}
data-column={header.id}
className="px-3 py-2 text-left font-semibold text-text-secondary truncate relative group"
className="group relative truncate px-3 py-2 text-left font-semibold text-text-primary"
style={{
width,
minWidth: MIN_COLUMN_WIDTH,
Expand All @@ -519,9 +519,9 @@ export const DataTable = ({
{flexRender(header.column.columnDef.header, header.getContext())}
{/* Resize handle */}
<div
className="absolute right-0 top-0 bottom-0 w-1 cursor-col-resize bg-transparent hover:bg-[#007acc] transition-colors"
className="workspace-column-resizer"
title={`Drag to resize ${header.id}`}
onMouseDown={(e) => handleResizeStart(header.id, e)}
style={{ transform: 'translateX(50%)' }}
/>
</th>
);
Expand Down
12 changes: 6 additions & 6 deletions src/components/QueryResultsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,13 @@ export const QueryResultsTable = ({
<div className="flex flex-col h-full bg-background overflow-hidden">
{/* Header */}
<div className="relative shrink-0">
<div ref={headerRef} className="overflow-hidden bg-surface border-b border-border-strong">
<div ref={headerRef} className="workspace-grid-header overflow-hidden">
<div className="flex" style={{ width: headerContentWidthForBody(totalWidth, scrollbarWidth), minWidth: '100%' }}>
{showLineNumbers && <div className="shrink-0" style={{ width: INDEX_COLUMN_WIDTH, height: headerHeight }} />}
{columns.map((name, index) => (
<div
key={`${name}-${index}`}
className="shrink-0 px-3 border-r border-border-strong flex items-center font-semibold text-text-secondary truncate relative group"
className="group relative flex shrink-0 items-center truncate border-r border-border-strong px-3 font-semibold text-text-primary"
style={{ width: columnWidths[index] || COLUMN_WIDTH, height: headerHeight, ...cellTextStyle }}
>
<span className="truncate">{name}</span>
Expand All @@ -335,18 +335,18 @@ export const QueryResultsTable = ({
{isColumnMasked(name) ? <EyeOff size={13} /> : <Eye size={13} />}
</button>
<div
className="absolute right-0 top-0 bottom-0 w-1 cursor-col-resize bg-transparent hover:bg-[#007acc] transition-colors"
className="workspace-column-resizer"
title={`Drag to resize ${name}`}
onMouseDown={(event) => handleResizeStart(index, event)}
style={{ transform: 'translateX(50%)' }}
/>
</div>
))}
</div>
</div>
{showLineNumbers && (
<div
className="absolute left-0 top-0 z-20 bg-surface border-r border-border-strong flex items-center justify-center text-text-muted pointer-events-none"
style={{ width: INDEX_COLUMN_WIDTH, height: headerHeight, ...indexTextStyle, color: dataTableAppearance.statusColors.rowNumbers }}
className="absolute left-0 top-0 z-20 border-r border-border-strong flex items-center justify-center text-text-secondary pointer-events-none"
style={{ width: INDEX_COLUMN_WIDTH, height: headerHeight, backgroundColor: 'color-mix(in srgb, var(--color-surface) 95%, var(--color-accent) 5%)', ...indexTextStyle, color: dataTableAppearance.statusColors.rowNumbers }}
>
#
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/TabContentQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,14 +557,14 @@ export const TabContentQuery = ({ id, initialQuery = '', connectionId }: TabCont
</div>
</div>
{assistantOpen && <div id="query-ai-assistant" style={{ width: assistantWidth }} className="relative h-full shrink-0 max-w-[65vw] max-[900px]:absolute max-[900px]:inset-0 max-[900px]:z-40 max-[900px]:!w-full max-[900px]:max-w-none">
<div role="separator" aria-label="Resize AI assistant" aria-orientation="vertical" tabIndex={0}
className="absolute -left-1 top-0 z-10 h-full w-2 cursor-col-resize hover:bg-accent/30 focus:bg-accent/30 max-[900px]:hidden"
<div role="separator" aria-label="Resize AI assistant" aria-orientation="vertical" aria-valuemin={300} aria-valuemax={640} aria-valuenow={assistantWidth} tabIndex={0}
className="group absolute -left-1 top-0 z-10 flex h-full w-2 cursor-col-resize items-center justify-center bg-background transition-colors hover:bg-accent/10 focus-visible:bg-accent/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent max-[900px]:hidden"
onPointerDown={event => { resizeStart.current = { x: event.clientX, width: assistantWidth }; event.currentTarget.setPointerCapture(event.pointerId); }}
onPointerMove={event => { if (resizeStart.current) setAssistantWidth(Math.max(300, Math.min(640, resizeStart.current.width + resizeStart.current.x - event.clientX))); }}
onPointerUp={event => { resizeStart.current = null; event.currentTarget.releasePointerCapture(event.pointerId); }}
onPointerCancel={() => { resizeStart.current = null; }}
onKeyDown={event => { if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') { event.preventDefault(); setAssistantWidth(width => Math.max(300, Math.min(640, width + (event.key === 'ArrowLeft' ? 24 : -24)))); } }}
/>
><span className="h-full w-px bg-border-strong transition-colors group-hover:w-0.5 group-hover:bg-accent group-focus-visible:bg-accent" /></div>
<AiAssistantPanel
connectionId={connectionId}
connectionLabel={`${connection?.name || 'Unknown connection'} (${connection?.environment || 'unclassified'})`}
Expand Down
6 changes: 3 additions & 3 deletions src/components/TabContentTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ export const TabContentTable = ({ id, tableName, connectionId }: TabContentTable

{/* Column Visibility Popover */}
{activeTab?.isColumnsPopoverVisible && id && (
<div className="absolute right-2 z-[60]" style={{ bottom: consoleHeight + 32 }}>
<div className="absolute right-2 z-[60]" style={{ bottom: consoleHeight + 40 }}>
<ColumnVisibilityPopover
tabId={id}
columns={tableColumns}
Expand All @@ -704,9 +704,9 @@ export const TabContentTable = ({ id, tableName, connectionId }: TabContentTable
onLostPointerCapture={() => { consoleDragRef.current = null; }}
onKeyDown={resizeConsoleWithKeyboard}
onDoubleClick={() => setConsoleHeight(clampTableConsoleHeight(DEFAULT_TABLE_CONSOLE_HEIGHT, availableConsoleHeight()))}
className="group relative z-10 h-2 shrink-0 cursor-row-resize touch-none bg-sidebar focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent"
className="group relative z-10 h-2 shrink-0 cursor-row-resize touch-none bg-sidebar transition-colors hover:bg-accent/10 focus-visible:bg-accent/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent"
>
<div className="absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border-strong transition-colors group-hover:bg-accent group-focus-visible:bg-accent" />
<div className="absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border-strong transition-colors group-hover:h-0.5 group-hover:bg-accent group-focus-visible:bg-accent" />
</div>

<TableFooter
Expand Down
24 changes: 13 additions & 11 deletions src/components/TableFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export const TableFooter = ({
const end = offset + displayedRows;

return (
<div className="h-8 bg-surface border-t border-border flex items-center justify-between px-2 text-[11px] select-none relative z-50">
<div className="flex items-center h-full">
<div className="flex bg-surface-elevated rounded p-0.5 h-6 mr-3">
<div className="relative z-50 flex h-10 shrink-0 items-center justify-between gap-3 overflow-x-auto border-t border-border-strong bg-surface px-2 text-[11px] select-none">
<div className="flex h-full shrink-0 items-center">
<div className="mr-3 flex h-7 rounded bg-surface-elevated p-0.5">
<button
onClick={() => onTypeChange('Data')}
className={cn(
Expand All @@ -70,21 +70,21 @@ export const TableFooter = ({
{onAddRow && (
<button
onClick={onAddRow}
className="flex items-center gap-1.5 px-3 h-6 bg-surface-elevated border border-border-strong rounded text-text-primary hover:bg-hover transition-colors mr-3 active:bg-hover"
className="mr-3 flex h-7 items-center gap-1.5 rounded border border-border-strong bg-surface-elevated px-3 text-text-primary transition-colors hover:bg-hover active:bg-hover"
>
<Plus size={12} className="text-text-secondary" />
<span>Row</span>
</button>
)}
{onViewRelationships && (
<button type="button" onClick={onViewRelationships} title="View declared foreign-key relationships" className="flex h-6 items-center gap-1.5 rounded border border-border-strong bg-surface-elevated px-2.5 text-text-primary transition-colors hover:bg-hover">
<button type="button" onClick={onViewRelationships} title="View declared foreign-key relationships" className="flex h-7 items-center gap-1.5 rounded border border-border-strong bg-surface-elevated px-2.5 text-text-primary transition-colors hover:bg-hover">
<GitFork size={12} className="text-accent" />
<span>Map</span>
</button>
)}
</div>

<div className="flex items-center gap-6">
<div className="flex shrink-0 items-center gap-3">
{executionTime !== undefined && (
<div className="text-text-secondary">
{executionTime}ms
Expand All @@ -101,7 +101,7 @@ export const TableFooter = ({
)}
</div>

<div className="flex items-center border border-border-strong rounded bg-surface-elevated h-6">
<div className="flex h-7 items-center rounded border border-border-strong bg-surface-elevated">
<button
onClick={onToggleColumns}
className={cn(
Expand All @@ -127,25 +127,27 @@ export const TableFooter = ({
{onExport && (
<button
onClick={onExport}
className="flex items-center gap-1.5 px-3 h-6 bg-surface-elevated border border-border-strong rounded text-text-primary hover:bg-hover transition-colors"
className="flex h-7 items-center gap-1.5 rounded border border-border-strong bg-surface-elevated px-3 text-text-primary transition-colors hover:bg-hover"
>
<Download size={12} className="text-text-secondary" />
<span>Export</span>
</button>
)}

<div className="flex items-center border border-border-strong rounded bg-surface-elevated h-6 overflow-hidden">
<div className="flex h-7 items-center overflow-hidden rounded border border-border-strong bg-surface-elevated">
<button
onClick={() => onPageChange('prev')}
disabled={offset === 0}
className="px-3 h-full border-r border-border-strong hover:bg-hover text-text-primary disabled:opacity-30 disabled:hover:bg-transparent"
className="h-full border-r border-border-strong px-3 text-text-primary hover:bg-hover disabled:opacity-30 disabled:hover:bg-transparent"
aria-label="Previous page"
>
<ChevronLeft size={14} />
</button>
<button
onClick={() => onPageChange('next')}
disabled={!hasMore}
className="px-3 h-full hover:bg-hover text-text-primary disabled:opacity-30 disabled:hover:bg-transparent"
className="h-full px-3 text-text-primary hover:bg-hover disabled:opacity-30 disabled:hover:bg-transparent"
aria-label="Next page"
>
<ChevronRight size={14} />
</button>
Expand Down
3 changes: 2 additions & 1 deletion src/components/ThemeSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export const ThemeSettings = ({
className={cn(
'transition-colors',
displayMode === 'toolbar'
? 'flex items-center gap-1.5 rounded-md px-2 py-1.5 text-text-muted hover:bg-hover hover:text-text-primary'
? 'flex h-8 w-8 items-center justify-center rounded-md text-text-secondary hover:bg-hover hover:text-text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent'
: 'w-full flex items-center justify-between gap-3 rounded-lg border border-border bg-surface px-3 py-2 text-text-secondary hover:bg-hover'
)}
title="Open appearance settings"
aria-label="Open appearance settings"
>
<span className="flex items-center gap-1.5">
{displayMode === 'toolbar' ? <SunMoon size={14} /> : <Palette size={14} className="text-accent" />}
Expand Down
Loading
Loading