[PR #4303] [MERGED] Fix crashes on reports page with translations enabled #5310

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4303
Author: @jfdoming
Created: 2/6/2025
Status: ✅ Merged
Merged: 2/6/2025
Merged by: @jfdoming

Base: master ← Head: jfdoming/fix-broken-translation


📝 Commits (2)

📊 Changes

5 files changed (+68 additions, -37 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/ReportOptions.ts (+48 -30)
📝 packages/desktop-client/src/components/reports/ReportSidebar.tsx (+8 -5)
📝 packages/desktop-client/src/components/reports/disabledList.ts (+5 -1)
📝 packages/desktop-client/src/components/reports/reports/CustomReport.tsx (+1 -1)
➕ upcoming-release-notes/4303.md (+6 -0)

📄 Description

As it says on the tin.

Steps to repro (in the latest release):

  1. Pick a language other than English.
  2. Reload the page.
  3. Navigate to the Reports page.
  4. Add a custom report.
  5. Observe crashes.

Testing this PR involves all of the above, but fixing the original crash uncovered many other crashes of the same shape. It's worth just clicking around the custom reports UI to verify the issue is eliminated (I did as much as I could, but it's possible I missed something).

Note to reviewers: Most of the options I added a "key" to have another value we could have already used as a "key"; for example, intervalOptions has .name. However, there are a ton of places in the reports code that hard-code string checks, and in most of these places, the interval (or other attribute) is passed as a plain string rather than a union of possible values. Fixing this is a huge pain—we'd need to add strict string types throughout the entire codebase, then fix all errors, and then add a migration to the new key attribute—so after trying that approach it seemed easier in the short term to just add a 'key' attribute instead with the exact same value as the previously-used description.

Also worth noting: mode, despite having a description attribute, doesn't use that attribute anywhere that's displayed/translated—hence I didn't add a key.


🔄 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/4303 **Author:** [@jfdoming](https://github.com/jfdoming) **Created:** 2/6/2025 **Status:** ✅ Merged **Merged:** 2/6/2025 **Merged by:** [@jfdoming](https://github.com/jfdoming) **Base:** `master` ← **Head:** `jfdoming/fix-broken-translation` --- ### 📝 Commits (2) - [`a8f000f`](https://github.com/actualbudget/actual/commit/a8f000f78eaff0daf2ab42030ffeb16cea102e7d) Fix crashes - [`f8b97f8`](https://github.com/actualbudget/actual/commit/f8b97f8722cb7cda14183ba43e9a1d44b68b97e3) Add release notes ### 📊 Changes **5 files changed** (+68 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/ReportOptions.ts` (+48 -30) 📝 `packages/desktop-client/src/components/reports/ReportSidebar.tsx` (+8 -5) 📝 `packages/desktop-client/src/components/reports/disabledList.ts` (+5 -1) 📝 `packages/desktop-client/src/components/reports/reports/CustomReport.tsx` (+1 -1) ➕ `upcoming-release-notes/4303.md` (+6 -0) </details> ### 📄 Description As it says on the tin. Steps to repro (in the latest release): 1. Pick a language other than English. 2. Reload the page. 3. Navigate to the Reports page. 4. Add a custom report. 5. Observe crashes. Testing this PR involves all of the above, but fixing the original crash uncovered many other crashes of the same shape. It's worth just clicking around the custom reports UI to verify the issue is eliminated (I did as much as I could, but it's possible I missed something). Note to reviewers: Most of the options I added a "key" to have another value we could have already used as a "key"; for example, `intervalOptions` has `.name`. However, there are a _ton_ of places in the reports code that hard-code string checks, and in most of these places, the `interval` (or other attribute) is passed as a plain string rather than a union of possible values. Fixing this is a huge pain—we'd need to add strict string types throughout the entire codebase, then fix all errors, and then add a migration to the new key attribute—so after trying that approach it seemed easier in the short term to just add a 'key' attribute instead with the exact same value as the previously-used `description`. Also worth noting: `mode`, despite having a `description` attribute, doesn't use that attribute anywhere that's displayed/translated—hence I didn't add a `key`. --- <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-02-28 21:10:22 -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#5310