Commit Graph
16 Commits
Author SHA1 Message Date
Davide Silvestri ad08d4be1d feat: Group-by aggregations (#5602)
* feat: show per-group aggregations in grouped grid views

Each group header shows the column's configured Summarize value computed
over that group's rows, column-aligned at every depth, visible whether
the group is collapsed or expanded. Reuses the footer aggregation config
and display components, and an interactive per-group picker that sets the
shared column aggregation. Gated behind the group_by_aggregations frontend
flag; backend returns values via the existing group-by-data response.

Not included (follow-up): realtime/live updates, performance and caching,
and consolidating the group-by-data and aggregations endpoints into one
request for grouped views.

* refactor: de-duplicate Decimal NaN handling in grid aggregations

Extract the repeated Decimal("NaN") -> "NaN" JSON-safety hack into a single
json_safe_aggregation_value helper, reused by the group-by per-group and totals
aggregations and the authed/public footer aggregation endpoints.

* fix: address copilot feedback on group-by aggregations

- Only show the "+ Summarize" picker for unconfigured columns; a configured
  column with no per-group value (e.g. distribution) now renders nothing
  instead of looking unconfigured.
- Document the aggregations_only and include_totals query params and the
  optional top-level aggregations field in the group-by-data OpenAPI schema.
- Mark row_count, sibling_index and row_offset optional (omitted in the lean
  aggregations_only mode).

* fix: de-flake replay-events last-seen-expired test

The test assumed RealtimeEvent id 1 never exists, but the id sequence isn't
reset between transactional tests, so the recorded event got id 1 when the
test ran first on an xdist worker and replay succeeded. Capture the real id,
delete it to simulate retention, and replay from it.

* feat: live, consolidated group aggregation updates

Group-header aggregation values and the footer total now update live and in
place on any change (cell edit, row create/delete, realtime), with no spinner.
In grouped mode they come from a single group-by-data request (aggregations_only
+ include_totals); the standalone /aggregations/ endpoint is no longer called
while grouped. Sort changes need no refresh (order-independent). Gated behind the
group_by_aggregations flag; flag-off behaviour is unchanged.

Deferred: per-group targeting (refreshes the loaded window), the optimistic +
realtime double request, and the 7.3.2 picker e2e.

* fix: dedupe and harden per-group aggregation refresh

Selecting an aggregation in a grouped view fired the group-by-data request
two or three times and could leave the footer total hidden behind a stuck
spinner until the page was refreshed.

- Clear the footer loading flag from refreshGroupByAggregations so the total
  shows on first select.
- Make refreshGroupByAggregations the single owner and supersede in-flight
  requests so a stale response can't overwrite newer values.
- Skip the duplicate fetch from updateFieldOptionsOfField and the footer
  watcher while a picker already owns the refresh.
- Right-align and shrink the banner aggregation value, and let the label slide
  behind the previous field instead of hiding it.

* chore: remove the group_by_aggregations feature flag

The per-group aggregations feature is finished, so enable it unconditionally
and drop the flag gating from the grid footer, group banners, and the
aggregation refresh action.

* test: drop obsolete group-by aggregation feature-flag specs

The group_by_aggregations flag is gone, so the two specs that asserted the
flag-disabled behaviour no longer apply.

* fix: stop the row context menu's Select row from clearing its own selection

The global click handler that clears a multi-select when clicking outside the
grid also fired for the row context menu's "Select row" click, wiping the
selection it had just made (most visible in group-by). Skip the clear when the
click lands inside a context menu; cell clicks, which should still clear, are
unaffected.

* fix: flaky test

* fix: show the spinner for updates as well

* fix: address copilot aggregation comment

* fix: avoid optimistic group aggregation values

* fix: address feedback

* fix: hide vert divider before primary field

* fix: only re-fetch when raw_aggregation_type changes
2026-07-06 08:20:54 +00:00
716d43a9a8 Nuxt 3 migration (#4342)
Update the nuxt3 version.

Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
Co-authored-by: Cezary <cezary@baserow.io>
Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io>
Co-authored-by: Bram <bram2w@users.noreply.github.com>
2026-01-22 10:27:19 +01:00
Bram Wiepjes b5f191a5f8 Baserow distribution aggregation 2025-02-04 23:01:02 +00:00
Petr Stribny cf714d69a7 Add count aggregation to summary widget 2025-01-10 14:19:48 +01:00
Bram Wiepjes 891ba0fec7 Show summarize label in grid view footer 2024-10-14 06:59:18 +00:00
Petr Stribny 4fd3c7098b Resolve "The UI should not allow editor and lower roles to create an aggregation on shared views" 2024-03-05 03:52:38 +00:00
Jonathan Adeline d40f7210da Restyle context, select, dropdown menus 2023-11-15 06:08:35 +00:00
Jonathan Adeline 4321aaea9a Replace icons 2023-09-28 13:39:41 +00:00
Nigel Gott 698ee76514 Resolve "Allow Viewers, Commenters and Editors to make personal views" 2023-06-21 07:56:52 +00:00
Peter Evans 0426ead072 Resolve "Rename group to workspace in frontend code." 2023-03-28 14:40:58 +00:00
Bram Wiepjes ef78dbc587 Moved the permissions and roles store to the groups store 2022-11-02 11:55:27 +00:00
Jeremie Pardou-Piquemal 210c02085d Add RBAC to Baserow. 2022-10-28 18:45:34 +01:00
Jeremie Pardou-Piquemal 508ac133b0 Fix earliest and latest date aggregations 2022-05-10 14:23:48 +02:00
Jrmi 9545c817ac Σ4️⃣ Footer calculation v0.4 - improve perfs 2022-04-19 07:03:00 +00:00
Jrmi a40c27781e Σ 3️⃣ Footer calculation v0.3 - add more aggregation types 2022-02-24 15:52:26 +00:00
Jrmi a33f7a8056 Σ 2️⃣ Footer calculation v0.2 - add frontend GUI 2022-02-23 14:44:52 +00:00