Skip to content

fix(dashboards): opt widgets out of global filters their object lacks (2.2.1)#458

Merged
os-zhuang merged 1 commit into
mainfrom
fix/dashboard-global-filter-bindings
Jul 20, 2026
Merged

fix(dashboards): opt widgets out of global filters their object lacks (2.2.1)#458
os-zhuang merged 1 commit into
mainfrom
fix/dashboard-global-filter-bindings

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Follow-up patch (2.2.1) to #457. The 2.2.0 dashboard fix only covered the built-in dateRange picker, but ObjectStack 15 (framework#2501) injects every dashboard filter — dateRange and each globalFilters[] entry — into every widget's analytics query. Widgets on objects that lack the filtered column still crashed with SqliteError: no such column: <field> and rendered as error cards.

Reported: on the Executive dashboard, selecting the Lead Source filter errored out most charts.

Fix

  • Executive Lead Sourcecrm_account has no lead_source, so total_accounts / new_accounts_by_month / accounts_by_industry threw no such column: lead_source. Added lead_source: false to their filterBindings. crm_contact / crm_lead do have lead_source, so total_contacts / open_leads keep filtering correctly.
  • CRM Ownercrm_product has no owner, so top_products would crash the same way. Added owner: false to its filterBindings.
  • Audited the full filter × object matrix across all four dashboards; Sales (all opportunity_metrics) and Service (created_date/owner/priority all exist on crm_case) needed no change.

Verification

Browser-verified by actually selecting the filter value (Lead Source = Web), not just loading the page:

  • Account widgets stay populated (opted out of lead_source); Contacts/Leads filter correctly; revenue widgets show empty results (no web-sourced closed-won this quarter) — zero no such column / analytics errors in the server log.
  • verify (validate + typecheck + build + vitest 17/17) green.

Follow-up

The upstream platform issue for shifting this class of check to build time is objectstack-ai/objectstack#3365 (validate dashboard filter field-existence).

🤖 Generated with Claude Code

… (2.2.1)

2.2.0 fixed only the built-in `dateRange` picker, but ObjectStack 15
(framework#2501) injects EVERY dashboard filter — dateRange AND every
globalFilters[] entry — into each widget's analytics query. Widgets on
objects without the filtered column still crashed with
`SqliteError: no such column: <field>` and rendered as error cards.

- Executive `Lead Source` filter: crm_account has no `lead_source`, so
  total_accounts / new_accounts_by_month / accounts_by_industry threw
  `no such column: lead_source`. Add `lead_source: false` to their
  filterBindings (contact/lead keep filtering — they have the field).
- CRM `Owner` filter: crm_product has no `owner`, so top_products would
  crash the same way. Add `owner: false` to its filterBindings.
- Audited the full filter×object matrix: Sales (all opportunity_metrics)
  and Service (created_date/owner/priority all on crm_case) need nothing.

Browser-verified by actually SELECTING the filter values (Lead Source = Web):
account widgets stay populated, contact/lead filter correctly, zero analytics
errors in the server log. verify (validate/build/test 17/17) green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies configuration labels Jul 20, 2026
@os-zhuang
os-zhuang merged commit f3f4899 into main Jul 20, 2026
6 checks passed
@os-zhuang
os-zhuang deleted the fix/dashboard-global-filter-bindings branch July 20, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration dependencies documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant