fix: restore TOC listings for publications without revisionDesc/@status#612
Merged
Merged
Conversation
The anticipated-volume guard added in 4e2e4c3 suppressed the table of contents for any document lacking tei:revisionDesc/@status = "published" or "partially-published". FRUS volumes all carry that attribute, but Milestones, FAQ, HAC, Short History, Buildings, Conferences, and FRUS History TEI do not, so their article/section listings rendered empty. The site's nginx cache masked the regression until the caches were repopulated. Suppress the TOC only when a document actually carries tei:revisionDesc/@status and none of its values is published or partially-published, preserving the anticipated-volume behavior for FRUS while restoring listings everywhere else. Add Cypress regression tests asserting the listings are present on the affected page types and that the FRUS suppression still works. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
🎉 This PR is included in version 3.12.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[This PR was prompted by Joe, drafted by Claude Code, and reviewed by Joe.]
Problem
Reports came in today of missing content on production: the article listings on Milestones chapter pages (e.g.
/milestones/1750-1775), the FAQ listing (/about/faq), the HAC listing (/about/hac), and the Short History chapter listing (/departmenthistory/short-history) all render an empty<div class="toc"></div>where the table of contents should be. The regression was invisible until now because the site's nginx caches had served year-old copies of these pages; repopulating the caches yesterday exposed it.Root cause
Commit 4e2e4c3 (2025-09-29, first released in v3.10.11) added a guard to
toc:toc()inmodules/frus-toc-html.xqmso that anticipated (not-yet-published) FRUS volumes — whose TEI may contain just chapter titles — don't display a table of contents:Every FRUS volume carries
tei:revisionDesc/@status, so the guard behaves correctly there. Buttoc:toc()is shared by every publication that renders a TOC – including Milestones, FAQ, HAC, Short History, Buildings, Conferences, and FRUS History. These generally have notei:revisionDesc/@statusat all (nine Milestones chapters have arevisionDescwithout@status; the rest have none). For all of those, the guard evaluated to false and the TOC was silently suppressed.Fix
Suppress the TOC only when the document actually carries
tei:revisionDesc/@statusand none of its values ispublishedorpartially-published. Documents without the attribute always show their TOC, restoring the pre-v3.10.11 behavior for non-FRUS publications while preserving the anticipated-volume suppression for FRUS.Verified against a container built from
joewiz/hsg-project:latest:/milestones/1750-1775,/about/faq,/about/hac,/departmenthistory/short-history,/departmenthistory/buildings, and/conferences/2010-southeast-asiaall render their listings againfrus1937v04) and partially published (frus1969-76ve10) volume landing pages still show their TOCfrus1981-88v16, statusbeing-cleared) still suppresses its TOCTests
The existing Cypress specs for these pages only assert headlines, which is why the regression passed CI. This PR adds
tests/cypress/e2e/ui-components/table-of-contents.cy.js, which asserts that the TOC listings contain links on all four reported page types and on a published FRUS volume landing page, and that an anticipated FRUS volume still suppresses its TOC. Run against the broken code, the four publication-listing tests fail and the two FRUS tests pass; against the fix, all six pass.🤖 Generated with Claude Code