Repository navigation
Description
Problem
When expenses are grouped by day, week, month, quarter, or year, exporting a selected group with Current view can export all groups matching the search instead of only the selected group.
This is an existing selection-scoping issue in the shared export path, not a regression introduced by the groups-only export option. The new Current view (groups only) option uses the same path and is affected too.
Steps to reproduce
- Have expenses in at least two different months, such as September and October.
- Open Spend → Expenses.
- Choose Display → Group by → Month, or search for
type:expense group-by:month. - Ensure both months appear in the results; do not filter the search to only one month.
- Tick the checkbox on the September group row. Leave October unchecked. Select the group itself, not an individual expense, and do not use Select all matching results.
- Choose Export → Current view.
- Open the CSV.
Expected result
Only the selected September group summary and its matching expense details are exported.
Actual result identified in code
The selected date group does not add a date restriction to the export query, and its transaction IDs are removed. The request therefore uses the original grouped search without the selection restriction, allowing unselected months to be exported.
Verification status: Identified by code inspection; not yet reproduced in a running app. Staging/production reproduction and affected versions remain to be confirmed.
Technical context
getGroupExportScope()removes IDs selected through a group, expecting a group filter to scope the export.addSelectedGroupsFilter()returns the original query if no selected-group filters can be generated.getSelectedGroupFilterEntry()supports member, card, withdrawal, category, merchant, and tag, but not date-based groups.- Review comment identifying the issue.
Acceptance criteria
- Current view exports only selected date groups for day, week, month, quarter, and year grouping.
- Selecting multiple nonadjacent periods preserves the gaps: September and November must not export October.
- Existing search filters remain in effect, including a date filter narrower than a selected period.
- Current view (groups only), when available, respects the same selection while omitting expense details.
- Failure to resolve a selected group must not silently broaden the export to the entire search.
- Add regression coverage for a single selected period, multiple nonadjacent periods, and an existing narrower date filter.
Implementation considerations
Multiple selected date ranges require OR between ranges and AND within each range, intersected with the original filters. Simply appending date comparisons to the current search string combines them with AND; merging nonadjacent periods into one range would incorrectly include unselected periods. Preserve the intended grouping in the structured export filter tree rather than losing it through a flat search-string round trip.
Activity
eszlamczyk commentedon Oct 27, 2026
Hi I am from Software Mansion Expert Agency and would like to work on this issue 👋
rlinoz commentedon Oct 27, 2026
Thank you!
rlinoz commentedon Nov 3, 2026
This might need a backend PR, let me know if you need anything!