Skip to content

Persist the soft-limits toggle and describe limits as origin distances - #624

Merged
knipknap merged 3 commits into
mainfrom
fix/soft-limits-toggle-and-labels
Oct 23, 2026
Merged

knipknap merged 3 commits into
mainfrom
fix/soft-limits-toggle-and-labels

Conversation

@knipknap

@knipknap knipknap commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes two problems in the hardware settings' Soft Limits group (one behavioral, one wording) and the matching website docs.

What does this PR change?

  1. Disabling "Enable Soft Limits" did not survive a restart. Machine.to_dict() serialized soft_limits but never soft_limits_enabled, while from_dict() reads that key with the freshly-constructed default as fallback - which is True. So after every restart the toggle flipped itself back on, with the configured bounds gone (disabling clears them via clear_soft_limits()), and jogging was silently checked against the full axis extents again. The flag is now serialized next to the bounds; the read side and the device-profile path (stored as None when enabled, False when disabled) already handled it correctly, only the write side was missing. A round-trip regression test covers it.

  2. The min/max rows read like machine coordinates. They were titled "X Min"/"X Max" with subtitles like "Minimum X coordinate", but the values are distances measured from the origin corner into the bed - fixed to the physical bed, independent of the active WCS. The rows are now titled "X Min Distance from Origin" and friends, with the helper text "Distance from the origin corner into the bed (not a coordinate). Fixed to the physical bed, independent of the WCS." as subtitle, in both the device settings hardware page and the machine wizard.

Docs: the website hardware page listed the old field names; the bullets are reworded in the English source and in every translation carrying the section (de, es, fr, hi, pt-BR, uk, zh-CN), each using that page's existing terminology. The soft-limit rows sit below the fold of the hardware screenshot, so no screenshot target changed.

Testing: tests/machine/models/test_machine_model.py (incl. the new test_soft_limits_enabled_persists_through_serialization), the neighboring machine/profile suites, and pixi run lint all pass; website markdown formatted with pixi run site-format.

Machine.to_dict() serialized soft_limits but never soft_limits_enabled,
and from_dict() fell back to the freshly-constructed default (True)
when the key was missing. Disabling the toggle therefore did not
survive a restart: soft limits came back enabled with the configured
bounds gone (disabling clears them), and jogging was checked against
the full axis extents again.

Serialize the flag next to the bounds. The device-profile path already
round-trips it correctly (stored as None when enabled, False when
disabled), and from_dict() has always read the key - only the write
side was missing. Covered by a round-trip regression test.
The min/max rows were titled "X Min"/"X Max" with subtitles like
"Minimum X coordinate", which reads as a machine coordinate. The
values are distances measured from the origin corner into the bed;
they are fixed to the physical bed and independent of the active WCS.

Retitle the rows to "X Min Distance from Origin" and friends, replace
the subtitles with that explanation, and apply the same wording in the
machine wizard. Update the website hardware docs (English, German,
French), which listed the old field names; the soft-limit rows are
below the fold of the hardware screenshot, so no screenshot target
changes.
…ages

The es, hi, pt-BR, uk, and zh-CN hardware pages still listed the old
"X/Y Min"/"X/Y Max" field names after the label rewording; they were
missed because the labels are translated and did not match the English
grep. Bring all five in line with the reworded English source.
@knipknap
knipknap merged commit 56032af into main Oct 23, 2026
22 checks passed
@github-actions

Copy link
Copy Markdown

🤖 Estimated LLM implementation cost

Replayed each of the 3 commits in this pull request and counted the code lines each commit added or rewrote:

Commit Message Lines (add/rewrite) Est. output tokens Est. output cost
c0d32fd2 fix(machine): persist the soft-limits enabled flag 13 / 0 130 $0.0019
e81e8227 fix(ui): describe soft limits as distances from the origin 54 / 18 720 $0.0108
c2266436 docs(i18n): reword soft-limit fields as origin distances in all languages 14 / 10 240 $0.0036
Total 109 1,090 $0.0163

Added lines by language: Python 61, Markdown 20

Full estimate

Component Est. tokens Est. cost
Code emission (109 add/rewrite lines) 1,090 $0.0163
Context input (reading touched files) 31,018 $0.0931
Conversation replay (≈15× output) 16,350 $0.0490
Prompting (pull request description) 385 $0.0012
Lower bound (output only) 1,090 $0.0163
Best estimate 48,843 $0.1596

Cost model: ≈10 tokens per code line at $15/Mtok output and $3/Mtok input (assuming heavy prompt caching); input ≈ 15× output for conversation replay; a review round ≈ 42,000 tokens; a failed CI run ≈ 21,000 tokens; file reads capped at 20 kB each.

Active window from first commit to merge: <1 day.

⚠️ Caveat: the lower bound covers only the tokens for emitting the code. The best estimate adds modeled overhead for exploration, conversation replay, review and debug turns, but real sessions vary by tool and task — treat it as an order-of-magnitude figure. Human engineering time is not included.

This branch was previously deployed

1 inactive deployment
pypi — c2266436 Deployed Oct 23, 2026 by knipknap via Build and Publish Wheel #2460
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.

1 participant