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

Update lower-right corner units menu to read and edit inline settings annotations if present #5212

Merged
merged 18 commits into from
Feb 6, 2025

Conversation

franknoirot
Copy link
Collaborator

Towards #3960. Allows UI to respond to per-file length unit annotations if the currently-opened file has them hand written within:

  1. alters the lower-right unit control menu to show the inline annotation's current value instead of the soon-to-be-deprecated project-level length unit setting
  2. alters this menu to edit the inline annotation instead of the project-level setting when changed.
  3. Added an E2E test that verifies normal settings inheritance happens until an inline annotation is present.

This allows us to have the UI not lie to users who are savvy enough to already be using per-file units (or who use our recently rewritten samples), ahead of our attempt to provide migrations to per-file units and truly deprecating the project-level setting.

Copy link

qa-wolf bot commented Feb 1, 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 Feb 1, 2025

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

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Feb 6, 2025 4:40pm

@franknoirot franknoirot requested review from jessfraz, jtran, Irev-Dev, nadr0 and pierremtb and removed request for jtran and jessfraz February 1, 2025 05:23
@franknoirot franknoirot changed the title Franknoirot/3960/file units UI Update lower-right corner units menu to read and edit inline settings annotations if present Feb 1, 2025
Copy link

codecov bot commented Feb 1, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.05%. Comparing base (11cac0c) to head (f598cc5).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/wasm-lib/kcl/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5212   +/-   ##
=======================================
  Coverage   86.05%   86.05%           
=======================================
  Files          92       92           
  Lines       33204    33204           
=======================================
  Hits        28575    28575           
  Misses       4629     4629           
Flag Coverage Δ
wasm-lib 86.05% <0.00%> (ø)

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.

@pierremtb
Copy link
Collaborator

Looking good here locally

image

image

@pierremtb
Copy link
Collaborator

Actually @franknoirot changing to mm worked in the code but the step export still gave me inches

image

image

@franknoirot
Copy link
Collaborator Author

franknoirot commented Feb 3, 2025

Actually @franknoirot changing to mm worked in the code but the step export still gave me inches

So with the project or user-level settings set to in and an inline annotation of mm, the STEP export is in in? I'll check that out

@pierremtb
Copy link
Collaborator

pierremtb commented Feb 3, 2025

@franknoirot ok I can reproduce:

  • user settings in mm
  • open project, load bracket sample, project settings get auto set to in (good)
  • export step -> freecad sees in (good)
  • change the annotation to mm
  • export step -> freecad sees in (bad)
  • refresh
  • export step -> freecad sees mm (good)
  • change the annotation to in
  • export step -> freecad sees mm (bad)
  • refresh
  • export step -> freecad sees in (good)

jtran added 2 commits February 3, 2025 13:52
- Fix thrown error to use the cause field
- Fix function names to not use "get"
@jtran
Copy link
Collaborator

jtran commented Feb 3, 2025

src/wasm-lib/kcl/src/lib.rs Outdated Show resolved Hide resolved
@pierremtb
Copy link
Collaborator

I don't know why yarn tsc fails on this branch

src/lang/queryAst.ts Outdated Show resolved Hide resolved
@franknoirot franknoirot enabled auto-merge (squash) February 6, 2025 16:49
@franknoirot franknoirot merged commit 1c0a38a into main Feb 6, 2025
31 checks passed
@franknoirot franknoirot deleted the franknoirot/3960/file-units-ui branch February 6, 2025 17:37
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.

3 participants