[PR #6432] Excel formula feedbacks #6519

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

Original Pull Request: https://github.com/actualbudget/actual/pull/6432

State: closed
Merged: Yes


  • Added QUERY_COUNT("queryName") formula function for Formula widgets:
    Returns the number of matching transaction rows for a saved query.

  • QUERY_COUNT is now recognized in function docs/autocomplete/highlighting alongside QUERY.

  • CodeMirror UX: Tab accepts autocomplete
    When the completion popover is open, pressing Tab now accepts the highlighted suggestion (same as Enter).
    Implemented with highest-precedence keymap so it wins over @uiw/react-codemirror/basicSetup bindings like indentWithTab.

  • Fixed query editor date handling (end-month bug)
    Previously, selecting an end month could normalize to the 1st day of the month, making the end month feel “exclusive” vs other reports.
    Now month selections are normalized consistently:
    start month → first day of month
    end month → last day of month

  • Fixed “Last month” query preset to be truly dynamic
    QueryManager “Last month” now uses mode: "lastMonth" (not sliding/static), so it updates over time like other dashboard cards.

  • Fixed sliding-window queries not sliding for Formula widgets


Note

Adds QUERY_COUNT to formulas, makes Tab accept CodeMirror autocompletions, and fixes query timeframe normalization and dynamic ranges (including last-month and sliding-window).

  • Formula execution & functions:
    • Add QUERY_COUNT("name") support alongside QUERY, including parsing, substitution, docs, autocomplete, and highlighting.
    • Refactor query execution with shared builder; add fetchQuerySum and fetchQueryCount.
    • Implement sliding-window as a live range; compute dates dynamically; update “Last month” preset to mode: 'lastMonth'.
  • Query Manager & timeframes:
    • Normalize month picks to days: start → firstDayOfMonth, end → lastDayOfMonth; apply on change and import/export.
  • Editor UX (CodeMirror):
    • Add highest-precedence keymap so Tab accepts active autocomplete suggestion.
  • Utilities:
    • New queryTimeFrame normalizers and getLiveSlidingWindowRange helper.

Written by Cursor Bugbot for commit df432fcbf7. This will update automatically on new commits. Configure here.

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6432 **State:** closed **Merged:** Yes --- - Added QUERY_COUNT("queryName") formula function for Formula widgets: Returns the number of matching transaction rows for a saved query. - QUERY_COUNT is now recognized in function docs/autocomplete/highlighting alongside QUERY. - CodeMirror UX: Tab accepts autocomplete When the completion popover is open, pressing Tab now accepts the highlighted suggestion (same as Enter). Implemented with highest-precedence keymap so it wins over @uiw/react-codemirror/basicSetup bindings like indentWithTab. - Fixed query editor date handling (end-month bug) Previously, selecting an end month could normalize to the 1st day of the month, making the end month feel “exclusive” vs other reports. Now month selections are normalized consistently: start month → first day of month end month → last day of month - Fixed “Last month” query preset to be truly dynamic QueryManager “Last month” now uses mode: "lastMonth" (not sliding/static), so it updates over time like other dashboard cards. - Fixed sliding-window queries not sliding for Formula widgets <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds QUERY_COUNT to formulas, makes Tab accept CodeMirror autocompletions, and fixes query timeframe normalization and dynamic ranges (including last-month and sliding-window). > > - **Formula execution & functions**: > - Add `QUERY_COUNT("name")` support alongside `QUERY`, including parsing, substitution, docs, autocomplete, and highlighting. > - Refactor query execution with shared builder; add `fetchQuerySum` and `fetchQueryCount`. > - Implement sliding-window as a live range; compute dates dynamically; update “Last month” preset to `mode: 'lastMonth'`. > - **Query Manager & timeframes**: > - Normalize month picks to days: start → `firstDayOfMonth`, end → `lastDayOfMonth`; apply on change and import/export. > - **Editor UX (CodeMirror)**: > - Add highest-precedence keymap so `Tab` accepts active autocomplete suggestion. > - **Utilities**: > - New `queryTimeFrame` normalizers and `getLiveSlidingWindowRange` helper. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit df432fcbf7b8ba3bbdfe053e89035cce3bd3604d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
GiteaMirror added the pull-request label 2026-02-28 21:29:29 -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#6519