Skip to content

Conversation

@Irev-Dev
Copy link
Contributor

WIP, PR aims to use the pointTool to call the add_segment rust function, and get back solve data as the return.

The function is stubbed out so does not do a code-mod or anything, but by returning fake data, we can start to draw the sketch client side.

Related to #8143

@Irev-Dev Irev-Dev requested review from a team as code owners October 17, 2025 04:40
@vercel
Copy link

vercel bot commented Oct 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Ready Preview Comment Oct 17, 2025 6:47am

@Irev-Dev Irev-Dev marked this pull request as draft October 17, 2025 04:40
@Irev-Dev Irev-Dev removed request for a team October 17, 2025 04:40
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

type: 'update sketch outcome',
data: result,
})

Copy link

Choose a reason for hiding this comment

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

Bug: Improper Use of sendParent in Async Context

The modAndSolve actor directly calls sendParent within its fromPromise implementation. sendParent is an XState action creator, intended for machine actions, not direct calls inside async functions. This could prevent events from being sent to the parent or cause runtime issues.

Fix in Cursor Fix in Web

segment: SegmentCtor,
label: Option<String>,
) -> Result<(SourceDelta, SceneGraphDelta)>;
) -> Result<(KclSource, SketchExecOutcome)>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be a temp change, if we want to stick with SceneGraphDelta?

I can see that NRC had made Sketch which is similar SketchExecOutcome

image

But is all ObjectIds, so guess I would still need a map of all of the objects?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should discuss this in our next call. I have a clearer understanding of it all now that I've implemented some of it, but I'm still on the fence about which way we should go.

Objects are analogous to runtime artifacts, i.e. those in the artifact graph. So it makes sense that if it's referencing segments, they would be ObjectIds pointing to them, not the Objects themselves. And yes, execution will build up a mapping from ObjectId to Object and provide a way to look things up.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 17, 2025

CodSpeed Performance Report

Merging #8594 will not alter performance

Comparing kurt-8143-point-tool-start (4fa791d) with main (857d949)1

Summary

✅ 139 untouched
⏩ 92 skipped2

Footnotes

  1. No successful run was found on main (78ceb4f) during the generation of this report, so 857d949 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 92 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

#[ts(export)]
// TODO not sure if this needs to be file name and content?
pub struct KclSource {
pub text: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

For the TODO, this is probably fine for now. We can't code-mod or refactor in imported files yet.

But the way I see it, this type and SourceDelta are redundant. They're the same and should be merged into one. I don't really care what we name it. Since this is the kcl-api crate, it seems a little redundant to call it "KCL source". But I get that the prefix probably makes it easier in TypeScript so that you don't need to alias it.


#[derive(Debug, Clone, Deserialize, Serialize, ts_rs::TS)]
#[ts(export)]
pub enum ConstrainedStatus {
Copy link
Contributor

Choose a reason for hiding this comment

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

This type is redundant/should be merged with Freedom in this file above.

wasm-pack build kcl-wasm-lib --release --target web --out-dir pkg
export RUSTFLAGS=''
cargo test -p kcl-lib --features artifact-graph export_bindings
cargo test -p kcl-api export_bindings
Copy link
Contributor

@jtran jtran Oct 17, 2025

Choose a reason for hiding this comment

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

Do we need to do this for kcl-error also? I guess I'm confused how things are working at all now on main if we do need it.

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