Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): parameter descriptions shouldn't disappear on input #13244

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

agilgur5
Copy link
Member

@agilgur5 agilgur5 commented Jun 25, 2024

Fixes #13242

Motivation

Per the issue, parameter tooltips/descriptions would disappear for all parameters as soon as you entered any text into any one of the parameter inputs. This buggy behavior would ofc make tooltips substantially less useful.

Modifications

  • the map statement missed description (and other parts of a Parameter) as it only listed a few fields and not all of them
    • use spread args to (shallow-)copy over the whole object instead, and then just overwrite the value as nothing else changes
      • spread makes this a lot more future-proof and less buggy, since we're not re-typing all of the unchanged fields

Verification

Confirmed it was working locally after typing some inputs. Screenshot:
Screenshot 2024-06-25 at 1 22 13 AM

Backport Notes

This is not directly backportable to 3.4 as the code has changed quite a bit (e.g. this shared component didn't exist and it used class components before). But the diff can be copy+pasted to the equivalent section in 3.4 if someone wants it.

Future Work

We might be able to further optimize this by re-using the same object when its value is unchanged (which will be the majority of cases since the whole array is modified at once). I just fixed the bug at this time

- the `map` statement missed `description` (and other parts of a `Parameter`) as it only listed a few fields and not all of them
  - use spread args to (shallow-)copy over the whole object instead, and then just overwrite the `value` as nothing else changes
    - spread makes this a lot more future-proof and less buggy, since we're not re-typing all of the unchanged fields

- we might be able to further optimize this by re-using the same object when its value is unchanged (which will be the majority of cases since the whole array is modified at once)

Signed-off-by: Anton Gilgur <[email protected]>
@agilgur5 agilgur5 added this to the v3.5.x patches milestone Jun 25, 2024
@agilgur5 agilgur5 requested a review from tczhao June 25, 2024 05:36
- revert to old style with `newParameters` variable
  - it feels more readable than what `prettier` wants 😅

- my editor was apparently lagging quite heavily in showing this in my previous commit (I only saw it when I re-opened the file), seemed like a stale lint cache or something

Signed-off-by: Anton Gilgur <[email protected]>
@tczhao tczhao enabled auto-merge (squash) June 26, 2024 05:14
@tczhao tczhao merged commit 06da23e into argoproj:main Jun 26, 2024
18 checks passed
@agilgur5 agilgur5 deleted the fix-ui-parameter-tooltips branch June 26, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Description/tool-tip disappears when you enter a value for one input when submitting a Workflow
2 participants