Skip to content
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 query editor cursor alignment by removing monaco css overrides #8912

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

d-rowe
Copy link
Member

@d-rowe d-rowe commented Nov 21, 2024

Description

Monaco editor computes the cursor position internally and does not account for any css overrides that change the position of the line (padding, margin, etc). This change removes the css override while we implement these styles with the monaco api directly.

Changelog

  • fix: ensure query editor cursor is aligned with text

Before

before

After

after

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Monaco editor computes the cursor position internally and does not account for any css overrides
that change the position of the line (padding, margin, etc). This change removes the css override
while we implement these styles with the monaco api directly.

Signed-off-by: Daniel Rowe <[email protected]>
ashwin-pc
ashwin-pc previously approved these changes Nov 21, 2024
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.87%. Comparing base (c928aec) to head (82123d7).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8912      +/-   ##
==========================================
+ Coverage   60.86%   60.87%   +0.01%     
==========================================
  Files        3802     3802              
  Lines       91059    91060       +1     
  Branches    14370    14370              
==========================================
+ Hits        55425    55437      +12     
+ Misses      32095    32084      -11     
  Partials     3539     3539              
Flag Coverage Δ
Linux_1 29.01% <ø> (+<0.01%) ⬆️
Linux_2 56.39% <ø> (ø)
Linux_3 37.90% <ø> (+0.02%) ⬆️
Linux_4 29.00% <ø> (+<0.01%) ⬆️
Windows_1 29.03% <ø> (+<0.01%) ⬆️
Windows_2 56.34% <ø> (ø)
Windows_3 37.90% <ø> (+0.02%) ⬆️
Windows_4 29.00% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Hailong-am
Hailong-am previously approved these changes Nov 22, 2024
@Hailong-am
Copy link
Collaborator

Can you fix the lint?

Signed-off-by: Daniel Rowe <[email protected]>
@d-rowe d-rowe dismissed stale reviews from Hailong-am and ashwin-pc via 82123d7 November 22, 2024 00:22
Copy link
Member Author

@d-rowe d-rowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding new line to resolve linting issue

@d-rowe
Copy link
Member Author

d-rowe commented Nov 22, 2024

Can you fix the lint?

Sure thing, I've fixed the linting issue.

Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you post a screenshot of the before/after of padding

approving to unblock assuming it passes ci

@d-rowe
Copy link
Member Author

d-rowe commented Nov 22, 2024

can you post a screenshot of the before/after of padding

Yup, I've added before and after screenshots in the PR description

@ananzh ananzh merged commit f110637 into opensearch-project:main Nov 22, 2024
70 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 22, 2024
…8912)

* Fix query editor cursor alignment by removing monaco css overrides

Monaco editor computes the cursor position internally and does not account for any css overrides
that change the position of the line (padding, margin, etc). This change removes the css override
while we implement these styles with the monaco api directly.

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR #8912 created/updated

* fix linting

Signed-off-by: Daniel Rowe <[email protected]>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit f110637)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@kavilla kavilla added discover for discover reinvent discover-next labels Nov 22, 2024
@d-rowe d-rowe deleted the query-editor-cursor-alignment branch November 22, 2024 18:25
silva-qa pushed a commit to silva-qa/OpenSearch-Dashboards that referenced this pull request Dec 12, 2024
…pensearch-project#8912)

* Fix query editor cursor alignment by removing monaco css overrides

Monaco editor computes the cursor position internally and does not account for any css overrides
that change the position of the line (padding, margin, etc). This change removes the css override
while we implement these styles with the monaco api directly.

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR opensearch-project#8912 created/updated

* fix linting

Signed-off-by: Daniel Rowe <[email protected]>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Signed-off-by: Federico Silva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants