[PR #5976] Typescript: GenericInput #6246

Closed
opened 2026-02-28 21:25:45 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/5976

State: closed
Merged: Yes


All of these changes have been done manually (not AI generated!). I would have preferred to have less code-changes when moving this component to TS, but it is a super complex one.. and unfortunately required quite a lot of refactoring to make it strict TS compatible.

Ideally would like to merge this AFTER the release goes out so it has ~1 month of testing before being released in v15.12.0


  • Rename GenericInput from jsx to tsx
  • Refactor GenericInput component to TypeScript and improve type safety
  • Enhance FiltersMenu and RuleEditor components for better value handling

Addresses #1483 - TypeScript migration tracking issue


Note

Migrates GenericInput to a strongly-typed TS component and adjusts calling sites and autocomplete typings for stricter value/id handling.

  • Core:
    • TypeScript Migration: Replace components/util/GenericInput.jsx with GenericInput.tsx using discriminated unions for id/saved/date/boolean/number/string, modal-based autocompletes, and refined input handling.
  • Consumers Updated:
    • FiltersMenu.jsx: Pass correct field for date subfields; normalize value defaults; support multi (oneOf/notOneOf) properly.
    • RuleEditor.tsx: Use GenericInput with safe defaults (''), apply to action/value editors, and numeric/percentage cases.
    • ScheduleEditModal.tsx: Use TS GenericInput for schedule name input.
    • reports/SaveReportChoose.tsx: Simplify GenericInput usage and handlers.
  • Autocomplete:
    • Tighten types: getItemId and multi-select onSelect/value now require NonNullable<T['id']>.
  • Release Notes:
    • Add maintenance entry documenting the migration.

Written by Cursor Bugbot for commit 6d165d48be. This will update automatically on new commits. Configure here.

**Original Pull Request:** https://github.com/actualbudget/actual/pull/5976 **State:** closed **Merged:** Yes --- All of these changes have been done manually (not AI generated!). I would have preferred to have less code-changes when moving this component to TS, but it is a super complex one.. and unfortunately required quite a lot of refactoring to make it strict TS compatible. Ideally would like to merge this AFTER the release goes out so it has ~1 month of testing before being released in v15.12.0 ---- - Rename GenericInput from jsx to tsx - Refactor GenericInput component to TypeScript and improve type safety - Enhance FiltersMenu and RuleEditor components for better value handling Addresses #1483 - TypeScript migration tracking issue <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Migrates `GenericInput` to a strongly-typed TS component and adjusts calling sites and autocomplete typings for stricter value/id handling. > > - **Core**: > - **TypeScript Migration**: Replace `components/util/GenericInput.jsx` with `GenericInput.tsx` using discriminated unions for `id/saved/date/boolean/number/string`, modal-based autocompletes, and refined input handling. > - **Consumers Updated**: > - `FiltersMenu.jsx`: Pass correct `field` for date subfields; normalize `value` defaults; support multi (`oneOf`/`notOneOf`) properly. > - `RuleEditor.tsx`: Use `GenericInput` with safe defaults (`''`), apply to action/value editors, and numeric/percentage cases. > - `ScheduleEditModal.tsx`: Use TS `GenericInput` for schedule name input. > - `reports/SaveReportChoose.tsx`: Simplify `GenericInput` usage and handlers. > - **Autocomplete**: > - Tighten types: `getItemId` and multi-select `onSelect/value` now require `NonNullable<T['id']>`. > - **Release Notes**: > - Add maintenance entry documenting the migration. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6d165d48bea443703da90c47f1bc92c030240467. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
GiteaMirror added the pull-request label 2026-02-28 21:25:45 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6246