Skip to content

chore: remove xml2st references + fix autocomplete box sizing - #951

Merged
thiagoralves merged 4 commits into
developmentfrom
chore/remove-xml2st-refs-autocomplete-sizing
Jul 22, 2026
Merged

chore: remove xml2st references + fix autocomplete box sizing#951
thiagoralves merged 4 commits into
developmentfrom
chore/remove-xml2st-refs-autocomplete-sizing

Conversation

@thiagoralves

@thiagoralves thiagoralves commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Byte-identical companion PRs (shared frontend/backend/shared/middleware/shared surface — compare-surfaces.py match, 0 diffs). Two changes:

1. Remove xml2st references

The xml2st tool was retired (replaced by the in-process ST transpiler). This removes the leftover references so the code is xml2st-free:

  • Build/CI/config: ci-build.yml step name, ci-unit-tests.yml comment, .gitattributes entry, .devcontainer/post-create.sh binary check. (Editor-local untracked artifacts — the 31 MB resources/bin/.../xml2st/ tree, its backup, and the .binary-metadata.json key — were also removed locally; they are not tracked and download-binaries.ts no longer fetches xml2st.)
  • Comments: every source/test comment that named xml2st now references the ST transpiler / STruC++ as appropriate. No behavior change.
  • Exported namespace: openplc.org/xml2st/library-blocksopenplc.org/library-blocks for the PLCopen <addData> block-signatures payload. Nothing reads it back on import (xml2st was the sole consumer), so this is a safe rename; the assertion test was updated. plc.xml generation itself is untouched — it remains the PLCopen-conversion / Export-as-XML flow.

