Skip to content

feat(webui): add SQL syntax highlighting to metric form editors#1341

Open
mohamadyasser118 wants to merge 2 commits intocybertec-postgresql:masterfrom
mohamadyasser118:feat/sql-editor-syntax-highlighting
Open

feat(webui): add SQL syntax highlighting to metric form editors#1341
mohamadyasser118 wants to merge 2 commits intocybertec-postgresql:masterfrom
mohamadyasser118:feat/sql-editor-syntax-highlighting

Conversation

@mohamadyasser118
Copy link
Copy Markdown
Contributor

As a follow-up to the web improvements and SQL display, I replaced plain OutlinedInput fields with react-simple-code-editor and prismjs for SQLs and InitSQL fields in the metric form. I see that this makes it easy to write SQLs.

Changes:

  • SQLs field: full editor and syntax highlighting
  • InitSQL field: same editor with smaller min-height
  • I Used react-simple-code-editor (lightweight) over CodeMirror
    to avoid unnecessary bundle size increase
  • Integrated with react-hook-form via Controller

SQLs Before:

before

SQLs After:

after

initSQL Before:

initSQL before

initSQL After:

initSQL after

AI & Automation Policy

  • I am the human author and take full personal responsibility for every change in this PR.
  • No AI or automated generative tool was used in any part of this PR OR I have disclosed all tool(s) below.
    Drafted and reviewed with the assistance Cluade Sonnet 4.6

Checklist

  • Code compiles and existing tests pass locally.
  • New or updated tests are included where applicable.
  • Documentation is updated where applicable.

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.

1 participant