Skip to content

Conversation

@Ebraam-Ashraf
Copy link

@Ebraam-Ashraf Ebraam-Ashraf commented Dec 27, 2025

Problem

The current SQLs textarea in Metrics → + New is not intuitive.
Users have to guess that it expects a list of "min_pg_version": "sql" pairs,
which makes it easy to enter invalid or incorrect data.

Solution

Replace the free-text SQLs textarea with a structured UI:

  • Separate input for Postgres minimum version
  • Separate textarea for SQL
  • Ability to add multiple version → SQL pairs
  • UI serializes the inputs back into the same payload format expected by the backend

Validation

  • At least one version → SQL pair is required before submission
  • Duplicate Postgres versions are not allowed
  • Empty version or SQL fields are rejected
  • Validation is handled in the UI to prevent invalid payloads from being sent
Screenshot from 2025-12-27 13-53-20

Fixes #1092

@pashagolub
Copy link
Collaborator

This approach wastes to much space
image

It might be a dropped down list with versions and one memo for SQL.

@pashagolub pashagolub added webui Admin UI related issues enhancement New feature or request labels Dec 28, 2025
@pashagolub pashagolub self-assigned this Dec 28, 2025
@coveralls
Copy link

coveralls commented Dec 28, 2025

Pull Request Test Coverage Report for Build 20563004293

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.754%

Totals Coverage Status
Change from base Build 20558805556: 0.0%
Covered Lines: 3802
Relevant Lines: 5155

💛 - Coveralls

@Ebraam-Ashraf
Copy link
Author

@pashagolub
thanks for feedback

I understand you want the dropdown approach instead of separate entries
but if we use a dropdown with hardcoded versions (11, 12, 13...), won't we need to update the code with every new release?
and at some point, we'll need to remove old unsupported versions too.

also the UI layout where should the version dropdown be placed?
at the top, above the sql textarea?
or let it at its place ?

let me know your thoughts and I'll get it done

@pashagolub
Copy link
Collaborator

but if we use a dropdown with hardcoded versions (11, 12, 13...), won't we need to update the code with every new release?

dropdown can be editable. People can add and remove items from it. Maybe it should be tabs instead of dropdown. But accordion won't work. One SQL is sometimes 2-3 screens, so it just doesn't make sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request webui Admin UI related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvement for new metric form in UI

3 participants