Skip to content
This repository was archived by the owner on Nov 22, 2026. It is now read-only.

bundle: new content goes to the spread in view, not to a far-off selection - #12

Merged
drietsch merged 1 commit into
mainfrom
fix/placement-active-spread
Oct 18, 2026
Merged

drietsch merged 1 commit into
mainfrom
fix/placement-active-spread

Conversation

@drietsch

Copy link
Copy Markdown
Contributor

A new chart went beside the selection, on the selection's page, and a lowered range went at it, wherever that selection was. The bundle selects everything it places, so each placement followed the last one.

Where it showed

  • The chart wall. In the editor's 134-page showcase document, the recto's five charts landed on the verso, on top of the wall.
  • The formulas page. A range lowered on page 99 landed on the table selected on page 98, so page 99 lost its exhibit.
  • For a user. Select a table, scroll ten pages on, place a chart: it went back beside the table, on a page out of view.

The rule

selectionIsInView:

  • A selection still places new content while it is on the active page's spread, including a spread view's other page.
  • Once the view has moved to another spread, the active page wins, as InDesign places onto the spread in view.
  • With no active page, or no spreadId to compare, the selection counts as before.

Both chartPlacement and placementForContent use it.

Reads: with nothing selected they are unchanged, and the perf budgets pass unchanged. With a selection, the placement adds one document.meta read. It reads the pages only when the selection is on another page than the active one; chartPlacement already read them.

Tests

  • chart-placement.spec.ts: four cases for selectionIsInView (same page, no active page, the facing page, another spread, no spread ids).
  • Locally: tsc is clean; chart-placement and perf-budgets pass.
  • Locally failing, the same on main: object-model.spec.ts, wasm-fresh.spec.ts and one session-wave9 case. My local engine wasm is stale (wasm-fresh says so), so CI's fresh build decides those.

Version: 0.1.0-canary.24, with a row in docs/status.md.

🤖 Generated with Claude Code

…ction

A new chart went beside the selection, on the selection's page, and a
lowered range went at it, wherever that selection was. The bundle selects
everything it places, so the next placement followed the last one: in the
editor's showcase the recto's five charts landed on the verso, and a range
lowered on page 99 landed on the table selected on page 98. A user who
selects a table, scrolls ten pages on and places a chart got it back
beside the table, on a page out of view.

selectionIsInView: a selection still places new content while it is on
the active page's spread, a spread view's other page included; once the
view has moved to another spread the active page wins, as InDesign places
onto the spread in view. With no active page or no spreadId to compare,
the selection counts as before. chartPlacement and placementForContent
both use it; with nothing selected the reads are unchanged (perf budgets).

0.1.0-canary.24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@drietsch
drietsch merged commit 89ae789 into main Oct 18, 2026
4 of 5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant