Skip to content

#4852 Delete line segments in sketch mode using keyboard #6407

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

andrewvarga
Copy link
Contributor

@andrewvarga andrewvarga commented Apr 20, 2025

@Irev-Dev this is just a quick try to see how to approach this, it is almost working, but I wonder.. isn’t the main issue here that modelingSend({ type: 'Delete selection' }) is not handling the selected segments? Or is that only supposed to delete larger scoped items in the feature tree, like sketches?

This PR just checks if the current selection is a segment and calls the segment specific Delete Segment command in that case..the reason it's not working yet is that the artifact is not found for segments just drawn, it is found when we exit and re-enter the sketch - probably the artifact graph needs to be refreshed.
My other approach would be to add a hotkey listener in the React component where the current delete segment button UI is..but having one delete callback which deletes the current selection seems cleaner here.

Copy link

qa-wolf bot commented Apr 20, 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

vercel bot commented Apr 20, 2025

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

Name Status Preview Comments Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 27, 2025 9:18am

@pierremtb
Copy link
Contributor

Excited for this!

@andrewvarga
Copy link
Contributor Author

Update: since this is not a visual change, I'll continue after #6333 but the direction we seem to prefer is to implement this in the React component which implements the existing delete segment function in the "..." options menu.

@andrewvarga
Copy link
Contributor Author

Small usability question: in this sketch of a triangle with 3 lines, when I delete the last line, it will actually not change anything because of the close() call in the end, so I need to select that last segment and delete it again..wondering if maybe the code generated in this case could be just the first 2 lines and then a close() when the user closes the sketch?

profile003 = startProfile(sketch003, at = [-123, -57.66])
  |> line(end = [171.22, -197.09])
  |> line(end = [104.14, 220.15])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

@andrewvarga andrewvarga changed the title WIP: #4852 Delete line segments in sketch mode using keyboard #4852 Delete line segments in sketch mode using keyboard Apr 27, 2025
Copy link

codecov bot commented Apr 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.31%. Comparing base (921adcb) to head (935e066).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6407   +/-   ##
=======================================
  Coverage   85.31%   85.31%           
=======================================
  Files         110      110           
  Lines       47356    47356           
=======================================
  Hits        40403    40403           
  Misses       6953     6953           
Flag Coverage Δ
rust 85.31% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@pierremtb pierremtb left a comment

Choose a reason for hiding this comment

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

The changes make sense, and testing it locally this feels really good too! I didn't mind deleting twice, it's definitely a huge improvement already and it made sense to me that one delete led to the deletion of one line. I think people are used to hitting delete multiple times too.

@pierremtb pierremtb merged commit a58a336 into main Apr 28, 2025
40 checks passed
@pierremtb pierremtb deleted the andrewvarga/4852/delete-line-segments-in-sketch-mode-using-keyboard branch April 28, 2025 14:27
@andrewvarga
Copy link
Contributor Author

@pierremtb thanks! I've added a quick test for this to in a separate PR:
#6543

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.

2 participants