Commit Graph
4 Commits
Author SHA1 Message Date
Peter Evans 17c1af4cc4 feat: show formula data as a source badge and the data it points to (#6857)
* feat: show formula data as a source badge and the data it points to

* docs: add a changelog entry for the formula data redesign

* test: close the data explorer before saving a button field in e2e tests

* fix: keep long formula data inside the filter row and wrap its tooltip

* fix: show the link styling tabs for a column just changed to a link
2026-11-26 13:34:21 +00: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
alamin-br 8d389cd0e8 fix(database): Show when a button field needs reconfiguring (#6114)
* feat: report when a button's row action points at the trash

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

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

* feat: disable a button cell that needs reconfiguring

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

* docs: describe the button reconfigure state in ADR 006

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* fix: count a missing integration a button action needs

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

* docs: note a missing required integration in ADR 006

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Refusing it told the editor that the field exists.

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

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

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

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

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

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

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

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

* docs: name every cause of the button reconfigure state

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

* test: expect the rowless button to render disabled

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

* perf: serialize button fields once for all restricted views

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

* perf: skip purged buttons and merge purge broadcasts

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

* fix: bump the global cache version

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

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

A trashed integration is missing from the list, so the verdict is the only warning.
2026-09-21 14:29:18 +02:00
alamin-br 886925500f feat[4a/6] Button field: send an HTTP request (#5968)
* feat: let a button field send an HTTP request

A button can now call an endpoint when it is clicked, and the actions
after it can read what came back. The request runs as part of the click,
in the order the actions are listed, and a failure stops the ones behind
it without rolling back what already ran.

What an endpoint answers with has no shape until it has answered once, so
a click by someone who may configure the field remembers the response and
the editor builds the data explorer from it. Only a successful answer is
kept, it is capped in size, and it never travels in an export, a snapshot
or a duplicate.

Because a click now makes this installation send a request, it is rate
limited per user and per workspace, and only clicks that reach outside
count. The address guard that stops a request reaching Baserow's own
network applies here too, and a failure is reported by position without
naming the URL it could not reach.

* feat: say what a button's request has answered, and what it has not

The data explorer only offers an HTTP action's body once a click has
answered, and until then nothing said why. The action's form now carries
the same block the builder uses: what the last click remembered, or a
note explaining that a click is what captures it.

The note also says the button's other actions run on that click, which a
preview elsewhere in Baserow has no reason to warn about.

* fix: stop a refused click from spending the budget, and sharpen what it is told

A click refused by a permission check kept the slots it reserved, so a
member who may not dispatch could spend the whole workspace's budget on
refusals and lock out the members who may.

The lock is now sized from what the click may wait for. The setting was a
fixed two minutes while a button can chain requests that are each allowed
to wait that long on their own, so the lock expired mid sequence on
exactly the buttons it was there to protect.

An external failure no longer hides a message about the values the action
was given, such as a body that is not JSON. Only a message naming the
address is withheld, since that is the part written for whoever configured
the button rather than whoever clicked it.

A result is returned to the browser only when a client action can read it.
An answer from outside Baserow carries whatever the endpoint sent back,
response headers included, and a clicker with nothing to run has no use
for it.

Also gives the remembered answer its own savepoint, so a value the column
refuses cannot leave an enclosing transaction unusable, logs why it was
refused, declares the 429 the endpoint can now return, and matches a
duplicated field by the name the job gives it.

* fix: charge a click for what it really sent, and stop leaking what it was told

Answers the review on the button field's external actions.

A click now takes one rate limit slot per action that reaches outside
Baserow, rather than one per click, and gives back whatever it did not
spend. The action list is read once and used for the budget, the
permission checks and the run, so the three cannot disagree.

A failure that names an address no longer reaches the log with the URL
and request headers attached, only the ids and the exception class. A
result the browser has no client action to hand it to is not sent at
all. The classification is now a list of the failures that can name an
address, so everything else keeps its own message and a malformed body
says so.

An HTTP response is read in chunks against a ceiling instead of being
buffered whole, so an endpoint cannot decide how much memory a worker
spends. A captured answer is dropped when a request-shaping value
changes, and is not rewritten when it has not changed. A nested service
type that disagrees with the action is refused rather than silently
dropped.

In the editor, the payload viewer shows what the explorer's paths name,
a newly added request already offers its status code, raw body and
headers, and reopening a field re-reads what a click captured.

Docs get the four button field variables, the corrected lock TTL, and an
ADR section that says secrets reach an export with external actions
rather than external integrations.

Claude-Session: https://claude.ai/code/session_01EwBqQJNK8seaAC5j8ppjF4

* fix: leave a button's API key out of an export

An HTTP request action has no integration, so its key lives in the
service's own headers and query parameters. Both were exported in clear
text, and travelled wherever the export went: snapshots, workspace
exports, templates.

`CoreHTTPRequestServiceType` now names them sensitive, and the export
config reaches them. `FieldType.export_serialized` takes it, the
application export passes it, and the button field hands it to its
actions, which blank whatever the backing service calls sensitive. The
paths that stay inside the installation, duplicating a field and
restoring a snapshot, pass no config and keep the key, so a copy still
works.

Which header holds the key is not knowable, so the whole list goes
rather than a guess at the secret one, and the import reads a stripped
list as none of them.

Claude-Session: https://claude.ai/code/session_01EwBqQJNK8seaAC5j8ppjF4

* test: guard the editor's explorer without leaving the page

Every other test here navigates or reloads between building a button and
reading what it captured, which fetches from the backend again and hides
what the editor was holding.

This one stays on one page: it adds an HTTP action and a dependent
action through the editor, checks the later one is already offered the
status code and raw body before either has been saved, then saves,
clicks, and reopens the field to find the answer the click just got.

Without the baseline schema the request has no node at all until the
field is saved and reopened. Without the re-read on reopen the captured
body stays missing until the page is reloaded.

* fix: hang up on a response that never stops arriving

Requests treats a scalar timeout as inactivity, so it starts again on
every byte. A server sending one every few seconds held the connection
open for as long as it liked, and the click outlived the lock sized to
`2 x sum(timeouts)`. Once Redis expired that lock a second click could
start and repeat actions that are not reversible, which is the case the
lock exists for.

The body is now read against a wall-clock deadline as well as the size
ceiling, both inside the streaming loop, and a deadline reached is
reported the same way as any other timeout.

The connect and header phases still use Requests' own inactivity
timeout. Closing those needs a renewable lock, which is left as a
follow-up.

* feat: say why a click captured nothing

A click that answered 404, timed out, or came back larger than the
sample data ceiling captured nothing and said so nowhere. The note
asking for a click stayed exactly as it was, so there was no way to tell
the click had already happened.

The action type now says why a result describes no shape rather than
only that it does not, and the reason is stored under the `_error`
sentinel the builder and automation already use. The editor shows it in
place of the note, through the viewer's existing error state.

Only written when there is nothing to lose: a shape an earlier click
learned outlives an explanation of the latest one, and every action
pointing at that shape would break with it. The reason names the status
code but never the address, which is for whoever configured the button
rather than whoever clicked it.

`generate_schema` now skips a stored failure. It is truthy, so the body
would otherwise come back as an empty object rather than being left out.

* fix: close the holes a review found in the button field's external actions

Seven of these are regressions from the earlier review fixes on this
branch.

An external action no longer logs its own exception, whatever type it
is. The previous rule keyed on the failure, but loguru prints the frame
locals beside the traceback and the frame that resolved the formulas
holds the URL and every resolved header, so a malformed body or an
oversized answer still wrote the key to the log.

A click no longer asks for more rate limit slots than the limit could
ever hold. Slots are taken one at a time, so a button carrying more
requests than the budget was refused the slot past the limit and could
never be clicked at all, however long anybody waited. Past that point
the limit is back to counting clicks.

A click is charged only for requests that were really sent. The callback
fired before the formulas were resolved, so a header naming a deleted
field, or a body that is not valid JSON, spent the budget without
reaching anything.

Reading the response no longer skips its ceiling when the ceiling is
switched off. It returned before consuming the body, so a truncated or
corrupt answer surfaced later as a 500 rather than a handled failure,
and the drip deadline was never armed.

An export keeps the keys of what it strips and blanks only the values,
so an imported button says what has to be entered again instead of
quietly sending a request without its `Content-Type`. Form data and the
body are stripped too, not only headers and query params.

The AI formula prompt no longer sends a button's headers to the
provider. It serialized every field with no export config, and reading a
formula field needs far less permission than configuring a button does.

The editor's re-read on reopen takes only what a click captured, matched
by id, so an unsaved action edit survives it.

Also: loguru ignores `exc_info`, so two handlers were swallowing their
tracebacks; the sample data cap measured escaped JSON, which refused a
Japanese answer at half the documented size; the unchanged-answer check
compared whole values, and `Date` alone moves every second, so nearly
every click rewrote the blob it was meant to skip; and an e2e test found
the duplicated field by an index that a new column had shifted.

* fix: charge, log and explain a click the way the last review asked

Four follow-ups from the review of the external actions.

A button carrying more requests than a rate limit could ever hold is now
refused rather than reserved for what fits: capping the reservation still
sent every request, so the limit was paying for a burst of any size.

An address Advocate refuses is told apart from a connection that failed,
so a click that never sent anything gives its slot back.

The HTTP service no longer logs its own unknown failures with the
traceback. The frame holds the URL, the resolved headers and the body,
and so does the one that could not keep an answer, so both log the class
of the failure and the ids only.

A reason left by an earlier failed click is replaced by the next one: a
404 followed by a timeout kept describing the 404. A shape an earlier
click learned is still never overwritten.

The e2e concurrency test waits for the first request to finish before
closing the competing context.
2026-09-03 11:46:21 +02:00