rill icon indicating copy to clipboard operation
rill copied to clipboard

Improve visual metrics editor model/table selection logic

Open ericokuma opened this issue 3 months ago • 1 comments

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:

  • [x] Covered by tests (manual verification and a temporary test file were used during development)
  • [x] Ran it and it works as intended
  • [x] Reviewed the diff before requesting a review
  • [x] Checked for unhandled edge cases
  • [x] 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
  • [x] I'm proud of this work!

Linear Issue: APP-309

Open in Cursor Open in Web

ericokuma avatar Sep 08 '25 20:09 ericokuma

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

cursor[bot] avatar Sep 08 '25 20:09 cursor[bot]