Skip to content

[AI] Fix mobile category delete confirmation#8301

Merged
matt-fidd merged 1 commit into
actualbudget:masterfrom
edwei06:codex/fix-mobile-category-delete-confirm
Jun 30, 2026
Merged

[AI] Fix mobile category delete confirmation#8301
matt-fidd merged 1 commit into
actualbudget:masterfrom
edwei06:codex/fix-mobile-category-delete-confirm

Conversation

@edwei06

@edwei06 edwei06 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a mobile regression where deleting a category or category group with transactions appeared to do nothing.

When the delete mutation needs to reassign existing transactions and balances, it opens the confirm-category-delete modal. On mobile, the category/category group menu previously passed an onSettled callback that called collapseModals(...) after the mutation, which also collapsed the newly opened confirmation modal. As a result, users did not see the Confirm Delete / Transfer to: flow.

This changes the flow to close the current category/category group menu before running the delete mutation. If the mutation determines that reassignment is required, the confirmation modal remains active and visible.

This PR also adds mobile Playwright regression coverage for both category and category group deletion paths, and adds a release note.

The code and tests in this PR were assisted by OpenAI Codex. I have reviewed the changes and test results.

Related issue(s)

Fixes #8230

Testing

  • Ran corepack yarn install --immutable.
  • Ran corepack yarn oxfmt --check packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx packages/desktop-client/e2e/budget.mobile.test.ts packages/desktop-client/e2e/page-models/mobile-budget-page.ts packages/desktop-client/e2e/page-models/mobile-category-menu-modal.ts packages/desktop-client/e2e/page-models/mobile-category-group-menu-modal.ts upcoming-release-notes/fix-mobile-category-delete-confirmation.md.
  • Ran corepack yarn workspace @actual-app/web run typecheck.
  • Ran corepack yarn oxlint --type-aware --quiet packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx packages/desktop-client/e2e/budget.mobile.test.ts packages/desktop-client/e2e/page-models/mobile-budget-page.ts packages/desktop-client/e2e/page-models/mobile-category-menu-modal.ts packages/desktop-client/e2e/page-models/mobile-category-group-menu-modal.ts.
  • Ran BASE_REF=master node packages/ci-actions/bin/release-notes-check.mjs.
  • Ran corepack yarn workspace @actual-app/web run playwright test e2e/budget.mobile.test.ts --browser=chromium --grep "transfer confirmation"; 4 tests passed.
  • GitHub Actions are passing, including lint, typecheck, test, functional e2e, visual regression tests, and Electron builds for Linux, macOS, and Windows.

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 28 13.02 MB → 13.02 MB (-60 B) -0.00%
loot-core 1 4.82 MB 0%
api 2 3.87 MB 0%
cli 1 8.02 MB 0%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
28 13.02 MB → 13.02 MB (-60 B) -0.00%
Changeset
File Δ Size
src/components/mobile/budget/BudgetPage.tsx 📉 -60 B (-0.16%) 36.97 kB → 36.92 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
static/js/narrow.js 358.79 kB → 358.73 kB (-60 B) -0.02%

Unchanged

Asset File Size % Changed
static/js/index.js 7.63 MB 0%
static/js/AppliedFilters.js 36.47 kB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 735.67 kB 0%
static/js/PayeeRuleCountLabel.js 7.1 kB 0%
static/js/ReportRouter.js 1.23 MB 0%
static/js/TransactionList.js 85.19 kB 0%
static/js/ca.js 179.71 kB 0%
static/js/da.js 100.19 kB 0%
static/js/de.js 177.24 kB 0%
static/js/en-GB.js 9.25 kB 0%
static/js/en.js 200.55 kB 0%
static/js/es.js 171.82 kB 0%
static/js/extends.js 435.39 kB 0%
static/js/fr.js 173.26 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 158.13 kB 0%
static/js/nb-NO.js 141.55 kB 0%
static/js/nl.js 119.14 kB 0%
static/js/pt-BR.js 181.5 kB 0%
static/js/th.js 173.33 kB 0%
static/js/theme.js 31.02 kB 0%
static/js/uk.js 209.97 kB 0%
static/js/useTransactionBatchActions.js 9.71 kB 0%
static/js/wide.js 305.07 kB 0%
static/js/workbox-window.prod.es5.js 7.21 kB 0%
static/js/zh-Hans.js 113.26 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 4.82 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.RjHyOlEX.js 4.82 MB 0%

