Commit Graph

8 Commits

Author SHA1 Message Date
Martha Schumann 75334a1c78 fix(shell-docs): address review feedback on checkComponentImports
Derive snippet component names from SNIPPET_MAP in docs-render.tsx at
runtime instead of maintaining a hardcoded 35-entry set that was already
13 entries behind. Replace name-level handledByInline gate with per-match
inline pattern check to fix a false-negative path. Align function
signature with sibling check functions. Add 3 unit tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-26 10:31:41 -07:00
Tyler Slaton 7e1ec07b70 fix(shell-docs): CR Round 1 bucket-a fixes — content + nav + MDX overrides + script hardening
Six fixes from CR Round 1 partition, all bucket (a):

- frontend_tools.py: docstring claimed the file was "Chat Customization
  (CSS) demo" but langgraph.json wires it as the Frontend Tools demo
  graph, and the new MDX setup snippets cite this exact file via the
  freshly-added `# region: middleware` markers. Users following the
  langgraph-python copilot-middleware setup would see CSS-demo wording
  on a Frontend Tools page. Rewrote the docstring to match what the
  cell actually demonstrates (mirroring the sibling
  frontend_tools_async.py phrasing).

- page.tsx mergeFrameworkNav: when introNode was non-null AND the root
  nav had no "Get Started" section, introNode was prepended to rootNav
  shifting every existing index +1. The adjustment block only added +1
  when getStartedIdx !== -1, so the splice-back position for the
  framework section was off-by-one in the no-Get-Started branch — the
  framework header rendered one slot too early in the sidebar.

- docs-page-view.tsx h2/h3 overrides: `{...rest}` was spread AFTER
  `id={id}`, so an MDX-supplied `<h2 id="custom">` would override the
  slugified id and silently break the TOC anchor + any inbound deep-
  links keyed on the slug. Reordered the spread so rest comes first
  and the slug-id always wins.

- probe-shell-docs.ts: terminated with bare `main();` while every
  sibling script (audit-docs-porting, verify-shell-docs) wraps in
  `.catch(e => { console.error(e); process.exit(1); })`. A rejected
  main() would surface as an unhandled rejection on older Node
  runtimes and exit 0 in CI, masking failure. Aligned with the
  established pattern.

- verify-shell-docs.ts: all four regex checks (InlineDemo refs,
  Snippet regions, internal links, alias imports) scanned page.body
  raw without first stripping fenced code blocks. Any docs page that
  showed example code containing `<InlineDemo demo="x" />`,
  `[link](/path)`, or `import x from "@/..."` triggered a false-
  positive validator failure. Mirrors audit-docs-porting.ts's
  FENCED_CODE_RE approach. Adds a regression test that fails without
  the strip.

- 3 new MDX content fixes:
  * mcp-apps.mdx + open-generative-ui.mdx: removed duplicate `<Callout>`
    "Free course" blocks (the same Callout appeared twice on each
    page, separated only by the Key Benefits list).
  * subagents.mdx: changed `[OnStateChanged, OnRunStatusChanged]` to
    `[UseAgentUpdate.OnStateChanged, UseAgentUpdate.OnRunStatusChanged]`
    — the bare identifiers aren't exported (the reference doc
    `useAgent.mdx` confirms the qualified form), so a user copying
    the snippet would hit an import error.

Call-site enumeration:
  - frontend_tools.py: only langgraph.json + the new setup MDX files
    reference this file by name; both consume the region markers, not
    the docstring. Docstring rewrite has zero call-site impact.
  - mergeFrameworkNav: single caller (FrameworkScopedDocsPage at this
    file's bottom). The new branch covers a strictly broader case;
    the original splice/replace paths are unchanged.
  - h2/h3: only used by the MDXRemote `components` map below. Spread
    order is a local prop-precedence change; no upstream callers.
  - probe-shell-docs main(): no external callers.
  - verify-shell-docs check functions: 4 exported functions called
    from runChecks() below + the test file. Strip is internal to each
    function so signature is unchanged.
  - UseAgentUpdate: confirmed exported from `@copilotkit/react-core/v2`
    per reference doc useAgent.mdx; no implementation change needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 12:02:42 -07:00
github-actions[bot] 32737977f7 style: auto-fix formatting 2026-05-20 18:07:03 +00:00
Tyler Slaton c573fd0622 feat(showcase): verifier checks @/snippets and @/components import paths 2026-05-19 13:36:34 -07:00
Tyler Slaton c485ec8981 feat(showcase): verifier checks internal markdown links against known routes 2026-05-19 13:36:04 -07:00
Tyler Slaton 4a56b958dc feat(showcase): verifier checks <Snippet> regions against demo-content 2026-05-19 13:35:32 -07:00
Tyler Slaton 11a351d4b9 feat(showcase): verifier checks <InlineDemo> ids against registry 2026-05-19 13:34:56 -07:00
Tyler Slaton 52ffd2ee8a feat(showcase): scaffold shell-docs verifier with nx build check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 13:31:07 -07:00