-
-
Notifications
You must be signed in to change notification settings - Fork 196
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 rename/updatemode and input issues #2199
Conversation
🦋 Changeset detectedLatest commit: 8e84e9b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
PR Analysis
PR Feedback
How to use
|
Commit SHA:105cdba0c2eded34ed36039c29125a9fa2c4f6cc Test coverage results 🧪
|
Commit SHA:105cdba0c2eded34ed36039c29125a9fa2c4f6cc |
if (!children || !React.isValidElement(children)) { | ||
return null; | ||
} |
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.
if (!children || !React.isValidElement(children)) { | |
return null; | |
} | |
if (!children || !React.isValidElement(children) || showEditForm) { | |
return null; | |
} |
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.
same as further down, that would cause jumps in layout as the button would not be rendered anymore. we just dont want the tooltip to be renderd
if (!children || !React.isValidElement(children)) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Tooltip | ||
side="bottom" | ||
label={( | ||
label={showEditForm ? '' : ( |
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.
label={showEditForm ? '' : ( | |
label={( |
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.
wouldn't it be better to add the condition above and just return null when the editForm is visible ?
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.
that would cause the children to also not be rendered though (Tooltip wraps the token button)
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.
ah got it. then the best way would be something like if (showEditForm) return children
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'll include that in a followup 👍
Fixes #2031
Fixes #2097
Fixes #1799
This set of changes includes improvements to the user experience and state management, as well as bug fixes. The
ConfirmDialog
andInput
components were updated to ensure immediate focus on the input element after rendering. TheuseTokens
module andEditTokenForm
component now store the last used update mode when renaming tokens, improving state management and UI. Two bug fixes were also included, related to issues when renaming tokens or token groups.src/app/components/Input.tsx
:setTimeout
function removed andfocus()
called directly onhtmlInputRef.current
to ensure immediate focus on input element after rendering. (F6c8a7b5L3)src/app/components/ConfirmDialog.tsx
: Improved UX by focusing on first input field afterConfirmDialog
is shown by removing setTimeout function and addingfirstInput
to useEffect dependencies inConfirmDialog.tsx
. (F7d9e2c8L1)src/app/store/useTokens.tsx
: Stores last used update mode when renaming tokens and groups, and UI now defaults to last used update mode instead of current mode. (F5a6b1e4L1)src/app/components/EditTokenForm.tsx
: Stores last used update mode when renaming tokens, ensuring it is selected by default instead of current mode. Improves state management and UI. (F2b5c8f1L1).changeset/curly-ravens-prove.md
and.changeset/young-kangaroos-brake.md
: Updated@tokens-studio/figma-plugin
to fix bug causing issues when renaming tokens or token groups. (Bug fixes)