Add cell copy/paste, multi-row edits and a context menu to the circuit grid

Ctrl+C/Ctrl+V copy and paste grid cells without opening an editor, using
the document copy/paste events so it also works over plain HTTP in the
LAN. Protection and cable summaries copy the complete circuit record;
tab-separated blocks from Excel spread over visible rows and columns.
With a Ctrl/Shift multi-selection, typing, pasting and the protection
dialog apply to every selected row that can take the value, including
device power and GZF; other cells are skipped and reported.

All of these writes use the new circuit-list.bulk-update command. It
carries complete circuit.update, circuit-device-row.update and
circuit-protection.update commands, applies them with the single-command
rules in one transaction and stores the reversed inverses, so each edit
is one undo step. The single-command apply logic is extracted for reuse.

A right-click menu (also context-menu key / Shift+F10) offers copy,
paste, edit, protection, cable sizing, insert circuit below, add device
and delete. The protection summary is now selected by click and opened
by double click, Enter or F2. Existing numbers open in the inline editor
with a decimal comma, so confirming an unchanged decimal no longer fails.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian Appel 2026-10-30 07:38:28 +01:00
parent 07bc52a134
commit 17a3945813
18 changed files with 2548 additions and 391 deletions

View file

@ -316,6 +316,80 @@ a {
box-shadow: inset 3px 0 0 var(--color-signal);
}
/* Section link with an optional expand toggle (Verteilungen). */
.sidebar-link-row {
display: flex;
align-items: center;
gap: 2px;
}
.sidebar-link-row > .sidebar-link {
flex: 1 1 auto;
min-width: 0;
}
.sidebar-subtoggle {
flex: 0 0 auto;
width: 2rem;
align-self: stretch;
border: 0;
border-radius: 8px;
background: transparent;
color: #c7d6e0;
cursor: pointer;
}
.sidebar-subtoggle:hover {
background: rgba(255, 255, 255, 0.08);
color: #fff;
}
.sidebar-project-name {
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sidebar-board-list {
display: flex;
flex-direction: column;
gap: 1px;
margin: 2px 0 6px 1.6rem;
border-left: 1px solid rgba(255, 255, 255, 0.14);
max-height: 45vh;
overflow-y: auto;
}
.sidebar-board-link {
display: block;
padding: 5px 10px;
border-radius: 6px;
color: #c7d6e0;
font-size: 0.82rem;
text-decoration: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sidebar-board-link:hover {
background: rgba(255, 255, 255, 0.08);
color: #fff;
text-decoration: none;
}
.sidebar-board-link.active {
background: rgba(255, 255, 255, 0.14);
color: #fff;
box-shadow: inset 3px 0 0 var(--color-signal);
}
.sidebar-board-link.disabled {
opacity: 0.55;
cursor: default;
}
.sidebar-icon {
width: 1.1em;
display: inline-flex;
@ -1677,7 +1751,7 @@ a.kpi:hover {
.tree-grid .cell-protection-trigger {
color: var(--color-primary);
cursor: pointer;
cursor: cell;
font-weight: 600;
transition:
background-color 0.12s ease,
@ -1714,6 +1788,95 @@ a.kpi:hover {
outline-offset: -2px;
}
/* Result of copy/paste or a multi-row edit, shown above the grid. */
.grid-status-line {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.35rem 0.75rem;
padding: 0.3rem 0.6rem;
border: 1px solid var(--notice-info-border);
border-radius: 4px;
background: var(--notice-info-bg);
font-size: 0.82rem;
}
.grid-status-selection {
font-weight: 600;
}
.grid-status-line button {
margin-left: auto;
border: 0;
background: transparent;
color: var(--text-muted);
font-size: 0.78rem;
text-decoration: underline;
}
/* Right-click menu of the circuit grid. */
.grid-context-menu {
position: fixed;
z-index: 1060;
display: flex;
flex-direction: column;
min-width: 15rem;
max-width: min(24rem, calc(100vw - 1rem));
padding: 0.3rem;
border: 1px solid var(--panel-border);
border-radius: 6px;
background: var(--panel-bg);
box-shadow: 0 6px 20px var(--shadow-menu);
}
.grid-context-menu-item {
display: flex;
align-items: center;
gap: 0.55rem;
width: 100%;
padding: 0.38rem 0.55rem;
border: 0;
border-radius: 4px;
background: transparent;
color: var(--text-strong);
font-size: 0.85rem;
text-align: left;
}
.grid-context-menu-item:not(:disabled):hover,
.grid-context-menu-item:focus-visible {
background: var(--panel-bg-subtle);
outline: none;
}
.grid-context-menu-item:disabled {
opacity: 0.45;
cursor: default;
}
.grid-context-menu-item.danger {
color: var(--color-danger);
}
.grid-context-menu-label {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.grid-context-menu-shortcut {
color: var(--text-subtle);
font-size: 0.75rem;
}
.grid-context-menu-separator {
height: 1px;
margin: 0.25rem 0.2rem;
background: var(--panel-border);
}
/* Picker trigger on the selected GZF cell. Positioned over the cell so the
column width does not change while the selection moves. */
.tree-grid td:has(> .cell-picker-trigger) {