Skip to content

feat(ui): edit a panel's SQL in place - #344

Merged
vishr merged 1 commit into
mainfrom
fix/panel-sql-editor
Oct 18, 2026
Merged

vishr merged 1 commit into
mainfrom
fix/panel-sql-editor

Conversation

@vishr

@vishr vishr commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Panels defined by SQL gain Edit SQL for people allowed to edit the dashboard (same permission as Edit layout).
  • A reusable CodeMirror 6 SqlEditor: SQL highlighting, completion of approved relations and columns, server validation problems inline, Mod-Enter to run, Escape to leave the editor. It loads as its own chunk.
  • Running previews through the existing execution path and panel renderer; Save writes only the SQL as a new dashboard version; Cancel discards; closing with unsaved changes asks first; conflicts keep the draft.
  • CodeMirror packages pinned (matching Monk's versions) with notices regenerated.

Verification

  • 1,371 UI unit tests; just ui, just ui-check, just ui-deadcode.
  • Browser: e2e/panel-sql-editor.spec.ts and e2e/accessibility.spec.ts, 32 passed; contrast proven at 4.5:1 or better in both themes with the rule enabled.
  • Two Codex adversarial reviews; findings fixed.
  • just check in the pre-push hook.

Panels defined by SQL gain "Edit SQL" for people allowed to edit the
dashboard. A reusable CodeMirror 6 editor offers SQL highlighting,
completion of the approved relations and their columns, and the server's
validation problems inline. Mod-Enter runs the edited panel through the
existing execution path and renders it with the panel renderer; Save
writes only the SQL as a new dashboard version, and Cancel discards it.

Escape leaves the editor without closing the dialog, closing with
unsaved changes asks first, and version conflicts keep the draft. The
editor loads as its own chunk, so dashboards that never edit do not
download it. CodeMirror packages are pinned and their notices included.

Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
@vishr
vishr force-pushed the fix/panel-sql-editor branch from dea036d to 853e1ef Compare October 18, 2026 02:15
@vishr
vishr merged commit 9b03b94 into main Oct 18, 2026
16 checks passed
@vishr
vishr deleted the fix/panel-sql-editor branch October 18, 2026 02:31
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