fix(Gridler): 🐛 improve state management and cleanup

* Update `askAPIRowNumber` to return `null` or `number` for better type safety.
* Refactor conditionals to ensure proper handling of row indices.
* Clean up console logs for improved readability and performance.
* Ensure consistent formatting across the codebase.
This commit is contained in:
Hein
2026-02-09 14:41:49 +02:00
parent 31e46e6bd2
commit 6cb50978d0
5 changed files with 41 additions and 38 deletions

View File

@@ -61,7 +61,7 @@ export function GlidlerFormAdaptor(props: {
col?: GridlerColumn,
defaultItems?: MantineBetterMenuInstanceItem[]
): MantineBetterMenuInstanceItem[] => {
//console.log('GlidlerFormInterface getMenuItems', id);
//console.log('GlidlerFormInterface getMenuItems', id, row, defaultItems);
if (id === 'header-menu') {
return defaultItems || [];
@@ -88,7 +88,7 @@ export function GlidlerFormAdaptor(props: {
? props.descriptionField(row)
: undefined;
if (id === 'other') {
if (id === 'other' || (id === 'cell' && !row)) {
items.push({
c: 'blue',
label: 'Add',