Commit Graph
49 Commits
Author SHA1 Message Date
Davide Silvestri 479e616ee9 feat: add columns layout to grouped grid views (#6022)
* feat: add columns layout to grouped grid views

* test: strengthen Columns layout coverage

* fix: remove doubled vertical border on group column spans

The group-by divider already draws a full-height line at each level
boundary, so the span's own border-right rendered a second adjacent
line in the body but not in the header.

* chore: renumber group_by_layout migration after rebase

Develop added 0221 and 0222 in the meantime, so the branch migration
forked the graph into two leaf nodes.

* refactor: rename banner group layout to section
2026-09-17 17:50:14 +02:00
Davide Silvestri 667cfdd850 feat: support grouped row ordering (#5787)
* feat: support grouped row ordering

* fix: use existing endpoints without modifications

* fix: make grouped row moves reliable and optimistic

* address feedback
2026-08-20 10:48:05 +02:00
Davide Silvestri 716e41a11b fix: group-by grid view review follow-ups (#5662)
* fix: group-by grid view review follow-ups

Address deferred review discussions from #5470 and #5602:

- Grouped grid refresh no longer blanks the grid before fetching. The
  plain-refresh path builds the new grouped state in a snapshot and swaps
  it in atomically (refreshActiveGroupBys gains a preserveScroll flag),
  matching the flat grid's fetch-then-swap and keeping the scroll position.
- Right-clicking a group's add-row button now opens the "add N rows" menu,
  seeding each new row with the group's values (new createNewRowsInGroup
  action).
- Grouped cell selection clears the previous selection in O(1) via
  rowLocations and a tracked selectedRowId, instead of scanning every
  loaded row.

* fix: address feedback
2026-07-07 17:23:37 +02:00
dimmur-brw 8eeb53e4fc feat: User presence (part 2) - user presence on grid (#5570) 2026-07-06 08:04:35 +02:00
Davide Silvestri 0aa7147db3 Collapsible group-by grid view (#5470)
* feat: add collapsible group-by grid view

* fix: address copilot feedback, plus some other cleanup/fixes

* fix: harden grid e2e navigation

* Add e2e tests; improve performance; clean up code

* feat: show resolved values for reference fields in group-by headers

- Resolve collaborator, link-row and select group values to renderable display
  objects in the group-by data API, batched once per field per page (O(1) lookups,
  no per-group queries).
- Order many-to-many groups identically to the rows via correlated-subquery
  ordering, since the relation column is shadowed by the aggregated array
  annotation in group-by queries.
- Render the display values as chips in the group-by banner via dedicated
  multiple-select / multiple-collaborators components; shrink the collaborator
  badge, reduce the field-name size and keep the label on one line.

* fix: group many-to-many fields by their set of values

Grouping a grid by a collaborator, multiple-select or link-row field
produced empty groups with orphaned rows and duplicate headers for the
same set of values. The group key (an id array) was order-sensitive: the
backend's aggregated array order was unstable row-to-row and the cell
appends new values, so an optimistically-created group's key diverged
from the server's and rows were rejected by rowBelongsToGroupBySection.

- pathKey and the group-row Vue keys now sort m2m id arrays numerically,
  so a group is identified by its set of ids, not their order.
- The backend aggregates the group value ordered by related id and sorts
  the group's unique value, making grouping deterministic and set-based.
- Optimistically-emptied groups (row_count 0) are no longer rendered (the
  node is kept for reconciliation), and the leading group gap is fixed so
  the first visible group has no spurious gap.
- A newly created collaborator group resolves its badge name from the
  workspace store instead of requiring the name on the value.

* fix: keep cell multi-select when dragging in a group-by view

A multi-select drag ends with a click whose target is the rows
container (the common ancestor of the dragged cells). cancelMultiSelect-
IfActive cancels the selection unless that container is recognised as
part of the rows area, but its whitelist only knew the flat-grid classes
(grid-view__rows / grid-view__row). The collapsible group-by feature
renders rows in grid-view__group-by-rows containers, so the post-drag
click was treated as "outside the rows" and the selection was cleared on
mouseup. Add the group-by row containers to the whitelist.

* test: expect emptied group-by banners to disappear

The optimistic empty-group hiding (a group disappears once its last row
moves out) made the e2e contract that kept the emptied source group
visible at row_count 0 obsolete. Update the 2.2.7/2.4.4 assertions to
expect the emptied group's banner to be gone (new expectNoGroupByBanner
helper), and correct the tree-maintenance comments: the node is still
kept for reconciliation, but the layout no longer renders its banner.

* perf: load the collapsible group-by grid in one bounded request

Grouping a wide table by many fields took several seconds and a request
waterfall to render the first screen. The group tree was fetched one HTTP
request per depth, a budget that ran out before reaching any leaf forced
a per-parent fallback, and the rows endpoint resolved group-by metadata
unconditionally.

Backend
- Walk the descendant tree with one batched windowed query per group-by
  level (get_group_by_data_for_parents) instead of one query per parent,
  so a single include_descendants request returns the whole visible
  subtree in O(depth) queries.
- Scale the descent window to the viewport: row_budget = ceil(limit /
  depth). A deep group-by stacks each leaf row under its ancestor
  banners, so far fewer leaf rows fill the first screen; the window now
  returns a viewport-sized slice (~264 -> ~68 groups on a 12-level grid)
  and the rest lazy-loads on scroll.
- Gate the rows endpoint's group-by metadata behind
  include=group_by_metadata so it is not computed when unused.
- Resolve reference/link-row display values in one id__in query per field
  across all pages instead of once per page.

Frontend
- Initial load issues one group-by-data prefetch and one viewport rows
  request; expand mode no longer takes the per-depth path.
- Cap the banner indent (<=50px) and shrink the per-level arrow spacing
  as the group-by count grows, keeping the count aligned and the field
  name ellipsised; render multi-level loading skeletons for the
  not-yet-loaded levels.
- Guard walkPage against a cyclic page-resolution stack overflow and keep
  activeGroupBys filtered to fields that still exist.

Plus e2e env isolation (configurable ports, cookie prefix) and docs.

* fix: address review feedback

Addresses the review comments on the collapsible group-by grid PR.

- Gate the group-by add-row "+" on the same condition as the flat grid
  (not read-only, not a one-way data sync, has create-row permission), so
  it no longer renders buttons that error on click for data-sync tables.
- Show the "(Empty)" label for empty array-valued groups (multiple select,
  link row, collaborators), matching the text-field behaviour.
- Stop the flat-grid row placeholder from rendering in group-by mode
  (v-else-if instead of v-else).
- Render formula group-by headers via the result field type's group-by
  component instead of RowCardFieldFormula, removing the dev-only
  "Missing required prop: row" Vue warning.
- Keep the cell selected at the first/last field for both Tab and arrow
  keys (restore the pre-refactor behaviour); navigating past the edge no
  longer drops the selection in either flat or group-by mode.
- Re-enable and de-flake the "sorted add outside buffer" e2e test: assert
  on the re-resolved last row instead of a snapshotted renderedRowCount()
  index, which raced with the create-confirmation re-render in CI.

* fix: keep rows inserted below in a grouped grid view in their group

Insert-below and add-row in a grouped view now derive the new row's group
path from the neighbouring row, so it inherits all writable group-by values
and lands in the same group; `before` is set only when the next row shares
that group.

* feat: soft-cap adding group-bys at 5 in the view UI

Once a view reaches 5 group-bys the add button is disabled with a tooltip;
views that already have more keep working and only offer to remove them.

* limit group-bys; fix css

* refactor: polish code and comments

* fix: address Bram's feedback

* feat: add vertical gap between sibling sub-groups and indent banner labels with their chevron

* fix: address remaining feedback

* fix: row-coloring and fixed-height for add-row

* fix: address Bram's feedback v2

* fix regression in last commit

* fix: address grid group review comments
2026-07-03 09:09:52 +02:00
Davide Silvestri d8ff2e5b1f refactor: add a test plan and extract grid view helpers in preparation for collapsible group-by (#5430)
* refactor: extract grid view common test helpers

* refactor: extract row-lifecycle helpers and migrate grid store

Add computeRowInsertPosition to utils/row.js (expresses insert
position by row identity rather than flat array index).

Add handleRowCreated, handleRowDeleted, handleRowUpdated to
rowLifecycle.js. Each takes a store-supplied mutations adapter so
the decision logic (filter matching, sort position) is shared
between the flat-array grid store and the upcoming collapsible
group-by store.

Migrate createdNewRow, updatedExistingRow, deletedExistingRow in
grid.js to delegate through the new helpers via inline adapter
closures that translate position descriptors to the existing
flat-buffer Vuex mutations. Observable behaviour is unchanged;
search gating is preserved in each Vuex action.

Also includes grid view e2e test additions (section 1.5 task queue,
section 7.7 row identifier type, section 10.1 hover actions) and
grid test plan updates from the refactor/grid-view-common-e2e work.

* chore: fix CI

* chore: cleanup

* refactor: remove dead grid e2e search helpers and dedupe row-lifecycle guards

- Drop the unused openSearch/typeInSearch/clearSearch/toggleHideNotMatchingRows
  methods from GridPage; the richer, used variants live in
  grid_view_options.spec.ts. This also removes the placeholder/getByText
  selectors flagged in review (the remaining 'Delete row' selector stays scoped
  to the visible context menu).
- Centralize the repeated 'applyMatchFlags ?? noop' / 'rowsForMatchCheck ??
  emptyRows' guards into a single normalizeMutations() helper. No behavior change.

* refactor: remove dead updateMatchFilters/updateMatchSortings grid actions

Both grid store actions lost all production callers in the row-lifecycle
migration (match flags are now computed via onRowChange/reapplyMatchFlags and
direct computeRowMatchFlags calls). Repoint the remaining viewFilters test at
the live onRowChange path instead of the orphaned updateMatchFilters action.

* docs: note field-constraint create/edit coverage in grid view test plan

Add 1.6.x and 2.6.x TODO entries describing add/edit behavior under unique and
unique-with-empty field constraints (backend validation error surfaced +
optimistic rollback; empty values exempt from uniqueness).

* test: await route registration in failNextRequest

failNextRequest fired page.route() without awaiting it, so the intercept
could register after the caller already triggered the request. Make it async
and await registration before returning (mirroring pauseNextRequestWithSignal);
it now returns { done } and the 3 callers await it.

* test: scope grid_interaction serial mode per-describe

Replace the single file-level serial config with a per-describe one (matching
the other two grid specs) so a failure in one block no longer skips the rest and
independent blocks can run in parallel.

* docs: document createRowLifecycleContext and clarify escape wording

- Add a docstring to createRowLifecycleContext.
- Reword the Deferred/Escape note in the grid view test plan.

* fix(e2e): return created rows from createRows helper

setupGrid expected createRows to return the created rows to collect their
ids, but the helper returned void and discarded the batch-create response,
so created.map() threw 'Cannot read properties of undefined' and every
grid_interaction spec failed deterministically. Return response.data.items.

* revert publicView changes
2026-06-25 12:26:19 +00:00
Davide SilvestriandBram Wiepjes 7781461158 feat (database): add pin/freeze columns for grid view (#5055)
* feat: add pin/freeze columns for grid view

Allow users to freeze up to 4 columns on the left side of the grid view
by dragging a handle at the divider between frozen and scrollable sections.
Frozen columns stay visible while scrolling horizontally.

- Add `frozen_column_count` nullable field to GridView model (null = 1)
- Register in GridViewType (allowed_fields, serializer, export/import)
- Update leftFields/rightFields computed to split by frozen count
- Add GridViewFreezeHandle component with drag-to-snap interaction
- Enable per-field width handles on frozen section
- Support cross-section field dragging (reorder across freeze boundary)
- Hide freeze handle in read-only/public/template views
- Disable frozen columns when group-bys are active

* fix: multi-cell selection offset with frozen columns

The selection used section-relative field indices in GridViewRow while
the store held absolute indices, causing selections to render on the
wrong columns when frozen columns were active.

* fix: update test snapshots and minor cleanup for freeze columns

Update Vitest snapshots to include the conditional GridViewFieldDragging
component comment. Fix justfile update-snapshots recipe for Vitest.
Minor template formatting in GridViewFreezeHandle.

* fix: address review feedback for freeze columns

- Filter hidden fields in leftFields/checkCanFitFrozenColumns so
  frozen_column_count refers to visible fields only
- Filter hidden fields in GridViewFreezeHandle sortedFields/boundaries
  so hidden fields don't affect drag snapping or max count
- Add null guard for closest('.grid-view') in freeze handle drag
- Remove unused tooltip i18n key from en.json
- Fix double border at freeze boundary by removing border-right on
  last column and placeholder in the frozen (left) section
- Add frozen_column_count to test assertions for serialized grid views

* fix: redesign freeze handle with improved drag UX

Replace the blue dot with a solid pill grip that follows the cursor,
make the drag line follow the mouse freely with a snap preview line
at the nearest column boundary, and add hover hint tooltip. Disable
hover visuals during multi-cell selection.

* address feedback

* address feedback v2

* address copilot feedback

* Changed `grid-view__freeze-handle-grip` transition time

* Revert last child change

* Change line break comment

* fix: address feedback v3

---------

Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
2026-04-08 10:58:26 +02:00
Davide Silvestri df68bd9339 fix (grid view): group by flickering at every change (#5043)
* revert: undo unnecessary frontend changes from f6a7d302f

Revert all frontend changes introduced in "fix: bug in public view with
hidden group by" (f6a7d302f). The backend changes from that commit are
kept as they are the actual fix for the public view bug.

The reverted frontend changes caused a regression where group bys would
flicker (disappear and reappear) when changing the group by order,
because activeGroupBys was being cleared at the start of every refresh.

* fix: public view crash when group by is added or removed

Add ViewType.forceViewRefresh() method that handles updating the view,
fields, and (for grid views) activeGroupBys atomically during a
force_view_refresh realtime event. This prevents components from
accessing fields that have been removed or haven't been added yet.

Also fix LinkRowFieldType.isEqual crashing with null/undefined values
when rows have no linked items.

* fix: inconsistency in counting hidden fields in grid view

* fix issue deleting/restoring group bys
2026-03-31 14:42:43 +02:00
dimmur-brw f6a7d302ff fix: bug in public view with hidden group by (#4859)
* Fix public view with hidden group by

* Show group by feature in PublicView when fields are hidden

* Review feedback

* Review feedback v2
2026-03-24 06:25:27 +01:00
dimmur-brw c46be3919a Replace $el with refs in GridView (#4803) 2026-02-19 11:21:44 +01:00
Bram 3aee185274 Fix unobserve element error by replacing with disconnect (#4813) 2026-02-18 23:00:46 +01: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 1a5fe5e78c [3/6] View level permissions - Rows (#4072) 2025-12-03 20:54:40 +01:00
Bram Wiepjes efab3a05a8 PostgreSQL two-way data sync 2025-08-21 20:15:49 +00:00
Bram Wiepjes e06931bb35 Decrease grid view min field width 2025-02-18 11:38:41 +01:00
Przemyslaw Kukulski 9f769d5e3c Resolve "Primary field becomes invisible when set to a hidden field" 2024-11-08 14:03:51 +00:00
Bram Wiepjes 037124219c Data sync final branch 2024-09-24 15:06:35 +00:00
Bram Wiepjes e72c8b1fd2 Allow horizontal resize of left sidebar (frontend) 2024-08-02 05:08:21 +00:00
Andrea Disarò 4f6e9c575a Resolve "Improve dropdown element to allow multi select" 2024-05-31 14:07:57 +00:00
Davide Silvestri 10bfececb7 Resolve "Group bys make view inaccessible" 2024-05-30 08:29:07 +00:00
Davide Silvestri 7e38154ca2 Resolve "Group bys make view inaccessible" 2024-05-22 08:51:16 +00:00
Petr Stribny 655a59969f Support aggregations in public grid views 2024-05-02 09:29:41 +00:00
Davide Silvestri eb13b10dd3 Resolve "Allow overwriting generative AI settings on workspace level" 2024-04-08 15:41:09 +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
Bram Wiepjes d9d0f053de Allow changing width of the group by 2023-12-19 13:16:55 +00:00
Bram Wiepjes 930e7dd627 Group by count 2023-12-17 19:51:05 +00:00
Bram Wiepjes 2744183bf0 Position group values sticky 2023-11-13 14:50:37 +00:00
Bram Wiepjes f6060f8966 Group rows by field in grid view 2023-11-06 15:14:11 +00:00
Peter Evans 0426ead072 Resolve "Rename group to workspace in frontend code." 2023-03-28 14:40:58 +00:00
Jonathan Adeline 9477997282 Fix grid multiselect on small resolutions 2023-03-21 15:54:11 +00:00
Alexander Haller dbc17849c4 Resolve "Ensure Link/Lookup/Formula fields work with restricted access" 2022-12-21 10:03:52 +00:00
Bram Wiepjes f8bac3ffb8 improved mobile grid view by making the primary field not sticky 2022-11-24 21:23:30 +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
Alexander Haller 6e06ee6221 Resolve "Hide unique row ID" 2022-05-24 07:27:22 +00:00
Jrmi 224d5dfee3 🌈 5️⃣ - Row coloring v5 - Add color to Gallery and Kanban view types 2022-05-17 06:49:29 +00:00
Jrmi 8e273e6960 🌈 3️⃣ - Row coloring v3 - Add condition value provider 2022-04-30 11:25:25 +00:00
Jrmi b24e777db0 🌈 1️⃣ - Row coloring v1 - Lays the frontend foundations 2022-04-19 07:24:47 +00:00
Zuhair Rayyes c0f0f6b9ff Resolve "Arrow key navigation doesn't work not rendered cells" 2022-03-15 12:16:56 +00:00
Zuhair Rayyes 773772baf4 Resolve "Copy multiple cells" 2022-03-02 12:14:55 +00:00
Jrmi a33f7a8056 Σ 2️⃣ Footer calculation v0.2 - add frontend GUI 2022-02-23 14:44:52 +00:00
Petr Stribny b96371a7ad Resolve "Make it possible to search in the gallery view" 2022-02-21 18:33:27 +00:00
Bram Wiepjes 54874601db Resolve "Add filter and sort to the publicly shared grid view" 2022-01-11 21:43:37 +00:00
Bram Wiepjes b1a302187c fix field conversion in grid view 2022-01-10 12:26:39 +01:00
Bram Wiepjes 97b32e044c Resolve "Don't render cell outside the viewport of the grid view" 2022-01-06 13:02:26 +00:00
Bram Wiepjes 2e56808b0e Resolve "Database templates" 2021-04-08 14:30:26 +00:00
Nigel Gott a001fc170a Fix arrow navigation over hidden and re-ordered fields by performing the selectNextCell method over the ordered list of visibleFields and not the internal list of unordered fields. 2021-04-06 13:23:17 +01:00
Bram Wiepjes 9728b64df0 Resolve "Ordering fields per grid view" 2021-03-12 13:46:22 +00:00
Bram Wiepjes 4a47f21551 Resolve "User reports that a table is slow having 21 columns" 2021-03-09 20:53:39 +00:00