Skip to content

[AI] fix: reports resetting to their default settings when the on-scr… - #9566

Open
thomasjbarrett82 wants to merge 1 commit into
actualbudget:masterfrom
thomasjbarrett82:fix-report-reset-on-mobile-keyboard
Open

thomasjbarrett82 wants to merge 1 commit into
actualbudget:masterfrom
thomasjbarrett82:fix-report-reset-on-mobile-keyboard

Conversation

@thomasjbarrett82

@thomasjbarrett82 thomasjbarrett82 commented Nov 16, 2026 •

Copy link
Copy Markdown

…een keyboard opens on mobile devices

Description

The bug was effectively fixed in v25.10.0 by accident, this PR updates reports/index.ts to match responsive/index.tsx and Background.tsx in the desktop-client/src/components.

What caused it:

  • Reports (packages/desktop-client/src/components/reports/index.tsx) passed a new importer={() => import('./ReportRouter')} function every time it rendered.
  • LoadComponent reloads whenever importer changes. When it reloads, it removes the whole report and rebuilds it, so all unsaved settings are lost. That's the blank chart showing "Payment: NaN" in the video.
  • FinancesApp re-renders on every window resize, because useResponsive() reports the window height. Opening the on-screen keyboard shrinks that height. In the video, tapping the Notes input brings up the keyboard bar, the window gets about 60px shorter, and the report reloads.
  • This explains the reports in the issue thread too. The devtools emulator never opens a keyboard, so nothing resizes. Importing ReportRouter directly skips LoadComponent entirely.
  • React Compiler (React Compiler #5562, first released in v25.10.0) caches that part of Reports, so the importer function no longer changes between renders. That protection breaks if the compiler ever skips this file, or if something in that part of Reports changes on every render.

Claude Code (Opus 5.5) was used to identify the root cause.

Related issue(s)

Fixes #4285

Testing

I checked on nightly with a touch-enabled browser: I set the report to "Time", opened the Notes filter, focused its input and shrank the window. The report kept its settings, the popover stayed open and the input kept focus.

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I have read every line of this diff and can explain what each change does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 37 14.92 MB → 15 MB (+83.01 kB) +0.54%
loot-core 1 5.43 MB 0%
api 2 4.33 MB 0%
cli 1 420.19 kB 0%
crdt 1 11.15 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
37 14.92 MB → 15 MB (+83.01 kB) +0.54%
Changeset
File Δ Size
src/components/reports/index.tsx 📈 +366 B (+70.79%) 517 B → 883 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/TransactionList.js 87.15 kB → 170.28 kB (+83.14 kB) +95.40%
static/js/index.js 2.94 MB → 2.94 MB (+366 B) +0.01%

Smaller

Asset File Size % Changed
static/js/web.js 1.48 kB → 1 kB (-492 B) -32.37%

Unchanged

Asset File Size % Changed
static/js/AutomaticSyncSettings.js 21.95 kB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/DateSelect.js 2.65 MB 0%
static/js/FormulaEditor.js 771.38 kB 0%
static/js/NotesTagFormatter.js 30.87 kB 0%
static/js/ReportRouter.js 2 MB 0%
static/js/TourHost.js 169.78 kB 0%
static/js/Value.js 1.76 MB 0%
static/js/bootstrapHyperFormula.js 302 B 0%
static/js/build-shims.js 140 B 0%
static/js/ca.js 161.65 kB 0%
static/js/columns.js 686.43 kB 0%
static/js/de.js 179.68 kB 0%
static/js/en-GB.js 13.59 kB 0%
static/js/en.js 292.34 kB 0%
static/js/es.js 181.74 kB 0%
static/js/fr.js 174.48 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 147.08 kB 0%
static/js/months.js 612.42 kB 0%
static/js/narrow.js 316.65 kB 0%
static/js/nb-NO.js 130.04 kB 0%
static/js/nl.js 142.79 kB 0%
static/js/pl.js 140.63 kB 0%
static/js/pt-BR.js 169.06 kB 0%
static/js/rolldown-runtime.js 2.03 kB 0%
static/js/ru.js 197.41 kB 0%
static/js/sv.js 127.95 kB 0%
static/js/theme.js 38.71 kB 0%
static/js/uk.js 237.17 kB 0%
static/js/useLocalPref.js 101.16 kB 0%
static/js/wide.js 304.1 kB 0%
static/js/workbox-window.prod.es5.js 7.21 kB 0%
static/js/zh-Hant.js 127.78 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.43 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.CtuGtJOw.js 5.43 MB 0%

api

Total

Files count Total bundle size % Changed
2 4.33 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
index.js 4.33 MB 0%
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 420.19 kB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
cli.js 420.19 kB 0%

crdt

Total

Files count Total bundle size % Changed
1 11.15 kB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
index.js 11.15 kB 0%

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for actualbudget ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c521b96
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/6afa7651e8bdaee2f7719fe4
😎 Deploy Preview https://deploy-preview-9566.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hello contributor!

We would love to review your PR! Before we can do that, please make sure:

  • ✅ All CI checks pass
  • ✅ The PR is moved from draft to open (if applicable)
  • ✅ The "[WIP]" prefix is removed from the PR title
  • ✅ The PR description follows the provided template, with all checklist boxes filled in
  • ✅ All CodeRabbit code review comments are resolved (if you disagree with anything - reply to the bot with your reasoning so we can read through it). The bot will eventually approve the PR.
  • ✅ Any AI usage is disclosed (see our AI Usage Policy)

A quick note on volume: please get one PR reviewed and merged before opening several more. A stack of simultaneous, similar PRs from one author is reviewed slowly, and low-effort, untested, or undisclosed-AI PRs may be closed without a detailed review.

We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges.

For more information, please see our Contributing Guide.

@thomasjbarrett82
thomasjbarrett82 marked this pull request as ready for review November 16, 2026 11:15
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Reports component now passes a module-level function that dynamically imports ReportRouter to LoadComponent. A release note describes reports resetting to default settings when the on-screen keyboard opens on mobile devices.

Changes: Reports loading

Layer / File(s) Summary
Reports importer and release note
packages/desktop-client/src/components/reports/index.tsx, upcoming-release-notes/fix-report-reset-on-mobile-keyboard.md
The component uses the module-level loadReportRouter function instead of an inline importer. The release note describes reports resetting when the mobile keyboard opens.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: size small

Suggested reviewers: j-f1, matissjanis

Merge Risk: Minimal · up to c521b

The change makes the Reports loader use a stable importer, which should keep reports from reloading and losing unsaved settings when the mobile keyboard resizes the window. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: reports reset to default settings when the on-screen keyboard opens on mobile. The changeset changes reports/index.tsx to use a stable module-level loadReportRouter im…
Description check Passed The description explains the root cause: an inline importer in Reports changed each render, which made LoadComponent reload and discard unsaved settings when a resize from the on-screen keyboard re-re…
Linked Issues check Passed Issue #4285 reports that typing in report fields on mobile browsers resets report settings. The root cause described in the PR is that Reports passed a new inline importer function on each render.…
Out of Scope Changes check Passed The PR changes two files. packages/desktop-client/src/components/reports/index.tsx (+4/-3) hoists the importer into loadReportRouter, which is the implementation of the linked issue fix. `upcoming…
Full details: Title check

Explanation

The title names the main change: reports reset to default settings when the on-screen keyboard opens on mobile. The changeset changes reports/index.tsx to use a stable module-level loadReportRouter importer, which prevents the reload. The title includes a bot-style '[AI]' prefix, but its content matches the changeset.

Full details: Description check

Explanation

The description explains the root cause: an inline importer in Reports changed each render, which made LoadComponent reload and discard unsaved settings when a resize from the on-screen keyboard re-rendered the component. It links issue #4285, describes the fix and the manual testing, and matches the changed files. Its bundle stats section is auto-generated, but the author-written content is related to the changeset.

Full details: Linked Issues check

Explanation

Issue #4285 reports that typing in report fields on mobile browsers resets report settings. The root cause described in the PR is that Reports passed a new inline importer function on each render. LoadComponentInner (util/LoadComponent.tsx) lists importer in its useEffect dependencies and calls setComponent(null) when it runs, so a new importer reference reloads the whole report. The diff at the reviewed head replaces the inline arrow with a module-level loadReportRouter function. The importer reference is now stable across renders, so a re-render caused by a window resize (for example, from the on-screen keyboard) no longer triggers a reload. The change directly targets the mechanism that causes the reported reset. Verification is manual only: the PR reports a touch-enabled browser test on nightly. No automated test was added. The coding requirement is implemented; the runtime fix is supported by manual evidence, not by an automated test.

Full details: Out of Scope Changes check

Explanation

The PR changes two files. packages/desktop-client/src/components/reports/index.tsx (+4/-3) hoists the importer into loadReportRouter, which is the implementation of the linked issue fix. upcoming-release-notes/fix-report-reset-on-mobile-keyboard.md adds a Bugfix release note that describes the same issue. The release note is project documentation tied to this change. No unrelated changes were found in the reviewed diff.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 33912a0 and c521b96.

Files selected for processing: 2

  • packages/desktop-client/src/components/reports/index.tsx
  • upcoming-release-notes/fix-report-reset-on-mobile-keyboard.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unable to type in fields when editing reports on mobile browsers

1 participant