-
Notifications
You must be signed in to change notification settings - Fork 237
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 formula text being janky #2618
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
/usr/local/bin/yarn: 3: dirname: not found Error: Cannot find module '/yarn.js' Node.js v22.9.0 WalkthroughThe pull request modifies the Changes
Suggested Reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
libs/gi/ui/src/util/getCalcDisplay.tsx (1)
223-234
: LGTM! The changes effectively fix the formula text display.The removal of the Material-UI Typography component in favor of native spans is a good approach to prevent unwanted line breaks and fix the "janky" appearance of formula text.
Consider memoizing the style object.
Since the style object is recreated on every render, consider memoizing it or moving it outside the map function:
+ const strikethroughStyle = { textDecoration: 'line-through' } {components.map((x, i) => ( <span - style={{ - textDecoration: info.strikethrough ? 'line-through' : undefined, - }} + style={info.strikethrough ? strikethroughStyle : undefined} key={i} > {x} </span> ))}Note: The Fragment is necessary here as we're mapping over components, so we can safely ignore the static analysis warning.
🧰 Tools
🪛 Biome (1.9.4)
[error] 223-234: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
libs/gi/ui/src/util/getCalcDisplay.tsx
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
libs/gi/ui/src/util/getCalcDisplay.tsx
[error] 223-234: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment
(lint/complexity/noUselessFragments)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: lint
This reverts commit e3482dc.
* Add nonstacking to all relevant buffs * fix * dumdum proof * Reapply "Add non-stacking buff back to NO4 in a smarter way (#2592)" (#2629) This reverts commit e8a420a. * Reapply "Fix formula text being janky (#2618)" (#2627) This reverts commit 72d89fb. --------- Co-authored-by: lantua <[email protected]>
Describe your changes
Fixed formula text being multiple lines
Issue or discord link
Testing/validation
Formulas are all normal now
Strikethrough still works
Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)
yarn run mini-ci
locally to validate format and lint.Summary by CodeRabbit
Typography
component with nativespan
elements