Skip to content

docs: document relative date ranges in view-level default_ui_filters#11216

Merged
keydunov merged 1 commit into
masterfrom
docs/ui-filters-update
Jul 7, 2026
Merged

docs: document relative date ranges in view-level default_ui_filters#11216
keydunov merged 1 commit into
masterfrom
docs/ui-filters-update

Conversation

@keydunov

@keydunov keydunov commented Jul 7, 2026

Copy link
Copy Markdown
Member

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made

Docs-only change for CUB-3018 (shipped in cubejs-enterprise#12945 / #12956): view-level meta.default_ui_filters now supports relative date bounds, and its authoring vocabulary was finalized to mirror the workbook filter bar.

reference/data-modeling/view.mdxdefault_ui_filters section

  • Canonical example now uses between with values: ["7 days ago", "today"] (inline YAML arrays per house style), and the intro mentions views embedded via the React Embed SDK.
  • New Operators subsection listing the UI operator names (equals, not_equals, between, greater_than, …, is_null, is_not_null).
  • New Relative date values subsection: between takes an explicit two-element [start, end] pair; each bound is a relative value (today, yesterday, N <unit>s ago, N <unit>s from now, this week|month|quarter|year, now as alias for today), a fixed ISO date, or a number for numeric members. Covers relative values on open-ended comparisons (greater_than: ["7 days ago"]), query-time resolution (CURRENT_DATE-based SQL, rolls day over day), both-bounds inclusivity, the Relative-tab editor, case/whitespace-insensitivity, and validation (a bad bound or single-value between drops that entry with a console warning; view selection never breaks).

docs/explore-analyze/workbooks/querying-data.mdx

  • Default filters example updated to the new syntax, plus a short paragraph on relative bounds linking to the reference.

Notes for the reviewer

  • The REST API inDateRange docs and the default_filters section are deliberately untouched — their semantics are unchanged, and query-level relative support is a separate unshipped ticket (CUB-3129).
  • Single-string range forms ("last 7 days", "from … to …") are intentionally not documented; they were never released as public syntax and are rejected.

Rendered locally with mintlify dev and reviewed.

🤖 Generated with Claude Code

Cube Cloud's view-level meta.default_ui_filters now accepts relative
date bounds in between filters (e.g. values: ["7 days ago", "today"]),
resolving at query time. Document the finalized authoring vocabulary:
UI operator names, the [start, end] bound forms, query-time resolution
and inclusivity, and validation behavior. Update the workbook filtering
page example to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude

claude Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keydunov's task in 59s —— View job


Code Review

Docs-only PR. LGTM with two small optional nits — nothing blocking.

Tasks

  • Read PR diff and both changed files
  • Verify link references (ref-default-ui-filters, ref-workbook-filtering) resolve
  • Check naming conventions vs docs-mintlify/CLAUDE.md ("Cube cloud platform", "React Embed SDK" ✓)
  • Sanity-check the inclusivity math ("7 days ago" → "today" = 8 days ✓)
  • Cross-check YAML/JS examples are equivalent ✓

What looks good

  • Canonical example now leads with the more compelling between + relative-value case; equals still shown as a second entry.
  • YAML and JavaScript examples stay in lockstep (same members, operators, values). Inline YAML arrays (values: ["7 days ago", "today"]) match house style.
  • Reference-link ids resolve — [ref-default-ui-filters] is defined at querying-data.mdx:271, [ref-workbook-filtering] at view.mdx:958.
  • Product-naming compliance: "Cube cloud platform" (view.mdx:289) and "React Embed SDK" (view.mdx:291) both match docs-mintlify/CLAUDE.md.
  • Validation behavior (unrecognized value or single-value between drops the entry with a console warn, view selection never breaks) is exactly the kind of edge case worth documenting.
  • Inclusivity claim checks out: ["7 days ago", "today"] inclusive on both ends → 8 calendar days.
  • Scope discipline: the PR explicitly leaves REST inDateRange and view-level default_filters untouched, and calls that out in the PR description.

Optional nits (non-blocking)

  1. is_null / is_not_null are unary — the intro says each entry has "a list of values" and the operator list (view.mdx:355–358) lumps is_null/is_not_null in with the rest without noting they don't take values. Worth a half-sentence: e.g. "is_null and is_not_null are unary and ignore values." Not a correctness issue, just saves a reader a round-trip.

  2. Heading depth##### Operators and ##### Relative date values at H5 under #### default_ui_filters (H4) is technically fine, but H5 rarely appears elsewhere on the page. If the on-page TOC starts to look cluttered when rendered, promoting them to bold **Operators** paragraphs would read the same. Purely cosmetic; keep as-is if the rendered page looks good.

  3. Minor proseview.mdx:366 reads `N days|weeks|months|quarters|years ago` inside a single backtick span. The | renders as a literal pipe, which is what you want, but a reader may momentarily parse it as markdown table syntax. Fine as-is; only worth touching if you notice it looking odd in the rendered output.

Things I checked and did not find issues with

  • No stale references to the removed inDateRange example.
  • The workbook page's new paragraph correctly points to the reference rather than duplicating the operator list.
  • No /docs legacy-directory edits.
• Branch: [`docs/ui-filters-update`](https://github.com/cube-js/cube/tree/docs/ui-filters-update)

@mintlify

mintlify Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cubed3 🟢 Ready View Preview Jul 7, 2026, 7:42 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@keydunov keydunov merged commit ede672f into master Jul 7, 2026
14 checks passed
@keydunov keydunov deleted the docs/ui-filters-update branch July 7, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant