address comments from coderabbit.

This commit is contained in:
Darshan
2025-10-19 19:28:25 +05:30
parent 09c6242bcc
commit daf83bf469
3 changed files with 9 additions and 5 deletions
@@ -680,7 +680,7 @@
if (!columnId) return;
let columnIndex = -1;
let columnSchema: SuggestedColumnSchema;
let columnSchema: SuggestedColumnSchema = null;
for (let index = 0; index < customColumns.length; index++) {
if (customColumns[index].key === columnId) {
@@ -690,10 +690,13 @@
}
}
if (columnIndex !== -1) {
customColumns.splice(columnIndex, 1);
if (columnIndex === -1 || !columnSchema) {
return;
}
// remove the column
customColumns.splice(columnIndex, 1);
// store column with its index for undo
columnBeingDeleted = { ...columnSchema, deletedIndex: columnIndex };
@@ -45,7 +45,7 @@ export const tableColumnSuggestions = writable<TableColumnSuggestions>({
context: null,
thinking: false,
table: null,
force: false,
force: false
});
export const showIndexesSuggestions = writable<boolean>(false);
@@ -205,7 +205,7 @@
</Container>
<div class="databases-spreadsheet">
{#if hasColumns && hasValidColumns && !$tableColumnSuggestions.force}
{#if hasColumns && hasValidColumns && $tableColumnSuggestions.force !== true}
{#if data.rows.total}
<Divider />
<SpreadSheet {data} bind:showRowCreateSheet={$showRowCreateSheet} />
@@ -266,6 +266,7 @@
$showCreateColumnSheet.show = true;
}} />
<!-- TODO: gate for cloud only! need design -->
<EmptySheetCards
icon={IconAI}
title="Suggest columns"