chore: sync upstream (10 Commits) #20

Merged
alf merged 10 commits from chore/sync-upstream-20261107 into main 2026-11-07 08:55:31 +00:00
Owner

Upstream-Sync von upstream/main (10 Commits). Fast-Forward.

  • e977f825 Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423)
  • c99a41af Fix iDML import drops a table cell's insets written as TextTopInset … (#2414)
  • 3e044b06 Merge pull request #2390 from storytold/house-rules
  • d1ed3956 docs: preserve local guidance in house-rules rollout
  • 542b5654 Copy the shared house rules into AGENTS.md.
  • 8fce2825 IDML export: a document's hyperlinks are written out (#1446) (#1659)
  • 6a85f422 IDML import: a page item's or a text run's hyperlink survives (#1446) (#1652)
  • 33b6768d Merge pull request #2368 from ZIDAN44/fix/2345-paste-into-frame-edges
  • 601a9125 Apply review fixes
  • f5581e3c Frame edges: a frame holding pasted-in content draws its own edge, not its content's (#2345)
Upstream-Sync von `upstream/main` (10 Commits). Fast-Forward. - e977f825 Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) - c99a41af Fix iDML import drops a table cell's insets written as `TextTopInset` … (#2414) - 3e044b06 Merge pull request #2390 from storytold/house-rules - d1ed3956 docs: preserve local guidance in house-rules rollout - 542b5654 Copy the shared house rules into AGENTS.md. - 8fce2825 IDML export: a document's hyperlinks are written out (#1446) (#1659) - 6a85f422 IDML import: a page item's or a text run's hyperlink survives (#1446) (#1652) - 33b6768d Merge pull request #2368 from ZIDAN44/fix/2345-paste-into-frame-edges - 601a9125 Apply review fixes - f5581e3c Frame edges: a frame holding pasted-in content draws its own edge, not its content's (#2345)
alf added 10 commits 2026-11-07 08:55:30 +00:00
draw_item_edges went into every Content::Group, including a frame with
Paste Into content, so with Frame Edges on it drew the nested image's whole
outline out past the shape and never the frame's own edge. Only real groups
are walked now; a frame with nested items draws its own path, as text and
graphic frames do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/ui-egui/src/canvas/frames.rs
Frame edges: a frame holding pasted-in content draws its own edge, not its content's (#2345)
* IDML import: a page item's or a text run's hyperlink survives (#1446)

IDML carries a hyperlink as three elements: a source, a destination and a
`Hyperlink` joining them by `Self`. Only `CrossReferenceSource` was mapped, so
an image frame linked to a photo and a run of text linked to a page were
dropped on import, although both are native here and both export to PDF.

The names are collected as the package is read and the two ends put together
in `finish`, once the pages, page items and anchors they name exist. A link
whose source or destination is not in the file is dropped with a warning
saying which, rather than silently or as a link that goes nowhere.

Carries all three review fixes:

- a source recorded in a table cell's or a footnote's story is dropped. Those
  stories are built under the StoryId(0) placeholder, so the link named a
  story nothing can look up, with offsets into text that is not there. The
  warning says where the text was instead of claiming it was not text.
- the same for a HyperlinkTextDestination in such a story: its anchor id is
  (0 << 24) | k, so it collides with other cells' anchors and belongs to no
  story the cross-reference index holds; the link resolved to Anchor(1) and
  the PDF left the annotation out without a word.
- the index's topic cross-references go in at the start of the first story
  with text after the ranges are recorded, so the ranges for that story are
  shifted with the markers; a range left alone covered the wrong nine bytes.

Rebased onto the post-split main, hunk by hunk: the Importer struct, its
fields, the element scan, hyperlink_list and finish are in import.rs, while
StoryBuilder, walk_story and the anchor list are in import/story.rs. finish
answers (Document, Vec<String>) so the warnings reach the caller.

* An anchor a hyperlink cannot mean is refused, not ignored

This branch carries its own copy of `dest_param`'s anchor arm -- the IDML import
needed anchors as link destinations and added it here independently of #1555 --
and it has the same hole, so review is right that the fix has to be here as well
rather than only on that PR.

`dest_param` returns `Result<Option<_>>`. `None` still means no destination was
given, which `hyperlink.edit` needs for an edit that only renames; an `anchor`
that is given and names none is an error.

An unknown *id* was accepted outright, since `as_u64` answers for any number, so
a link was stored to an anchor nobody has and the export quietly left it out. On
`hyperlink.edit` the `None` read as "no destination given", so the command
reported success and kept the old destination, which is the case review
reported. An unknown *name* did already fail on `hyperlink.create`, but with
"give `url`, `email`, `page` or `anchor`" -- the wrong problem named.

The same change is on #1555, deliberately: each PR introduces this code on its
own line and each has to be right on its own. Whichever lands first, the other's
conflict is the same text on both sides.

* Split the hyperlink and index-marker steps out of Importer::run, under clippy's complexity limit

* IDML import: say when a link's frame is anchored in text, which PDF export cannot place yet

---------

Co-authored-by: skylar taylor-barrick <hi@skylar.cc>
* IDML import: a page item's or a text run's hyperlink survives (#1446)

IDML carries a hyperlink as three elements: a source, a destination and a
`Hyperlink` joining them by `Self`. Only `CrossReferenceSource` was mapped, so
an image frame linked to a photo and a run of text linked to a page were
dropped on import, although both are native here and both export to PDF.

The names are collected as the package is read and the two ends put together
in `finish`, once the pages, page items and anchors they name exist. A link
whose source or destination is not in the file is dropped with a warning
saying which, rather than silently or as a link that goes nowhere.

Carries all three review fixes:

- a source recorded in a table cell's or a footnote's story is dropped. Those
  stories are built under the StoryId(0) placeholder, so the link named a
  story nothing can look up, with offsets into text that is not there. The
  warning says where the text was instead of claiming it was not text.
- the same for a HyperlinkTextDestination in such a story: its anchor id is
  (0 << 24) | k, so it collides with other cells' anchors and belongs to no
  story the cross-reference index holds; the link resolved to Anchor(1) and
  the PDF left the annotation out without a word.
- the index's topic cross-references go in at the start of the first story
  with text after the ranges are recorded, so the ranges for that story are
  shifted with the markers; a range left alone covered the wrong nine bytes.

Rebased onto the post-split main, hunk by hunk: the Importer struct, its
fields, the element scan, hyperlink_list and finish are in import.rs, while
StoryBuilder, walk_story and the anchor list are in import/story.rs. finish
answers (Document, Vec<String>) so the warnings reach the caller.

* An anchor a hyperlink cannot mean is refused, not ignored

This branch carries its own copy of `dest_param`'s anchor arm -- the IDML import
needed anchors as link destinations and added it here independently of #1555 --
and it has the same hole, so review is right that the fix has to be here as well
rather than only on that PR.

`dest_param` returns `Result<Option<_>>`. `None` still means no destination was
given, which `hyperlink.edit` needs for an edit that only renames; an `anchor`
that is given and names none is an error.

An unknown *id* was accepted outright, since `as_u64` answers for any number, so
a link was stored to an anchor nobody has and the export quietly left it out. On
`hyperlink.edit` the `None` read as "no destination given", so the command
reported success and kept the old destination, which is the case review
reported. An unknown *name* did already fail on `hyperlink.create`, but with
"give `url`, `email`, `page` or `anchor`" -- the wrong problem named.

The same change is on #1555, deliberately: each PR introduces this code on its
own line and each has to be right on its own. Whichever lands first, the other's
conflict is the same text on both sides.

* IDML export: a document's hyperlinks are written out (#1446)

Import reads hyperlinks now, but export dropped them, so a round trip lost
every link the document had. The three elements IDML wants are written: a
destination, a source, and a `Hyperlink` joining them.

A link on a run of text is a `HyperlinkTextSource` around the ranges it
covers, and the element nests inside a `ParagraphStyleRange`, so a link whose
text crosses a paragraph is written as one source per paragraph and each piece
stays clickable. Consecutive ranges of one link share a single source element.

Carries both review fixes:

- a link to an anchor whose text has been deleted is not written. The anchor
  is resolved first, as the page destination's page already was, so the file
  cannot hold a `Hyperlink` whose `Destination` names no element.
- every `Self` names one element. Three links on one frame wrote three
  `HyperlinkPageItemSource` elements all called i12, and each link to a page
  pushed another `HyperlinkPageDestination`; the item source carries the
  link's index now, and the page destination is written once per page as
  url_dest_el already did for URLs. The round-trip test collects every `Self`
  in the designmap and asserts none repeats, so an element added later is
  covered without anyone remembering to extend it.

Rebased onto the post-split main, on top of the rebased #1652: the `Ex` state
is in export.rs, the hyperlink elements are written in export/designmap.rs
with url_dest_el, fnv and has_self beside their only caller, and the run
cutting and wrapping is in export/story.rs.

* Split the hyperlink and index-marker steps out of Importer::run, under clippy's complexity limit

* Split the hyperlink and index-marker steps out of Importer::run, under clippy's complexity limit

* Split the hyperlink steps out of story_para, under clippy's complexity limit

* IDML import: say when a link's frame is anchored in text, which PDF export cannot place yet

---------

Co-authored-by: skylar taylor-barrick <hi@skylar.cc>
The blocks come from craft-contrib at dde09ea31e2e457f5b4653a6e76f7cdf55944bdf. CLAUDE.md imports AGENTS.md. The house-rules workflow checks the copy.
Copy the shared house rules into AGENTS.md
Fixes #2410.

- crates/idml/src/import/table.rs
- crates/idml/src/import/styles.rs
- crates/idml/src/export/table.rs
- crates/idml/src/export/styles.rs
- crates/idml/tests/autocraft_regression_2410.rs
Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423)
Some checks failed
ci.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (push) Failing after 0s
house-rules.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (push) Failing after 0s
packaging-lint.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (push) Failing after 0s
sonarcloud.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (push) Failing after 0s
ci.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (pull_request) Failing after 0s
house-rules.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (pull_request) Failing after 0s
packaging-lint.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (pull_request) Failing after 0s
sonarcloud.yml / Fix [Bug Report] [DesignCraft] Image content and frame don't move together (#2423) (pull_request) Failing after 0s
e977f82558
Fixes #2422.

- crates/engine/src/cmd/object.rs
- crates/engine/tests/autocraft_regression_2422.rs
alf merged commit e977f82558 into main 2026-11-07 08:55:31 +00:00
alf deleted branch chore/sync-upstream-20261107 2026-11-07 08:55:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
iris/designcraft!20
No description provided.