-
Notifications
You must be signed in to change notification settings - Fork 178
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
refactor(app): refactor command text out of CommandText #15708
Conversation
Decouple the logic that generates command text from the component that renders it.
Tagging auth for visibility as well, since this impacts run preview stuff (which maybe is AUTH or maybe it's EXEC idk)...I eventually figured out how to tag them 😎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good but I think we can enhance the types even farther
app/src/molecules/Command/hooks/useCommandTextString/utils/getCommentCommandText.ts
Outdated
Show resolved
Hide resolved
app/src/molecules/Command/hooks/useCommandTextString/utils/getDirectTranslationCommandText.ts
Show resolved
Hide resolved
app/src/molecules/Command/hooks/useCommandTextString/utils/getConfigureForVolumeCommandText.ts
Outdated
Show resolved
Hide resolved
...rc/molecules/Command/hooks/useCommandTextString/utils/getConfigureNozzleLayoutCommandText.ts
Outdated
Show resolved
Hide resolved
app/src/molecules/Command/hooks/useCommandTextString/utils/getMoveToWellCommandText.ts
Show resolved
Hide resolved
app/src/molecules/Command/hooks/useCommandTextString/utils/getPrepareToAspirateCommandText.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like it
f7936ca
to
b8e53a1
Compare
Explicitly handle the null command case to prevent warnings. The intention of useCommandTextString after #15708 is to support null commands, so this change genuinely implements the desired behavior.
Closes EXEC-575
Overview
Works towards EXEC-574.
Decouple the logic that generates command text from the component that renders it. There was a good bit of cruft, translation files were in different places instead of the correct place, and a large number of missing string generator util functions were missing, so this PR adds/cleans up those instances.
There's one small non-functional change: the primary string generator hook,
useCommandTextString
, now supports an optionalCommandTextData
, whereas this variable was required before. Half the time we were accounting for thenull
case when string building, and half the time we weren't, so let's just make all string builders handle the null case and makeuseCommandTextString
a bit more flexible (which will come in handy with Error Recovery, soon!) .Test Plan
CommandText
, which is not the best place for them now, but I've added a TODO to clean up the testing later.Risk assessment
low