Skip to content

[AAASM-3758] ✨ (hub): Add hub-level version/module switcher to docs landing#44

Merged
Chisanan232 merged 3 commits into
mainfrom
v0.0.1/AAASM-3758/hub_version_switcher
Jun 26, 2026
Merged

[AAASM-3758] ✨ (hub): Add hub-level version/module switcher to docs landing#44
Chisanan232 merged 3 commits into
mainfrom
v0.0.1/AAASM-3758/hub_version_switcher

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

Description

Adds a hub-level module + version switcher to the docs hub
(docs.agent-assembly.com). Per-module switchers were restored in #41/#42/#43,
but the hub landing itself had none — you had to open a module first to change
its version. This adds a persistent header on every hub page (rendered via
docs/theme/head.hbs, the same vanilla-JS widget-injection pattern as the
existing search / feedback / consent widgets) with a module dropdown and a
version/channel dropdown; selecting both navigates to
/<subpath>/<channel-or-tag>/.

It is driven entirely by the aggregated manifests the build already produces
no hard-coded version strings:

  • /modules.json — the build's own registry, now copied verbatim into public/
    by docs/scripts/aggregate.sh; the widget reads each module's name + subpath.
  • /<module>/versions.json — the same manifest each module's own per-version
    switcher reads. The widget handles both shapes the aggregation emits: the
    mdBook {channels[], archived[]} shape (core) and the mike array
    [{version,title,aliases}] shape (python-sdk).

Graceful degradation (AC #4): a module with no versions.json (node-sdk,
go-sdk) is still listed and its option links to the module root; a hub built
standalone with no aggregation has no /modules.json and the widget silently
no-ops (exactly like the Pagefind search widget above it).

The per-module switcher logic is not touched, and no release-ordering
dependency is introduced.

Type of Change

  • ✨ New section or feature documentation
  • 🔧 Configuration / CI change

Related Issues

  • Related Jira ticket: AAASM-3758

Documentation Checklist

  • cd docs && mdbook build passes locally with no warnings
  • All internal cross-links verified
  • Page registered in docs/src/SUMMARY.md (N/A — header widget, not a new page)
  • Self-hosted instructions not included (SaaS-only scope)
  • "Last reviewed" footer updated (N/A — no content page edited)
  • Commits follow GitEmoji convention and are small / atomic

How verified

  • bash -n docs/scripts/aggregate.sh — syntax OK; cp $REGISTRY public/modules.json
    • a verify_manifest public/modules.json gate added to the existing
      manifest-presence checks.
  • cd docs && mdbook build — hub renders; rendered index.html contains the
    .aa-modswitch widget; {{ path_to_root }} resolves correctly (ROOT='' at
    root domain).
  • End-to-end: extracted the real widget script from the rendered HTML and ran
    it under a Node DOM shim against a local HTTP server serving a mini aggregated
    tree (real modules.json + core/python versions.json, node/go intentionally
    without one). Confirmed: module list = Core / Python SDK / Node SDK / Go SDK;
    core lists latest, pre-release, archived tags → /core/pre-release/;
    python lists mike versions+aliases → /python-sdk/<v>/; node/go fall back to
    /node-sdk/, /go-sdk/ roots.

Browser screenshot not attached — Chrome isn't available in this environment;
validated instead by running the actual widget code end-to-end under a Node DOM
shim against a live server (above).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cc1vBBiNxp9qLKQ5Gq85w8

Chisanan232 and others added 3 commits June 26, 2026 08:36
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cc1vBBiNxp9qLKQ5Gq85w8
A persistent, manifest-driven selector on every hub page: reads
public/modules.json for the module list and each /<module>/versions.json
for that module's versions/channels, then navigates to
/<subpath>/<channel-or-tag>/. No hard-coded version strings. Modules
without a versions.json (node-sdk, go-sdk) degrade to the module root;
a standalone hub build with no manifests silently no-ops.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cc1vBBiNxp9qLKQ5Gq85w8
…tput

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cc1vBBiNxp9qLKQ5Gq85w8
@Chisanan232

Copy link
Copy Markdown
Contributor Author

✅ Claude Code review — APPROVE-ready

CI: Aggregate all module docs green (the real end-to-end test — it clones every module, builds, and runs the full aggregation) + SonarCloud green.

Scope vs AAASM-3758: matches all four ACs.

  • Hub landing gets a persistent module + version/channel switcher (docs/theme/head.hbs).
  • Driven entirely by the aggregated manifests — /modules.json (newly emitted from the build's own registry) + each /<module>/versions.jsonno hardcoded versions. Handles both manifest shapes the pipeline emits: mdBook {channels[],archived[]} and mike [{version,title,aliases}].
  • Selecting module+version navigates to /<subpath>/<channel-or-tag>/; {{ path_to_root }} keeps it base-path-aware (root domain and github.io subpath).
  • Graceful degradation: modules without versions.json (node/go today) still listed, fall back to module root; standalone hub build with no /modules.json silently no-ops.

Side-effect check: no regression. The widget lives in the hub's own mdBook theme head, so it affects only hub pages — the per-module subsites (built by their own toolchains) and their restored switchers are untouched. The aggregate.sh change is an additive cp modules.json public/ + a verify_manifest presence gate (consistent with the existing manifest checks); the green Aggregate run proves the gate passes and the pipeline still produces every module. No release-ordering dependency added. Injection pattern mirrors the existing search/feedback/consent widgets.

Validated by the agent: bash -n + mdbook build clean; widget extracted from rendered HTML and run under a Node DOM shim against a mini aggregated tree with real modules.json + core/python versions.json (node/go intentionally without) — module list and all navigation paths confirmed. (Browser screenshot not possible in-env; DOM-shim e2e used instead.)

Ready to merge. — Claude Code

@Chisanan232 Chisanan232 merged commit 7f597ff into main Jun 26, 2026
3 checks passed
@Chisanan232 Chisanan232 deleted the v0.0.1/AAASM-3758/hub_version_switcher branch June 26, 2026 00:45
@sonarqubecloud

Copy link
Copy Markdown

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