Losing work and not getting expected results

On top of not being able to reset the tab order of the inputs in my form, I am having a couple other significant problems this morning.

For starters, I lost a bunch of work again this morning. I had saved the worked I did as a release and I even published it, but after doing a computer reboot this morning, the changes I had made were gone.

Second, I have my shipping table set up to allow a user to click a cell and then change the color of that cell by clicking the corresponding button. When the user clicks the cell they want, it is suppose to set a variable value. Hopefully this screenshot will help visualize what I am talking about.

Most of the time it works, but for some cells it does. For example, if the user selects the NOTES cell, no value is set for the variable.

Here is how I have that set up:

Screenshot 2025-01-27 105153

Once the user has clicked the cell and then clicked the color button, a query is supposed to be triggered. This is the code for the Attention button:

UPDATE
  shipping
SET
  trailer_attn = CASE
    WHEN {{ cell_update.value }} = 'trailer' THEN
      CASE
        WHEN trailer_attn = TRUE THEN FALSE
        ELSE TRUE
      END
  END,
  status_attn = CASE
    WHEN {{ cell_update.value }} = 'status' THEN
      CASE
        WHEN status_attn = TRUE THEN FALSE
        ELSE TRUE
      END
  END,
  load_time_attn = CASE
    WHEN {{ cell_update.value }} = 'load_time' THEN
      CASE
        WHEN load_time_attn = TRUE THEN FALSE
        ELSE TRUE
      END
  END,
  ship_date_attn = CASE
    WHEN {{ cell_update.value }} = 'ship_date' THEN
      CASE
        WHEN ship_date_attn = TRUE THEN FALSE
        ELSE TRUE
      END
  END,
  notes_attn = CASE
    WHEN {{ cell_update.value }} = 'shipping_notes' THEN
      CASE
        WHEN notes_attn = TRUE THEN FALSE
        ELSE TRUE
      END
  END
WHERE
  id = {{ table1.selectedRow.id }}

Most of the time, this does not work either. I click the cell to set the variable and then click the button to trigger the code and nothing happens. This has been an on-going issue. I seem to get it working for a while and then it stops again. Very frustrating. Does anyone see a problem in any of these steps?

For the first issue:

Second issue:

Third issue:

Does that SQL query run when the Attention button is clicked? Or is the event handler also set for cell change? Setting the value of a variable is done by running an async function. If there are multiple event handlers attached to the same event, and we need them to run one by one, we should use Run script and use await:

await variableName.setValue('newValue')
await queryName.trigger()