Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ platform API version.

### Added

- **Find in the diagram.** The palette's loupe opens a box at the top of
the palette that finds nodes in the model, not in the drawing, so a node
off screen or too small to be drawn at the zoom is found too. It matches a
node by its name (`cal:entityName`, or the label of a frame) and by the
text a producer adds for find (`wf:searchText`, one text, or a text per
field). A root that names fields (`wf:searchFields`, `[{ key, label,
title? }]`) gets a tab per field. A query can be a regular expression.
With one node selected that holds others, the search stays inside it
and the chip says so, following the selection while the box is open.
Each row ends with the name of the node the match is in (its line, inside
a scope of that name), and a node's `wf:searchDetail` tells like matches
apart. A click, or Enter for the first row, selects the hit and centres
it, at the zoom shown where names are drawn there, else fitted no closer
than 1:1 (a product whose matches are read in the detail of a node says
that zoom, `ViewToolPalette.findReadableZoom`). In a palette that lists tools the same text filters the tools,
as GLSP's field did. The box is `DiagramFindPanel`, its search
`findMatches`, and its styles `diagram-find.css`.
- **A failed build keeps the diagram.** A file that built before and fails
to build now (a syntax error typed halfway) keeps the graph it last built
for the same view, dimmed under a red bar: the first error of the build
Expand Down Expand Up @@ -50,6 +67,11 @@ platform API version.

### Changed

- **The palette's loupe opens find**, not GLSP's field. That field
filtered the tools and the lines of the view options, and said "No
results found." when it matched neither. The text of find filters the
tools alone, and the view options stay whole while it is open: what it
finds is nodes, and it says itself what it matched.
- **Command ids a product does not have.** `runWorkflow`, `stopWorkflow`,
`setAgentToolConfig`, `getAgentToolConfig` and `createNewContainer` are
optional in `DiagramCommandIds`: only a sidecar product registers them, and
Expand Down
1 change: 1 addition & 0 deletions packages/diagram-client/src/diagram-client.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@import './graph-status.css';
@import './floating-buttons.css';
@import './hierarchy-outline.css';
@import './diagram-find.css';

:root {
--sprotty-background: var(--vscode-editor-background, #1e1e1e);
Expand Down
192 changes: 192 additions & 0 deletions packages/diagram-client/src/diagram-find.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
/* ── Find in the diagram (diagram-find.ts) ────────────────────────────────
A block at the top of the palette's body, not a window over it: it
extends the palette downwards, and the palette stays one thing. Its own
file, so that a product that draws its own palette imports it alone. */

.diagram-find {
display: flex;
flex-direction: column;
gap: 6px;
box-sizing: border-box;
width: 100%;
min-width: 180px;
padding: 6px 4px 5px;
/* The ground of the palette's tool groups: the body under it shows the
canvas through. */
background: var(--vscode-settings-dropdownBackground, var(--vscode-editorWidget-background, #252526));
color: var(--vscode-foreground, #ccc);
font-size: 11px;
text-align: left;
}

.diagram-find[hidden] {
display: none;
}

/* The rows are content, not settings: they take the breathing room the
lines of the view options take from their own padding. */
.diagram-find > *:not(.diagram-find-results) {
margin: 0 2px;
}

.diagram-find-heading {
font-weight: 600;
}

.diagram-find-scope {
display: flex;
align-items: center;
gap: 4px;
}

.diagram-find-scope-chip {
max-width: 240px;
padding: 2px 8px;
border-radius: 999px;
font-size: 10px;
background: var(--vscode-badge-background, #4d4d4d);
color: var(--vscode-badge-foreground, #fff);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.diagram-find-scope-clear {
padding: 0 2px;
border: none;
background: transparent;
color: var(--vscode-descriptionForeground, #8b8b8b);
font-size: 12px;
line-height: 1;
cursor: pointer;
}

.diagram-find-scope-clear:hover {
color: var(--vscode-foreground, #ccc);
}

.diagram-find-query {
display: flex;
align-items: center;
gap: 4px;
}

.diagram-find-input {
flex: 1 1 auto;
min-width: 0;
box-sizing: border-box;
padding: 4px 6px;
border: 1px solid var(--vscode-input-border, var(--vscode-dropdown-border, #454545));
border-radius: 3px;
background: var(--vscode-input-background, #3c3c3c);
color: var(--vscode-input-foreground, #ccc);
font-family: var(--vscode-editor-font-family, monospace);
font-size: 11px;
}

.diagram-find-input:focus {
outline: 1px solid var(--vscode-focusBorder, #007fd4);
outline-offset: -1px;
}

.diagram-find-fields {
display: flex;
gap: 4px;
}

.diagram-find-fields[hidden] {
display: none;
}

.diagram-find-field {
padding: 2px 8px;
border: 1px solid var(--vscode-dropdown-border, #454545);
border-radius: 3px;
background: transparent;
color: var(--vscode-foreground, #ccc);
font-size: 10px;
cursor: pointer;
}

.diagram-find-field:hover {
background: var(--vscode-toolbar-hoverBackground, rgba(128, 128, 128, 0.18));
}

.diagram-find-field.active {
border-color: var(--vscode-inputOption-activeBorder, var(--vscode-focusBorder, #007fd4));
background: var(--vscode-inputOption-activeBackground, rgba(51, 153, 255, 0.3));
color: var(--vscode-inputOption-activeForeground, var(--vscode-foreground, #fff));
}

.diagram-find-regex {
flex: none;
font-family: var(--vscode-editor-font-family, monospace);
}

/* The count above the list: it says whether the query was any good
without a row read. */
.diagram-find-summary {
min-height: 13px;
font-size: 10px;
color: var(--vscode-descriptionForeground, #8b8b8b);
}

/* Bounded, or a query matching two thousand nodes makes the palette taller
than the window and the view options out of reach. */
.diagram-find-results {
display: flex;
flex-direction: column;
max-height: 220px;
overflow-y: auto;
}

.diagram-find-result {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
padding: 3px 6px;
border: none;
border-radius: 3px;
background: transparent;
color: var(--vscode-foreground, #ccc);
font-size: 11px;
text-align: left;
cursor: pointer;
}

.diagram-find-result:hover,
.diagram-find-result:focus-visible {
background: var(--vscode-list-hoverBackground, rgba(128, 128, 128, 0.18));
}

.diagram-find-result-primary {
flex: 0 1 auto;
font-family: var(--vscode-editor-font-family, monospace);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

/* What tells like matches apart (the value a step defines): beside the
match, not off in the last column. */
.diagram-find-result-detail {
flex: 0 1 auto;
margin-right: auto;
padding-left: 8px;
font-family: var(--vscode-editor-font-family, monospace);
color: var(--vscode-charts-blue, var(--vscode-focusBorder, #3794ff));
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.diagram-find-result-context {
flex: 0 0 auto;
max-width: 130px;
font-size: 10px;
color: var(--vscode-descriptionForeground, #8b8b8b);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Loading
Loading