Skip to content

Comments

Claude/tighten up types in coreui and wdk-client [Claude Code + CC Web]#1550

Draft
bobular wants to merge 91 commits intomainfrom
claude/tighten-up-01VC5MTuCMsecPxLDsqo23TV
Draft

Claude/tighten up types in coreui and wdk-client [Claude Code + CC Web]#1550
bobular wants to merge 91 commits intomainfrom
claude/tighten-up-01VC5MTuCMsecPxLDsqo23TV

Conversation

@bobular
Copy link
Member

@bobular bobular commented Nov 16, 2025

wdk-client and coreui already converted to TS by Claude Code Web

  1. coreui as anys tightened up via Claude Code locally

Converted 5 Answer view components to TypeScript:
- AnswerAttributeSelector.jsx → .tsx
- AnswerFilter.jsx → .tsx
- AnswerFilterSelector.jsx → .tsx
- AnswerTable.jsx → .tsx
- AnswerTableCell.jsx → .tsx

All conversions:
- Preserve class-based vs functional structure
- Use existing TypeScript types from WdkModel and Actions
- Add comprehensive prop and state interfaces
- Maintain backward compatibility
Converted 5 more components to TypeScript:
- Answer.jsx → .tsx (main answer view with table state)
- AnswerTableHeader.jsx → .tsx
- ApplicationSpecificProperties.jsx → .tsx
- UserPasswordReset.jsx → .tsx
- ChangePasswordForm.jsx → .tsx

All conversions use existing types from WdkModel, WdkUser, and Actions.
Maintained functional component structures.
…ript

Converted 5 more components to TypeScript:
- RecordHeading.jsx → .tsx
- RecordLink.jsx → .tsx
- RecordMainCategorySection.jsx → .tsx (class-based)
- RecordMainSection.jsx → .tsx
- SiteMap.jsx → .tsx

Also added ApplicationSpecificProperties.tsx that was missing from previous commit.

All conversions use existing types from WdkModel, CategoryUtils, and Actions.
Maintained class-based vs functional structures as-is.
Converted 5 more Record components to TypeScript:
- RecordActionLink.jsx → .tsx
- RecordNavigationItem.jsx → .tsx
- RecordNavigationSection.jsx → .tsx (class-based)
- RecordTable.jsx → .tsx (class-based with Mesa integration)
- RecordUI.jsx → .tsx (class-based)

All conversions use existing types from WdkModel, CategoryUtils, and RecordHeading.
Maintained class-based vs functional structures as-is.
- Fix ChangePasswordForm: updateChangePasswordForm should return PasswordForm
- Fix SiteMap: make tree prop optional and handle undefined case
- Fix ChangePasswordForm: make user prop optional and handle undefined case
…ch 5)

Converted 5 more components to TypeScript:
- FavoritesList.jsx → .tsx (class-based)
- RecordAttribute.jsx → .tsx
- RecordTableDescription.jsx → .tsx
- DownloadFormContainer.jsx → .tsx (class-based)
- ReporterCheckboxList.jsx → .tsx

Also fixed FavoritesController.tsx to remove any type cast.

All conversions use existing types from WdkModel, WdkUser, and WdkResult.
Maintained class-based vs functional structures as-is.
…(batch 6)

Converted 5 more components to TypeScript:
- DownloadForm.jsx → .tsx
- PrimaryKeySpan.jsx → .tsx
- Core/main.js → .ts
- UnknownCount.jsx → .tsx
- StackedBar.jsx → .tsx

All conversions use existing types from WdkModel, History, Redux, and AttributeFilter/Types.
Maintained class-based vs functional structures as-is.
Converted 5 more AttributeFilter components to TypeScript:
- EmptyField.jsx → .tsx
- FieldFilter.jsx → .tsx
- FilterList.jsx → .tsx (class-based)
- Histogram.jsx → .tsx (class-based)
- MembershipField.jsx → .tsx (class-based)

All conversions use existing types from AttributeFilter/Types.ts.
Maintained class-based vs functional structures as-is.
Converted 5 more AttributeFilter components to TypeScript:
- EmptyValues.jsx → .tsx
- FilterLegend.jsx → .tsx
- HistogramField.jsx → .tsx
- InvalidFilterList.jsx → .tsx
- SingleFieldFilter.jsx → .tsx (class-based)

All conversions use existing types from AttributeFilter/Types.ts.
Maintained class-based vs functional structures as-is.
Converted 5 more AttributeFilter components to TypeScript:
- DateField.jsx → .tsx (class-based)
- FieldList.jsx → .tsx (class-based)
- MultiFieldFilter.jsx → .tsx (class-based)
- NumberField.jsx → .tsx (class-based)
- ServerSideAttributeFilter.jsx → .tsx

Also updated Types.ts to add missing properties (term, description, variableName).

All conversions use existing types from AttributeFilter/Types.ts.
Maintained class-based vs functional structures as-is.
Converted final 7 components to TypeScript:
- AccordionButton.jsx → .tsx (class-based)
- Sticky.jsx → .tsx (class-based)
- DateRangeSelector.jsx → .tsx (class-based)
- DateSelector.jsx → .tsx (class-based)
- Main.jsx → .tsx (class-based)
- Modal.jsx → .tsx
- Modal/index.js → .ts

