Skip to content

refactor!: render ASTRA records with shared UI and brand packages - #10

Closed
EiffL wants to merge 2 commits into
mainfrom
refactor/astra-ui-rendering
Closed

EiffL wants to merge 2 commits into
mainfrom
refactor/astra-ui-rendering

Conversation

@EiffL

@EiffL EiffL commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

  • consume MySTRA's versioned astra-publication-bundle.v1 carrier as the exact @astra-spec/sdk resolved bundle, then derive canonical record/analysis indexes with the SDK
  • render canonical inline references as @astra-spec/ui buttons and record dialogs, scoped with the published @lightcone-research/brand adapter
  • rejoin MyST-rewritten artifact URLs to SDK bindings by outputPath and cacheToken, with bounded table/metric loading and safe figure policies
  • leave ASTRA block carriers on upstream MyST renderers, preserving the readable neutral AST instead of maintaining parallel block markup
  • remove the obsolete resolved-store mirror, bespoke cards/renderers/citation helpers, legacy CSS system, and its stale design-mirror workflow

This is the clean successor to #8. It keeps that PR's shared-UI direction while using the now-published SDK/UI/brand packages and deliberately avoids its page-chrome and broad renderer forks.

Companion producer change: LightconeResearch/MySTRA#25.

Publication boundary

The overlay accepts only this carrier version:

{
  schemaVersion: 'astra-publication-bundle.v1',
  activeAnalysisPath: string,
  bundle: ResolvedAnalysisBundle,
}

Carrier data is validated before indexing. Unsupported or malformed documents degrade to the neutral MyST output rather than breaking the page. Static resources are consumed only from the dedicated sibling carrier, require matching SDK cache tokens, and reject active/protocol-relative URL schemes.

Artifact previews are intentionally bounded:

  • known browser image formats with a 25 MiB SDK descriptor limit
  • CSV/TSV/JSON table and JSON metric responses streamed to a 1 MiB hard limit
  • required, format-appropriate response media types
  • explicit states for pending, unavailable, stale, unsupported, and oversized artifacts

Upstream maintenance

The copied MyST applications remain nearly untouched. The ASTRA-specific app-shell diff is limited to four files:

  • Article.tsx / ArticlePage.tsx: mount the DOM-transparent publication provider around rendered article surfaces
  • each root.tsx: retain the overlay stylesheet seam and remove external font links now bundled by the brand package

There are no local header, navigation, route, or upstream content-component forks. The renderer map overrides only canonical ASTRA inline spans; every block stays on the upstream renderer. Contract parsing, dialogs, artifacts, and styles live under packages/astra, so future myst-theme updates can be applied first and the small seams reapplied afterwards.

Breaking alpha cleanup

No legacy compatibility layer is retained:

  • removes @astra-spec/store-types and the old serialized-store/provider model
  • removes custom decision/finding/output/value/data-source/sub-analysis renderers and hover cards
  • removes the local DOI/citation rendering path; shared UI derives literature from the resolved SDK document
  • replaces the hand-built design token system with public UI CSS plus the Lightcone brand adapter
  • requires Node.js 20, matching the new SDK packages

Verification

  • npm ci
  • npm test — 21 tests
  • npm run typecheck — overlay, article, and book workspaces
  • npm run build — production article and book builds
  • git diff --check

Build note

The legacy Remix 1 compiler prints a non-fatal resolver warning for @astra-spec/sdk because SDK 0.1.1 exposes an import-only conditional export while the server build targets CommonJS. Both production builds complete, and their metafiles contain the SDK implementation with no external SDK import. Adding a default export condition in a future SDK patch will remove the diagnostic without a theme change.

Signed-off-by: EiffL <fr.eiffel@gmail.com>
@EiffL

EiffL commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

The parity implementation is complete and validated locally, but I am keeping this PR draft until the shared preview API is published.

Dependency stack:

  1. fix: consume the published Lightcone brand adapter astra-ui#8 fixes clean published-brand consumption.
  2. feat: add accessible hover and focus record previews astra-ui#9 adds the accessible PreviewPopover and RecordPreview APIs.
  3. Merge those PRs and publish @astra-spec/ui@0.0.3.
  4. This branch can then pin ^0.0.3, regenerate its clean lockfile, push the final theme commit, and rerun CI.

Current local verification is green: 33 theme tests, all workspace typechecks, article/book production builds, and a live DESI browser audit. The live article has 57 rich references, 5 output provenance drawers, 28/28 caption equations rendered as KaTeX, upstream <figure> semantics, and the astra-theme/main preview chrome with the new hover/focus interaction.

@EiffL EiffL closed this Aug 30, 2026
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