Surfaced during testing of the 5-2-tools-align cut (PR #564). The TPEN_CONTEXT.canvases array sent to tool iframes only includes pages from the single layer that contains the active page. For a project with multiple layers (e.g. "Layer 1 Page 1" + "Layer 2 Page 1"), only the active layer's pages reach the tool — Compare-Pages' dropdown is correspondingly limited.
This is a pre-existing gap, not introduced by #564. The legacy CANVASES payload (now removed) used the same single-layer .find(layer)?.pages?.flatMap(...) shape (see 1196c28:components/simple-transcription/index.js lines 1070-1072), so #getActiveLayerCanvases was a faithful 1:1 port — but the constraint pre-dates the contract cleanup and is worth lifting.
Required change
Broaden #getActiveLayerCanvases (in components/simple-transcription/index.js) to flatten across all layers, not just the active one. Likely shape:
#getProjectCanvases() {
return TPEN.activeProject?.layers
?.flatMap(l => l.pages ?? [])
.map(p => ({ id: p.target, label: p.label })) ?? []
}
Consider renaming to #getProjectCanvases since "active layer" no longer describes the result. Update the JSDoc on #buildTPENContext to clarify the list spans all layers.
Companion repo
Compare-Pages (CenterForDigitalHumanities/Compare-Pages) consumes canvases directly without filtering, so no code change is needed there once this lands. Its PR CenterForDigitalHumanities/Compare-Pages#3 will start showing the cross-layer list automatically.
Verification
On a multi-layer project, open /transcribe, attach Compare-Pages, and confirm the dropdown lists every page across every layer.
Surfaced during testing of the
5-2-tools-aligncut (PR #564). TheTPEN_CONTEXT.canvasesarray sent to tool iframes only includes pages from the single layer that contains the active page. For a project with multiple layers (e.g. "Layer 1 Page 1" + "Layer 2 Page 1"), only the active layer's pages reach the tool — Compare-Pages' dropdown is correspondingly limited.This is a pre-existing gap, not introduced by #564. The legacy
CANVASESpayload (now removed) used the same single-layer.find(layer)?.pages?.flatMap(...)shape (see1196c28:components/simple-transcription/index.jslines 1070-1072), so#getActiveLayerCanvaseswas a faithful 1:1 port — but the constraint pre-dates the contract cleanup and is worth lifting.Required change
Broaden
#getActiveLayerCanvases(incomponents/simple-transcription/index.js) to flatten across all layers, not just the active one. Likely shape:Consider renaming to
#getProjectCanvasessince "active layer" no longer describes the result. Update the JSDoc on#buildTPENContextto clarify the list spans all layers.Companion repo
Compare-Pages (CenterForDigitalHumanities/Compare-Pages) consumes
canvasesdirectly without filtering, so no code change is needed there once this lands. Its PR CenterForDigitalHumanities/Compare-Pages#3 will start showing the cross-layer list automatically.Verification
On a multi-layer project, open
/transcribe, attach Compare-Pages, and confirm the dropdown lists every page across every layer.