feat(Components): improve documentation (AI enabled)#2627
Open
joelharkes wants to merge 4 commits intomainfrom
Open
feat(Components): improve documentation (AI enabled)#2627joelharkes wants to merge 4 commits intomainfrom
joelharkes wants to merge 4 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 018f3cb The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Todo
Context
I upgraded the documentation with help of claude:
Steps taken
Component Documentation Audit Report
Executive Summary
The Fondue component library has strong documentation in its best components (Button, Notice, Badge, Accordion, Checkbox) that could serve as the gold standard for the rest. However, there is significant inconsistency across the library — roughly a third of components have excellent prop-level JSDoc, a third have partial coverage, and a third are barely documented. Storybook descriptions follow a similar pattern: only ~6 of 30 story files include a component-level description.
Overall documentation health: 6/10 — good bones, inconsistent execution.
Part 1: Storybook Documentation Audit
1.1 Coverage
tags: ['autodocs']andparameters.statusdocs.description.componentblock1.2 Component Descriptions — Who Has Them
1.3 What Good Descriptions Look Like
The best descriptions (Accordion, Button, Checkbox) follow a clear template:
Example (Button):
1.4 argTypes Usage
Only 5 of 30 stories define
argTypeswith descriptions:tablemetadata)Finding: Most components rely on autodocs to pull descriptions from JSDoc. This works well when JSDoc exists, but leaves the controls table blank for undocumented props.
1.5 Story Variant Coverage
Most components have decent variant coverage through named stories. Notable patterns:
1.6 Anti-patterns Found
parameters.docs.description.storyto explain why a variant existsargsdefaults in most stories — Only Button and Accordion set sensibleargsdefaults in metaPart 2: JSDoc / Prop Documentation Audit
2.1 Tier System
Tier 1 — Excellent (100% or near-complete prop documentation)
form,children,className@deprecatedusagedecorativeTier 2 — Partial (key props documented, gaps in secondary props)
childrenprops missingid,name,className@deprecatedon extraActionsonChangevsonCommitexplanationTier 3 — Poor (minimal or no prop documentation)
asanddisplaydocumented; inherited layout props undocumented2.2 Terminology Bugs
valuedefaultValuedisabledonBlur/onFocusvariant"default 'default'"(missing@prefix)2.3 Description Style Inconsistencies
Problem: Two different documentation voices exist
Voice A — Contextual/designer-friendly (Button, Notice, Badge):
Voice B — Mechanical/developer-only (Slider, TextInput, Switch):
Voice A explains when and why to use each option. Voice B just restates the type. Voice A should be the standard.
2.4 Default Value Documentation
Good news:
@defaulttags are used consistently when JSDoc exists. The pattern is well-established.Issue: Some defaults are quoted (
@default "button") and others are not (@default medium). Minor but inconsistent.2.5 Missing Patterns
@exampletags anywhere — Would help with complex propsexport const Dialog = { Root, Trigger, ... }has no doc comment explaining the composition patternchildrenprops rarely documented — When children must be specific components (e.g.,Accordion.IteminsideAccordion.Root), this constraint isn't notedLayoutComponentProps,CommonAriaProps,CommonAriaAttrsare used widely but their individual props aren't documented at the usage sitePart 3: Cross-cutting Issues
3.1 Storybook ↔ JSDoc Misalignment
For autodocs to work well, JSDoc must be complete. When it's not, the Storybook controls table shows props without descriptions. This is the case for:
LayoutComponentProps(affects Box, Flex, Grid, Section)CommonAriaPropsandCommonAriaAttrsspread props3.2 Component Selection Guide (AI.md) vs Storybook
The
AI.mdcomponent selection guide is excellent and comprehensive. But Storybook descriptions — the developer-facing docs — don't include "when to use" guidance for most components. Developers using Storybook directly miss the decision-making context that exists in AI.md.3.3 Priority Fix List (Quick Wins)
Part 4: Component-by-Component Scoreboard
Switch: C with a critical terminology bug — see Part 2.2
Part 5: Recommendations Summary
Must Fix (Bugs)
@defaultcomment onvariantHigh Priority (Gap-closing)
docs.description.componentto all 24 missing componentsMedium Priority (Consistency)
childrenconstraints where they exist@defaultvalues consistently:@default "medium"not@default mediumNice to Have
@exampletags for complex propsparameters.docs.description.storyto story variants that aren't self-explanatoryargsdefaults in all story meta blocks