Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 4, 2025

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:

  • Textarea: py-1.5 px-2 (normal mode) or pt-1.5 pb-10 px-2 (edit mode) plus pr-9
  • Highlight layer: py-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:

  • Match the padding logic for both edit mode and normal mode
  • Added pr-9 to the highlight layer to match the textarea's right padding
  • Now both layers use identical spacing, ensuring perfect alignment

Changes

  • Updated ChatTextArea.tsx to synchronize padding between highlight layer and textarea
  • No changes to functionality, only visual alignment fixes

Testing

  • ✅ All existing tests pass
  • ✅ Linting checks pass
  • ✅ Type checks pass
  • ✅ Visual alignment verified in the UI

Fixes #6647


Important

Fixes highlight layer misalignment with textarea in ChatTextArea.tsx by synchronizing padding values.

  • Behavior:
    • Fixes highlight layer misalignment with textarea in ChatTextArea.tsx by synchronizing padding values.
    • Applies pr-9 padding to highlight layer to match textarea's right padding.
  • Testing:
    • Verified visual alignment in UI.
    • All tests, linting, and type checks pass.

This description was created by Ellipsis for 79fd28c. You can customize this summary. It will automatically update as commits are pushed.

- 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
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 4, 2025 09:10
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working UI/UX UI/UX related or focused labels Aug 4, 2025
@roomote roomote bot mentioned this pull request Aug 4, 2025
Copy link
Contributor Author

@roomote roomote bot left a 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",
Copy link
Contributor Author

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",
Copy link
Contributor Author

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.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 4, 2025
@daniel-lxs
Copy link
Member

Fixed by #6648

@daniel-lxs daniel-lxs closed this Aug 4, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 4, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XS This PR changes 0-9 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Highlight layer misalignment

4 participants