fix(ui): Move operator close button to bottom in arithmetic builder#118254
Closed
jameskeane wants to merge 2 commits into
Closed
fix(ui): Move operator close button to bottom in arithmetic builder#118254jameskeane wants to merge 2 commits into
jameskeane wants to merge 2 commits into
Conversation
- Repositioned the close (x) button on arithmetic operators from top to bottom - Updated FloatingCloseButton positioning from top: -14px to bottom: -14px - Adjusted border-radius on button and HoverFocusBorder to match new position - Refactored ArithmeticTokenOperator to use custom implementation instead of DeletableToken wrapper - Preserves all keyboard navigation and delete functionality Fixes DAIN-1735 Co-authored-by: James Keane <james.keane.github@gmail.com>
- Changed HoverFocusBorder from vertically centered to top-aligned - Updated height from 33px to calc(100% + 14px) to properly encompass both operator and close button - Simplified transform from translate(-50%, -50%) to translateX(-50%) for horizontal centering only - Changed border-radius to 2px (all corners) for proper wrapping Co-authored-by: James Keane <james.keane.github@gmail.com>
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.
Problem
In the equation builder, the close
×button on arithmetic operators (+, -, *, /) was positioned at the top of the token, which looked awkward and was inconsistent with user expectations. The outline/border also didn't properly encompass the close button.Issue: Linear DAIN-1735
Solution
Changes Made (2 commits):
Commit 1: Move close button to bottom
top: -14px) to the bottom (bottom: -14px)FloatingCloseButtonborder-radius to0 0 2px 2px(bottom corners rounded)ArithmeticTokenOperatorto use a custom implementation instead of the genericDeletableTokenwrapperCommit 2: Fix hover border positioning
HoverFocusBorderfrom vertically centered to top-aligned (top: 0instead oftop: 50%)33pxtocalc(100% + 14px)to properly encompass both operator (24px) and close button (14px)translate(-50%, -50%)totranslateX(-50%)for horizontal centering only2px(all corners rounded) for proper outline wrappingVisual Changes
The operator tokens now display with the close button at the bottom, and the hover/focus outline properly encompasses both the operator icon and the close button.
Before vs After
Normal state (no hover):
Normal state - operators visible, close buttons hidden
Hover state - Plus operator:
Plus operator with close button at bottom
Hover state - Minus operator:
Minus operator with close button at bottom
Hover state - Multiply operator:
Multiply operator with close button at bottom
Verification
✅ Close button appears at the bottom when hovering
✅ Hover outline (purple border) properly wraps around both operator and close button
✅ Border-radius is correctly applied (2px on all corners)
✅ Height calculation works correctly (38px total: 24px operator + 14px button)
✅ Close button is hidden when not hovering
All functionality is preserved:
Testing
Manual testing was performed using a static HTML test page that replicates the component styling. All hover states were verified visually across all four operator types (+, -, *, /).
To test locally:
×button appears at the bottom (not the top)To show artifacts inline, enable in settings.
Linear Issue: DAIN-1735