Skip to content

fix(ui): preserve titles, navigation and console copy in UI bundles - #18

Open
Hanabi9248 wants to merge 5 commits into
IvorySQL:mainfrom
Hanabi9248:codex/quoted-title-tags-oct26
Open

Hanabi9248 wants to merge 5 commits into
IvorySQL:mainfrom
Hanabi9248:codex/quoted-title-tags-oct26

Conversation

@Hanabi9248

@Hanabi9248 Hanabi9248 commented Oct 26, 2026 •

Copy link
Copy Markdown

This PR fixes five UI failures in the bilingual sources and the ZIP bundles loaded by the playbooks. Each fix remains a separate logical commit.

  1. Quoted attributes in titles, such as pass:[<span data-meaning="left > right">Quoted</span>], leave an attribute suffix in page titles. The detag helper now recognizes single- and double-quoted attributes.
  2. A supported AsciiDoc [id="rate%"] heading and <<rate%,target>> xref throw URIError during navigation initialization. Catch only URIError and retain the original fragment in both decoding locations. Successful percent decoding is unchanged. [[rate%]] does not generate the target and is excluded; valid-escape %25 ambiguity is outside this change.
  3. AsciiDoc link:#destination[Open destination,window=_blank] and named-window links produce explicit HTML targets, but the scroll enhancement cancels their default navigation and scrolls the current page. Register that enhancement only for links without a target or targeting _self; leave other targets to browser navigation.
  4. With Antora’s supported urls.html_extension_style: drop, pagination from guide/index.adoc (/docs/1.0/guide/) to guide.adoc (/docs/1.0/guide) previously rendered . and returned to the directory. Preserve the distinct extensionless sibling as ../guide, including fragments, in both helpers and ZIPs. The checked-in playbooks use the default extension style; this case requires the supported drop configuration and suitable server routing.
  5. Asciidoctor literal console blocks with supported [subs="+quotes"] can contain several text and inline markup nodes. Promoting only the first node to code truncated the copied command. Move every original node, in order, into the console wrapper in both scripts and loaded ZIPs.

Validation:

  • Quoted-title commit fee6f1813d01dce8091340629a0351d77de68a57: real Asciidoctor 2.2.9 and Handlebars 4.7.9; source helpers baseline 4 failures / 2 controls -> 6 pass, independently extracted UI bundles 4 failures / 2 controls -> 6 pass.
  • Literal-percent commit 889f8ac73d63882ff54020a290e46fee418099b1: real Asciidoctor and JSDOM 11.12.0 execute each complete site.js. Bilingual percent/plain/Chinese IDs across click, initial hash and hashchange: source baseline 6 URIError failures / 12 controls -> 18 pass; independently extracted UI bundles baseline 6 failures / 12 controls -> 18 pass.
  • Explicit-target commit 08906bb21f40f6b39c4753ae6abd13d29f994ec6, built directly on the preceding commit: real Asciidoctor output and both complete scripts. Source baseline 4 target failures / 4 ordinary-link controls -> 8 pass; independently extracted final UI bundles 4 failures / 4 controls -> 8 pass. Cases cover _blank, a named target, no target and _self in both languages. Assertions verify actual converted attributes, event cancellation, current-context hash and scroll calls.
  • JSDOM has no layout engine: offsets, toolbar geometry and scrollTo observation are explicit boundaries. Target generation, DOM lookup, hash handling, event dispatch and complete script execution are real. The target tests prove the handler preserves default navigation; they do not prove a real new window opens.
  • The explicit-target commit changes only js/site.js inside each preceding ZIP. All quoted-title payloads, literal-percent handling and unrelated archive entries remain intact. Entry order, timestamps, permissions, compression methods, comments and extra metadata are checked. CN ZIP mode 100755 is retained; recompression changes binary archive bytes.
  • Node 24.19.0 on Windows; CPU1, aggregate 768MiB, 16 processes, private TMP and BLAS1. Peaks: title 204304384 bytes, fragment 172359680 bytes, target 168353792 bytes. Existing dependencies only. Accepted title/fragment tests were not replayed for the target commit.
  • Initial target archive assembly stopped on a ZipInfo permission-metadata check before candidate execution. Metadata was corrected; existing baseline results were retained and each candidate source/bundle test ran once.
  • Extensionless-sibling commit 64aaac7c891d1ee2806b6005d0b0c51f45c37d3e: actual Antora 3.1.7 ContentCatalog, AsciiDoc loader, navigation builder, page-composer UI model and Handlebars pagination partial. Baseline 4 wrong-link failures / 6 controls -> candidate 10 pass / 0 skip. The fixture asserts the generated URLs, internal navigation entry and pagination attribute before the link assertion. CPU1, aggregate 768MiB, 16 processes, private TMP and BLAS1; peak 113106944 bytes. Initial wrapper metadata assertion expected TAP but Node 24 emitted the spec reporter; saved product logs were verified without rerunning tests. Each ZIP differs from preceding head 08906bb only at helpers/relativize.js; that entry and its partial/helper dependencies are byte-identical to the tested source. All other payloads and archive metadata are preserved. This is byte-equivalence verification, not an additional bundle runtime run. The test default root was corrected for repository installation after the isolated runs; those runs explicitly selected the source and dependency roots. Real server routing, full Antora generation, browser navigation and PDF output were not tested.
  • Full Antora generation, real browser/new windows/layout, PDF generation, deployment, unrelated responsive UI and other Node versions were NOT_RUN. No hosted CI pass is claimed.

