docs(dashboards): document control values in the dashboard URL - #11687
Conversation
Two gaps, one of them newly closed in the product.
`controls.mdx` never said that a published dashboard's URL carries the
viewer's control values at all — so the page described three controls whose
selections looked, to a reader, like they lived only in that browser tab. It
now has a "Sharing the current selection" section covering both parameters,
what does and does not travel in a link (a static default and a
user-attribute default deliberately stay out, so a shared link neither pins a
stale default nor leaks the sharer's own attribute value onto the recipient),
and when an inbound parameter is ignored.
`embedding/iframe/dashboards.mdx` documented only `?f_…`, though `?tg_…` for
time granularity has worked on the way in for as long. Its section now covers
both, in a table, and says the values also travel back out. The heading gained
"and granularities" with an explicit `{#pre-set-dashboard-filters-via-url}`
anchor so the existing link from `events.mdx` keeps resolving.
Companion to cubedevinc/cubejs-enterprise#14497 (CUB-4198), which added the
outbound half for time granularity — a viewer's granularity pick now reaches
the URL the way a filter pick already did.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Claude finished @mngr's task in 1m 47s —— View job Review: docs-only, no blockers — 2 medium, 3 low, all inlineFull review — findings, verification notes, and checklistChecklist
What's good
Findings
Nit not worth an inline comment: the new section hard-wraps at ~80 columns while the surrounding prose in Scope noteThe behavioral claims (which values get serialized, the |
Follow-up to #11687, which I merged on green checks before reading the review that had landed two minutes earlier. All five findings hold; four are mine, one is pre-existing. - The granularity list said `day`…`year`, contradicting *Allowed granularities* on the same page: `second`, `minute` and `hour` are offered for `TIMESTAMP` / `DATETIME` dimensions, so a reader building an hourly `tg_` link would have concluded the parameter couldn't express it. Both pages now name the sub-day grains and point at the switcher's allowed list as the authority. - "Published dashboards only" read as scoping the whole feature, contradicting the embed page's "works on both regular and published dashboards". Both are true — the restriction is on the outbound write, not the inbound read — so the bullet now says which direction it constrains. - The section said the children's values travel but not what the recipient's PARENT dropdown shows. Confirmed against the implementation: a parent's selection is runtime-only state and never serialized, so it falls back to the widget's saved `defaultOptionId`. Documented, because a recipient seeing the children set while the parent reads something else looks like a bug. - The link text still said "Pre-set dashboard filters via URL" after this work renamed that heading to include granularities. - The embed example carries raw `{`, `"` and `}`. Pre-existing, but that section is now the canonical reference for hand-written links, so it says to percent-encode when building the URL programmatically. Also unwrapped the new prose to one paragraph per line, matching the rest of `controls.mdx` (the hard-wrapped block would have made every later diff there noisier).
* docs(dashboards): address the review on the control-URL section Follow-up to #11687, which I merged on green checks before reading the review that had landed two minutes earlier. All five findings hold; four are mine, one is pre-existing. - The granularity list said `day`…`year`, contradicting *Allowed granularities* on the same page: `second`, `minute` and `hour` are offered for `TIMESTAMP` / `DATETIME` dimensions, so a reader building an hourly `tg_` link would have concluded the parameter couldn't express it. Both pages now name the sub-day grains and point at the switcher's allowed list as the authority. - "Published dashboards only" read as scoping the whole feature, contradicting the embed page's "works on both regular and published dashboards". Both are true — the restriction is on the outbound write, not the inbound read — so the bullet now says which direction it constrains. - The section said the children's values travel but not what the recipient's PARENT dropdown shows. Confirmed against the implementation: a parent's selection is runtime-only state and never serialized, so it falls back to the widget's saved `defaultOptionId`. Documented, because a recipient seeing the children set while the parent reads something else looks like a bug. - The link text still said "Pre-set dashboard filters via URL" after this work renamed that heading to include granularities. - The embed example carries raw `{`, `"` and `}`. Pre-existing, but that section is now the canonical reference for hand-written links, so it says to percent-encode when building the URL programmatically. Also unwrapped the new prose to one paragraph per line, matching the rest of `controls.mdx` (the hard-wrapped block would have made every later diff there noisier). * docs(embedding): finish the direction, encoding and link fixes Three low-severity follow-ups from the review of the previous commit, all on the embed page and all in text this work already touched: - The "reverse direction works too" paragraph still claimed write-back without the published-only qualifier — the same contradiction the controls page just had fixed on its read side, surviving here on the write side. - The percent-encoding note pointed at "constructing the URL programmatically", but the failure a reader will actually hit is pasting the example into the `src="…"` of the iframe snippet directly above it, where the raw quote closes the attribute and truncates the URL. Says that instead. - "the switcher's allowed granularities" is now a link, as it already is in the parallel sentence on the controls page; a reader here had no way to reach the list. --------- Co-authored-by: Gleb <gleb@unknownd2d4c7120595.localdomain>
What
Documents that a published dashboard's URL carries the viewer's control values — the user-facing half of cubedevinc/cubejs-enterprise#14497 (CUB-4198), which added outbound URL sync for the time granularity switcher.
Two gaps:
docs/explore-analyze/dashboards/widgets/controls.mdxnever mentioned the URL at all, so the page described three controls whose selections read as living only in the viewer's browser tab. New Sharing the current selection section covers:f_<view>.<dimension>=<JSON>,tg_<view>.<dimension>=<granularity>), with the internal-name and lowercase-granularity gotchas;embedding/iframe/dashboards.mdxdocumented only?f_…, though?tg_…has worked inbound for as long. Its section now covers both in a table and notes the values travel back out too.Note on the anchor
The embed heading became "Pre-set dashboard filters and granularities via URL" but keeps its old anchor explicitly (
{#pre-set-dashboard-filters-via-url}), so the existing link fromembedding/iframe/events.mdxkeeps resolving.Verification
Every claim was checked against the shipped code rather than inferred: the parameter formats and the internal-name/lowercase requirements, the defaults-excluded rules (
buildUrlFilterParamsFromState/buildUrlTimeGrainParamsFromStateserialize only viewer-overridden widgets), theallowedGrainsgate on inbound, and published-only scope. The behavior itself was driven end-to-end on a real published dashboard.