Skip to content

Fix spacing call sites for collection cardinality - #41

Draft
HassanAkbar wants to merge 5 commits into
mainfrom
fix/ppr-spacing-collection
Draft

Fix spacing call sites for collection cardinality#41
HassanAkbar wants to merge 5 commits into
mainfrom
fix/ppr-spacing-collection

Conversation

@HassanAkbar

Copy link
Copy Markdown
Member

Metanorma PR checklist

Related to lutaml/lutaml-model#720
Fixes spec failurs in https://github.com/lutaml/lutaml-model/actions/runs/30433439998/job/90521685449?pr=720

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Uniword’s handling of paragraph spacing to support Word’s behavior of emitting multiple w:spacing elements within a single w:pPr, and updates affected call sites and specs accordingly (related to lutaml-model collection/cardinality behavior).

Changes:

  • Change Wordprocessingml::ParagraphProperties#spacing to a collection and add #ensure_spacing for safe mutation of the “first” spacing entry.
  • Update builder APIs and multiple specs to treat spacing as an array/collection.
  • Add/extend round-trip tests to ensure repeated w:spacing entries are preserved and that Style#spacing_before/after can find values across entries.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/uniword/wordprocessingml/styleset_roundtrip_spec.rb Adjust spacing assertions for collection semantics; add private-fixture coverage for repeated w:spacing.
spec/uniword/wordprocessingml/styleset_integration_spec.rb Update spacing access for collection (needs a robustness tweak per stored comment).
spec/uniword/wordprocessingml/style_roundtrip_spec.rb Add fixture-free inline XML coverage for repeated w:spacing and spacing value lookup across entries.
spec/uniword/wordprocessingml/paragraph_enhanced_properties_spec.rb Update spacing expectation to handle collection.
spec/uniword/wordprocessingml/line_spacing_spec.rb Update spacing mutation/assertions to use ensure_spacing and collection access.
spec/uniword/properties/paragraph_properties_spec.rb Add coverage for building/ensuring spacing entries and collection behavior.
spec/uniword/docx/reconciler_spec.rb Update spacing access to tolerate collection.
spec/uniword/builder/style_builder_spec.rb Update spacing expectations to use .first.
spec/uniword/builder/paragraph_builder_spec.rb Update spacing expectations; add test ensuring spacing reuses the existing entry.
lib/uniword/wordprocessingml/style.rb Update spacing_before/after to search across multiple spacing entries.
lib/uniword/wordprocessingml/paragraph_properties.rb Make spacing a collection; add ensure_spacing; update flat-attribute conversion to build a single entry.
lib/uniword/builder/style_builder.rb Update builder spacing setter to use ensure_spacing.
lib/uniword/builder/paragraph_builder.rb Update builder spacing setter to use ensure_spacing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/uniword/wordprocessingml/styleset_integration_spec.rb Outdated
Comment thread lib/uniword/wordprocessingml/paragraph_properties.rb Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@HassanAkbar
HassanAkbar marked this pull request as ready for review August 11, 2026 15:30
@HassanAkbar
HassanAkbar marked this pull request as draft August 11, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

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.

2 participants