mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
feat(database): JSON-aware value editor for json cells (#2410)
Refs #2333 Editing json / jsonb / MySQL JSON cells showed one long plain text line, and invalid JSON only failed on Submit. The Value panel and the grid's ⇧Enter window now open the IDE's code editor for JSON cells, pretty-printed (big integers and duplicate keys preserved, large values formatted off the main thread) with highlighting, folding and find; validation as you type blocks Apply only for JSON columns; Reformat; Apply of an unchanged value creates no pending edit, and drafts survive opening the window. XML and bytea modes from #2333 remain. Co-authored-by: Inf1mum <8135225+Inf1mum@users.noreply.github.com>
This commit is contained in:
@@ -951,6 +951,37 @@
|
||||
outline: none;
|
||||
border-color: var(--focus-ring);
|
||||
}
|
||||
/* The JSON value editor's host (#2333): the CodeMirror view fills it. */
|
||||
.valueEditor {
|
||||
flex: 1;
|
||||
min-height: 120px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-input);
|
||||
color: var(--fg-strong);
|
||||
overflow: hidden;
|
||||
}
|
||||
.valueEditor > :global(.cm-editor) {
|
||||
height: 100%;
|
||||
font-size: var(--fs-code);
|
||||
}
|
||||
.valueError {
|
||||
color: var(--danger);
|
||||
font-size: var(--fs-code);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.valueWindowBody {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
gap: 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.valueWindowBody .valueEditor {
|
||||
min-height: 160px;
|
||||
}
|
||||
.recordText {
|
||||
resize: vertical;
|
||||
padding: 3px 6px;
|
||||
|
||||
Reference in New Issue
Block a user