Skip to content

Improve visual metrics editor model/table selection logic#7907

Draft
ericokuma wants to merge 1 commit into
mainfrom
cursor/APP-309-improve-visual-metrics-editor-model-table-selection-logic-5154
Draft

Improve visual metrics editor model/table selection logic#7907
ericokuma wants to merge 1 commit into
mainfrom
cursor/APP-309-improve-visual-metrics-editor-model-table-selection-logic-5154

Conversation

@ericokuma

Copy link
Copy Markdown
Contributor

This PR addresses APP-309 by improving the Visual Metrics Editor's logic for selecting models and tables.

The core problem was that the editor struggled with MotherDuck tables (which are not Rill models), leading to incorrect YAML generation and a confusing UI.

This PR resolves the issue by:

  • Removing the models/tables switcher to simplify the selection process.
  • Always using OLAPListTables for surfacing available options, ensuring all tables (including external ones) are discoverable.
  • Implementing dynamic YAML generation to correctly use model: <table_name> for tables in the default database/schema, and database: <database>, database_schema: <database_schema>, table: <table_name> for tables outside the default context.

This ensures a consistent and correct experience for all table selections in the Visual Metrics Editor.

Checklist:

  • Covered by tests (manual verification and a temporary test file were used during development)
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes (APP-309)
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Linear Issue: APP-309

Open in Cursor Open in Web

Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
@cursor

cursor Bot commented Sep 8, 2025

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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.

2 participants