Skip to content

fix(workflow-form): a rebuild that arrives while the reader is typing is dropped instead of held (from #8437) #8497

Description

@yangzhang75

What happened?

On the Form View, a rebuild of the input cards that arrives while the focus is inside a form control is discarded rather than postponed. Two paths reach it:

  • Compilation finishes while a reader is typing in a card: the schema refresh (for example the column names an attribute dropdown offers) never lands until the next compile or a reload.
  • With feat(gui): author the Form View in place with an edit mode #8455's edit mode: ticking a property in the step panel to expose it. The tick box is an <input type="checkbox"> inside the page, so it has the focus at the moment the change fires; the rebuild is dropped and the card only appears after some unrelated rebuild or a refresh. Unticking behaves the same way.

Expected: the rebuild runs as soon as it safely can. A tick box is not typing, so its rebuild should run at once; a rebuild that does arrive mid-typing should run when the focus leaves the field, not vanish.

Root cause: isTypingInTheForm() (from #8437) counts any focused INPUT inside the page as typing, tick boxes included, and both subscribers (getCompilationStateInfoChangedStream, formBindingChanged$) return when it says so. Nothing runs the emission later.

Fix: only text-like inputs, textareas, selects and content-editables count as typing; a rebuild that arrives while typing is held and runs once the focus leaves the text control (focusout, decided a tick later so tabbing to the next text field keeps it held). Found while verifying #8455 (parent #8011). #8455 carries the same change so it stays self-contained; whichever merges first, the other rebases and the duplicate hunk disappears.

How to reproduce?

On main (reader path):

  1. Open a workflow in the Form View with an exposed attribute input.
  2. Put the cursor in a text input and, while it is focused, cause a compile (for example a co-editor changes an upstream operator on the canvas).
  3. The attribute dropdown keeps its old column list until the next compile or a reload.

With #8455 checked out (author path):

  1. Open the Form View, click Edit, click a step in the preview.
  2. Tick a property in the panel. No card appears until something else rebuilds the page.

Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

357d901 (#8437) introduced the guard; reproduced on 1fbd346.

What browsers are you seeing the problem on?

Chrome

Relevant log output

No log output: the emission is dropped client-side with no error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions