Repository navigation
fix(ui-elements): center tooltip alignment, add text crash guard, and fix ActionButton icon overflow - #1399
Open
Diwaspant132 wants to merge 1 commit into
Conversation
… fix ActionButton icon overflow Signed-off-by: Diwaspant132 <diwaspanta132@gmail.com>
Diwaspant132
force-pushed
the
fix/tooltip-actionbutton-ui-alignment
branch
from
October 23, 2026 15:55
663f90f to
e3f1d41
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(ui-elements): center tooltip alignment, add text crash guard, and fix ActionButton icon overflow
Description
This pull request addresses several UI alignment, reliability, and accessibility defects across
@embeddedchat/ui-elements:left: 50%): InTooltip.styles.js, tooltips previously used a hardcodedleft: 64%; transform: translateX(-50%), causing every tooltip in the chat interface to be skewed ~14% off-center to the right of its anchor button. Changed toleft: 50%; transform: translateX(-50%)to ensure exact centering.Tooltip.jspreviously executed{text.charAt(0).toUpperCase() + text.slice(1)}without verifying thattextwas a defined non-empty string. Hovering over elements without a title (e.g. attachments with falsyattachment?.title) threw an unhandledTypeError: Cannot read properties of undefined (reading 'charAt'). Added safe string handling and only render the tooltip popup whenhasTextis true.let touchTimerwithuseRefand added unmount cleanup inuseEffect.a11y): AddedonFocus,onBlur, andEscapekey dismissal handlers along withrole="tooltip"andaria-hiddenattributes so keyboard users navigating withTabcan access tooltips."down": Handled bothposition="bottom"andposition="down"variants so arrows invert (rotate(180deg)) and anchor properly when"down"is passed (e.g. inAttachmentMetadata.js).size="small"was passed toActionButton(a 20px /1.25remsquare button), icons defaulted to 24px (1.5rem), overflowing outside the button bounds. AddedgetIconSizehelper that derives appropriate icon sizing based on buttonsize(small->1rem,large->1.75rem,medium->1.25rem) while supporting explicit string and object overrides.Acceptance Criteria fulfillment
left: 50%).undefined,null, and empty strings without runtime errors.onFocus/onBlur) andEscapekey dismissal supported.role="tooltip"andaria-hiddenattributes added.size="small"ActionButton displays properly scaled1remicon without container overflow.PR Test Details
node --test packages/ui-elements/src/components/**/*.test.mjs(19/19 passing).yarn format:check(10/10 projects passed).cd packages/ui-elements && yarn storybook-> Components -> Tooltip & ActionButton.