feat(layout): add safe incremental --only-new placement - #19
Merged
Merged
Conversation
`config layout` currently re-arranges the whole page (grid_layout). After `config add`, new blocks land without coordinates while the rest of the page is already laid out by hand — re-running the full layout throws that hand-work away. Add `--only-new`: position ONLY blocks that have no `Px`, leaving every already-positioned block byte-identical. New blocks are placed with a Sugiyama-style layered layout so they flow left→right along their wiring: - layer = longest path over the sub-DAG of new blocks (predecessors that are themselves new) - order within a layer by barycenter of predecessor rows (fewer crossings) - coordinates snapped to the 96-unit editor grid, anchored in the free area to the right of the page's existing content Motivation: clears the "missing canvas layout — Loxone Config will repair this block on first save and may drop wires" warning without disturbing the existing diagram. Verified on a real 500-block config: 9 added logic gates placed in clean layers, 498 positioned blocks unchanged, `config validate` 0 errors. Adds `incremental_layout()` + two unit tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1TT6BSmf3uXakmtfexfDt
Treat blocks with any missing canvas coordinate as unpositioned, stack variable-height blocks without overlap, and remove the duplicate Unicode-normalized LFS fixture. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove unused self receivers from recursive XML traversal helpers so strict Clippy passes on Rust 1.91. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use array chunks and Option::filter as required by the current stable Clippy used in CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
eisber
force-pushed
the
takeover/pr-14-layout-only-new
branch
from
September 8, 2026 17:54
03c18d8 to
d6401ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #14 because its fork branch was deleted and could not be updated in place.
Includes the original
config layout --only-newfeature plus takeover fixes:Px,Py,Px2, orPy2as unpositionedValidated in Docker with Rust 1.91:
cargo fmt --check --allcargo clippy --workspace -- -D warningscargo build --workspace --releasecargo test --workspace --release