All 52 non-vendored JavaScript files in wdk-client are now TypeScript!
Maintained class-based vs functional structures as-is.
- DateField: Handle optional timeformat with default value
- FieldFilter: Add fieldTree prop and handle optional displayName
- FilterList: Add type assertions for MultiFilterValue operations
- FieldList: Add type annotation for renderNode parameter and cast offsetParent to HTMLElement
- FieldFilter: Add type assertions for props spread to child components
- FilterList: Fix concat type issue with proper Filter casting
- FieldList: Add type assertion for CheckboxTree ref
- Histogram: Fix duplicate identifiers, add jQuery type assertions, handle script-loader imports
- HistogramField: Handle null/undefined values, add type assertions for incompatible types
Remove property declarations that conflict with actual method definitions.
Use type assertions for throttle, debounce, and memoize wrapping.
…, and Histogram

- Add type assertions for passive event listener options in Sticky component
- Fix ServerSideAttributeFilter fieldTree and selectByDefault type issues
- Fix FilterList shouldAddFilter parameter count
- Add onSelecting prop to HistogramField
- Fix Histogram undefined parameter issues (binStart, binSize, xaxisMax, yaxisMin, yaxisMax, timeformat)
- Fix Histogram reduce accumulator property name mismatch
- Fix MultiFieldFilter type assertions for concat, filter, and toArray operations
- Fix FieldList CheckboxTree type parameters
- Fix DateRangeSelector undefined start/end parameter handling
- Fix DateSelector start/end variable shadowing and type mismatches
- Fix DateSelector onChange handlers to convert string to number
- Fix DateSelector error handling (throw instead of return Error)
- Add default values for xaxisMin, xaxisMax, valuesMin, valuesMax in formatDate calls
- Add step prop to y-axis NumberRangeSelector
- Add default values for binSize in assignBin calls
- Add type assertion for wdkDependencies
- Fix container type (remove undefined, cast querySelector result)
- Add typeof check for __DEV__ global variable
- ServerSideAttributeFilter: Explicitly pass displayName and hideGlobalCounts to FilterList
- Histogram: Add null checks for ReactDOM.findDOMNode() before using with jQuery
- Histogram: Handle undefined return from assignBin function
- SingleFieldFilter: Use component variable to handle dynamic field detail components
- Add type assertions for passive event listener options
- Convert activeSectionId undefined to null for state
- Fix URL constructor to use location.href instead of Location object
- Use empty string instead of null for history.replaceState title
- Cast sectionNode to HTMLElement to access id property
- Add default empty string for activeSection prop
- Wrap onSectionToggle to convert optional boolean to required
- Add type annotation for ref callback parameter
- Add global __DEV__ declaration in index.d.ts
- ServerSideAttributeFilter: Pass only required props to FilterList explicitly instead of spreading all props
- ServerSideAttributeFilter: Convert null to undefined for activeField prop
- UserPasswordChangeController: Pass only required props to ChangePasswordForm
- AnswerTable: Fix DataTable import path to use @veupathdb/coreui
- AnswerTable: Add type assertion for defaultProps
- Fix UserEvents interface to return void instead of PasswordForm
- Fix SaveButton onPress handler signature
- Add newBuild property to Reporter interface
- Fix DownloadFormContainer scope type to allow null
- Fix DownloadForm props spreading with type assertion
- Fix ApplicationSpecificProperties to accept UserProfileFormData
- Fix ChangePasswordForm to not use getChangeHandler with Redux action creators
- Fix DownloadFormContainer to allow resultType to be null
- Add null checks for resultType and selectedReporter in onSubmit
- Add isPrimary property to AttributeField interface
- Fix wdkReference access in RecordMainCategorySection with type assertions
- Fix wdkReference access in RecordNavigationItem with isIndividual type guard
- Fix TextBox and TextArea props: autoComplete should be string, maxLength/size/cols/rows should be numbers
- Add null check for recordClass in renderIdCell
- Fix Banner interface to extend BannerProps from coreui
- Convert banners to BannerProps when passing to BannerList
- Call renderCountSummary() directly instead of assigning to variable
- Add type assertion for withRouter usage
- Remove MesaStateOptions import (not exported from coreui)
- Change MesaOptions to not extend MesaStateOptions
- Fix isPrimary to use nullish coalescing for boolean type
- Fix FavoritesList to use RouteComponentProps instead of WithRouterProps
- Add filterAttributes and filterTables to AnswerFilterProps
- Fix AnswerFilterSelector keyboard event handler to use React.KeyboardEvent
- Add className prop support to RecordLink component
- Add type assertions for wdkReference when passing to RecordAttributeSection and RecordTableSection
- Fix Header string to be typed as keyof React.ReactHTML
- Add type assertion for dynamic header element creation
- Fix 'in' expression error by extracting attribute value to variable
- Cast sortDirections array to correct type for orderBy function
- Add type assertion for row data in orderBy function to fix index signature errors
- Cast sort directions array to correct type for orderBy
- Type newData as any to allow link object transformation
- Fix uiState.sort.columnKey to be string instead of undefined
- Add type assertion for wrappable(pure(RecordTable))
- Answer.tsx: Remove 'as any' from AnswerCount and AttributePopup props
- MultiFieldFilter.tsx: Refine type assertions to be more specific
  - Use MemberFilter instead of Filter for leaf filters
  - Use (string | number)[] instead of any[] for filter values
  - Remove 'any' type from filter callback parameter
The natural-sort library has proper TypeScript type definitions
that correctly type the function call, making the assertion unnecessary.
… function types

Replace generic 'as any' with more specific type assertions for lodash
compose functions, improving type safety while maintaining compatibility
with Mesa's customSortFactory.
@bobular bobular changed the title Claude/tighten up types in coreui [Claude Code + CC Web] Claude/tighten up types in coreui and wdk-client [Claude Code + CC Web] Nov 17, 2025
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.

2 participants