Skip to content

Conversation

@twjeffery
Copy link
Collaborator

@twjeffery twjeffery commented Jan 14, 2026

Summary

  • Adds JSDoc documentation comments to component props across 67 Svelte components
  • Enables better IDE hints and autocomplete for developers using GoA components
  • Supports automated documentation generation
  • No functional changes - documentation only

Changes

  • 67 files modified
  • ~642 lines added (comments only)
  • ~60 lines removed (internal section markers replaced with JSDoc)

Example

/** Sets the visual style of the button. Use "primary" for main actions... */
export let type: ButtonType = "primary";

Testing

  • No functional changes, documentation only
  • Existing tests should pass unchanged

Created with the help of claude code

Add documentation comments to component props across 67 components.
These descriptions enable better IDE hints and support automated
documentation generation.
@twjeffery twjeffery force-pushed the tom/jsdoc-prop-descriptions branch from a1b95c1 to 8e7d486 Compare January 14, 2026 02:56
@twjeffery twjeffery requested review from bdfranck and chrisolsen and removed request for bdfranck January 14, 2026 03:01
@twjeffery twjeffery closed this Jan 14, 2026
@twjeffery twjeffery reopened this Jan 14, 2026
- Remove @required tags from props without validateRequired() calls
- Fix overstated "form submission" claims to "change events"
- Remove incorrect "Auto-generated" claim from Accordion id prop
- Fix "Reset skeleton shapes" to "Sets the skeleton shape"

Addresses feedback from initial review
} from "../../types/relay-types";
/** Name of the input value that is received in the _change event */
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the space

import { quartOut } from "svelte/easing";
// required
/** Sets the size of the spinner. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should mention that it is required

Copy link
Collaborator Author

@twjeffery twjeffery Jan 22, 2026

Choose a reason for hiding this comment

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

Added @required

import { injectCss, type Spacing } from "../../common/styling";
/** Horizontal spacing */
Copy link
Collaborator

Choose a reason for hiding this comment

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

empty line

type SkeletonSize = (typeof Sizes)[number];
/** Set component maximum width. Currently only used in card skeleton type */
Copy link
Collaborator

Choose a reason for hiding this comment

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

blank line

/** Sets the type of the input field. */
export let type: Type = "text";
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe remove all the spaces in between props to keep things consistent

type Variant = (typeof Variants)[number];
// required
Copy link
Collaborator

Choose a reason for hiding this comment

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

no longer needed

import type { Spacing } from "../../common/styling";
/** Gap between child items */
Copy link
Collaborator

Choose a reason for hiding this comment

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

space

/** Accepted file types as a comma-separated list of MIME types or file extensions (e.g., "image/*,.pdf"). */
export let accept: string = "*";
/** Maximum file size with unit (e.g., "5MB", "100KB", "1GB"). Files exceeding this will be rejected. */
export let maxfilesize: string = "5MB";
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice if the default value was contained in the comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

import type { Spacing } from "../../common/styling";
/** @required The title heading */
Copy link
Collaborator

Choose a reason for hiding this comment

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

blank line

export let disabled: string = "false";
/** Shows an error state on all radio items in the group. */
export let error: string = "false";
/** The design system version for styling purposes. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove comment for version

Copy link
Collaborator

@vanessatran-ddi vanessatran-ddi left a comment

Choose a reason for hiding this comment

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

I left all the comments.

- Fix formatting: remove blank lines between JSDoc and exports
- Standardize testid descriptions across components
- Add @internal tag to version props (not for public docs)
- Add @internal to multiselect in Dropdown (not exposed)
- Add @required to Spinner size (no default value)
- Fix inaccurate descriptions (Callout size, Dropdown icon/maxheight)
- Add missing docs (DatePicker size, Button/IconButton/LinkButton actions)
- Add default value to FileUploadInput maxfilesize description
- Remove redundant // required comment in IconButton
@twjeffery
Copy link
Collaborator Author

@chrisolsen @vanessatran-ddi
I addressed all the feedback, ready for another look.

What changed:

  • Added @internal to the design system version props so they won't show on public docs
  • Added docs for the action props on Button, IconButton, LinkButton
  • Standardized testid wording, removed blank lines between props
  • Fixed the specific callouts (Dropdown icons, Callout size, RadioItem disabled context, etc.)
  • Marked those Popover internal props with @internal

One note: I kept MicrositeHeader's version as a public prop. That's the app version shown in the header, not the design system version.

Regarding framework-specific props (as/tag, ReactNode/TemplateRef): For now, the comments in Svelte can at least stay as the source of truth for descriptions. We'll sort out how to show Angular vs React differences on the website as well, probably based on the framework selector. I will create a new PR for that.

Copy link
Collaborator

@vanessatran-ddi vanessatran-ddi left a comment

Choose a reason for hiding this comment

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

The rest looks good! There are some files missing JS doc

export let size: BadgeSize = "medium";
/** Sets the visual emphasis. 'subtle' for less prominent, 'strong' for more emphasis. */
export let emphasis: (typeof emphasisLevels)[number] = "strong";
/** The design system version for styling purposes. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing set internal

/** Sets a custom width for the button (e.g., "200px" or "100%"). */
export let width: string = "";
/** Design system version. Version 2 includes updated styling and accessibility improvements. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing internal on the comment

handleKeyDown: (e: KeyboardEvent) => void;
}
// Props
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are missing document for DropdownItem.svelte

/** Sets the size of the input. 'compact' reduces height for dense layouts. */
export let size: "default" | "compact" = "default";
/** The design system version for styling purposes. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing @internal

import { GoAIconType } from "../icon/Icon.svelte";
import { dispatch, receive, relay } from "../../common/utils";
import { MenuAction } from "./MenuAction.svelte";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing document for MenuAction.svelte

// Public
/** Width of the table. By default it will fit the enclosed content. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are missing document for TableSortHeader.svelte

export let initialtab: number = -1;
/** Sets a data-testid attribute for automated testing. */
export let testid: string = "";
/** The design system version for styling purposes. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing @internal

| "progress";
// Props
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are missing TemporaryNotificationCtrl.svelte

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.

4 participants