Skip to content

[#45] docs: add JSDoc comments across all components - #66

Merged
ToryMic merged 2 commits into
BreachDirect:mainfrom
broda-spendy:issue-45
Aug 14, 2026
Merged

[#45] docs: add JSDoc comments across all components#66
ToryMic merged 2 commits into
BreachDirect:mainfrom
broda-spendy:issue-45

Conversation

@broda-spendy

Copy link
Copy Markdown
Contributor

Summary

Closes #45. App/RemittanceForm/RouteList/RouteCard had light or no JSDoc. Adds consistent documentation matching the existing prose + @param style already used in routingEngine.js.

What's included

  • App.jsx: component-level doc explaining why state lives here rather than in a hook (ties back to ADR-0001's reasoning), plus doc on handleSubmit's query shape and its error-handling behavior
  • RemittanceForm.jsx: full @param docs added to the existing component-level comment (currencies, onSubmit's callback shape), plus a one-line comment on handleSwap
  • RouteList.jsx: doc covering the deliberate "render nothing before a search has run" behavior, which isn't obvious from the code alone
  • RouteCard.jsx: doc flagging that route.totalCost is intentionally not displayed (it's a ranking score, not a monetary amount) — worth having directly in the component that renders the other Route fields but skips this one

RouteList/RouteCard reference the Route/Hop typedefs already defined in routingEngine.js via an @param {import('../engine/routingEngine').Route} type reference, rather than redefining them, so there's one source of truth for the shape.

Verification

This is a JS/Vite project (not one of the Soroban Rust ones), so I could verify for real:

  • npm test: 12/12 pass
  • npm run build: succeeds

Closes #45

…components

App/RemittanceForm/RouteList/RouteCard had light or no JSDoc. Adds
consistent documentation matching the existing prose + @PARAM style
already used in routingEngine.js:

- App.jsx: component-level doc explaining why state lives here rather
  than in a hook (ties back to ADR-0001's reasoning), plus doc on
  handleSubmit's query shape and its error-handling behavior
- RemittanceForm.jsx: full @PARAM docs added to the existing
  component-level comment (currencies, onSubmit's callback shape),
  plus a one-line comment on handleSwap
- RouteList.jsx: doc covering the deliberate "render nothing before a
  search has run" behavior, which isn't obvious from the code alone
- RouteCard.jsx: doc flagging that route.totalCost is intentionally
  not displayed (it's a ranking score, not a monetary amount) - a
  clarification worth having directly in the component that renders
  the other Route fields but skips this one

RouteList/RouteCard reference the Route/Hop typedefs already defined
in routingEngine.js via an @PARAM import() type reference, rather
than redefining them, so there's one source of truth for the shape.

Verified for real (this is a JS/Vite project, not one of the Soroban
Rust ones - Node tooling works fine in this sandbox):
- npm test: 12/12 pass
- npm run build: succeeds

Closes BreachDirect#45
@broda-spendy
broda-spendy requested a review from ToryMic as a code owner August 14, 2026 06:27
@ToryMic
ToryMic merged commit 8e42d8e into BreachDirect:main Aug 14, 2026
1 check passed
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.

Add JSDoc comments across all components

3 participants