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: Properly setting selection range when KCL editor is not mounted. #4960

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nadr0
Copy link
Collaborator

@nadr0 nadr0 commented Jan 7, 2025

closes #4859

Issue

lastSelectionEvent is not properly set in one of the set selection workflows so when the KCL editor is mounted it will break.

Implementation

In the completeSelection workflow which is the selection workflow when a constraint is applied I properly compute the new selection range for the AST mod. I pass this range to the setLastSelectionEvent which then highlights the code in codemirror.

If the range cannot be computed I select the bottom of the file by default so we can always have some selection event.

Future notes

It would be nice to have a clearer workflow for selection throughout the system. We have artifact selections as well as editor selections and then multiple different selection visuals within each one.

Selection
+ Entity
  + highlight
  + select
+ Code Mirror
  + Highlight range
  + cursor location
  + Line selection
+ Global State
  + Code mirror selection
  + Artifact graph selection
+ Ways to select
  + User
  + Through code

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Jan 7, 2025 5:55pm

Copy link

qa-wolf bot commented Jan 7, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.82%. Comparing base (97cef4d) to head (7da3da5).
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4960   +/-   ##
=======================================
  Coverage   85.82%   85.82%           
=======================================
  Files          86       86           
  Lines       31005    31005           
=======================================
  Hits        26611    26611           
  Misses       4394     4394           
Flag Coverage Δ
wasm-lib 85.82% <ø> (ø)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected error occurs after opening KCL panel when horizontal contraints are applied
1 participant