Skip to content

Render TypeScript API parameter descriptions - #2009

Merged
David Pine (IEvangelist) merged 1 commit into
mainfrom
aspireagent/ts-param-descriptions
Nov 1, 2026
Merged

David Pine (IEvangelist) merged 1 commit into
mainfrom
aspireagent/ts-param-descriptions

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #1287, part 1: the TypeScript API reference never showed parameter descriptions, so the TS withIconName page lacked the FluentUI icon hint that the C# page has.

Root cause: TsMemberCard.astro maps each TS parameter into MemberCardBase's Param shape but copied only name, type, isOptional and defaultValue. MemberCardBase already renders p.description as .mc-param-desc, but it never received one. This affects every TS function and method page that uses TsMemberCard: [module]/[item] function pages and [module]/[item]/[member] method pages.

The data already includes the text. In src/data/ts-modules/Aspire.Hosting.13.6.0.json, withIconName.parameters[0].description is "The name of the FluentUI icon to use. See https://aka.ms/fluentui-system-icons for available icons."

Fix: pass description: p.description through. This is a one-line change.

On part 2 of #1287 (the broken storybook link): the current generated data no longer contains storybooks.fluentui.dev and uses https://aka.ms/fluentui-system-icons instead. That text comes from upstream XML docs, so this PR doesn't change it.

Before / after

/reference/api/typescript/aspire.hosting/withiconname/ at 1440×900, Playwright Chromium, astro dev:

Before (main f05f556): parameters show only name and type.

Before: withIconName parameters without descriptions

After (this PR): each parameter shows its description, including the FluentUI hint.

After: withIconName parameters with descriptions

Third-party links and affiliations

None. The aka.ms FluentUI link appears only because it already exists in the generated API data; this PR doesn't add it.

Validation

  • Unit (regression): new TypeScript member cards render parameter descriptions test in tests/unit/api-reference-components.vitest.test.ts. It fails without the fix (× ... 83ms, 1 failed) and passes with it (2/2).

  • E2E (regression): new tests/e2e/api-reference-ts-parameters.spec.ts asserts that the iconName parameter on the TS withIconName page shows a visible .mc-param-desc with the FluentUI text.

    • Without the fix, locally against astro dev: fails with .mc-param-desc element(s) not found. The parameter row itself is found.
    • With the fix: 6/6 passed, desktop-chromium and mobile-chromium with --repeat-each=3 --retries=0.
  • eslint --max-warnings=0 is clean on the changed TS files. No local production build was run, per repo guidance; CI builds and runs the full E2E suite.

  • CI on exact head a98172ac (run 41198748955): all checks green. The E2E shards passed 250/246/210/248/243/208 with 0 flaky and 0 failed. The new spec passed on desktop-chromium, tablet-chromium and mobile-chromium.

🤖 Posted by AspireAgent (AI Agent)

TsMemberCard dropped each parameter's description when mapping the TS API
data into MemberCardBase, so TypeScript function and method pages showed
parameter names and types without their docs (e.g. the FluentUI icon hint
on withIconName, #1287).

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #2009. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #2009 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

@davidfowl
David Fowler (davidfowl) marked this pull request as ready for review October 31, 2026 12:23
Copilot AI balanced review requested due to automatic review settings October 31, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change restoring TypeScript API parameter descriptions.

No open issues 🎉

What changed in this PR

Restores parameter descriptions in the TypeScript API reference by passing existing API data to the shared member-card renderer. This addresses the missing FluentUI icon hint from #1287 without changing generated data or links.

Changes:

  • Pass parameter descriptions through TsMemberCard.
  • Add unit coverage for parameters with and without descriptions.
  • Add an end-to-end check that the withIconName page displays the FluentUI hint.
File Description
src/​frontend/​tests/​unit/​api-reference-components.vitest.test.ts Tests description rendering and omission when absent.
src/​frontend/​tests/​e2e/​api-reference-ts-parameters.spec.ts Checks the FluentUI parameter description is visible on the API page.
src/​frontend/​src/​components/​api-reference/​TsMemberCard.astro Forwards parameter descriptions to the shared renderer.

Review effort: Balanced

David Pine (IEvangelist) pushed a commit that referenced this pull request Nov 1, 2026
…2010)

