feat(bind-template): let a bind declare an interactive filter, including a context filter#629
Open
mattcfilbert wants to merge 1 commit into
feature/desktoptableau/tableau-mcp:feature/desktopfrom
claude/m7-declarative-filterstableau/tableau-mcp:claude/m7-declarative-filtersCopy head branch name to clipboard
Open
feat(bind-template): let a bind declare an interactive filter, including a context filter#629mattcfilbert wants to merge 1 commit intofeature/desktoptableau/tableau-mcp:feature/desktopfrom claude/m7-declarative-filterstableau/tableau-mcp:claude/m7-declarative-filtersCopy head branch name to clipboard
mattcfilbert wants to merge 1 commit into
feature/desktoptableau/tableau-mcp:feature/desktopfrom
claude/m7-declarative-filterstableau/tableau-mcp:claude/m7-declarative-filtersCopy head branch name to clipboard
Conversation
…ing a context filter A bind could not express 'top 10 products, and let me filter to one region' correctly. The agent built a plain Top-N plus an ordinary region filter, so Tableau computed the global top 10 first and then filtered by region — the wrong list. The fix is to let a bind carry filters, and to emit a region filter as a context filter (Tableau runs it before the Top-N), so a selected region gets its own top 10. - Add an optional filters[] to the bind proposal (field, optional values, optional context). - Emit a context filter (context='true') and declare its column, spliced AFTER the Top-N so the Top-N planner still sees a single dimension and does not refuse. - Emit a shown filter card so the user has an interactive control, not just a hidden filter. - Fold filters into the proposal signature so adding one counts as a changed proposal on re-bind. Full suite green (5062 passing; the lone config-test failure is the discovery-dir env fixture, not this change). Live apply/order-of-operations round-trip is not yet verified against Desktop. No version bump. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mattcfilbert
marked this pull request as ready for review
July 23, 2026 18:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decision
Let a bind carry an interactive filter, and emit a region filter as a context filter so a "top N within a selected dimension" ask builds correctly in one call. This is a new capability on bind-template, not a change to how existing binds behave (no filter, no new behavior).
The problem it fixes: asked for "top 10 products by sales, and let me filter to one region," the agent built a plain Top-N plus an ordinary region filter. Tableau computes the global top 10 first and then filters by region — the wrong list. A context filter runs before the Top-N (Tableau's order of operations), so a selected region gets its own top 10.
Scope
filters[]on the bind proposal:{ field, values?, context? }(values optional — a "let me filter" ask names no region, so the control enumerates all members).context='true'on the filter and declare its column, spliced after the Top-N so the Top-N planner still sees a single dimension and does not refuse.What future work must preserve
The context filter must be spliced after the Top-N (or the Top-N planner refuses on two dimensions), and a context filter must ship with a shown card (order of operations alone, with no control, is not what the user asked for).
Change / evidence / risk
Full suite green: 5062 tests, typecheck and lint clean, verified firsthand (the lone config-test failure is the discovery-dir env fixture, not this change). New tests assert the emitted XML:
context='true'on the region filter, the filter column in datasource-dependencies and slices, the shown card in the window, and the Top-N groupfilter unaffected.Not yet verified: the live apply round-trip. Whether Desktop preserves the emitted context filter and actually reorders the operations as intended is a live probe I have not run — the XML forms are copied from confirmed real-workbook evidence, but the end-to-end behavior on Desktop is unconfirmed. This needs a live sing before we trust it.
Reviewer decision
Approve = bind-template can build a top-N-within-an-interactive-filter correctly, pending the live round-trip check.
Posted by MattGPT (automation) on Matt Filbert's behalf.
🤖 Generated with Claude Code