Assemblies: UX improvements around foreign file imports#6159
Assemblies: UX improvements around foreign file imports#6159
Conversation
Will eventually fix #6120 Right now the whole loop is there but the codemod doesn't work yet
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6159 +/- ##
==========================================
- Coverage 85.03% 85.01% -0.03%
==========================================
Files 109 109
Lines 44758 44758
==========================================
- Hits 38062 38050 -12
- Misses 6696 6708 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
…etry' into pierremtb/issue6152-UX-improvements-around-foreign-file-imports
Thanks @Irev-Dev for the suggestion
…oreign-file-imports
…oreign-file-imports
There was a problem hiding this comment.
Approving because I know this is all behind a DEV flag, so up to you if you want to fix as part of this PR or follow up.
But essentially,
- When importing an obj (maybe applies to others) I get an error straight away, that is fixed just by causing a re-execute
- When importing there's no check to see if the local name conflicts with existing variable names.
- maybe want to test the above when fixed.
Screenshare.-.2025-04-09.9_06_57.PM.mp4
| export const isRelevantFile = (filename: string): boolean => | ||
| RELEVANT_FILE_TYPES.some((ext) => filename.endsWith('.' + ext)) |
There was a problem hiding this comment.
Oooh nice appreciate the heads up. Will get it updated to match in a follow up once it lands!
| return sourceRange[2] | ||
| } | ||
|
|
||
| export function getInVariableCase(name: string, prefixIfDigit = 'm') { |
There was a problem hiding this comment.
Don't really understand the name though, the in in particular.
There was a problem hiding this comment.
Haha yeah, maybe getStringInVariableCase? I'll think of a better name
|
Nice thanks a bunch @Irev-Dev!
pretty certain this is related to #5780. will do more testing
that's a great gotcha thanks for pointing that out
yes abosolutely! I think I will ride the green CI high and merge-as is, will address point 2&3 in a dedicated PR |
|
Created follow up issue at #6230 under the meta issue |
) * WIP: Add point-and-click Import for geometry Will eventually fix #6120 Right now the whole loop is there but the codemod doesn't work yet * Better pathToNOde, log on non-working cm dispatch call * Add workaround to updateModelingState not working * Back to updateModelingState with a skip flag * Better todo * Change working from Import to Insert, cleanups * Sister command in kclCommands to populate file options * Improve path selector * Unsure: move importAstMod to kclCommands onSubmit 😶 * Add e2e test * Clean up for review * Add native file menu entry and test * No await yo lint said so * WIP: UX improvements around foreign file imports Fixes #6152 * @lrev-Dev's suggestion to remove a comment Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> * Update to scene.settled(cmdBar) * Add partNNN default name for alias * Lint * Lint * Fix unit tests * Add sad path insert test Thanks @Irev-Dev for the suggestion * Add step insert test * Lint * Add test for second foreign import thru file tree click * Add default value for local name alias * Aligning tests * Fix tests * Add padding for filenames starting with a digit --------- Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
Fixes #6152
Makes the interaction with non-KCL files in the context of assemblies easier, as a follow up to the initial PR for point-and-click assemblies
Includes:
.stepfiles in the file tree (previously only.stp) through more consistent checks around importable filesimport()call. Note: I'm still rather unhappy about the kcl wrapper approach that feels somewhat unintuitive to me at least. I'd rather us loading the file into a new project that we'd prompt the use to save somewhere first. But that's outside of the scope hereDoes not include:
Mind the next two stacked PRs as well that will be made available after this one:
Demo:
https://github.com/user-attachments/assets/cca91477-44df-4687-8761-4dc604ceb698