Commands: node --test tests/detag-title.test.cjs, node --test tests/site-fragment.test.cjs, node --test tests/site-link-target.test.cjs, and node --test tests/relativize-template.test.cjs. Existing dependency overrides: DOC_TOOL_MODULE_ROOT and DOC_DOM_MODULE_ROOT for target tests; the earlier tests retain their documented dependency/source overrides.

The pagination regression also accepts RELATIVIZE_SOURCE_ROOT and RELATIVIZE_DEPENDENCY_ROOT for isolated source and installed-dependency directories. Antora documents extensionless server requirements at https://docs.antora.org/antora/3.1/playbook/urls-html-extension-style/ .

Literal console-copy commit 64a23cce50f3337a3e1c70e7929e271c7af9cf95: real Asciidoctor 2.2.9, original Handlebars templates and complete bilingual site scripts. Two formatted-literal cases fail on baseline truncated code and pass after the fix; eight controls preserve plain literals, source console blocks, absent Clipboard API and rejected clipboard behavior. Acceptance is staged: the initial candidate had eight passing cases and two harness errors because JSDOM 11 lacks MutationObserver; after removing that unavailable observation requirement, only those two controls were rerun and passed on both variants. Previously passing cases were not replayed. Clipboard writeText is an explicit external API recorder/rejection boundary; textContent supplies JSDOM innerText only for visible text/strong content, while the primary node-loss assertion independently checks DOM node identity/order. No OS clipboard, real browser/layout or full site generation was tested. CPU1/768MiB whole job/16 processes/private TMP/BLAS1; peak 165433344 bytes. Node syntax checks pass. Each new ZIP changes only js/site.js, byte-identical to the tested script; all other payloads, order and metadata are preserved. This is archive byte-equivalence checking, not additional bundle runtime testing. Run: node --test tests/site-copy-literal.test.cjs; dependency/source overrides DOC_TOOL_MODULE_ROOT, DOC_DOM_MODULE_ROOT, DOC_TEMPLATE_ROOT and DOC_COPY_SOURCE_ROOT are supported.

Keep greater-than characters inside quoted HTML attributes from prematurely
ending a tag match. Update both language helper sources and the UI bundles
actually referenced by the playbooks, preserving unrelated archive entries.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
Handle URIError without aborting navigation or anchor initialization for
supported AsciiDoc named IDs. Update both complete UI assets and bundled
ZIP payloads, retaining the previously accepted quoted-title fix.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
@Hanabi9248 Hanabi9248 changed the title fix(ui): strip quoted tag attributes from generated titles fix(ui): preserve quoted titles and literal-percent section anchors Oct 26, 2026
Only intercept fragment links targeting the current window. Leave
_blank and named contexts to browser navigation while retaining normal
same-page scrolling. Test real Asciidoctor output with both complete
bilingual scripts and independently extracted UI bundles.

Preserve the existing quoted-title and literal-percent fixes, all other
archive payloads and checked archive metadata. Actual new-window opening
and full browser layout remain untested.

Assisted-by: Codex:0.165.0-alpha.1.2
Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
@Hanabi9248 Hanabi9248 changed the title fix(ui): preserve quoted titles and literal-percent section anchors fix(ui): preserve titles and fragment link navigation Oct 28, 2026
Preserve Antora drop-style pagination between guide/index.adoc and
its extensionless sibling in both sources and shipped UI bundles.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
@Hanabi9248 Hanabi9248 changed the title fix(ui): preserve titles and fragment link navigation fix(ui): preserve titles and navigation in bilingual UI bundles Oct 28, 2026
@Hanabi9248 Hanabi9248 changed the title fix(ui): preserve titles and navigation in bilingual UI bundles fix(ui): preserve titles, navigation and console copy in UI bundles Oct 29, 2026
@Hanabi9248
Hanabi9248 force-pushed the codex/quoted-title-tags-oct26 branch 2 times, most recently from a541bae to 64a23cc Compare October 30, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant