-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: align highlight layer with textarea to fix misalignment issue #6649
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
Conversation
- Match padding values between highlight layer and textarea - Use same padding logic for edit mode (pt-1.5 pb-10 px-2) and normal mode (py-1.5 px-2) - Add pr-9 to highlight layer to match textarea right padding - Fixes #6647
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 reviewed my own code and found it surprisingly adequate. The universe remains intact.
| "leading-vscode-editor-line-height", | ||
| "py-2", | ||
| "px-[9px]", | ||
| isEditMode ? "pt-1.5 pb-10 px-2" : "py-1.5 px-2", |
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.
Is this intentional? The padding values are duplicated between the highlight layer (lines 1014-1015) and the textarea (line 1062). Could we consider extracting these into constants or CSS variables to ensure they stay synchronized?
For example:
This would make future maintenance easier and prevent accidental desynchronization.
| "py-2", | ||
| "px-[9px]", | ||
| isEditMode ? "pt-1.5 pb-10 px-2" : "py-1.5 px-2", | ||
| "pr-9", |
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.
Nice fix! The alignment issue is resolved by matching the padding. Would it be worth adding a test to ensure these padding values remain synchronized in the future? This could help prevent regression of the alignment issue.
|
Fixed by #6648 |
Summary
This PR fixes the highlight layer misalignment issue reported in #6647. The highlight layer that shows highlighted mentions and commands was not properly aligned with the textarea content, causing visual misalignment.
Problem
The highlight layer and textarea had different padding values:
py-1.5 px-2(normal mode) orpt-1.5 pb-10 px-2(edit mode) pluspr-9py-2 px-[9px](fixed values)This mismatch caused the highlighted text to appear misaligned with the actual text in the textarea.
Solution
Updated the highlight layer to use the same padding values as the textarea:
pr-9to the highlight layer to match the textarea's right paddingChanges
ChatTextArea.tsxto synchronize padding between highlight layer and textareaTesting
Fixes #6647
Important
Fixes highlight layer misalignment with textarea in
ChatTextArea.tsxby synchronizing padding values.ChatTextArea.tsxby synchronizing padding values.pr-9padding to highlight layer to match textarea's right padding.This description was created by
for 79fd28c. You can customize this summary. It will automatically update as commits are pushed.