Skip to content

[FEAT] Section-manifest ports for the stack, instrument, and mooring reports - #80

Merged
eleanorfrajka merged 13 commits into
mainfrom
rep/07-manifest-pages
Aug 18, 2026
Merged

[FEAT] Section-manifest ports for the stack, instrument, and mooring reports#80
eleanorfrajka merged 13 commits into
mainfrom
rep/07-manifest-pages

Conversation

@eleanorfrajka

Copy link
Copy Markdown
Collaborator

Summary

Finishes the report section-manifest rollout begun with grid (#79). The stack, instrument, and mooring pages are each ported onto the same declarative system — a per-page context + a registry of Panels wrapping the unchanged figure adapters, a Profile of ordered Sections, and one shared macro that renders every page. After this branch all four report pages render through resolve() + the shared report_body/panel macros; the page templates' content blocks are a single macro call, and the pre-manifest slot shim is gone.

It is one PR with separable, individually-re-baselined commits so each diff reads on its own (per-page ports, then cross-page polish from an eyeball-review pass).

What changed

All four pages are manifest-driven. Each page declares its sections/panels; the resolver generates the jump-nav, numbers the headings (content (1)…(N), appendices (A), (B)), renders each panel, and drops inapplicable sections to a "not applicable" footer. This fixes real defects: the mooring page's hand-typed numbering (it started at "2" and had a "3.5"), instrument's two mutually-exclusive "Current roses" headings, and stack's velocity headings that had no anchor id.

One shared body macro. report_body(report, na_scope, generated, cruise, yaml_path) in _macros.html renders the jump-nav + numbered section loop + footer; grid/stack/instrument/mooring content blocks are now just that call. Section numbers render in parentheses (1) Files in both headings and jump-nav; the duplicated literal "Jump to:" is dropped (.jump-nav::before supplies it).

Captions are a plain-text data field (*_CAPTIONS dicts, Unicode notation, rendered escaped) — never |safe — because they will become user-editable via a future config/report.yaml. Structured content (windows explainer, QC tables, analog list, NetCDF tables, the mooring pipeline/timing/calibration/issues blocks, the PDF diagram embed) renders through kind="html"/"table" sub-templates emitted |safe.

Layout. New Panel.slot=None (bare .fig, no width contract) for figures not rendered through the slot system, and new Section.layout="row" — a wrapping flex row that places slot="half" figures side-by-side (mooring knockdown HAB+anomaly, stack aquadopp/adcp trajectories) with a slot="full" figure wrapping to its own line.

NetCDF appendix split: (A) NetCDF variables (dimensions + variables + scalar metadata) and (B) NetCDF attributes (global attributes), on grid/stack/instrument.

Footer (shared): centered (matches ctdcast); drops the report-generator host (already in the file's processor_machine/processor_os metadata); adds the cruise and the oceanarray version; the mooring footer keeps its config-file path. oceanarray.__version__ is now exposed (from the setuptools-scm _version.py, with fallbacks) and shown when meaningful.

Slot-shim cleanup: deletes _slots._SLOT_BY_B64 + slot_for() (the slot now travels on the resolved panel); _slots.render keeps only width forwarding.

Also: re-vendored config/report_tokens.py + reports/_css.py byte-identical to ctdcast; fixed the current-direction colorbar (showed m s⁻¹, now ° with compass ticks); shared the history/NetCDF-table render helpers across pages; moved the figure collapse toggle into shared chrome.

Breaking changes

  • Report HTML layout changed on all four pages (output format). Section anchors are now the section ids (e.g. stack #temp/#sal/#pressure#hydrography, #dims/#vars#netcdf_variables/#netcdf_attributes; grid/instrument likewise); headings are numbered (N)/(A); the jump-nav is generated; captions are plain text (no <code>/<strong>). Sections whose data/instrument-type does not apply now appear in a "Not applicable" footer instead of being silently omitted. The instrument "Start & end windows" section id is deliberately preserved as #start (mooring deep-links to it). Migration: any external deep-link into a report anchor must use the new section-id anchors (an audit found none in this repo or the docs).
  • generate_stack_page / generate_instrument_pages / the mooring generator no longer take the per-figure keyword arguments — each builds its context and resolves a profile internally. No callers outside reports/ pass them.
  • Vendored _manifest.py model gained fields (Panel.slot now accepts None; new Section.layout; ResolvedSection.layout) — re-vendor to ctdcast alongside the PanelGroup/unavailable_if additions from # [FEAT] Report section-manifest model and resolver  #78.
  • Footer format changed (all pages): Generated by oceanarray v{version} • {cruise} • {date} (+ • config: {path} on mooring); the report-generator hostname is no longer shown.

@eleanorfrajka
eleanorfrajka merged commit ac63309 into main Aug 18, 2026
5 checks passed
@eleanorfrajka
eleanorfrajka deleted the rep/07-manifest-pages branch August 18, 2026 04:30
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