api

Total

Files count Total bundle size % Changed
2 3.87 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 3.87 MB 0%
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 8.02 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
cli.js 8.02 MB 0%

crdt

Total

Files count Total bundle size % Changed
1 11.12 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.12 kB 0%

@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit cd09c8d
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/6a395ab02dbee100098c6833
😎 Deploy Preview https://deploy-preview-8301.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.

@edwei06 edwei06 marked this pull request as ready for review June 22, 2026 16:41
@edwei06 edwei06 requested a review from joel-jeremy as a code owner June 22, 2026 16:41
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ed6b7957-f4ab-4105-a90a-6f2e3ef8c8b7

📥 Commits

Reviewing files that changed from the base of the PR and between 208283a and cd09c8d.

📒 Files selected for processing (6)
  • packages/desktop-client/e2e/budget.mobile.test.ts
  • packages/desktop-client/e2e/page-models/mobile-budget-page.ts
  • packages/desktop-client/e2e/page-models/mobile-category-group-menu-modal.ts
  • packages/desktop-client/e2e/page-models/mobile-category-menu-modal.ts
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • upcoming-release-notes/fix-mobile-category-delete-confirmation.md

📝 Walkthrough

Walkthrough

Fixes mobile delete confirmation by collapsing the category/group menu modal synchronously before calling the delete mutation, allowing the "Confirm Delete" modal to appear when transactions exist. Adds a new CategoryGroupMenuModal page model, extends CategoryMenuModal with a delete() method, and covers both flows with new E2E tests.

Changes

Mobile Category/Group Delete Confirmation Fix

Layer / File(s) Summary
Synchronous modal collapse before delete mutation
packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx, upcoming-release-notes/fix-mobile-category-delete-confirmation.md
onDeleteGroup and onDeleteCategory now call dispatch(collapseModals(...)) synchronously before mutate({ id }), removing the onSettled callback that was deferring modal teardown and preventing the confirm-delete modal from appearing.
CategoryGroupMenuModal page model and CategoryMenuModal delete()
packages/desktop-client/e2e/page-models/mobile-category-group-menu-modal.ts, packages/desktop-client/e2e/page-models/mobile-category-menu-modal.ts, packages/desktop-client/e2e/page-models/mobile-budget-page.ts
New CategoryGroupMenuModal class with heading, menuButton, and delete(). CategoryMenuModal gains menuButton and delete(). MobileBudgetPage.openCategoryGroupMenu() now returns a CategoryGroupMenuModal instance.
E2E tests for deletion confirmation flows
packages/desktop-client/e2e/budget.mobile.test.ts
Updates existing heading assertion to use the returned modal object. Adds two tests verifying that deleting a category group or category that has transactions opens the "Confirm Delete" modal containing "Transfer to:".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • joel-jeremy
  • youngcw

Poem

🐰 Hop hop, the modal was lost in the queue,
Delete was tapped but nothing came through!
Now collapse fires first, before mutate runs free,
"Confirm Delete" appears — just as it should be.
A bunny fixed bugs so your budget stays clean! 🥕

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main fix: addressing the mobile category delete confirmation flow issue.
Description check ✅ Passed The description clearly explains the bug, the root cause, the fix, and includes information about testing and release notes.
Linked Issues check ✅ Passed The PR directly addresses issue #8230 by fixing the mobile deletion flow for categories and category groups with transactions through structural changes and test coverage.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the mobile category/group deletion confirmation flow; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@matt-fidd matt-fidd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@matt-fidd matt-fidd added this pull request to the merge queue Jun 30, 2026
Merged via the queue into actualbudget:master with commit 8c0e8ea Jun 30, 2026
53 checks passed
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]: Can't delete a categories/groups with transaction on Mobile

3 participants