## Summary

Related to #1287 (part 2: the broken Fluent UI icons link). Part 1 is
handled by #2009, which leaves this link unchanged.

The "Fluent UI: Icons catalog" link on **Custom HTTP commands** (English
and Japanese) pointed to
`https://storybooks.fluentui.dev/react/?path=/docs/icons-catalog--docs`.
That story no longer exists. microsoft/fluentui#35991 (merged
2026-04-15) deleted `apps/public-docsite-v9/src/Icons/IconsCatalog.mdx`
and the other local Icons stories. The React storybook now pulls in the
icons docsite as a composed Storybook ref, so the old
`icons-catalog--docs` deep link doesn't resolve.

The catalog now lives in the `microsoft/fluentui-system-icons` docsite,
defined by `packages/docsite/stories/Icons/IconsCatalog.mdx` with `<Meta
title="Icons/Catalog" />`, which gives story ID `icons-catalog--docs`.
That docsite is deployed to
`https://microsoft.github.io/fluentui-system-icons/`; its latest GitHub
Pages deployment (commit 883bef1, 2026-10-09) succeeded and contains
that file. This PR changes the link to:


`https://microsoft.github.io/fluentui-system-icons/?path=/docs/icons-catalog--docs`

It also adds `tests/unit/fluentui-icon-links.vitest.test.ts`, which:
- fails if any docs page links to the removed
`storybooks.fluentui.dev/react/?path=/(docs|story)/icons-*` stories, and
- checks that both `http-commands` pages link to the new catalog.

## Third-party links and affiliations

Changed:
`https://storybooks.fluentui.dev/react/?path=/docs/icons-catalog--docs`
→
`https://microsoft.github.io/fluentui-system-icons/?path=/docs/icons-catalog--docs`
(Microsoft's Fluent UI System Icons docsite). No affiliation beyond
Microsoft.

## Validation

- New regression test: **3 of 3 failed before the fix** (both pages
listed as offenders and missing the new URL), **3 of 3 pass after**.
- `bun run test:unit`: 85 files, 1123 passed, 1 skipped.
- `bun run lint`: passes. Prettier passes on the new test file. The two
MDX pages already show Prettier warnings on `main`, unrelated to this
one-line change.
- Rendered-page check: with Playwright against the local dev server,
`/fundamentals/http-commands/` and `/ja/fundamentals/http-commands/`
each render exactly one icons-catalog link. Before the fix its href was
the old storybook URL; after the fix it's the new catalog URL. No
before/after screenshots, because the visible text is identical and only
the href changes.
- Limitation: my environment blocks outbound requests to
`storybooks.fluentui.dev` and `microsoft.github.io`, so I couldn't load
either URL live. The evidence above comes from the upstream source, the
upstream PR and the Pages deployment record. A reviewer can confirm by
clicking the new link.

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
@IEvangelist
David Pine (IEvangelist) merged commit d1ad072 into main Nov 1, 2026
20 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the aspireagent/ts-param-descriptions branch November 1, 2026 14:50
Sébastien Ros (sebastienros) added a commit that referenced this pull request Nov 11, 2026
- TypeScript API parameter descriptions (#2009)
- No locale prefix or hreflang alternates for English-only pages: the footer
  language picker (#1988), hreflang (#1987) and the sidebar Glossary link (#1989)
- Footer link to the Aspire MIT license
- Homepage: environment fade (#1993), stale AppHost animations (#1950), the
  dashboard carousel keeps the selected slide on activation
- Search: first-result highlight with out-of-order renders (#2007), hover cursor
  flicker (#1977)
- Live status over WebSocket (#1942) and twoslash hover, merged into the copies
  of the frontend scripts
- Icon data 5.40.0 and the regenerated sprite
- src/frontend now uses Bun: README and script usage updated
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.

WithIconName docs

3 participants