You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve docs-builder serve reliability and startup speed (#2982)
The serve command had several regressions that made the local authoring
workflow frustrating: editing docset.yml no longer reloaded properly,
adding/removing/renaming files required a full restart, OpenAPI generation
blocked startup, CTRL+C was slow to cancel, and the diagnostics HUD
disappeared after the first file change.
This fixes all of those issues and adds a quality-of-life improvement
that preserves navigation tree state across live reloads.
Configuration reload on file changes:
- Add BuildContext.ReloadConfiguration() to re-read docset.yml from disk
when config files or file structure changes, while skipping the
expensive re-parse for simple markdown content edits.
- Watch _docset.yml and toc.yml in addition to docset.yml and *.md so
navigation structure changes are detected without a restart.
- Preserve serve-mode feature flags (e.g. diagnostics panel) across
configuration reloads.
Lazy OpenAPI generation:
- Move OpenAPI document generation out of the startup path so the server
reaches "Now listening on" immediately instead of blocking on spec
parsing.
- Generate API references on-demand when the first /api/ request arrives,
with change detection so specs are only regenerated when modified.
Faster CTRL+C cancellation:
- Wire a service-scoped CancellationTokenSource through the reload
pipeline so in-flight reloads are cancelled promptly on shutdown,
replacing the previous Cancel.None that caused hangs.
Navigation state preservation (dev mode only):
- Persist expanded/collapsed navigation tree state to sessionStorage so
sections you had open stay open after a live reload, instead of
collapsing back to only the current page's ancestors.
- Gated behind the diagnostics panel presence check so it has zero
impact on production builds.
Made-with: Cursor
0 commit comments