diff --git a/ui/chen/components/ConsolePanel.vue b/ui/chen/components/ConsolePanel.vue
index c7db2f0a..5bd6af6a 100644
--- a/ui/chen/components/ConsolePanel.vue
+++ b/ui/chen/components/ConsolePanel.vue
@@ -13,6 +13,7 @@ const props = defineProps<{
tab: ChenPromptConsoleTab;
contextLabel: string;
promptLabel: string;
+ canCopy: boolean;
}>();
const emit = defineEmits<{
@@ -78,11 +79,6 @@ function handleKeydown(event: KeyboardEvent) {
run();
return;
}
- if (event.key === "Enter" && pendingSqlValue.value.trimEnd().endsWith(";")) {
- event.preventDefault();
- run();
- return;
- }
if (event.key === "ArrowUp" && !event.shiftKey && inputRef.value?.selectionStart === 0) {
event.preventDefault();
moveHistory(-1);
@@ -213,7 +209,7 @@ defineExpose({ focus: () => inputRef.value?.focus() });
Result {{ resultIndex + 1 }}
{{ resultSummary(result) }}
-
+
inputRef.value?.focus() });
class="max-h-32 min-h-7 flex-1 resize-none bg-transparent py-1 text-[var(--app-fg)] outline-none placeholder:text-[var(--app-muted)]"
:disabled="busy"
rows="1"
- placeholder="Enter SQL; finish with ; or press Cmd/Ctrl+Enter"
+ placeholder="Enter SQL; press Cmd/Ctrl+Enter to run"
spellcheck="false"
@keydown="handleKeydown"
/>
diff --git a/ui/chen/components/ConsoleResultGrid.client.vue b/ui/chen/components/ConsoleResultGrid.client.vue
index eae77e9f..44c42e7d 100644
--- a/ui/chen/components/ConsoleResultGrid.client.vue
+++ b/ui/chen/components/ConsoleResultGrid.client.vue
@@ -8,9 +8,15 @@ import { AgGridVue } from "ag-grid-vue3";
import "ag-grid-community/styles/ag-grid.css";
import "ag-grid-community/styles/ag-theme-balham.css";
-const props = defineProps<{
- dataset: ChenDataViewDataset;
-}>();
+const props = withDefaults(
+ defineProps<{
+ dataset: ChenDataViewDataset;
+ canCopy?: boolean;
+ }>(),
+ {
+ canCopy: false
+ }
+);
ModuleRegistry.registerModules([AllCommunityModule]);
@@ -42,6 +48,10 @@ function handleGridReady(event: GridReadyEvent) {
fitColumns(event.api);
}
+function handleCopy(event: ClipboardEvent) {
+ if (!props.canCopy) event.preventDefault();
+}
+
watch([columnDefs, () => props.dataset.data], async () => {
const api = gridApi.value;
if (!api) return;
@@ -53,7 +63,7 @@ watch([columnDefs, () => props.dataset.data], async () => {
-
+
props.dataset.data], async () => {
:row-height="28"
:header-height="32"
:animate-rows="false"
+ :enable-cell-text-selection="canCopy"
:suppress-cell-focus="false"
:ensure-dom-order="true"
@grid-ready="handleGridReady"
diff --git a/ui/chen/composables/useChenQueryConsole.ts b/ui/chen/composables/useChenQueryConsole.ts
index be0a8510..aa9f4b43 100644
--- a/ui/chen/composables/useChenQueryConsole.ts
+++ b/ui/chen/composables/useChenQueryConsole.ts
@@ -163,7 +163,9 @@ export function useChenQueryConsole(
if (tab.kind === "console" && packet.data?.inQuery === false) {
const entry = activeConsoleEntry(tab);
if (entry) {
- if (entry.status === "cancelling") entry.status = "cancelled";
+ const executionStatus = packet.data.executionStatus;
+ if (entry.status === "cancelling" || executionStatus === "cancelled") entry.status = "cancelled";
+ else if (executionStatus === "error") entry.status = "error";
else if (entry.status === "running") entry.status = "success";
entry.completedAt = Date.now();
tab.activeTimelineEntryId = "";
diff --git a/ui/chen/types.ts b/ui/chen/types.ts
index f3f0eb4d..8b77ddef 100644
--- a/ui/chen/types.ts
+++ b/ui/chen/types.ts
@@ -174,6 +174,7 @@ export type ChenSqlHints = Record;
export interface ChenConsoleState {
loading?: boolean;
inQuery?: boolean;
+ executionStatus?: ChenConsoleExecutionStatus;
editorLoading?: boolean;
canCancel?: boolean;
currentContext?: string;
diff --git a/ui/chen/workspaces/DatabaseSessionSurface.vue b/ui/chen/workspaces/DatabaseSessionSurface.vue
index 6577669d..42e4777b 100644
--- a/ui/chen/workspaces/DatabaseSessionSurface.vue
+++ b/ui/chen/workspaces/DatabaseSessionSurface.vue
@@ -763,6 +763,7 @@ defineExpose({ focus });
:tab="activeConsoleTab"
:context-label="currentContextLabel"
:prompt-label="consolePromptLabel"
+ :can-copy="auth.profile.value?.canCopy === true"
@run="runQueryTab"
@cancel="cancelQueryLikeTab"
@clear="clearConsoleTranscript"