Skip to content

fix(remixer): skip ShowOrg prefix when reused page already calls it - #986

Merged
jakeaturner merged 1 commit into
stagingfrom
fix/duplicated-show-org
Sep 29, 2026
Merged

jakeaturner merged 1 commit into
stagingfrom
fix/duplicated-show-org

Conversation

@jakeaturner

Copy link
Copy Markdown
Collaborator

handleImportedPage prepended the create-time content template to every imported page body. For topic-category and topic-guide placements, their templates have <p>{{template.ShowOrg()}}</p>, so a source page that already called ShowOrg rendered the org banner twice.

Check the composed body first and strip ShowOrg from the prefix when the call is already present, keeping only the template:tag-insert block. ShowOrg state stays owned by applyArticleKindToPage, which is already idempotent.

handleImportedPage prepended the create-time content template to every
imported page body. For topic-category and topic-guide placements, their
templates have `<p>{{template.ShowOrg()}}</p>`, so a source page that
already called ShowOrg rendered the org banner twice.

Check the composed body first and strip ShowOrg from the prefix when the
call is already present, keeping only the template:tag-insert block.
ShowOrg state stays owned by applyArticleKindToPage, which is already
idempotent.
@jakeaturner
jakeaturner requested review from yghaemi and a balanced review from Copilot September 29, 2026 19:40
@github-actions

Copy link
Copy Markdown

No actionable issues found in the changes to book-service.ts and remixer-service.ts. The shared helpers preserve existing behavior, and the import change avoids adding a duplicate ShowOrg call.

The checkout is shallow with no available merge base, so I reviewed the direct diff between the supplied commits.

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The focused change correctly reuses existing behavior and preserves article-kind handling.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents duplicate organization banners when Remixer imports pages already containing ShowOrg.

Changes:

  • Extracts reusable ShowOrg detection and removal helpers.
  • Omits ShowOrg from imported-page prefixes when already present.
File Description
server/​api/​services/​remixer-service.ts Avoids adding a duplicate ShowOrg call.
server/​api/​services/​book-service.ts Exposes shared ShowOrg helpers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jakeaturner
jakeaturner merged commit 3c1644b into staging Sep 29, 2026
8 checks passed
@jakeaturner
jakeaturner deleted the fix/duplicated-show-org branch September 29, 2026 19:56
@libretexts-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 2.154.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants