555 Commits
Author SHA1 Message Date
Jonathan Adelineandpeter_baserow a26c5ce6b0 feat: filter dashboard widgets by date or date range (#6954)
* fix: handle calendar boundaries in date comparisons

* feat: add a single-date filter to the dashboard API

* feat: send the viewer timezone with dashboard data requests

* refactor: share dashboard filter controls and target settings

* feat: configure dashboard filter conditions on date fields

* feat: add the Date filter to the dashboard widget picker

Implement the single-date mode of #6886.

* fix: restore dragging dashboard filters by their titles

* feat: persist the dashboard date filter display format

* feat: choose how dashboard filter dates are displayed

* test: align numeric filter checks with shared dashboard controls

* style: format the dashboard date filter component test

* fix: accept fixed UTC offsets in dashboard date filters

* fix: expose dashboard filter dates as ISO strings in formulas

* fix: seed dashboard conditions with compatible operators

* feat: expose date ranges in dashboard formulas and viewer selections

* feat: configure inclusive date range conditions for dashboard targets

* feat: persist and dispatch inclusive dashboard date ranges

* docs: describe date range selections in the dashboard dispatch API

* feat: select and configure dashboard date ranges

* fix: let viewers clear each dashboard date range endpoint

* fix: preserve unfinished dashboard date range bounds on refresh

* fix: refresh public dashboards after a date filter mode change

* test: group dashboard date filter mode transitions

* fix: warn about incompatible date range formula operands

* fix: convert dashboard date defaults from the saved widget

* fix: keep dashboard filter controls aligned when a condition has a warning

* fix: clear incompatible dashboard conditions when switching date modes

* fix: show cleared date conditions without warnings or redundant saves

* fix: ignore empty dashboard date conditions after switching modes

* fix: ignore dashboard date conditions without a single date and simplify mode switch clearing

---------

Co-authored-by: peter_baserow <peter@baserow.io>
2026-12-03 20:40:18 +04:00
Przemyslaw Kukulski 67101593d4 fix: apply view field visibility to ad hoc filters, sorts and aggregations (#6913) 2026-11-30 17:07:59 +01:00
Davide Silvestri 23f328cb19 feat(database): assign identities to rows and mention them in comments (#6619)
* feat(database): assign and mention identities behind a field option

- Collaborator fields get `include_identities` and long text fields
  `long_text_include_identities`, both off by default.
- With the option on, active identities of the workspace can be assigned
  or suggested as mentions; they are shown with their icon and renamed
  in realtime, and they never receive notifications.
- Turning the collaborator option off backs up the column, deletes the
  identity assignments and strips identities from the view defaults, so
  the update can be undone.
- Identities can author row comments and be mentioned in them.
- Exports write an identity as `Name <identity>`.

* refactor: hide internal emails in collaborator exports through one check

* fix: import a personal view only for a person, without a query per owner

* fix: show collaborator identities with the icon of the user subject type

* refactor: drop a redundant local import of the core handler

* fix: unify identity icons and space field options

* fix: keep identity field menus and saved mentions readable

* fix: limit identity mention suggestions to row comments

* perf: prefetch available collaborators once per workspace

* fix: use workspace members as authors of generated rows

* fix: resolve linked collaborator values by member email

* fix: use workspace collaborators for field pickers and paste

* refactor: move identity avatar styles to the avatar stylesheet

* fix: address review feedback on identity collaborators
2026-11-18 22:53:44 +01:00
216d724aa3 Add dashboard text filter widgets (#6572)
* feat: add dashboard input filters and connected widget filtering

* style(dashboard): refine filter widget layout and resize handles

* fix: hide optional labels in dashboard filter settings

* feat(dashboard): resolve dropdown filter values from formulas

* feat(dashboard): add input and dropdown filter settings with cached options

* style(dashboard): use segmented control for filter type

* style(dashboard): remove separator above filter type

* style(dashboard): align filter settings field spacing

* feat(dashboard): support list-valued dropdown filters

* feat(dashboard): add single and multiple selection controls

* feat(ui): allow item cards without an icon

* feat(dashboard): simplify filter target configuration

* fix(ui): position floating dropdowns around their trigger

* feat(dashboard): simplify widget filter condition editing

* style(dashboard): streamline filter sidebar settings

* style(dashboard): clarify filter action buttons and spacing

* test(dashboard): align widget fixture with card rendering

* chore(changelog): document dashboard filters

* fix: preserve dashboard filter links across trash and restore

* fix: merge pending dashboard widget saves and settle all callers

* fix: match individual values in dashboard multi-select filters

* style: refine dashboard clear selection button

* feat: show dashboard filter cases as tabs with condition counts

* fix: limit dashboard refresh waits to dependent widget saves

* refactor: share the builder and dashboard item picker

* style: improve the dashboard text filter illustration

* feat: show inherited dashboard filters in widget refinements

* test: include table schemas in dashboard source responses

* fix: defer builder element availability checks until picker opens

* test: use shared item picker selectors in end-to-end tests

* feat: show Select actions for dashboard filter option fields

* feat: choose dashboard filter defaults from available options

Reuse cached options for single and multiple default selections and place the default picker below Filter values. Store multiple defaults as JSON lists while preserving existing string defaults.

* fix: clear dashboard filter defaults when options change

Save the new options and cleared default together so undo restores both. Ignore unchanged formula values and leave option refreshes unaffected.

* fix: persist filter defaults when switching selection modes

* fix: normalize dashboard filter defaults at the write boundary

* fix: preserve active filter selections when switching modes

* fix: remove unavailable dashboard filter defaults

* fix: reconcile filter defaults when dashboard options load

* fix: roll back filter selections independently of other widget saves

* fix: preserve explicit filter selections during failed saves

* fix: align dashboard filter input and dropdown dimensions

* feat: indicate when dashboard widget results are filtered

* feat: toggle dashboard filters for individual widgets

* feat: confirm and reset widget filters when changing tables

* fix: use source context data for dashboard filter options

* refactor: resolve dashboard filter options in the frontend

* refactor: organize dashboard filter providers and lifecycle hooks

* test: align dashboard context schema expectations

* fix: accept formula validation context in dashboard providers

* refactor: share dashboard update hooks and table selection

* refactor: configure nested dashboard formulas with shared field

* test: use grouped table selector in button field workflows

* refactor: validate dashboard runtime data through providers

* refactor: share formula property extraction across dashboard and builder

* refactor: delegate filter status to service types

* refactor: simplify dashboard restoration hooks and request cache

* perf: cache dashboard property extraction per widget

* refactor: resolve dashboard runtime filters through widget hooks

* refactor: rely on request transactions for dashboard source updates

* perf: share dashboard widget lookups and validation per request

* refactor: resolve dashboard context sources through handler

* refactor: validate dispatch data through every provider

* refactor: extract dashboard properties using source handler

* refactor: validate dashboard source ownership when saving formulas

* refactor: apply dashboard filters as additional AND groups

* refactor: store dashboard widget filters in relational models

* refactor: share grouped filter conversion and persistence

* refactor: delegate empty summary values to aggregation types

* refactor: place dashboard settings separators in data forms

* refactor: defer dashboard source formula imports

* fix: expose table field options for all data source types

* fix: scope dashboard cache signals to dashboard models

* feat: support option labels in selection filters

* fix: preserve summary widget spacing in edit mode

* test: preserve selection labels during filter imports

* fix: harden dashboard filters on public dashboards and select label view filters

* fix: keep dashboard filter imports, settings and stored links consistent

* fix: accept stale multi-value selections and validate inactive dashboard filter conditions

* feat: gate dashboard filter creation behind a feature flag

* feat: default dashboard filter conditions to their widget value

* fix: explain when the formula data explorer is empty

* test: use grouped table selector for agent triggers

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
Co-authored-by: peter_baserow <peter@baserow.io>
2026-11-18 15:22:53 +00:00
Bram 236249fe62 Allow editors to copy the view configuration into personal view (#6541) 2026-10-29 21:47:49 +01:00
Bram a208062925 refactor: Only include actually used icons (#6537) 2026-10-29 15:16:35 +01:00
Davide Silvestri fc6bfb299b feat(database): format AI field text output as rich text (#6221)
* feat(database): format AI field text output as rich text

AI fields with text output can store rich text, reusing the rich long
text editor without mentions or images. New AI fields default to it in
the create form; existing fields, API clients and old imports stay
plain. Rich fields add a one-line formatting instruction to the prompt.

Also:
- forward row-modal edits of AI fields, which were never saved
- keep image markdown as literal text when images are off, instead of
  reducing it to its alt text and losing the URL on save
- escape user file image references as `![alt]\[name]` so a reference
  nested in another's alt text can't stay live
- return 400 instead of 500 when a PATCH would make a primary field
  rich text

Closes #6220

* fix: preserve reference image URLs in rich text

Defined Markdown image tokens carry their destination and title separately
from the raw reference marker. Keep that data as self-contained literal
inline text when image nodes are disabled, and align the preview behavior.

Add parser, AI row persistence, and browser regressions while preserving
internal file references and the existing inline-image path.

* fix: handle AI field changes during generation
2026-10-05 09:17:09 +02:00
Davide Silvestri 331910f62e fix(database): anchor the floating add row button to the view (#6222)
* fix(database): anchor the floating add row button to the view

Position the + button absolute to the gallery, grid and timeline view
containers instead of fixed to the viewport, so it stays inside the view
when a side panel narrows it.

* chore(storybook): replace fixed with absolute in ButtonFloating story
2026-09-30 16:30:54 +02:00
alamin-br aedbdfcfd3 fix(database): guard grid against missing and stale cell values (#6207)
* fix(database): guard grid against missing and stale cell values

Grouped rows now get newly created fields, sorts treat a missing or null cell
as empty, and rich text cells tolerate a value of the previous field type.
Rows in collapsed groups resolve their group from the section key.

* fix(database): address review findings on grid cell guards

Key an undefined group value like null so pathFromKey can parse it, remove
deleted rows from collapsed groups, and sort present-but-undefined cells and
empty multiple select or collaborator formulas as empty.

* refactor(database): drop empty value for formula types that cannot be sorted

Multiple select and collaborator formulas cannot be sorted or grouped by, so a missing cell never reaches their sort.

* fix(database): sort zero in array formulas as a value

The element check treated 0 as missing, so [0] tied with [] and with other numbers.

* fix(database): keep grouped row caches shared and sort null cells as empty

addField now reuses one copy per row, so an edit reaches both sectionRows and
absoluteRows. The sort wrapper also replaces null cells.
2026-09-30 15:16:52 +02:00
Davide Silvestri 157f586602 feat(database): add a floating add row button to the grid view (#6193)
* feat(database): add non-optimistic createNewRowConfirmed grid store action

* feat(database): add floating add row button to the grid view

* test(e2e): cover the grid floating add row button

* chore: add changelog entry for the grid floating add row button

* test(database): update page snapshots for the grid floating add row button

* test: tighten floating add row button assertions

* fix(database): keep the grid floating add row button above the footer
2026-09-29 09:17:20 +02:00
dimmur-brw 5d0bef8f7a feat: enable image embedding in rich text fields (#5775) 2026-09-28 13:57:41 +02:00
alamin-br 9b4fbdff7e fix: button field follow-ups from the #6086 review (#6135)
* fix: keep a button action card open when its save finishes

A created action is keyed by its new id once the list is refetched, which closed the card while the context was still on screen.

* fix: give the button action error a line height

* fix: outline the selected button field cell

* fix: name the button actions that ran before one failed

Completed actions are not rolled back, and the old message left the clicker to assume nothing had happened.

* fix: disable a button field for users who may not click it

The dispatch operation is now scoped to the field, which is the only id a cell has to ask with. Roles attach no lower than the table, so one check on the field answers the same as one per action.

* fix: refetch permissions when a field is created or restored

A role on the table or database lists the fields it covers, so a field
added after the page loaded was refused by every field scoped check
until a reload.

* test: cover the disabled button in the row modal and on a card

* fix: keep a button action card in place while its save finishes

The refetched list keyed a created or retyped action by its new id, so
its card remounted and the editor scrolled to the top mid-save.
2026-09-23 16:00:14 +02:00
alamin-br 8d389cd0e8 fix(database): Show when a button field needs reconfiguring (#6114)
* feat: report when a button's row action points at the trash

* fix: keep a row action's mapping on a trashed field across edits

* fix: update buttons in other tables when their target is trashed

* feat: disable a button cell that needs reconfiguring

* feat: flag a row action that writes to a trashed field

* docs: describe the button reconfigure state in ADR 006

* test: cover a button healing when its mapped field is restored

* test: keep failing-click tests clickable under the reconfigure state

Give "Broken" and "BrokenChain" a table-targeting action that fails at
dispatch instead of one with no table, so requires_reconfiguration
stays false and the original click/toast assertions still run.

* perf: look up a button's own services in the reconfigure check

The uncorrelated subqueries scanned every upsert row service in the
instance, which the builder and automations share.

* perf: load mapped fields in one query when saving and serializing mappings

Update responses and realtime payloads read each mapping's field for
`trashed`, and saving looked each field up separately.

* fix: let undo restore the values of a mapping on a trashed field

The kept mapping was skipped, so replaying the exported mappings left its
current value and enabled flag in place.

* perf: skip the button lookup when no service depends on a trashed item

Every table and application created, and every field trashed, joined all
button fields and their actions even when no service pointed at it.

* fix: only offer restoring the field to heal a trashed field mapping

A permanent delete is cleaned up later without a broadcast, so an open
page never learns the action works again.

* fix: show the full label of a grid button that needs reconfiguring

The tooltip span shrink-wrapped the button, so its 90% max width
resolved against the span and cut the label short.

* fix: put a button using a trashed integration in the reconfigure state

The dispatch refuses a service whose integration is in the trash, so the
button now says so up front and open grids update on trash and restore.

* fix: update open grids when emptying the trash heals a button

Permanently deleting a trashed field or integration ends the reconfigure
state without any broadcast, so the cell stayed disabled until a reload.

* docs: note trashed integrations and permanent deletion in ADR 006

* fix: count a missing integration a button action needs

Deleting a trashed Slack bot left the action with none and re-enabled a
button that still fails. Also skips integrations outside a database, keeps
service lookups as subqueries, and stops a failed deletion leaking state.

* docs: note a missing required integration in ADR 006

* test: wait for a button field save to finish before moving on

The save sends the field update and each action call in sequence. A test
that navigated right after clicking Save could cancel the order call, so the
Stale button kept its old order and never navigated.

* fix: replace a row action's mappings with exactly what the payload sends

Keeping trashed mappings the payload left out stopped undo from removing them
and made undo raise on a mapping it had removed. The editor now sends them back.

* fix: leave the reconfigure flag out when the field refresh after a save fails

The mount-time value was written over whatever a broadcast had set since.

* fix: update buttons mapping a link field to a table that is trashed

Trashing a table trashes the link fields to it in other tables without a field_deleted signal.

* perf: send the buttons of a table in one message with their flags annotated

Every field_updated refreshes the grid, and an unannotated button cost queries of its own.

* fix: put a button whose target table is in a trashed workspace in the reconfigure state

An action can target a table in another workspace, and the dispatch refuses one whose workspace is trashed.

* fix: leave the buttons of a new table or database out of its broadcast

Duplication, template installs and imports send the created signals too, and nobody has the copy open.

* perf: pair each button service lookup only with the actions it backs

Also stop the early check deduplicating its UNION, and test that permanently deleting a builder integration never looks up buttons.

* fix: name each action that needs reconfiguring in the button editor

The field flag is now whether any action has the per-action flag, so the
editor can point at a trashed table, database or integration too.

* fix: keep the button flags out of the cached table model

They depend on other tables, so a model cached for the button's table served
them stale. They are now annotated only where fields are fetched to serialize.

* test: make the shared grid view private again after the public view test

A public view hides a field created in it until its editor closes, so the
retry test that runs later never saw its column.

* fix: update buttons mapping a link field to a table deleted from the trash

Deleting the table deletes the link fields to it and their mappings, with no signal of their own.

* fix: send a restored workspace's dependent buttons once and leave its own out

The once-per-restore check now keys the waiting on-commit callback by workspace id instead of relying on a shared Workspace instance.

* perf: leave a button's action state out of a service's table schema

The grouped aggregate rebuilds that schema uncached per property, and each
flag now cost a query per button. Nothing reads them from the schema.

* refactor: read an action's reconfigure flag straight from its definition

* fix: update buttons mapping a link field whose related field is purged

Emptying the trash for a link field also deletes its related field and that
field's mappings, which left buttons mapping it disabled until reload.

* fix: drop a mapping whose field was deleted from the trash on save

An open editor or an undo still sends the purged field's id, so every save
failed until reload. Fields that still exist elsewhere are still refused.

* fix: match no button for a lookup with no action model

An empty model list left the action filter empty, which matched every action
and would have sent every button in the instance.

* test: describe mappings replaced by the payload after a table change

The table change test sent no mappings, so it did not show a new table's
mapping replacing the old table's trashed one.

* fix: name a button action's trashed table instead of its fields

Trashing a table marks all its fields trashed, so the editor asked to restore a
field that only restoring the table brings back. The 404 from the fields fetch
now marks the table missing, and the action says so rather than a toast.

* fix: drop a mapping on another workspace's field instead of refusing it

Refusing it told the editor that the field exists.

* perf: send a button's state on its own realtime message

A `field_updated` makes the client refetch the whole grid, which for a flag
that says nothing about the rows throws away what someone is typing. The
signal also gives the enterprise restricted views a place to mirror from.

* fix: update buttons when a workspace is purged without being trashed

`delete_expired_users` and the admin panel delete a workspace outright, so
the `workspace_deleted` that would have flagged the buttons pointing into it
never goes out. A snapshot's application expires the same way.

* fix: flag an update row action that names no row

Every click on it is refused, so to the person clicking it is no different
to a target in the trash, but the button stayed enabled.

* fix: clear the server's reconfigure verdict when an action is edited

It describes the action as it was read, so the warning stayed up after a fix
until the save landed. Changing the type already dropped it by rebuilding.

* docs: name every cause of the button reconfigure state

The field and action descriptions each left one out, so they disagreed with
ADR 006 and with each other.

* test: expect the rowless button to render disabled

The server now flags an update row action with no row id, so the click the test made never lands.

* perf: serialize button fields once for all restricted views

Each serialization runs the reconfigure and action queries, which repeated for every view.

* perf: skip purged buttons and merge purge broadcasts

Buttons deleted with their container were collected for nothing, and a workspace purge
also purges its tables, so one button could be sent twice.

* fix: bump the global cache version

The button field schema dropped its action state, and cached schemas would keep the old shape.

* fix: keep the reconfigure verdict while the integration is unchanged

A trashed integration is missing from the list, so the verdict is the only warning.
2026-09-21 14:29:18 +02:00
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
Bram 42371d6beb feat: Add skeleton loading animation and make pages load instantly (#6023) 2026-09-09 11:03:03 +02:00
Bram e69a5188b3 feat: Copy view configuration (#5959) 2026-09-02 16:27:04 +02:00
alamin-br 1cdb8fd9cd feat[2/6]: Run configured actions when a button is clicked (#1722) (#5786)
* feat: add an optional actor to the service dispatch context (#1722)

* feat: add a context manager to run actions outside the undo stack (#1722)

* feat: resolve the acting user and permission workspace for local baserow services (#1722)

* feat: dispatch local baserow services without an integration (#1722)

* fix: assert actor strictly and cover the integration-less read path (#1722)

* chore: add changelog entry for actor-based local baserow dispatch (#1722)

* fix: carry the dispatch actor through clone explicitly (#1722)

Subclasses replace `own_properties` rather than extend it, so listing
`actor` there only worked for contexts that repeated the entry. Carry it
over in `clone()` instead, popping it before construction so no subclass
constructor ever sees an unexpected `actor` kwarg.

* test: cover an unauthorised actor on the local baserow read path (#1722)

The existing negative test is on the create-rows path, where the rejection
comes from the action itself. This one exercises the `build_queryset`
permission check, the only place the branch feeds a resolved actor
straight into `check_permissions`.

* fix: resolve the delete row acting user before the row ids guard (#1722)

The delete path resolved its user inside `if row_ids:`, so an empty id
list skipped the check the other paths make up front.

* feat: add the database workflow action models (#1722)

* feat: register the database workflow action types (#1722)

* fix: mix in CustomFieldsInstanceMixin for database workflow action queryset enhancement (#1722)

DatabaseWorkflowActionType only extended WorkflowActionType, which
does not provide enhance_queryset. DatabaseWorkflowServiceActionType's
enhance_queryset override calls super().enhance_queryset(), which
raised AttributeError once anything iterated a field's workflow
actions. The builder's equivalent type mixes in
PublicCustomFieldsInstanceMixin for the same reason.

* feat: add the database workflow action handler (#1722)

* feat: add the database workflow action service layer (#1722)

* fix: capture the workflow action id before deleting it (#1722)

* feat: add the database workflow action API (#1722)

* fix: put ERROR_USER_NOT_IN_GROUP in the 400 schema bucket (#1722)

* feat: add the workflow action ordering endpoint (#1722)

* feat: export, import and duplicate button field workflow actions (#1722)

* chore: add changelog entry for button field workflow actions (#1722)

* fix: remove the unused database workflow action object scope (#1722)

DatabaseWorkflowActionObjectScopeType was registered in the
object_scope_type_registry but referenced by no OperationType and no
queryset filter. Permission checks for workflow actions run against the
parent field's own ReadFieldOperationType / UpdateFieldOperationType by
design, so the scope had no consumer.

test_all_scope_types_referenced_by_operations_are_registered asserts a
strict equality between registered scope types and operation context
scope names, and correctly failed on the orphaned registration. Deleting
the scope (rather than adding a matching operation type) keeps the
phase's permission design intact. A later phase adding a dispatch
operation can reintroduce the scope legitimately once something
references it.

* fix: create a matching service when a workflow action type changes (#1722)

PATCHing an action's type reached the service with the old type, so the
new action was built from the old type's service and blew up on a missing
field. Mirror the builder: resolve the new type, prepare values without an
instance so a fresh service is created, and carry field and order over.

Also covers cross-workspace PATCH and DELETE on the item endpoints, the
only routes with no field-scoped path parameter.

* test: back each workflow action fixture with its own service type (#1722)

The fixture hardcoded an upsert row service for every action type, so a
delete_row action wrapped a local_baserow_upsert_row service, a state
prepare_values can never produce. Resolve the action type and build the
service its service_type names instead.

* test: assert the service is deleted when a button field converts away (#1722)

The test used plain django_db, so the on_commit receiver that deletes the
service never ran and ADR 006 section 8 was only half verified.

* fix: gate the workflow action endpoints behind FF_BUTTON_FIELD (#1722)

Button field creation is already gated, but the action config API stayed
open once the flag was turned off.

* docs: correct the import cycle comments and flag the unwired formula generator (#1722)

The cycle runs field_types to workflow_action_types to local_baserow
service_types and back, not through fields/models. Also record that
formula_generator has no consumer yet and what wiring it needs.

* docs: record the export path constraint and track the field duplication gap (#1722)

ADR 006 section 6 gains the constraint that FieldType.export_serialized
carries no files_zip, storage or import_export_config, so the action export
path cannot strip credentials once external integrations arrive.

Single field duplication drops workflow actions, contradicting section 8.
Track it with a strict xfail so it fails the moment the missing FieldType
duplication hook lands.

* refactor: hoist the workflow action imports in ButtonFieldType (#1722)

The local imports carried a comment claiming they broke an import cycle. There
is no cycle: neither workflow_actions.handler nor workflow_actions.registries
reaches fields.field_types. Only workflow_action_types does, via
integrations/local_baserow/service_types, and neither local import touched it.

Verified by hoisting both to module scope: manage.py check passes and the field,
workflow action, core, integrations and builder suites are green.

* docs: record that url_formula retires into an open_url action (#1722)

Phase 1 shipped the button with a `url_formula` because it landed before
the action layer. The ADR never said whether that attribute was
permanent, which left the phase 2 click behaviour undefined and would
have got more expensive to settle once real data existed.

It is scaffolding. Opening a URL becomes an `open_url` action and the
attribute retires under the zero-downtime rules, so a button never
carries both. Because that type is frontend-only the client runs it
without the dispatch endpoint, which is what keeps a URL-only button
working in public views under section 7.

* docs: correct the public view reasoning for frontend-only actions (#1722)

The open_url section justified the client-side execution path by saying it
kept a URL-only button working in public views. Phase 1 review concluded the
opposite: button fields should not appear in public views at all, and
ButtonFieldType now sets can_be_in_public_view = False.

The conclusion stands on its own merits, but the reason was wrong, and leaving
it would have had phase 2c design around a constraint that no longer exists.

* feat: add the database dispatch context for button clicks (#1722)

* fix: guard DatabaseDispatchContext against a missing field or row (#1722)

field and row default to None only so clone() can reconstruct the context
without passing actor. A real dispatch never has either as None, so raise
early instead of surfacing an opaque AttributeError deeper in a data
provider.

* feat: add the raw row data provider for button dispatch (#1722)

* test: exercise both row data providers against the same row (#1722)

* feat: dispatch a single database workflow action (#1722)

* test: cover the base database workflow action type's dispatch refusal (#1722)

* feat: add the dispatch operation and restore the workflow action scope (#1722)

* feat: run a button field's actions in order on click (#1722)

* fix: authorise an actionless button click and prove the click lock holds

* feat: add the button field dispatch endpoint

* fix: pair each dispatch result with its action inside the service

* test: pin the row snapshot semantics for button dispatch and add a changelog entry

* fix: ignore a supplied integration on a button action's service

integration_id is writable on the service request serializer and the
handler that resolves it does no permission check, so a create or update
could point a button action at any integration in the instance. At
dispatch the service then acts as that integration's authorized_user
instead of as the person who clicked, which inverts ADR 006 section 5 and
misattributes every row the click writes.

Drop the id in prepare_values, the way deserialize_property already
hardcodes None on import.

Also adds a dispatch endpoint test that a database token cannot
authenticate there.

* fix: make the row data providers safe against each other's context

Both providers share one registry, so get('row.…') now validates inside
an AI field's prompt and resolves against a HumanReadableRowContext,
which has no row. That raised an AttributeError the caller saw as a 500.
The mirror case, get('fields.…') in a button action argument, had the
same problem. Both now return None instead.

Also resolves row.id, since row_id on the update and delete services is a
formula and this is the only way an action can name the clicked row.

* fix: harden the button dispatch error path and its click lock

Two problems in the dispatch loop.

The catch wrapped every exception into WorkflowActionDispatchError, whose
error template renders the message verbatim, so a DatabaseError or an
internal ValueError put its text in the API response. Only the dispatch
exceptions written for the clicker are wrapped now; everything else is
logged and left to the normal 500 handler.

The lock was deleted unconditionally, so a sequence that outlived the TTL
deleted the lock of the click that took the key after it. The value is
now a token this click checks before deleting. The TTL moves to
BASEROW_BUTTON_DISPATCH_LOCK_TTL_SECONDS, alongside the builder's
dispatch cache TTL.

Adds an end to end test that an update action can target the clicked row
through get('row.id').

* test: resolve the button dispatch role rule through RBAC

The existing test only asserted the operation is listed in default_roles,
which passes even when RBAC cannot resolve the workflow action scope. Its
parent chain runs workspace, database, table, field, workflow action, and
the scope itself was deleted in phase 2b and restored for this operation,
so it is worth exercising. A viewer is refused, an editor clicks.

* feat: add the database workflow action api client

* feat: register the database workflow action types on the frontend

* test: pin the create/update/delete row action-to-service wiring

* feat: add workflow action reconciliation for the button field editor

* fix: treat unknown local ids as new actions and document the type-diff boundary

* feat: add the button field action list editor

* fix: namespace the sortable id fallback so it cannot collide with a real action id

* feat: save a button field's actions when the field form is submitted

* fix: re-sync workflow actions after save and guard the mount fetch by field type

* feat: report whether a button field has workflow actions

* feat: dispatch a button field's actions when its cell is clicked

* fix: keep a button field's actions when the field is duplicated

* chore: add changelog entry for the button field action editor

* fix: let local baserow service forms pick a table without an integration

* fix: send the service type when a new button action is first saved

A buffered action's service has no `type` until the server makes one, so
the follow-up update after the create sent a service payload the API's
polymorphic serializer could not type and answered with a 500. The table
a user picked on a brand new action was therefore never persisted, while
the same edit on an already-saved action worked because its service
carries the type the server assigned.

Take the type from the service the create just returned.

* fix: correct the upsert row form on the integration-less path

Two defects the button field's action editor exposed in the shared form.

The table loading spinner is only lowered again by the `loading` prop
going false, which the builder toggles around the save it makes when the
table changes. The button field buffers its edits instead, so nothing
ever lowered the spinner and the field mappings form, hidden behind it,
never came back. Raising it is now opt-out via `savesOnTableChange`.

The "choose a table" hint tested `values.table_id`, which this form never
populates: `allowedValues` is `['field_mappings']`. It was dead code
until the `databases` prop widened the condition, and then showed
permanently. Test the service, which actually carries the table.

* fix: render the field mapping formula inputs in the button field editor

A "create a row" action's field mappings render their formula input through
the shared InjectedFormulaInput, which resolves the component to render from
an injected formulaComponent. The builder and automation editors provide one;
nothing in the database module did, so the injection was undefined and Vue
rendered a bare comment node where the input should be.

FieldButtonSubForm now provides a DatabaseFormulaInput, plus the row data
provider a button action's arguments actually resolve against. Additive:
InViewport, FieldMappingForm and FieldMappingsForm are untouched, so the
builder, automation and dashboard callers are unaffected.

* test: cover the button dispatch operation reaching existing roles

RBAC reads a role's operations from the core_operation table, so an
instance whose table predates the dispatch operation denies the click to
every role. Only the post_migrate receivers write that row, so a test
database never shows it while a long lived one refuses until migrated
again. Pins both halves: the deny without the row, and the repair after
the sync.

* fix: discard the buffered action list when the field editor is cancelled

UpdateFieldContext keeps one sub-form per field alive across opens, so
cancelling only reset the form values and left the action buffer intact.
The discarded action was still listed on the next open, and a later save
created it for real. Rebuild the buffer from the last server response in
reset().

* fix: refresh a button field's has_workflow_actions after saving its actions

The flag is derived server side and returned by the field create/update
response, which is built before the workflow actions are saved. The store
committed that stale value, so a freshly configured button field kept
rendering the url link branch until the page was reloaded, and a field that
lost its last action kept a dispatch button that did nothing.

* fix: disable the button field dispatch until the row exists

The row create modal renders every visible field, so the dispatch button was
clickable there and posted a request without a row id, which the API rejects
with a generic error. Gate it on rowIsCreated like the AI field does.

* fix: keep the button action editor out of the field form payload

The nested action and service forms register up the form chain, so the field
create/update body carried their service config too. Return only the field's
own values from the sub-form.

* test: drive the buffered action list through the real editor

The test assigned localActions directly, so it never exercised addAction and
would still have passed if adding an action had called the API.

* test: restore the role cache after the dispatch operation test

The test deletes the operation rows and resets the handler's process wide
role cache. Without teardown a failure between the delete and the re-sync
would leave later tests in the same worker with a cache missing it.

* feat: add the open url button field workflow action

* fix: give workflow action formulas their application type context

* feat: return frontend only actions to the browser instead of dispatching them

* test: prove the open-url lock skip and the client_actions wire shape

* fix: remap field references inside an open url action on import

* feat: add the open url action type to the field editor

* test: pin the segmented control to the 36px small size

* feat: choose and change a button action type from a dropdown

* fix: type a service payload when a button action changes type

Changing an action's type into a service-backed type sent
`{ type, service: {} }` in one PATCH. The empty service carries no nested
`type`, so the polymorphic service serializer fails with an AssertionError
and the API answers 500. The type change now goes on its own and the
config follows against the recreated action, typed from the service that
PATCH returned, exactly as a create already did.

Also remount the per-row form on a type change: `create_row` and
`update_row` resolve to the same component and the row key does not
change, so Vue reused the instance and could show the old config.

* fix: type a button action's service on a plain config update too

A type round trip inside one editing session (create_row to update_row and
back) leaves the type matching the server's, so the payload carries no
top-level `type` and the deferral guard does not fire. Its service is still
brand new, because picking a type resets the config and the remounted form
re-seeds it, so it reached the API untyped and hit the same polymorphic
serializer 500.

The service fixup now lives in `withTypedService`, shared by the create
follow-up and the plain update. An empty service is dropped rather than
sent, a configured one takes its type from the action the server already
has, and an update left with nothing to say makes no call. The server
response is read with the same optional chaining the surrounding id guards
already use.

* fix: run a button's browser side actions after the dispatch response

* test: prove a button's client actions run one after another

* feat: retire the button field url attribute into an open url action

* fix: keep the merged button field migration untouched

* chore: add changelog entry for the open url button action

* fix: decide a button url's protocol with the browser's url parser

A leading C0 control character made the scheme regex read a
`javascript:` url as relative, so it passed through untouched and was
assigned to window.location, where the parser stripped the control
character and ran it. Parse with new URL() instead, which is the same
parse the browser performs.

* docs: correct adr 006 on how open_url actually reaches the browser

Section 2 still said a frontend-only action skips the dispatch endpoint
and that url_formula is still read. Both are now wrong: the client always
dispatches and the server returns the frontend-only actions under
client_actions, and url_formula is a deprecated column nothing reads.

* test: record that clicking an existing button needs the flag on

The registration comment claimed existing button fields keep working with
the flag off, but only reading does: has_workflow_actions is serialized
either way, so the cell renders an enabled button whose click the gated
dispatch endpoint refuses. State the real boundary and assert it.

* test: assert the open url formula reference the frontend actually uses

The formula lacked the field_ prefix, so it was not the reference form the
migration writes or the data provider resolves, and the assertion only
checked the id appeared somewhere in an echoed string.

* fail a button click that would write an unwritable field

ADR 006 section 5 requires a click to fail when an action would write a
field the clicker cannot write, rather than skipping it the way the
builder's upsert does. The upsert service type is shared, so the rule is
carried on the dispatch context: DatabaseDispatchContext turns on
requires_writable_fields, and only then does the upsert raise instead of
filtering. The builder, automation and dashboards inherit the default and
keep skipping.

The refusal is a PermissionDeniedDispatchException, listed in
USER_FACING_DISPATCH_EXCEPTIONS so it reaches the clicker's error toast as
ERROR_WORKFLOW_ACTION_DISPATCH_FAILED rather than a 500. It is raised
before any row is written, so nothing lands.

* remap a button action's service formulas on import

A create or update row action can map a field to a formula such as
get('row.field_25'). Only the field mapping's field_id was remapped on
import, so a duplicated table or an imported database kept a formula
naming the source table's field and silently wrote the wrong value.

Wires the formula generator that was already there to a database-side
import_formula, and gives the row data provider the import_path it needs
to remap a field reference.

* cover the button dispatch failure toast

ERROR_WORKFLOW_ACTION_DISPATCH_FAILED is the only failure surface a
clicker gets until a later phase, and nothing tested it. Adds the API side
(400, the error code, and a body naming the action that failed, with the
earlier action's row still standing) and the cell side (both branches of
the catch: a handled API error goes through notifyIf, anything else raises
the toast itself).

* correct adr 006 on the button loading state

Section 3 described broadcasting the loading state to every open view over
the row realtime channel. That was descoped to phase 4 on 2026-07-28: local
dispatch is synchronous, so the clicker gets the result in the response and
other viewers see the rows change through the normal signals. The clicking
user's own loading state does exist, so the section now describes that and
records the deferral.

* log skipped formula remapping and correct import docs

The formula importer swallowed parse and unknown-provider errors without a
trace. The swallow stays, but a genuine failure now logs a warning, and the
comment says a partial remap is possible.

Two import/export tests claimed the formula came back untouched. It is
re-rendered from its parse tree, so casing and spacing may change; the
wording now says what actually holds.

The ADR 006 sequence diagram returned results after the failure branch with
no else, contradicting section 2. Added the success branch.

* refresh the clicker's grid after a button dispatch

A dispatch changes rows server side, so the client applies nothing itself,
but the WebSocketId header still left it out of the realtime broadcast its
own request triggered. The clicker's grid stayed stale until a reload while
every other viewer saw the change.

Requests can now opt out of the header.

* offer field mappings on an unsaved button action

The upsert form derives its mappings from the service schema, which only a
saved service carries. The button editor buffers its changes, so a newly
added create or update row action had none and the form reported that the
table held no writable fields. Nothing could be mapped until the field was
saved and reopened.

The editor now fetches the target table's fields itself, which also keeps
the list right when a table other than the saved one is picked.

* keep the add button out of the action list's sortable container

The sortable directive builds the new order from every element child of the
dragged item's parent. The add button sat alongside the action rows, so its
missing sortable id arrived as undefined, the id-to-action lookup missed,
and an undefined entry landed in the list. The next render then threw on
action.id and took the whole editor down, which is why adding and deleting
stopped working after a drag as well.

The rows get a container of their own, as every other sortable list in the
codebase already does, and an unresolvable id no longer reorders anything.

* name the row provider after the row it exposes

The picker group was labelled just "Row", directly under the action's own
table picker, which reads as a row of that table. It is the clicked row, and
there is no row of the target table to reference: a delete or update action
chooses rows by id.

Also covers deleting several rows in one click, which the service's own
tests only exercised with an integration behind them.

* match the action editor to the figma

Four gaps against the design:

The actions section had no heading. The design puts "Actions" and "Add
action" on one row above the cards, under a divider; the add button sat
below the list instead, with no label and no rule.

The empty state invented copy the design does not have. It now shows the
heading and nothing else.

The drag handle was an icon glyph. The design draws two columns of three
dots, which is how the builder draws its own handles, so it is drawn the
same way here. The 10px handle plus its 10px gap keeps the 20px slot the
icon had, so the dropdown width above is unchanged.

The type dropdown searched with the generic "Search" placeholder rather
than "Search actions".

* annotate whether a button field has actions when fields are listed

has_workflow_actions is serialized for every button field, so the
property's own exists() cost one query per button on every table load.
Annotate it in enhance_field_queryset, which the bulk field fetches
already run, and keep the query as a fallback for a field fetched alone.

* refuse a dispatch whose integration has no authorized user

authorized_user is nullable, and an import nulls it when the exported
username is not in the target workspace. get_acting_user returned that
None, which reached a permission check as an anonymous user. Raise the
same exception it already raises when no actor supplies a user.

* stop a re-picked table hiding the field mappings behind a spinner

The action editor saves nothing when the table changes, but the upsert
form still raised its own tableLoading, which only the loading prop can
lower. The table dropdown is not clearable, so re-picking the selected
table re-emits the same id: table_id never changes, nothing refetches,
loading never moves and the spinner covers the mappings for good.

Opt the editor out with savesOnTableChange, and let loading raise the
spinner as well as lower it for a caller that has opted out.

* discard a field fetch overtaken by a newer one

Picking two tables in quick succession left whichever response arrived
last describing the mappings, which can be the table no longer selected.
Take a token before the fetch and drop a response whose token is stale.

Only the newest fetch lowers the spinner too, so an overtaken one cannot
uncover the previous table's mappings mid flight. Clearing the table
lowers it directly, since the fetch it supersedes no longer will.

* name the failed action by its position, not its id

The toast read "The workflow action 62 failed". That id is a primary key
the clicker never sees anywhere in the UI, so it identified the action
without telling them which one it was.

The editor shows an ordered list, so report the position instead.
Counted over the whole list, frontend-only actions included, so it
matches what the editor shows.

* add a deferred callback context for imports

Some import work can only be done once everything has been imported. This
lets an importer register that work instead of doing it, and runs it when
the entry point that opened the context exits.

* import a button field's actions once every application is in

An action can target a table, and name fields, of another database. The
field hook that imported them runs at the end of one database's import, so
a reference into another one was read as trashed: the target table came out
null and the field mappings were dropped, leaving a button that looked
configured and did nothing.

The action import is now deferred until every application has been
imported, and the formula remapping it registers waits until every action
has been imported. Every path that reaches the action import opens a
callback context.

* let the service decide how it acts, not the dispatch context

A Local Baserow service already knows how it runs: with an integration it
acts as that integration's authorized user on someone else's behalf, and
without one it acts as the person in front of the screen. Two flags were
telling it the same thing from the outside.

`requires_writable_fields` is gone; the upsert service reads
`service.integration_id` instead. `requires_integration` no longer takes a
dispatch context and is False for every Local Baserow service, so a missing
integration is refused by `get_acting_user` rather than one step earlier.
The message a dispatch source sees is unchanged.

* remap an open url through the shared formula import

The url had its own `deserialize_property` calling `replace_field_id_references`
by hand, because the `fields` data provider had no `import_path` and so the
shared importer could not remap a `get('fields.field_25')`.

The provider has one now, next to the one `row` already had, and the url is
declared as a `simple_formula_fields` entry. The deferred import pass moved
up to `DatabaseWorkflowActionType` so an action without a service reaches it
too, which is what `open_url` needed.

* let each application type say where the tables come from

The shared Local Baserow service form carried its own integration dropdown
and worked out the databases from whatever was picked. That only suits an
application type that has an integration, and a button field has none, so it
had grown a second way in through a `databases` prop.

The form now only picks a table, from the databases it is handed. Supplying
them belongs to the wrapper of the application type it is rendered in: the
builder and automation offer the dropdown, a button field passes its own
workspace. Both dropdowns are the same `LocalBaserowIntegrationPicker`.

The builder's workflow actions were relying on the shared form's dropdown
without ever asking for it, so they get `picksIntegration` and keep it.

* chore: simplify code comments (#1722)

Second pass over the comments this branch adds: cut the ones that restate
the code, and rewrite the over-compressed ones to say why rather than what.

* refactor: use the WithRegistry get_type shortcut in the action serializer (#1722)

* fix: hand relational row values to actions as ids (#1722)

A link row, select or collaborator field held a manager or a model instance,
which reached the row API as something it could not write. The field type's
internal value is used instead, and read-only fields fall back to their
computed value.

* fix: keep the target table's field names out of the dispatch error (#1722)

The message reaches the clicker, who may have no access to that table at all.
Roles are not field scoped, so the list could only ever name every mapped
field, which says nothing the table name doesn't.

* chore: clarify the is_frontend_only comment (#1722)

* fix: keep the picked integration when the builder service form emits

The form no longer emits integration_id, so rebuilding the service from the
server's copy dropped a freshly picked one and saved the action without it.

* fix: trash the imported applications when a deferred callback fails

The callbacks run once the import loop is over, so a failure there raised past
the cleanup and left a partial import visible.

* fix: give client actions the row as it was at click time

The dispatch takes its own realtime broadcast, so an earlier row action could
update the cell's row before open_url resolved its formula.

* test: assert the dispatch refusal names no fields

* test: cover the button field click path end to end

* test: cover realtime, reorder, save failure and public views end to end

* fix: keep a button's loading state when the grid swaps the cell

* test: cover unmount during dispatch, two buttons on a row and a re-picked table

* test: cover an action type change, a reorder alongside it and a self deleting row

* fix: refuse a database dispatch carrying an integration (#1722)

An integration's authorized_user outranks the dispatch actor, so a service
that carries one would run every click as that user. prepare_values already
strips integration_id on the way in; guard the dispatch too, and cover both
with regression tests.

* feat: expose the clicked row id to a button's url formula (#1722)

A url resolves through the fields provider only, which is built from the
table's fields, so the row id was unreachable from an open_url action. The
row provider carries it but is deliberately kept out of urls, since it
returns raw types. Add the id to the fields provider on both sides instead.

* fix: keep a duplicated action's target table outside the copied scope (#1722)

Duplicating a table maps only that table, so an action pointing anywhere
else found no mapping and had its target nulled. A duplicate stays in the
same workspace, so the original table is still right; an import can land
elsewhere, so that case still nulls. The button field also has to pass the
import config down, or the service type cannot tell the two apart.

* refactor: namespace the button dispatch lock setting under DATABASE_ (#1722)

Matches BUILDER_DISPATCH_ACTION_CACHE_TTL_SECONDS ten lines above it, so
the module a setting belongs to is readable from its name. Also documents
it in configuration.md, which it was missing from. Not added to
env-remap.mjs: the frontend never reads it.

* refactor: namespace the row workflow actions as local_baserow (#1722)

The create, update and delete row actions are Local Baserow specific today
but will not always be, so name them for it now rather than carry a
compat_type forever. Renames the three models, their types and the type
strings; open_url is frontend-only and keeps its name.

The builder already has models of these exact names pointing at Service,
so the abstract base sets an explicit related_name to keep the reverse
accessors apart. The migration is edited in place since it was created on
this branch.

* test: cover the button field's remaining basics end to end (#1722)

Four gaps the unit and backend tests cannot reach on their own:

- a click runs as the user who clicked, proven with two real users in two
  browsers rather than a mocked request
- a duplicated table keeps its actions pointing somewhere resolvable,
  including a target outside the copied scope, which is the case that
  emptied the form's dropdowns
- creating the field through the UI, the only coverage of the feature flag
  gating the type dropdown
- a create row action, whose new row reaches the grid by a different
  broadcast to the other action types

Removing an action joins add, reorder and retype in the editor save test.

The suite gains three columns, so the viewport widens to fit them, and
opening a field's editor now retries because the context self-hides when it
does not fit.

* chore: drop the button field changelog entries until the flag is lifted (#1722)

The button field is behind FF_BUTTON_FIELD, so a single entry when the flag
is removed says more than eight spread across the phases. The encode_uri
entry goes with them and needs folding into that final entry: those formula
functions ship ungated.

* fix: read the clicked row again as each button action starts (#1722)

The row provider held the row from click time, so an action saw what the
actions before it did only for values behind a related manager: link row,
multiple select and multiple collaborators query when they are read, and
were never part of the snapshot the rest of the row was. A sequence mixed
snapshotted and live values with nothing to say which was which.

Every field now reads at the same moment, once per action. Reading the row
after an earlier action deleted it fails that action rather than resolving
to nothing, which would have written blanks over the deleted values.

Reverses the snapshot decision in ADR 006 section 4, which leaned on the
previous-action provider for fresher values. That provider is not built
yet, and reads a named action's result rather than the row.

* fix: keep a duplicated action's field mappings for a kept table (#1722)

A duplicate keeps a target table that falls outside the copied scope, but
that table's fields are outside it too, so nothing mapped them and every
mapping was dropped. The action landed on the right table with nothing to
write to it.

An unmapped field is now kept when it still exists, which is what tells a
field outside the copied scope apart from a trashed one. Trashed fields
are still dropped, or they would come back pointing at the source table.

* fix: restore the row id input on the get row data source (#1722)

The service form stopped carrying an integration when the table picker
moved to a `databases` prop, so the guard on this block never passed again
and the data source could no longer be given a row to fetch. The upsert
form was moved off the same guard, this one was missed.

The table is what the row id depends on, so it is what the block asks for.

* fix: apply a mapping edit when the field is left, not on its timer (#1722)

A mapping formula is only applied 500ms after the last keystroke, so a save
in that window read the buffer before the edit reached it and kept the old
formula, with nothing to say the edit was dropped. The button field's
editor makes this easy to hit: clicking Save is what ends the typing.

The formula input now says when it loses focus, and a pending edit is
applied there instead of waiting. Clicking Save takes the focus, so the
edit lands first. Builder and automation stop waiting on the timer too.

* fix: refuse to read a password field into a button action (#1722)

The row provider handed back whatever the column stores, and for a password
field that is the hash. Mapping it into a text field copied the hash
somewhere readable, which every other surface prevents: the response
serializer, exports and row history all mask it.

A field type can now say its stored value must never be handed back, and
the provider refuses to read one. The editor leaves such a field out of the
data explorer, so it cannot be picked in the first place.

* fix: identify an unsaved button action by more than its place (#1722)

An action with no id yet was keyed by its position, so deleting one handed
its key, and with it the form Vue had already built, to the action below.
Two unsaved actions of the same type left the survivor showing the deleted
action's configuration.

Each action the editor makes now carries a client id, which identifies its
row until the server gives it a real one. It is stripped from what is sent
and from what is diffed, so nothing reaches the API.

* fix: wait for the saved actions before the list can be edited (#1722)

The editor started empty and filled itself when the fetch returned, so an
edit made in between was replaced by the response. Keeping the edit instead
would have been worse: the buffer would be missing the actions the user
never saw, and saving would delete them.

The list is only rendered once the fetch is in, with a spinner until then,
so neither is reachable.

* feat: tell the table when a button field's actions change (#1722)

A cell renders a working button or an inert one from `has_workflow_actions`,
and nothing told anyone else when that changed. Adding the first action, or
removing the last, left every other session showing the button the wrong way
round until a refresh.

The action signals now send the button field out again, so the flag everyone
holds matches what the field has. The field is all that is broadcast: an
action's configuration is of no use outside the editor.

* fix: keep a half saved action list open on its edits (#1722)

A save that failed part way still closed the editor and replaced the buffer
with the server's list, so whatever had not saved was gone with only a toast
to say so. Keeping the buffer as it was is not enough either: the actions the
attempt did create would be created a second time on the retry.

The buffer now takes on the ids the server handed out before it is kept, so a
retry updates what exists and creates only what does not. The server list is
refreshed either way, so the retry diffs against what is really there, and
the editor stays open on the edits rather than closing over them.

* fix: stop the field watcher discarding kept action edits (#1722)

The editor stayed open on a half saved list, then emptied itself anyway: the
field's own update reaches the `field` watcher, which rebuilds the form from
the server's list and throws the kept edits away.

The watcher now leaves the form alone while a failed save is holding edits
for a retry. Cancelling drops them, as it always did.

* fix: require update rights to read a button field's actions (#1722)

An action is serialized with the schema and select options of the table it
writes to, and reading the field was enough to be handed them. A viewer with
no access to that table could read it through a button pointed at it.

Reading the actions now asks for the same right as changing them, which is
what the rest of the editor already asks for. Clicking a button is unaffected:
the dispatch reads the actions through the handler and keeps its own checks.

* fix: hide the schema of a target table the reader cannot see (#1722)

Requiring update rights to read a button's actions narrowed who is handed the
target table's schema, but not to people who may see that table. An editor of
one table could still read the fields and select options of another through a
button pointed at it.

A service now says whether the reader may see the table it writes to, and
carries no schema when they may not. The editor says so in place of the field
mappings rather than showing an empty list. The masking is a database only
serializer, so the builder and automation are untouched.

* refactor: drop the unused formula field error helper (#1722)

`get_formula_field_error` lost its last caller and only its own tests still
reached it. Premium's `get_ai_prompt_error` does the same job for the one
field that needs it, on the same shared helpers.

Two of its tests were really covering `get_table_field_ids` caching and its
invalidation, which premium still relies on, so they now call that directly
rather than going through the helper being removed.

* test: cover removing an action, and drop the unused e2e helpers (#1722)

`deleteWorkflowAction` and `orderWorkflowActions` were never called, and
`updateWorkflowAction` only ever by this module. Reordering is already
covered by dragging in the editor, but nothing covered removing an action,
which is the path that deletes it server side on save.

That test now exists and the two unused helpers are gone, with the third no
longer exported. The suite needs every column on screen at once, so the
viewport grew with the field the new test needs.

* fix: refuse a click whose mapping points at a trashed field (#1722)

A mapping whose field had been trashed was dropped at dispatch, so the click
wrote the row without it and reported success. A create row action configured
with one mapping made an empty row.

It now fails the way an unwritable field already does, so the clicker is told
rather than left with a row that quietly lost a value. The mapping itself is
untouched, so restoring the field from trash heals it (ADR 006 section 8).
A disabled mapping writes nothing, so a trashed field behind one is ignored.

* docs: say that a button's actions are not undoable yet (#1722)

ADR 006 section 8 claimed configuration changes were undoable like other
field updates. Nothing makes them so: the service has no undoable action
type, and the only undo related code keeps clicks out of the stack.

The field update around a save is undoable, so undo leaves the label
reverted and the actions as they were saved. A test pins that half state,
so the deferral lives in code rather than only in prose, and fails when
undo is implemented and the ADR needs revisiting.

* refactor: move the service action base in with the types (#1722)

`DatabaseWorkflowServiceActionType` sat beside the registry while every type
extending it lived in `workflow_action_types.py`. The builder splits the same
two files the other way round, with only its base type and registry in
`registries.py`.

A move, no behaviour change. It also takes the API serializer import out of
the registry module, which now reaches no further than core and contrib.

* refactor: keep the button field out of the generic field form (#1722)

* chore: annotate the button field's workflow action types (#1722)

* chore: annotate the rest of the button field's new backend code (#1722)

* fix: release the button dispatch lock atomically (#1722)

* fix: create a workflow action with its config in one call (#1722)

* refactor: drop the unread integration assignments in upsert dispatch (#1722)

* refactor: return the button dispatch result as a dataclass (#1722)

* fix: keep a button field's actions when a type change is undone (#1722)

* refactor: swap a workflow action's type in place instead of recreating it (#1722)
2026-08-20 12:33:20 +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
alamin-br 3b2ab433bf feat[1/6]: Add button field type with URL button behind feature flag (#1722) (#5767)
* refactor: move formula field-reference visitors from premium to core

* feat: add ButtonField model and fixture (#1722)

* feat: add read-only button field type backend (#1722)

* feat: resolve database formulas client-side for the button field (#1722)

* feat: add button field type frontend (#1722)

* chore: add changelog entry for button field (#1722)

* fix: disable button field cells when the url formula is broken (#1722)

* fix: encode whitespace in resolved button field urls (#1722)

* fix: rename button field visitor tests to avoid pytest module collision

* test: add button field to expected premium export outputs

* test: add button field to remaining interesting-table test expectations

Registering the button field in construct_all_possible_field_kwargs
changed the interesting test table used by several golden-output
tests. Update the affected expectations (serialized row value, CSV
export column, and generated schema entry) to match actual behavior.

* feat: put the button field behind the button-field feature flag

* fix: address button field review nits

* fix: renumber button field migration after develop merge

* docs: describe the button field as an action field in API docs

* fix: handle raw formulas and missing field references in button fields

* fix(review): remap binary-op field refs, cache parse trees, extend button field tests

- visit both operands in BaserowFormulaReplaceFieldReferences.visitBinaryOp so
  get() references inside binary expressions are remapped on import/duplication
- cache client-side formula parse trees so large grids do not re-parse the same
  button formula for every row
- add tests for the urlInvalid submission block, the field-store fallback in
  functional grid cells, and duplication with broken field references

* fix: keep button field type registered when the feature flag is off

Gating registration behind the flag meant that disabling it after button
fields existed made every registry lookup for those fields raise, breaking
all row, field and export endpoints for the affected tables.

The type is now always registered on both backend and frontend, matching
how other gated field types work. Creating a button field (or converting
a field to one) is rejected with ERROR_FEATURE_DISABLED while the flag is
off, and the field type dropdown hides the type entirely via the new
isVisibleInDropdown hook. Existing button fields keep rendering and their
tables keep working.

* fix: keep brackets when remapping field references in formulas

* fix: keep the button url formula mode when remapping field references

Assigning the remapped formula string to `url_formula` made the patched
`save()` re-wrap it through `to_python` as `simple` mode, undoing the
raw-mode guard in `replace_field_id_references`. A raw literal URL then
became an unparseable formula, so duplicating a table left the button
broken. Assign the whole formula object so mode and version survive.

* fix(review): share the formula field id cache and cover the flag-off cases

Move `get_table_field_ids` and its `table_schema_changed` invalidation into
core next to the visitors, so validating a button field's url formula no
longer costs a query per field on every field response. The AI prompt
validation now reads the same cache instead of its own copy.

Also list the edited field's own type in the field form dropdown even when
hidden, otherwise an existing button field renders with a blank type once
the feature flag is turned back off, and drop the always-null cell backup
on type conversion.

* chore(review): tidy the button field export branch and flag docs spacing

* test: cover the formula parse tree cache

The cache is shared by every resolveFormula caller, including the builder,
so record what it guarantees: one parse per distinct formula, raw formulas
never parsed, failures not cached, and oldest-first eviction at the cap.
Also state the read-only invariant the reuse depends on.

* fix: guard and cache the formula field reference helpers (#1722)

`get()` and `get('fields')` both parse and both pass the create API, so
remapping them raised an uncaught IndexError that aborted the whole
duplication or import job. Guard every index instead.

`extract_field_id_dependencies` also parsed raw formulas, unlike its two
sibling helpers, and re-parsed on every call. It now short-circuits raw
mode and caches the extracted ids per formula string.

* fix: keep the AI prompt's mode when remapping field references (#1722)

Moving the reference visitors to core added a raw short-circuit that
returns a bare string. `AIFieldType.after_import_serialized` re-saved
that string, so `to_python` re-wrapped a raw natural language prompt as
`simple` mode and every row's generation then failed on parsing the
prose.

Assign the whole formula object instead, the same way the button field
already does, and cover a raw prompt surviving an export/import.

* feat: add the encode_uri and encode_uri_component formula functions (#1722)

A button field's URL is built by concatenating row values, so a value
holding a reserved character corrupts it: `shoes#7` truncates to a
fragment and `a&b=1` injects a parameter. Encoding every value
automatically is not an option, because a value can legitimately be the
whole URL.

These mirror the two functions that already exist in the database
formula language and let a formula escape the parts that need it. The
backend and the browser encode identically, since button URLs resolve
client-side and everything else resolves on the server.

* fix: address review on the button field backend (#1722)

The field no longer creates a database column. It held nothing but an
always-null boolean, and that boolean leaked into the API docs and the
Local Baserow schema. `get_model_field` returns None and a
`NoDatabaseColumnField` is contributed to the generated model instead,
which Django treats as non concrete. A `ButtonFieldConverter` handles
conversion in both directions, since the lenient schema editor cannot
alter into or out of a column-less field, and the serializer is now
always-null while staying writable so the read-only validator still
rejects a write.

Also from review: only creation is gated by the feature flag, so an
existing button field stays editable with the flag off; dependencies are
read off the cached table model rather than two queries per field; and
the client is only told to re-fetch when a referenced field appears or
disappears, not when one is renamed or retyped.

* fix: address review on the button field frontend (#1722)

Without a label the button showed the percent-encoded URL. The URL is
now resolved once as the user built it and only the href is encoded, so
the label reads `https://example.com/Red Button` while the link points
at `Red%20Button`. With no label and no URL it reads "Click me".

Also from review: a read-only field the search cannot match no longer
disables optimistic row updates for every edit in a searched view, which
a valueless field like this one did; the parse tree cache evicts the
least recently used entry rather than the oldest inserted one; and the
field type reports its icon class statically and no longer claims its
cells are booleans in the API docs.

* fix: hide button fields from public views and require a label (#1722)

Button fields are no longer handed to visitors of a publicly shared view.
A new `FieldType.can_be_in_public_view` flag drives the exclusion, applied
to the public view info endpoint, the public rows queryset and the two
public websocket signal paths, so a visible field option isn't enough to
expose the label and the URL formula.

The label is now mandatory. It's the only text a button shows, so it must
be set when the field is created or converted into a button, and it can't
be emptied afterwards. The client-side fallbacks to the resolved URL and
to a default label are gone with it.
2026-07-29 14:53:38 +02:00
Bram 92ce535aba feat: Report abuse in public views (#5766) 2026-07-29 13:24:21 +02:00
Bram b0451c7aad bug: Fix grid scrolling blocked when hover scrollable cells (#5784) 2026-07-29 13:23:56 +02:00
dimmur-brw b4a9872f62 fix: resolve search/filter/sort race condition in grid view refresh (#5765) 2026-07-24 12:15:13 +02:00
Peter Evans b07b64fac4 feature: introduce filter groups to Local Baserow services (#5703) 2026-07-23 11:57:07 +01:00
Davide Silvestri 3a4a57246d fix: use the official TipTap Markdown extension and fix newlines disappearing (#5721)
* fix: use TipTap Markdown for rich text fields

* fix: escape markdown at line starts only and skip saves without edits

* perf: skip the preview markdown round-trip when no empty paragraphs are possible

* fix: address feedback; add docs

* fix: copilot feedback

* fix: copy one cell, paste in edit mode in another one
2026-07-22 12:02:53 +02:00
dimmur-brw f5ebc9457c feat: show anonymous public view visitors in editor's presence bar (#5704) 2026-07-20 17:01:01 +02:00
alamin-br 59da1eb2da feat: rich content in form view descriptions (#1851) (#5707)
* feat: rich text editor for form field description (creator)

* feat: render form field description as rich text (respondent)

* feat: rich text editor for form description (creator)

* feat: render form description as rich text (respondent)

Renders the form-level description read-only via RichTextEditor in
FormViewModeForm.vue (the public standard form), matching the field
description treatment from FormPageField.

FormViewModeSurvey.vue was checked and has no separate form-level
description/title render at all (it goes straight to fields), so no
change was needed there.

* docs: changelog for rich form descriptions (#1851)

* fix: only save form description after an actual edit

saveDescription ran on every editor blur and compared tiptap's
normalized markdown against the raw stored value, so clicking into
a legacy plain-text description (with chars like *, #, %) and away
without editing silently rewrote the stored value. Add a dirty flag
set only by update:modelValue (real edits) so blur without an edit
is a no-op.

Also drops the unused editor-class attribute on the description
RichTextEditor (no matching SCSS rule).

* perf: only mount field description editor when needed (v-if)

* fix: preserve in-progress description edit on external update; add e2e coverage

* fix: click-to-edit toggle for form descriptions; fix cursor reset

Replace the always-editable inline RichTextEditor on the form builder with a
shared FormViewDescription component that renders read-only markdown and mounts
the editor only while editing, behind an edit pencil (matching title/submit).

- Restores the edit affordance that regressed vs the old Editable.
- Passes model-value one-way and reads markdown back on blur, so typing after
  moving the cursor no longer resets to the end.
- No floating menu lingers on the form once editing stops.
- Removes the dirty/save-on-blur logic duplicated across FormViewField and
  FormViewModePreviewForm.

* test: cover form description toggle and save-on-blur

* fix: keep description editor menu stuck to cursor line on scroll

Pass the form preview's scroll container (.form-view__preview) to the editor so
its floating/bubble menu tracks the cursor line while the page scrolls, instead
of falling back to the editor's own non-scrolling root.

* Address PR review feedback (#5707)

- Route public form description render sites through FormViewDescription
- Pass scroll container as a resolver prop instead of a closest() lookup
- Wrap long unbroken words in form and field descriptions
- Use palette color variable for the description placeholder

* fix: clamp form description containers to the form column

The flex editor wrapper inside the inline-block description containers
made them shrink-to-fit their max-content width, letting long words
escape the form column on the public form.
2026-07-17 17:40:40 +02:00
Davide Silvestri 2fdee1e93b feat: add group by field to grid field context menu (#5705)
* feat: add group by field to grid field context menu

Adds a toggle in the grid field header menu to group by a field
(and un-group when already grouped), gated on the create_group_by
permission and hidden past the group-by limit.

* chore: remove active CSS class and check icon
2026-07-15 12:03:53 +00:00
Davide Silvestri ecdda10a8f feat: add configurable max length for text-based field values (#5689)
* feat: add configurable max length for text-based field values

Add BASEROW_MAX_FIELD_TEXT_LENGTH (default 500000), enforced at the serializer and in the frontend for single line text, long text, URL and AI fields. Existing longer values remain readable; only new writes over the limit are rejected.

Implements #5688

* fix: address review feedback for max text length

- Fix rich text editor modal crashing on expand: guard
  FieldRichTextModal.serializeToMarkdown() while the editor is
  unmounted during the open transition.
- Surface the max-length error inside the expanded modal (Alert
  banner) and block closing while the value is over the limit.
- Fall back to the default limit in the frontend when the runtime
  config is missing or non-numeric instead of silently disabling it.
- Improve the error message to show how many characters are over the
  limit (Max N chars (-x)).
- Avoid a settings crash when BASEROW_MAX_FIELD_TEXT_LENGTH is set to
  an empty string.
- Add frontend tests for the rich text modal and the validation.
2026-07-09 15:45:21 +02:00
dimmur-brw 4ce2c422fb fix(database): fix user presence on group-by grid being displayed incorrectly (#5685) 2026-07-08 16:14:43 +02:00
Davide Silvestri 53d54c06ac chore: improve escaping of URLs and user input in database views (#5670)
* fix(database): improve escaping of URLs and user input

Escape user-provided select option values and colors when building the
database API documentation, and restrict URL, link and button field cell
hrefs to a safe scheme allowlist so non-navigable values are normalised.

Add unit tests for the URL scheme helpers and the select option docs output.

* fix(database): keep url hrefs working for string and protocol-relative values

Restore hrefs for URL lookup/array cells whose value is a plain string, and
prefix protocol-relative `//` URLs with `https:` instead of `https://`.

Add changelog entry.

* fix: address feedback
2026-07-07 16:30:48 +00: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
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
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
dimmur-brw 0b0562ec93 feat: User presence (part 1) - infrastructure and grid avatars (#5399) 2026-07-01 07:10:01 +00: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
alamin-br 0060e07e9b fix(web-frontend): remove empty option from link-to-table dropdown in form view (#5571)
* fix(web-frontend): remove empty option from link-to-table dropdown in form view

The form-view link-row fields mount PaginatedDropdown without overriding
its `addEmptyItem` prop, which defaults to true with an empty display name.
That rendered a blank option at the top of the dropdown. Suppress it with
`:add-empty-item="false"` on both the single and multiple link-row form
components, matching the FormViewFieldSingleSelectRadios pattern (which
renders no empty option).

Closes #5549

* fix(backend): resolve PR feedback
2026-06-24 12:09:19 +02:00
Jonathan Adeline 552ce22d16 chore: Bump to Nuxt4 (#5197) 2026-06-17 16:10:09 +04:00
alamin-br 0e1dc939e1 fix(web-frontend): Show unnamed row label for empty linked rows in form drop downs (#5469)
* fix(web-frontend): Show unnamed row label for empty linked rows in form
dropdowns

* fix: address reviewer comments on form link-row dropdown fix

* fix(web-frontend): keep required validation passing when user picks an
unnamed linked row

* fix(web-frontend): reset the cache to prevent it from growing
unboundedly

* fix(web-frontend): enforce required form validation at the field-type level

Required validation in the form submit path relied on each component's
isValid(), which the duration field overrides with a touched-based check.
An untouched empty required duration field therefore passed validation and
the form submitted an empty value the backend rejected.

Move the required check back to the field-type level via a new
isEmptyForRequiredValidation(), which defaults to isEmpty but lets link_row
use presence semantics (a picked row with an empty primary still counts as
filled) without changing isEmpty, so the conditional-visibility filters keep
treating that row as empty.

Also generalise PaginatedDropdown so valueName accepts a function and select()
emits the resolved item, which removes the fetchPage side effects (label
injection and the rowLookup copy) and lets the single and multiple link-row
components share a formViewLinkRowField mixin.

* fix(web-frontend): align link_row empty semantics with the backend

Replace isEmptyForRequiredValidation with a single isEmpty. A link_row is
a many-to-many relation, so the backend treats it as empty only when no row
is linked; the frontend's isEmpty was inheriting the base array check and
reporting a picked empty-primary row as empty. Make isEmpty selection-based
so the conditional-visibility filters and required form validation share one
definition that matches the backend.

* test(e2e): cover link_row behaviour on the public form

Add e2e tests for the public form link_row field: the "unnamed row" label
for empty-primary linked rows, an empty-primary pick revealing a
show-when-not-empty field, client-side blocking of a required empty field,
and a required link satisfied by an empty-primary row. Add form-view and
row fixtures and a FormPage page object to support them.

* refactor(web-frontend): tidy form link-row validation and row-value resolution

Collapse the duplicated requiredField branches in the multiple link-row
getValidationError into a single guard, document why it delegates to
baseField (not rowEditField) to avoid a double required check, and extract
the shared item/displayName resolution into resolveRowValue on the mixin so
the explanatory comment lives in one place.

No behaviour change; covered by existing form link-row unit tests.

* refactor(e2e): merge createTable helpers and fix link_row isEmpty semantics

Unify createTable/createTableWithData into a single createTable with an
optional data argument, and treat a link_row value as empty only when
every slot lacks a real id (some -> every), so a picked empty-primary
row counts as a real selection.

* fix(web-frontend): show required error for an untouched empty duration field

The duration field only computed its error message while the user typed, so
a required, untouched, empty field blocked form submission silently with no
visible error. Fall back to the field-type validation in the duration mixin's
getError so the required error renders on submit, and assert it in the e2e.

* refactor(web-frontend): drop redundant duration isValid override

isValid() now matches baseField's implementation exactly, and no
intermediate mixin defines it, so the override is dead weight.

* fix(web-frontend): guard duration form error slot with touched && !valid
2026-06-16 14:25:01 +02:00
Bram 057f5a1cb0 feat: Add drag and drop ordering of sortings and group bys (#5332) 2026-05-21 18:37:47 +02:00
Jonathan Adeline 56a4d7f3a1 chore: replace moveToBody with <Teleport /> built-in vue3 component (#4872) 2026-05-19 15:05:00 +04:00
Bram edb06c290b feat Show matching restricted view filters and allow setting default values (#5149) 2026-05-19 11:34:29 +02:00
Bram 090fc3550d feat: Add clear button to the view search (#5351) 2026-05-15 11:45:00 +02:00
Davide Silvestri 6b4696e782 fix: keep primary grid field visible (#5289) 2026-05-05 18:36:33 +02:00
Jérémie Pardou 87ccd866b5 Remove all live code TODO MIG (#5207) 2026-04-21 11:12:36 +02:00
Davide Silvestri 4ac572ca80 fix: guard grid quick edit permissions (#5223) 2026-04-21 09:54:02 +02:00
dimmur-brw 132d203678 fix: link-row group-by crash in grid view with more than 20 linked items (#5185)
* Fix link-row group-by crash in grid view with more than 20 linked items

* Review feedback
2026-04-17 10:38:36 +02:00
Davide Silvestri 9d8f54bca9 fix: field drag-and-drop offset and text selection with group-by active (#5194)
Include activeGroupByWidth in crossSectionDraggingOffset so the drag
placeholder and target indicator account for the group-by column width.
Prevent default on mousedown to stop browser text selection during drag.
2026-04-14 14:50:49 +02:00
Petr Stříbný 47e71b193a Fix linked row modal checkbox (#5148) 2026-04-08 13:21:26 +02: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