Not touched: historical docs (docs/strucpp-migration/*, docs/transpiler/*, CLAUDE.md's "xml2st retired" note, web docs/*) that document the xml2st→strucpp migration — removing xml2st from those would erase the record. Flag if you want those gutted too.

2. Autocomplete box sizing

The graphical (LD/FBD) variable-box autocomplete was fixed at w-36, cropping long suggestions (e.g. some_global_complex.structureVar). It now grows to fit content up to max-w-[16rem] and wraps long names (break-all) to multiple lines, so the full text is always visible.

Verification

tsc 0 errors, ESLint clean, Prettier clean; changed test suites pass (editor 235, web 228); autocomplete sizing verified live in the browser on dev:local.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Improved autocomplete popover and variable-row layout to reduce wrapping/layout shift for long variable names.
    • Updated generated library-block metadata identifiers to use the current library-block naming.
  • Documentation
    • Refreshed terminology across the compile and library build experience (including tests) to match the in-process ST transpiler workflow and current validator/tool names.
  • Refactor
    • Streamlined development setup checks by verifying only the required matiec binary.

xml2st cleanup (the tool was retired; the in-process ST transpiler replaced it):
- Drop stale build/CI/config references (ci-build step name, ci-unit-tests
  comment, .gitattributes entry, devcontainer binary check).
- Rewrite every source/test comment that named xml2st to reference the ST
  transpiler / STruC++ as appropriate (no behavior change).
- Rename the exported PLCopen <addData> namespace
  openplc.org/xml2st/library-blocks -> openplc.org/library-blocks (nothing
  reads it back on import; xml2st was its only consumer). plc.xml generation
  itself is unchanged — it is the PLCopen-conversion / Export-as-XML flow.

Autocomplete box sizing:
- The graphical (LD/FBD) variable-box autocomplete had a fixed w-36 width, so
  long suggestions (e.g. struct member refs like some_global_complex.structureVar)
  were cropped. It now grows to fit content up to max-w-[16rem] and wraps long
  names (break-all) to multiple lines so the full text is always visible.

Byte-identical across the shared frontend surface (compare-surfaces: match, 0
diffs). tsc/lint/prettier clean; changed test suites pass; autocomplete sizing
verified live in the browser.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f19136d9-293b-425d-9cd6-a250763cbbe0

📥 Commits

Reviewing files that changed from the base of the PR and between cb841a7 and 76311bd.

📒 Files selected for processing (1)
  • src/frontend/components/_atoms/graphical-editor/autocomplete/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/frontend/components/_atoms/graphical-editor/autocomplete/index.tsx

Walkthrough

The PR removes obsolete xml2st references across tooling, compilation documentation, PLC metadata, tests, and frontend comments. It also changes the library-block payload name and improves autocomplete handling for long variable names.

Changes

xml2st retirement

Layer / File(s) Summary
Tooling and CI metadata
.devcontainer/..., .gitattributes, .github/workflows/*
Removes xml2st binary verification and metadata, and updates CI wording.
Compile and library pipeline terminology
src/backend/editor/..., src/backend/shared/compile/..., src/backend/shared/library/..., src/middleware/shared/...
Updates documentation and test descriptions to describe the in-process ST transpiler and structured strucpp diagnostics.
PLC and transpiler contracts
src/backend/shared/transpilers/..., src/backend/shared/utils/PLC/...
Changes the library-block payload name to openplc.org/library-blocks and updates related documentation and expectations.
Frontend wording and autocomplete layout
src/frontend/components/..., src/frontend/hooks/..., src/frontend/utils/...
Updates legacy terminology and allows long autocomplete variable names to wrap within constrained popover dimensions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

I nibbled old names from the code,
While ST paths softly glow.
Library blocks found a newer tag,
Long labels now can grow.
A tidy burrow, bright and neat—
The rabbit hops on happy feet. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the changes and verification, but it does not follow the required template and omits the References and DOD checklist sections. Reformat the PR description to match the template, adding the References section and a completed DOD checklist, then keep the change summary and verification.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the two main changes: removing xml2st references and fixing autocomplete box sizing.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-xml2st-refs-autocomplete-sizing

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/backend/shared/compile/pipeline.ts`:
- Around line 241-243: Update the documentation for
RunCompilePipelineResult.errors to describe structured diagnostics from the
entire compile pipeline, including ST-transpiler, Arduino compilation, and
strucpp stages, rather than attributing them only to strucpp. Keep the existing
errors field and type unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 842ad1dc-0ccf-47c5-9136-51c0095bf179

📥 Commits

Reviewing files that changed from the base of the PR and between e48914d and 41e54bf.

📒 Files selected for processing (39)
  • .devcontainer/post-create.sh
  • .gitattributes
  • .github/workflows/ci-build.yml
  • .github/workflows/ci-unit-tests.yml
  • src/backend/editor/compiler/compiler-module.ts
  • src/backend/editor/utils/xml-manager.ts
  • src/backend/shared/compile/__tests__/pipeline-runtime-v3.test.ts
  • src/backend/shared/compile/__tests__/pipeline.test.ts
  • src/backend/shared/compile/__tests__/validate-empty-variables.test.ts
  • src/backend/shared/compile/pipeline.ts
  • src/backend/shared/compile/steps/generate-defines.ts
  • src/backend/shared/compile/steps/validate-empty-variables.ts
  • src/backend/shared/library/__tests__/build-pipeline.test.ts
  • src/backend/shared/library/__tests__/program-build-helpers.test.ts
  • src/backend/shared/library/build-pipeline.ts
  • src/backend/shared/library/program-build-helpers.ts
  • src/backend/shared/library/program-build-pipeline.ts
  • src/backend/shared/transpilers/st-transpiler/core/path-tree.ts
  • src/backend/shared/transpilers/st-transpiler/emit/pou-graphical.ts
  • src/backend/shared/transpilers/st-transpiler/helpers/block-library.ts
  • src/backend/shared/transpilers/st-transpiler/walker/ld.ts
  • src/backend/shared/utils/PLC/__tests__/collect-library-blocks.test.ts
  • src/backend/shared/utils/PLC/__tests__/split-program-st.test.ts
  • src/backend/shared/utils/PLC/collect-library-blocks.ts
  • src/backend/shared/utils/PLC/split-program-st.ts
  • src/backend/shared/utils/PLC/xml-generator.ts
  • src/frontend/components/_atoms/graphical-editor/autocomplete/index.tsx
  • src/frontend/hooks/use-navigate-to-compile-error.ts
  • src/frontend/utils/PLC/__tests__/pou-signature-serializer.test.ts
  • src/frontend/utils/PLC/xml-generator/base-type-tag.ts
  • src/frontend/utils/PLC/xml-generator/codesys/__tests__/data-type-xml.test.ts
  • src/frontend/utils/PLC/xml-generator/old-editor/__tests__/data-type-xml.test.ts
  • src/frontend/utils/PLC/xml-generator/old-editor/__tests__/type-xml.test.ts
  • src/frontend/utils/__tests__/generate-iec-variables-to-string.test.ts
  • src/frontend/utils/debugger-session.ts
  • src/frontend/utils/generate-iec-variables-to-string.ts
  • src/frontend/utils/iec-types-registry.ts
  • src/middleware/shared/ports/compiler-port.ts
  • src/middleware/shared/utils/library/compose-runtime-v4-bundle.ts
💤 Files with no reviewable changes (2)
  • .devcontainer/post-create.sh
  • .gitattributes

Comment on lines +241 to 243
/** Structured strucpp diagnostics from this run. Carries
* the per-error events the renderer's navigation keys off. */
errors?: StructuredCompileError[]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Document all pipeline error sources, not only strucpp diagnostics.

RunCompilePipelineResult.errors can receive ST-transpiler errors and Arduino compilation errors as well as strucpp errors. Calling the field “Structured strucpp diagnostics” makes the public result contract misleading; describe it as structured compile-pipeline diagnostics or split it by stage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/backend/shared/compile/pipeline.ts` around lines 241 - 243, Update the
documentation for RunCompilePipelineResult.errors to describe structured
diagnostics from the entire compile pipeline, including ST-transpiler, Arduino
compilation, and strucpp stages, rather than attributing them only to strucpp.
Keep the existing errors field and type unchanged.

thiagoralves and others added 3 commits July 22, 2026 07:28
…me never wraps

When the suggestion list overflows and the vertical scrollbar appears, it stole
horizontal space the content-based auto-size didn't reserve, wrapping the last
character of the widest name onto a new line. Add `scrollbar-gutter: stable` to
the scroll container so the reserved gutter is included in the auto-size.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Safari-specific rendering of the LD/FBD variable-box dropdown:
- `w-max` pins the popover to the widest item's full single-line width (clamped
  by min/max). Safari's shrink-to-fit otherwise collapsed the width toward
  min-content when items use `break-all`, wrapping names unnecessarily.
- `shrink-0` on the item rows, the "Add variable"/new-block rows, and the
  variables container. Safari vertically shrinks flex-column children, so a
  wrapped name's second line overflowed its box and rendered on top of the
  "Add variable" button below. Keeping full height pushes siblings down instead.

Chrome was unaffected (sizes to max-content and doesn't shrink these rows);
verified no Chrome regression. Safari behavior to be confirmed by the reporter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ropdown

Root cause of the Safari-only cropping: `word-break: break-all` collapses
WebKit's max-content computation, so the auto-sized dropdown came out too
narrow and wrapped names (even short ones), and the wrapped line overlapped
"Add variable". `overflow-wrap: break-word` (Tailwind `break-words`) does NOT
collapse max-content — it still breaks over-long names — so the popover sizes
to the full name (clamped to [9rem, 16rem]) in both Chrome and Safari. Dropped
the now-unneeded `w-max` (its interaction with min-width under WebKit was part
of the problem); Radix's `min-width: max-content` wrapper drives the sizing.
`shrink-0` rows retained so a genuinely long name that wraps still pushes
"Add variable" down instead of overlapping it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thiagoralves
thiagoralves merged commit a41c8d8 into development Jul 22, 2026
12 checks passed
@thiagoralves
thiagoralves deleted the chore/remove-xml2st-refs-autocomplete-sizing branch July 22, 2026 20:07
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