[PR #5976] [MERGED] Typescript: GenericInput #40677

Closed
opened 2026-04-23 13:30:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5976
Author: @MatissJanis
Created: 10/21/2025
Status: Merged
Merged: 11/6/2025
Merged by: @MatissJanis

Base: masterHead: matiss/ts-generic-input


📝 Commits (10+)

  • 5b85bdd Rename GenericInput from jsx to tsx
  • 13da3e9 Refactor GenericInput component to TypeScript and improve type safety
  • 7dec34e Merge branch 'master' into matiss/ts-generic-input
  • 79b31aa Enhance FiltersMenu and RuleEditor components for better value handling
  • 134b5e5 Document conversion of GenericInput component to TypeScript with generic types
  • 3afb0c8 Refactor SaveReportChoose component to simplify onChange handler
  • f9f4ce9 Merge branch 'master' into matiss/ts-generic-input
  • 2d4ec29 Refactor GenericInput component to improve case handling
  • 7b795e8 Refactor GenericInput component to utilize forwardRef and improve prop handling
  • b3e1317 Merge branch 'master' into matiss/ts-generic-input

📊 Changes

9 files changed (+473 additions, -339 deletions)

View changed files

📝 packages/desktop-client/src/components/autocomplete/Autocomplete.tsx (+3 -3)
📝 packages/desktop-client/src/components/budget/goals/editor/HistoricalAutomation.tsx (+1 -2)
📝 packages/desktop-client/src/components/filters/FiltersMenu.jsx (+4 -3)
📝 packages/desktop-client/src/components/reports/SaveReportChoose.tsx (+1 -3)
📝 packages/desktop-client/src/components/rules/RuleEditor.tsx (+7 -5)
📝 packages/desktop-client/src/components/schedules/ScheduleEditModal.tsx (+0 -3)
packages/desktop-client/src/components/util/GenericInput.jsx (+0 -320)
packages/desktop-client/src/components/util/GenericInput.tsx (+450 -0)
upcoming-release-notes/5976.md (+7 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/5976 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 10/21/2025 **Status:** ✅ Merged **Merged:** 11/6/2025 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `matiss/ts-generic-input` --- ### 📝 Commits (10+) - [`5b85bdd`](https://github.com/actualbudget/actual/commit/5b85bdd6b6a7ff6c8b58140fcbbb6e6906c49a4f) Rename GenericInput from jsx to tsx - [`13da3e9`](https://github.com/actualbudget/actual/commit/13da3e9afc2193c291632a01294787d781d1eac8) Refactor GenericInput component to TypeScript and improve type safety - [`7dec34e`](https://github.com/actualbudget/actual/commit/7dec34eefdec9cf30a70a9829896571916013da0) Merge branch 'master' into matiss/ts-generic-input - [`79b31aa`](https://github.com/actualbudget/actual/commit/79b31aa3accc7e4c7b2d3f82d6a361db962f820b) Enhance FiltersMenu and RuleEditor components for better value handling - [`134b5e5`](https://github.com/actualbudget/actual/commit/134b5e50b3f125e0daf25d6bdb3a2378e89b2152) Document conversion of GenericInput component to TypeScript with generic types - [`3afb0c8`](https://github.com/actualbudget/actual/commit/3afb0c827cad4fbf63c32176193376e4608c953d) Refactor SaveReportChoose component to simplify onChange handler - [`f9f4ce9`](https://github.com/actualbudget/actual/commit/f9f4ce943cf91f00ddee62719047039a35aa3f11) Merge branch 'master' into matiss/ts-generic-input - [`2d4ec29`](https://github.com/actualbudget/actual/commit/2d4ec29ba8aaae40e29662662851d1d95b2c9720) Refactor GenericInput component to improve case handling - [`7b795e8`](https://github.com/actualbudget/actual/commit/7b795e89c23ab35411ce8a3e44437967a30ccf5e) Refactor GenericInput component to utilize forwardRef and improve prop handling - [`b3e1317`](https://github.com/actualbudget/actual/commit/b3e131734afb515284e2cc60446253b250250b25) Merge branch 'master' into matiss/ts-generic-input ### 📊 Changes **9 files changed** (+473 additions, -339 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/autocomplete/Autocomplete.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/budget/goals/editor/HistoricalAutomation.tsx` (+1 -2) 📝 `packages/desktop-client/src/components/filters/FiltersMenu.jsx` (+4 -3) 📝 `packages/desktop-client/src/components/reports/SaveReportChoose.tsx` (+1 -3) 📝 `packages/desktop-client/src/components/rules/RuleEditor.tsx` (+7 -5) 📝 `packages/desktop-client/src/components/schedules/ScheduleEditModal.tsx` (+0 -3) ➖ `packages/desktop-client/src/components/util/GenericInput.jsx` (+0 -320) ➕ `packages/desktop-client/src/components/util/GenericInput.tsx` (+450 -0) ➕ `upcoming-release-notes/5976.md` (+7 -0) </details> ### 📄 Description 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 --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 13:30:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#40677