Commit Graph
243 Commits
Author SHA1 Message Date
Przemyslaw Kukulski 547237eafb fix: don't report sign-out error when old session token is already invalid (#6980)
* fix: don't report sign-out error when old session token is already invalid

* Review feedback
2026-12-02 14:15:12 +01:00
Jonathan Adeline 63765512ac feat: support numeric input in dashboard filters (#6899)
* feat: support numeric input in dashboard filters

* fix: show only the numeric filter error outline

* fix: recover stale filters in shared dashboards

* fix: initialize the English translation fallback
2026-12-02 09:59:32 +04:00
Przemyslaw Kukulski f01dce307f chore: remove the agent-builder and user_templates feature flags (#6960) 2026-12-01 19:56:53 +01:00
Peter EvansandJeremie Pardou d7e2c3f635 chore: remove core and WAB feature flags shipping in v3 (#6903)
* chore: remove core and WAB feature flags shipping in v3

* docs: drop stale feature flag mentions from invitation link comments

* docs: add missing changelogs for released core features

* docs: mark identities ADR as accepted

* chore: remove the identities feature flag

* docs: add changelog for workspace identities

* test: remove obsolete identity feature flag test

* docs: remove stale identities feature flag references

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-12-01 16:01:14 +00:00
Tsering Paljor 380ecc6c21 feat: Collect only anonymous page views on published applications (#6877)
* Collect only anonymous page views on published applications.

* Explain why a published page is counted once when it opens.
2026-11-26 18:57:53 +04:00
alamin-br 724ca69647 fix(agent): small Agent Builder fixes from the launch review (#6871)
* fix(agent): small Agent Builder fixes from the launch review

Imported actions ask first, SECRET_KEY_FALLBACKS is read, signed links keep their query,
Gemini retries transient errors, approval cards stop saying 'by you', and agent-builder turns identities on.

* test(assistant): turn identities off by having no flags

The agent-builder flag now turns identities on as well.

* fix(agent): address review of the launch quick fixes

Key fallbacks are JSON arrays, Gemini retries once per Kuma call, and an
imported action must carry the service its type runs.
2026-11-26 15:21:58 +01:00
Przemyslaw Kukulski becb8db5a1 feat: track template marketplace usage in PostHog (#6847) 2026-11-26 12:40:30 +01:00
Przemyslaw Kukulski ed9eb7d3a7 feat: turn user templates off for a whole instance (#6842)
* feat: turn user templates off for a whole instance

* Review feedback
2026-11-26 11:12:23 +01:00
Peter EvansandJeremie Pardou 95b892af41 feat: add automatic snapshot schedules (#6746)
* feat: add automatic snapshot schedules

* fix: show the count in relative date labels

* refactor: rename snapshot allowance setting to workspace

* feat: notify workspace admins when automatic snapshots fail

* feat: show the last automatic snapshot execution per application

* fix: simplify snapshot modal layout and capacity feedback

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-11-24 14:12:03 +00:00
Peter EvansandJeremie Pardou 2b8e6ba569 feat: add per-workspace snapshot allowances and protected snapshots (#6783)
* feat: add per-workspace snapshot allowances and protected snapshots

* fix: guard snapshot replacement and separate quota management

* refactor: delegate snapshot permission descriptions to application types

* fix: highlight inherited workspace snapshot maximums

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-11-23 11:23:05 +00:00
Przemyslaw Kukulski db66e25b17 feat: per-user feature flags for early access (#6780) 2026-11-19 08:32:55 +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
Peter Evans 864c6d6f51 feat: let visitors report abuse on published applications (#6715)
* feat: let visitors report abuse on published applications

* fix: let logged-in app users report published applications
2026-11-18 09:00:31 +00:00
Davide Silvestri 5169076065 feat: introduce User-backed workspace identities (#6556)
* feat: introduce User-backed workspace identities

Replaces workspace core.Agent subjects with identities stored as Django
Users, so permissions, execution and attribution use the same record.

- User.objects and WorkspaceUser.objects are human-only; permission and
  identity code opts in through objects_and_identities. is_human and
  is_identity classify a user at runtime.
- Login, tokens, seats, notification recipients, personal views and
  last-admin checks stay human-only. Roles, teams and field grants work
  for identities unchanged.
- Agent applications run as an identity, never as a person. Every shared
  tool rechecks the identity's authority on each call, and MCP refuses a
  tool that skips that boundary.
- Migrations add the profile metadata and index, remove the Agent model
  and delete or clear legacy Agent data: trash entries, role assignments,
  team memberships, integration authorizations and run-as bindings.
- Rename the management API, UI, events and feature flag to identity.

Squashed and rebased onto develop; the previous history is kept on
backup/6556-before-develop-rebase.

* refactor: remove generic subject options endpoint

* refactor: simplify identity selection and Agent run-as options

* feat: distinguish identity notification senders

* fix: restrict identity bindings to identity managers

* docs: record users and identities verification

* fix: restore snapshots as the person restoring

A restore checked the snapshot creator's permission and used the creator
to decide whether an Agent keeps its identity binding. It now checks the
person restoring, passed to the import as `restored_by`. `copied_by` stays
unset on restore, so credential checks keyed on it behave as on develop.

Restoring a snapshot whose creator was deleted works again. The copy rule
for identity bindings covers Agent run-as only; a copied Local Baserow
integration keeps its authorized subject.

* fix: leave settings pages the user may not open

A settings route without a permitted tab rendered an empty page, as the
Identities page did with its feature flag off. It now opens the first
page the user may see.

* fix: renumber the legacy Agent cleanup migrations

Develop added agent 0016 and integrations 0043, so the migrations that
clear legacy Agent run-as bindings and integration authorizations move to
agent 0017 and integrations 0044.

* test(agent): run the trigger self-event test as an identity

The test added on develop created a `core.Agent`, which this branch
removes. It now uses an identity user as the Agent's run-as subject.

* perf: load user types once per batched permission check

* refactor: state the stored subjects in each subject type

* fix: give every user a profile

* fix: keep identity attribution on rows copied in their workspace

* refactor: give people and identities their own subject type

UserSubjectType stays the type both are registered and stored under. It forwards what differs to HumanSubjectType and IdentitySubjectType, so get_specific_type is the only place in subject code that inspects the user type. The registry returns the specific type on request and get_by_model keeps returning the stored type, which never reads the profile.

An identity's membership is checked in one query instead of two.

* fix: keep the roles of identities when a database is duplicated

The role import read subjects through the model's default manager, which only returns people, so duplicating or restoring a database failed when an identity held a role on it. It now resolves the subject through the subject registry.

A subject that no longer exists is skipped instead of failing the whole duplicate or restore.

* refactor: look up a subject type from its content type in one place

* fix: reload a cached token whose profile is incomplete

A token cached by the previous release has a profile without the user type, which reads as not a person, so its requests were refused until the entry expired. The token cache now treats it as a miss, with the check the user cache already used.

* refactor: check the user type once where the check was repeated

The MCP endpoint loader, the personal view permission manager and the identity trash type each asked the same question several times. The rule that an identity is never selected by email moves from the team handler to the identity subject type.

* refactor: leave trashed workspaces out of the identity membership manager

WorkspaceUser.objects_and_identities was named after objects but also returned memberships of trashed workspaces, so callers filtered them by hand. It now follows the existing pair: it leaves trashed workspaces out, and objects_and_identities_and_trash includes them, as objects_and_trash does for people.

* test: state the behaviour of every user type

The table fails when a user type is added and says what has to be decided first. An unknown type is checked to be denied.

* refactor: refuse to say whether a stored user subject is interactive

The answer differs between a person and an identity, so reading it from the stored type would be wrong for one of them. It now raises and points to the specific type.

* refactor: lock the person in membership writes instead of checking the type

Leaving a workspace, removing a member and adding a user lock the user through the people manager, which refuses an identity or an unknown type in the same query. Nothing adds an identity through add_user_to_workspace, so its branch for identities goes. The last admin check compares the membership with the people who are admin, which needs no type check.

* test: leave no rows behind in the legacy authorization migration test

The test left an integration that pointed at a user that didn't exist and a workspace, in the database the migration tests share. Tests that ran after it then failed on the foreign key or on the workspace id. It now uses a real user and empties the two tables.

* docs: describe the subject types and compare the Subject table alternative

ADR 013 is shorter and states that people and identities each have a specific subject type under the stored auth.User type. It compares shared User storage with a Subject table that users and identities would both point to.

* chore: run the legacy run-as cleanup after the agent actions migration

Develop added agent migration 0017, so the cleanup becomes 0018 and depends on it.

* test: leave no rows behind in the legacy agent migration tests

Like the legacy authorization test, these left a workspace in the database the migration tests share, which a later test that creates workspaces with fixed ids collides with.

* fix: write and read the workspace role of an identity in one place

The role assignment API wrote the role of an identity through the membership update of people, which told every member of the workspace about it and stored Builder as MEMBER, while the identities API stored BUILDER and returned the stored value. Both now write through the identity handler, which stores the role like the role of a person, and the role is read with the resolver the workspace members use.

* fix: take no row lock in the membership writes of a person

Leaving a workspace locked the user before the membership while removing or updating a member locks the membership first, so the two could deadlock. The user type never changes and these operations refuse an identity, so the lock protected nothing: they now only check that the user is a person. Leaving no longer locks the admin memberships and removing a member no longer checks for the last admin, as before identities.

* fix: find an identity by its name only in the subject options

The search also matched the email and username, which for an identity hold an internal key, so searching a part of that key returned every identity.

* chore: run the identity migrations after the new ones on develop

Develop added core 0138, integrations 0044 and enterprise 0073, so the identity migrations become core 0139 and 0140, integrations 0045 and enterprise 0074 and depend on them.

* fix: keep the identity of a copied integration only for identity managers

A duplicated application or a restored snapshot kept the identity its Local Baserow integration acts as, without checking the person who made the copy. Restoring a snapshot could so bring back a binding an admin had removed. The copy now keeps the identity only when that person may bind identities, as the Agent application already did, and is otherwise authorized as that person.

* docs: follow the renumbered migrations and the copy rule in the test plan

The test plan named the identity migrations and their tests by their old numbers and still said a copied integration keeps its subject.

* test(agent): run the row trigger tests as an identity

The row trigger tests added on develop created a `core.Agent`, which this
branch removes. They now use an identity user as the Agent's run-as
subject, and the e2e fixture creates it through the identities endpoint.
2026-11-18 08:44:31 +00:00
alamin-br d63c32fa7a fix: require read access to the linked table for joins and link writes (#6608)
* fix: require read access to the linked table for joins and link writes

A token or restricted role limited to one table could read a linked table through
joins, and read its primary values by linking rows.

* fix: batch linked table checks and cover the remaining link write paths

Checks now run once per linked table so queries stay flat, and token batch results no longer take the last table's outcome.
Undo, skipped import columns and restricted-view self-links work again; upsert names and view default links are checked.

* fix: authorize link row view defaults when they are saved

An unreadable default on a shared view blocked everyone from adding rows there, so saving a new one now needs linked-table read.
Personal views keep the check on row creation because their owner configures them.

* fix: link the checked rows and explain linked table denials

Names were resolved again after the check, ids of missing rows passed it,
and the UI sends view defaults as values. Denials now name the linked table.

* fix: resolve self-link names per field and recheck trusted link defaults

Name lookups ran once per row in batch writes, and saved link defaults stayed
trusted after the field's linked table or the view's ownership changed.

* fix: check the linked table for link filters, assistant row tools and batch services

A link row filter and the assistant's row tools returned names of rows from a
table the user can't read, and batch services validated links before the check.
A default kept from another field type could be re-saved without the check.

* fix: restore removed link defaults on undo and refresh them in open views

Removing defaults on a link target change lost them on undo and left open
views sending the old value. Copying defaults into a view that trusts them
skipped the linked table check.
2026-11-17 09:17:33 +01:00
Bram 3d9e37163e feat: [3/5] Semantic search action for automations and applications (#6451)
* Semantic search action for automations and applications

* Fixed feedback
2026-11-12 11:03:12 +01:00
Davide Silvestri 9f9e068a27 feat(agent): show waiting approvals and let editors stop the asking (#6610)
* feat(agent): count pending approvals per application and conversation

* feat(agent): show waiting approvals in the sidebar, header and conversation list

* feat(agent): always allow a held tool from the approval

* feat(agent): add Always allow and the ask before changes switch

* fix(agent): read pending counts from the primary and lock the conversation first

* test(agent): run approval test actions through the action registry

* test(agent): read the decision result in the web search approval test

* test(agent): let the waiting conversations request start before answering it

* fix(agent): keep older waiting conversations through a reconnect

* perf(agent): count pending approvals for many users and conversations at once

The core hook takes many users and returns counts per user and application, so
creating or restoring an Agent and the count task count once for all members
instead of once per member; the task sends every count in one broadcast.
Pending approvals are defined once, and a page of conversations gets its counts
in one query passed to the serializer, like its runs, instead of an annotation
with a per-object fallback.

* refactor(agent): return one decision result and name the count signal after its event

The service and the action both return the decision result, which carries the
approved and rejected tools, so they are computed once for the audit params and
Always allow. Always allow bumps the Agent's updated_on like a configuration
update. The signal is renamed application_pending_count_updated, like its
websocket event.

* fix(agent): keep the deciding tab's waiting counts current

A decision lowers the Agent's count before its request and restores it when the
request fails, unless the call was decided elsewhere. Its conversation count
goes through the tracked update, so a list read that started earlier restarts
instead of bringing the old count back. The pill adds only the waiting
conversations it hadn't loaded, and leaves a conversation picked while it loads
selected.

* chore(agent): describe the ask switch and drop the unused counter class

The ask switch is described by its text and the row separator is hidden from
screen readers. The sidebar no longer adds tree__action--has-counter, whose
padding --has-options already sets.

* test: give fixture fields unique default names

Two fields of one table could get the same random name, so a formula
referencing the other field referenced itself and failed with
SelfReferenceFieldDependencyError.

* refactor(agent): show the sidebar count with the warning counter

The admin Templates count added badge-counter--warning, so the Agent's count
uses it too instead of its own yellow color prop on BadgeCounter.

* fix(agent): reconcile approval counts and cycle loaded conversations

* fix(agent): name the tools Always allow stops asking for

* fix(agent): load older pages until the pill reaches a waiting conversation
2026-11-11 17:25:51 +00:00
Peter Evans 8e37e1ec3a fix: sign users out of existing sessions when an admin changes their password (#6629)
* fix: sign users out of existing sessions when an admin changes their password

* fix: keep admins signed in after changing their own password in the admin panel

* fix: send other tabs to the login page after a password change instead of crashing

* chore: add changelog entry for the password change tab crash fix

* fix: send users with two-factor auth to the login page after changing their own password
2026-11-11 10:10:17 +00:00
Przemyslaw Kukulski 13ac9fc914 feat: manage every user template from the admin Templates page (#6654)
* feat: manage every user template from the admin Templates page

* Review feedback
2026-11-10 20:14:11 +01:00
Przemyslaw Kukulski 5e6ce919b6 feat: share a user template with a private link (#6611)
* feat: share a user template with a private link

* Review feedback
2026-11-10 12:50:34 +01:00
Davide Silvestri ca3d710b3b feat(agent): choose the identity an Agent runs as (#6540)
* feat(agent): choose the identity an Agent runs as

Agents can run as one of the workspace's Agent identities or with no
workspace access. The tools that act with the identity's permissions
come next.

* fix(agent): refresh the run-as identity label

* fix(agent): flag deleted run-as identities in configuration

* feat(agent): explain unavailable workspace identities

* refactor(agent): return a typed configuration object

* fix(agent): handle run-as identity permissions and lifecycle

* refactor(agent): use constants for readiness and state checks

* fix(agent): record before and after configuration values

* refactor(agent): move configuration transaction to API view

* fix(agent): batch run-as identity invalidations

* test: use real debounce in views admin tests

* fix(agent): keep run-as choices within the viewport

* perf: reuse permission data within batches
2026-11-05 09:16:14 +01:00
Bram d0571201ad feat: [2/5] Added semantic search vector indexing for text fields (#6450)
* Added semantic search vector indexing

* Introduced incompatible state

* Covered template scenarios

* Set data_schema in local baserow ingration

* Check if field is still enabled when updating

* Update docs about env var hash change

* Added enterprise query test

* Fixed index name
2026-11-03 11:41:13 +01:00
Davide Silvestri 362f690b9e feat(chat-runs): per-run-type limits and a core run stream (#6454)
* feat(chat-runs): limit active runs per run type, per user or workspace

Each run type now counts only its own runs. The per-user limit keeps its default of 2, and a run type can add a per-workspace limit.

* feat(chat-runs): follow any run over one core streaming endpoint

GET /api/chat-runs/<run_id>/stream/ relays the output of any run type behind its read check. Helm and the install guides route /api/chat-runs/ to the ASGI service; the guides also gain Kuma's /assistant/ route.

* feat(chat-runs): read the core run stream by default in the frontend

The base ChatRunType reads the core stream, applies the resume baseline and retries once after a token refresh.

* refactor(chat-runs): expose the output fold for lost runs

Run types rebuild a lost run's partial text from the buffered output with fold_output.

* perf(chat-runs): send heartbeat records and skip repeated run reads

While no output arrives, an open stream sends run.heartbeat as a JSON
record, so a follower can tell a quiet stream from a stalled one. The stream
view hands follow_run the run state it read for its permission check,
finish_run returns the ended run instead of letting callers read it again,
and a lease renewal takes one statement while the run goes on. The
per-workspace limit hook receives the workspace, so a run type can set the
limit per plan.

* perf(chat-runs): follow runs from their open stream in the frontend

The store reads a run's status only while it has no stream or the stream
lost its output, and restarts a stream that stays silent for 15 seconds,
also after the computer slept. Following a run opens its stream directly,
and Stop doesn't read a run whose stream is open. Each run type keeps one
chat subscription, released with unsubscribeFromChat; refreshChat runs only
when a subscription is confirmed on a new websocket, and window focus or a
regained network only re-attach followers. The developer guide documents
the subscription and heartbeat contract.

* perf(chat-runs): write a reply's first words at once

- The journal writes output after a quiet moment at once and batches
  what follows, so the first words no longer wait for the 250 ms timer.
- The stream adapter settles when aborted. Chrome can fire the last
  progress event after the request is done, where aborting fires no event.
- A stream refused with 503 is retried with the next status check
  instead of spending every reconnect attempt at once.

* refactor(chat-runs): register the stream route by URL name
2026-10-30 10:35:50 +01:00
Przemyslaw Kukulski 356f9a9da6 feat: install a user template (#6460)
* feat(install-user-template): Install a user template

* Review feedback

* Review feedback v2
2026-10-28 14:07:20 +01:00
alamin-br b14271c6e6 fix: accept workspace invitations only with the emailed token or a verified email (#6502)
* fix: accept workspace invitations only with the emailed token or a verified email

Accepting by id only compared the username with the invited address, which anyone can
register without verifying it. The emailed token now proves ownership and verifies the
email; without it, the user's email has to be verified.

* fix: require a verified email to reject invitations and keep accept visible

Rejecting still only checked the username, so whoever registered the invited address could delete the invitation. Accept stays visible after a verification error so it works once the email is verified.

* fix: hide accept for unverified users, allow reject, skip the check without SMTP

Without an email backend neither the invitation nor a verification email arrives, so the check can't be met.
Signing up from the invitation link verifies the email, so the user is signed in even when verification is enforced.

* fix: leaving a workspace hangs and removing the current user deletes the wrong workspace
2026-10-28 11:19:47 +01:00
Bram 60ce89199d [1/2] feat: Improve initial page load performance (#6433)
* Improve initial page load performance

* Fixed moment (calendar view) bug
2026-10-23 15:25:53 +02:00
Davide SilvestriandBram Wiepjes 72760990c5 feat(agent-builder): configure Agent instructions and model (#6415)
* feat(agent): configure Agent instructions and model

Adds the Agent settings fields, readiness and configuration endpoints, an
autosaving configuration sidebar and the settings permission. Settings are
copied with the Agent and exported only by members who can read them.

* test(agent): share Agent page setup and mock helpers

Both page specs reuse one setup and one-line route mocks, and API tests share
an authenticated client.

* fix(agent): lock parent before configuration updates

* fix(agent): limit model availability checks to settings readers

* refactor(agent): read Agent readiness from the application

Readiness travels with the application payload instead of a separate
readiness endpoint, so the page load and realtime updates keep it current.

The configuration form also stays stable while editing. It no longer
reloads on unrelated application updates, saves text fields on blur and
selections on change, restores a blank name instead of blocking
navigation, keeps the current Agent selected when the save before a
switch fails, and ignores re-selecting the current provider. The export
permission test now goes through ExportApplicationsActionType.

* fix(agent): tighten the Agent configuration API

The configuration endpoint now serves only instructions, provider and
model behind agent_application.read_configuration, which saving also
requires. Renames go through the standard application update, the views
return their declared serializers, the length limits come from the model,
and the endpoints are documented in the API schema.

* fix(agent): rename through the application and fit the assistant panel

The configuration sidebar renames the Agent through the regular application
update, follows the Agent column width with container queries, offers
Retry first without an empty actions row, keeps its focus outline on its
own buttons, and names an unavailable provider. The first load starts on
mount, and the specs mount with a route record and find fields by label.

* fix(agent): keep configuration edits across token refreshes

The page reset itself whenever a token refresh reassigned the user, because
the watch compared a new array each time; it now watches the Agent and user
ids by value. The configuration payload names its readiness `readiness`,
like the application payload, and the redundant readiness tests are gone.

* fix(agent): explain configuration section errors

* fix(agent): address configuration review feedback

* refactor(agent): reuse shared menu and button components

* fix(agent): align sidebar separators and back control with design

* fix(agent): match sidebar close control to design

* Remove name input loading spinner and added newline

* remove double validation

---------

Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
2026-10-23 09:12:13 +00:00
Davide Silvestri 9eabe6b06b feat(core): add Redis-backed background chat runs (#6382)
* feat(core): add Redis-backed background chat runs

Run AI work once in Celery and follow bounded Redis Streams over HTTP. Keep
lifecycle, Stop, leases and final outcomes in Postgres without per-token writes.
Include the shared frontend follower, adapter registry, recovery API, migration,
queue/deployment wiring and adapter guide. No product uses it yet.

Part of #6346

* Remove unused chat run response header exposure

* Extract shared async streaming HTTP router

* Simplify chat run follower and group engine constants

- Check read access once when a stream opens; read run state from Postgres
  only after 5 s without output or on run.finished.
- Split follow_run into small steps around _OutputReader.
- Turn event kinds, error codes and stop reasons into StrEnums; the
  Kuma-only model_unavailable code moves to Kuma.
- Document ChatRunType hooks with param, return and raises fields.
- Add BASEROW_ASGI_HTTP_MAX_CONCURRENT_STREAMS and size the follower Redis
  pool by it.
- Give handler publish/recover calls their own event loop, so cleanup
  cannot close pools shared by HTTP followers.
- Update ADR 010 and the background chat runs docs.

* Clean up chat run interfaces and test setup

* Prune chat runs once after 7 days and skip overdue claims

- Delete each expired page with one statement. Incomplete runs get one more
  ensure_interruption_warning call first, and are deleted even if it fails,
  so run metadata never accumulates. The hook now returns None.
- Keep runs for 7 days instead of 30.
- Never claim a queued run older than NOT_STARTED_AFTER; the sweeper ends it.

* Retry brief Redis failures in chat run followers

- A connection error, or a buffer that does not exist yet, is retried with
  the same cursor, sending heartbeats meanwhile.
- run.replay_unavailable is only sent once the follower stops reading, so
  the browser can treat it as final.

* Let finished chat run output expire with the active TTL

Nothing reads a buffer once its run has finished: followers return the saved
outcome first and recovery only reads running runs. Drop finish() and the
24 h TTL, so a finished buffer expires an hour after its last append.
_publish_terminal now reuses _publish.

* Run the chat run scale tests on fakeredis

Build the buffer's real read and write pools on fakeredis connections, so
these tests always run and backend CI needs no Redis service. The Kuma e2e
tests cover a real Redis.

* Address the remaining chat run review comments

- Serialize the saved outcome after the transaction, so only a failed save
  is logged as one.
- Make the primary-pin test transactional; inside the test transaction the
  router always used the primary, so it could not fail.
- Cover the race past the per-user lock, a lost run after Stop and an old
  writer appending to a recreated buffer.
- End the admission test's request with a disconnect, so a regression fails
  instead of looping.
- Document that one worker process runs AI replies one at a time.

* Move the chat run migration after develop's core 0130

* Log only the class of an outcome serialization error

* Test that the run deadline asks a run to stop

* Keep a run's status when a resumed follower rebuilds its output

* Note that slow DNS lookups turn off a run's live output
2026-10-21 14:52:59 +02:00
Davide Silvestri aba67743e2 feat(agent-builder): scaffold Agent workspace applications (#6343)
* feat: scaffold Agent Builder applications and empty agents

* chore: defer Agent Builder changelog until feature flag removal

* refactor: represent each agent as a workspace application

* fix: complete Agent application rollout safeguards

* fix: use the designed robot icon for Agent applications

* refactor: gate only Agent application creation

* refactor: keep Agent scaffold on standard shared behavior

* fix(agent): load workspace access before opening from overview

* refactor(agent): align enterprise feature naming

* refactor(agent): retain application stylesheet name

* refactor(agent): move application scaffold into open source

* fix(agent): hide the empty Agents sidebar group while creation is disabled

* test(agent): keep only Agent-specific scaffold tests

Generic application behaviour is already covered by core tests, and the
branch has no enterprise code, so the enterprise tests are removed.

* refactor(agent): define the agent-builder flag with the other flags

* chore(agent): type Agent application hooks and tidy flag docs

* fix(agent): support the purple item icon color

* fix(agent): use the shared application type keys for Agent names

The export and import dialogs read `applicationType.<type>s`, so Agent
groups showed the raw key.

* fix(agent): hide the Agent type filter while creation is disabled

All workspaces now only offers the application types that can be
created, so Agent stays out of the filter while the flag is off.

* fix(agent): use a singular Agent search subtitle

* test(agent): cover Agent creation with the flag enabled

* refactor(agent): match the Agent search type to Dashboard

The backend already filters results by read permission, and the Agent
route checks access when it opens.

* refactor(agent): drop the unreachable sidebar creation check

The only link that opens the modal already checks `canBeCreated()`.

* fix(agent): drop the Enterprise-only hint from the empty Agent page

Managing access needs Enterprise, so the text was wrong elsewhere.

* refactor(agent): drop the default allowed_fields from the Agent type

* feat(agent): track when Agents were last viewed

Opening an Agent now loads it from `GET /api/agent/<id>/`, which marks it
viewed like the load endpoints of the other application types.
2026-10-20 10:41:14 +02:00
Peter Evans 2f95f715bf feat: add an error style on builder/automation applications (#6377)
* Feature flagged: display an error style on a builder and automation application, and then its settings, if an integration is in error.

* Show the error message in a tooltip

* fix: merge duplicate integration error methods after rebase on develop

* Tweak the error message

* test: give the live integration fixture an authorized subject
2026-10-19 13:45:42 +01:00
Przemyslaw Kukulski 8ba73684d8 feat(core): new template browser behind the user_templates feature flag (#6334) 2026-10-14 15:48:33 +02:00
Peter Evans f8b38b2185 chore: common invite modal with registry-driven routes (#6348) 2026-10-13 13:30:07 +01:00
dimmur-brw 5d0bef8f7a feat: enable image embedding in rich text fields (#5775) 2026-09-28 13:57:41 +02:00
Davide Silvestri 64c9fff85e feat [6/8]: prepare AI provider management for rollout (#6070)
* feat: retire AI provider flag and add rollout audit

* test: remove obsolete AI provider flag setup and docs

* chore: clean up AI provider configuration and tests

* feat: deprecate legacy AI provider environment configuration

* docs: explain AI provider migration sizing and timing

* docs: mark AI provider migration audit for removal

* docs: explain AI provider migration audit usage

* fix: log AI provider env deprecations after logging setup

log_ai_provider_env_deprecations() ran at the tail of _setup_health_checks(),
which ready() calls before setup_logging(). The notice went out through
loguru's default sink and missed BASEROW_BACKEND_LOG_LEVEL, the Baserow
format, and the OpenTelemetry log exporter, so operators shipping logs to a
collector never saw it.

Also drop two references the flag removal invalidated: the getEffectiveAIAgentModels
JSDoc still described filtering as conditional on the removed provider flag, and
the AI field architecture doc still pointed provider authors at the deleted
legacy workspace-setting hook. That doc now names BuiltInGenerativeAIModelType,
which is what grants an integration override model inheritance.

* fix: reuse environment AI settings in generation workers

* feat: import legacy AI provider settings on upgrade

Removing the ai-providers flag makes database-backed providers the default, which
would leave every existing installation on an empty AI providers page with a
management command as the only way to populate it. A data migration imports the
environment and each workspace's stored settings instead, so a standard upgrade
needs no commands.

Both scopes are imported in one migration. Legacy workspace settings replaced the
instance ones entirely, while database providers inherit, so each imported workspace
is also switched off the instance provider of the same type. Without that a workspace
would silently gain models billed to the instance account.

Settings that cannot fit their columns are skipped and logged rather than raising
DataError and rolling back the whole upgrade. The migration reverses as a no-op
because the previous version does not read these tables, so deleting rows would only
discard edits made during a rollback window.

migrate_ai_provider_settings stays as the recovery path and now shares its planning
logic with the migration, so both agree on which legacy settings are complete. It
deliberately does not switch workspaces off inherited providers, and warns instead.

* chore: remove the temporary AI provider audit command

audit_ai_provider_settings existed to inventory legacy configuration before a manual
import. The upgrade now imports automatically, so the command has no remaining step
to support. Removal was already tracked in #5749.

* docs: reduce AI provider docs to lasting behaviour

The upgrade procedure, rehearsal plan and sizing query described a one-time
transition and do not help anyone after the release; they live in the pull request
instead. What remains explains how providers work: the two scopes, how they combine,
the inheritance switch, what the deprecated environment variables still do, and how
integration overrides and published applications behave.

Also corrects claims that no longer hold: published applications keep materialised
credentials only when they were published before the upgrade, the import is no longer
optional, and a workspace-owned provider suppresses the environment fallback too.

* docs: shorten the AI provider changelog entries

Bullet points render as single list items under the entry. The released entries
average around twenty characters; these ran to four hundred, so the detail belongs
in the AI providers guide rather than the changelog.

* docs: clarify where imported AI credentials are stored

The previous wording implied Baserow's own exports carry provider credentials.
They do not: AIIntegrationType lists ai_settings as a sensitive field and
ImportExportConfig excludes those by default, and AIProviderConfig is not part of
any export path.

* docs: explain the AI provider upgrade and where to configure providers

State that the upgrade imports the BASEROW_* provider variables once and no longer
reads them, list the exceptions, and give the exact navigation for instance admins
(Admin tools -> AI providers) and workspace admins (workspace Settings -> AI
providers). Map each deprecated variable to the field that replaces it.

* fix: renumber the legacy AI provider import after 0121_agent

Develop's core 0121_agent and this branch's import migration both depended on
0120, leaving two leaf nodes, so migrate refused to run and the startup check and
E2E shards failed. The import is now 0122 and depends on 0121_agent.

* feat: remove the legacy workspace generative AI settings endpoint

GET/PATCH /api/workspaces/{id}/settings/generative-ai/ had no caller left, yet a
PATCH was still honoured for any provider type without a workspace provider and
never shown in the AI providers UI. Remove it with the handler parameter,
receivers and frontend handler that only it could trigger.

* fix: stop instance AI provider changes from fanning out per workspace

An instance-level change queued one Celery task per 25 workspaces behind a global
blocking lock, sent a payload to every connected user, and made the premium receiver
serialize every AI field on the instance. Instance changes now notify staff only;
other users see them after a reload. The render lock is per scope, and the in-use
guards no longer read one row per workspace.

* fix: keep inherited Kuma when a workspace switches off the instance provider

The upgrade switches imported workspaces off the same-type instance provider, which
made an inherited instance Kuma model invalid there, so Kuma fell back to the
deprecated env model or turned off. Inheriting the instance Kuma selection now
ignores workspace switch-offs; explicit workspace selections stay strict and are
the only ones that block a switch-off.

* fix: skip malformed Ollama URLs during AI provider migration

* fix: preserve skipped legacy AI provider connections

* test: cover independent legacy AI workspace connections

* fix: skip malformed legacy AI provider settings

* fix: move legacy AI import after current core migrations

The linear rebase omitted the migration renumbering from the previous merge commit, while develop advanced through core 0124. Rename the existing AI import to 0125, depend on 0124, and update its historical migration test so core has a single leaf.
2026-09-25 17:05:10 +02:00
Bram ac6cdb5aca All workspaces homepage [4/7] Remember user last viewed (#6001)
* Track when a user last viewed a view, page, dashboard or workflow

* moved `ai_provider_states` into _get_application_serializer_context

* Fixed feedback

* Fix migration conflict

* Fixed feedback

* Skip impersonated last viewed
2026-09-25 12:37:13 +02:00
alamin-br a3095f807e feat(database): remove the button field feature flag (#6149)
* feat(database): remove the button field feature flag

The field ships in the next release, so creation, conversion and the
workflow action endpoints no longer check FF_BUTTON_FIELD.

* chore: drop leftover button field flag references

The 403 schemas and comments still described the removed gate.
2026-09-23 16:17:20 +02:00
Jérémie Pardou ad80341c03 feat: add Agent subject type (#5851)
* Add workspace Agents and permission management

* fix: remove all duplicate team subject memberships

* fix: align agent team role inheritance with users

* fix: delegate workspace role storage to subject types

* fix: preserve agent team memberships through trash

* Fix migration conflict

* fix: save agent settings pages independently

* fix: preserve agent roles across license changes

* fix: stabilize agent list pagination

* fix: filter agent websocket events by list permission

* fix: authorize agent team membership changes

* fix: serialize concurrent agent team updates

* fix: refresh agent teams through realtime events

* fix: restrict personal views to user subjects

* fix: deny agents with unavailable roles

* fix: exclude agents in trashed workspaces

* test: cover permanent agent access cleanup

* fix: gate agents in team selectors

* fix: accept trash option for preview actors

* fix: set native agent form button types

* fix: ignore stale agent modal saves

* fix: show permitted agent management actions

* fix: validate subject lookup fields

* perf: optimize batched user membership checks

* perf: cache agent team feature per list

* fix: map agent nonmember API errors

* fix: document paginated agent API schema

* fix: stabilize agent API schema operations

* fix: show agent name validation errors

* fix: show total agent count

* test: cover agent creation submissions

* test: cover agent and subject UI behavior

* docs: define direct subject role contracts

* fix: clarify team access management

* fix: use standard empty agents table

* fix: align agent name column styling

* refactor: move agent trash import

* refactor: align agent extension registry naming

* fix: recover agent team selector loading

* fix: validate every subject in role batches

* fix: ignore stale agent list responses

* perf: index recent team subjects

* fix: restore role handler imports

* Fix lint

* fix: reuse prefetched user memberships

* fix: preserve low priority role fallback

* fix: preserve trashed field permission subjects

* fix: open team picker when agent loading fails

* Fix tests
2026-09-21 16:32:32 +02:00
Davide Silvestri bb1f2c47a3 fix: webSocket stalls and reduce realtime replay storage overhead (#6040)
* fix: prevent realtime replay from stalling websocket workers

* fix: index replay recipients and reset disposable history

* docs: explain realtime recipient trigger

* docs: identify realtime recipient trigger on model

* fix: reject expired replay anchors retained by cleanup locks
2026-09-09 16:46:09 +02:00
Bram 42371d6beb feat: Add skeleton loading animation and make pages load instantly (#6023) 2026-09-09 11:03:03 +02:00
Jérémie PardouandTsering Paljor 40c18a3c9f feat: add separate domain for preview (#5682)
Co-authored-by: Tsering Paljor <tsering@baserow.io>
2026-09-09 08:53:47 +02:00
Davide Silvestri ab45c2346a feat [4/8]: per-feature AI model settings (#5796)
* feat: per-feature and workspace-level AI model settings

Baserow could only point every AI feature at one instance-wide model. An
administrator can now register provider models, declare which AI features each
model may serve, and pick the default model per feature; a workspace admin can
inherit that choice, override it, or disable the feature locally.

The assistant resolves its model once per logical request and threads that
snapshot through its nested agents and tools, so a single run can no longer
re-read settings repeatedly or pick a model other than the one it validated.
The scoped provider state is memoized for the duration of a request, keeping
workspace serialization from loading it once per workspace.

Also:
- add Google and Groq provider types, and keep these database-only providers
  out of the legacy workspace settings they cannot round-trip through;
- prune orphaned feature selections so an unloaded feature type's RESTRICT FK
  no longer blocks provider and model deletion;
- record whether a configured model answers text and tool-calling probes, and
  invalidate that result when its credentials or identifier change;
- broadcast provider and availability changes over the existing realtime
  channel so open clients update without reloading;
- read the assistant model from the shared configmap, so frontend pods no
  longer miss it on Helm installs.

Manual test instructions live in docs/testing/kuma-model-settings-test-plan.md.

* fix: address AI provider settings review feedback
2026-09-04 10:53:53 +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 f27bb387fe feat [3/8]: add workspace AI provider management and complete AI Field resolution (#5785)
* feat: add workspace AI providers for AI fields

* fix: address workspace AI provider review feedback

* fix: address remaining AI provider review feedback

* fix: resolve core migration conflict

* fix: stabilize premium AI provider tests

* address feedback for local imports
2026-08-20 10:49:57 +02:00
Bram 85bb455970 feat: Add option to replay guided tour (#5892) 2026-08-18 11:07:28 +02:00
Davide Silvestri 4feb259e10 chore(deps): upgrade Nuxt to 4.5.0 and Vue ecosystem (#5763) 2026-08-05 16:05:01 +00: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
Davide Silvestri c3706658a2 feat [1/8]: add instance AI provider management behind a feature flag (#5740)
* feat: add instance AI provider management

* fix: simplify AI provider testing

* fix: remove extra model list spacing

* fix: show AI provider form errors inline

* fix: use icons for AI provider row actions

* fix: place model errors before help text

* chore: polish code

* fix: address feedback

* fix: address remaining frontend CI failures
2026-07-27 14:12:37 +00:00
dimmur-brw f5ebc9457c feat: show anonymous public view visitors in editor's presence bar (#5704) 2026-07-20 17:01:01 +02:00
dimmur-brw 8eeb53e4fc feat: User presence (part 2) - user presence on grid (#5570) 2026-07-06 08:04:35 +02:00