Show where an inspector row can be dragged and answer the pointer
After #310 rows could be dragged by their mark, but nothing said which marks take a drag, and the pointer on one changed nothing but the cursor. - A mark that drags is now a Grip: the same widget wrapped, the same size, so the value column stays where it was. Once sortBlocks takes it, it carries six faint dots at its left edge. - Marks that cannot drag stay plain: the variables of a placed object and the fields of a typed struct show no dots. - With the pointer on a grip its dots light up and the whole block that would move is washed in the accent colour, a struct with its fields. While the block is carried the wash gives way to the dimming, and the grip stays lit. - While a block is carried the other grips let the pointer pass: no lit dots, no wash. Every grip of the column shows grabbing instead of grab until the drop. - The wash first used controlHover like list rows. In the inspector it is darker than the panel and vanished next to the dark fields, so it became the accent at 15 percent, the colour of the drop line. - __gm.inspectorMark also reports the dots: none, idle or lit. Tests: - Gate on melektaus-atx: 236 files, 3576 tests (+4 in block-drag.test.ts, one of them a drag passing over another grip). - e2e 22: 40 checks (+1, sum 1740). 22f-iii reads idle dots, moves the mouse onto the mark and reads them lit. - Two counter-checks bite: no wash on hover fails 1 test, grips never made grabbable fail 3. A third: hover ignoring the drag fails 1. - Screenshots of a lit single row and a lit struct block looked at. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2c19c89878
commit
c74b6b1cab
10 files changed
+270
-23
No files matched your search
@@ -4,6 +4,7 @@ import type { PropertyDef, StructFieldDef } from '../../core/properties/Property
|
||||
import {
|
||||
Button,
|
||||
Dropdown,
|
||||
Grip,
|
||||
HStack,
|
||||
Icon,
|
||||
Label,
|
||||
@@ -88,7 +89,7 @@ export interface VariableOptions {
|
||||
|
||||
/** A variable's first row, and its mark – where the asset lets it be dragged to another place (#310). */
|
||||
export interface VariableRow extends FieldRow {
|
||||
grip: Widget;
|
||||
grip: Grip;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +105,7 @@ export function buildVariable(
|
||||
): VariableRow {
|
||||
const { edit, typing, keep, hidden, actions } = options;
|
||||
const name = nameCell(def.key, 0, edit && ((next) => edit.rename(next)));
|
||||
const grip = markLabel(def.kind);
|
||||
const grip = new Grip(markLabel(def.kind));
|
||||
const head = gridRow(0, grip, name);
|
||||
let setValue: (next: PropertyValue) => void = () => {};
|
||||
let below: Widget | undefined;
|
||||
@@ -258,10 +259,10 @@ function fieldRow(
|
||||
field: StructFieldDef,
|
||||
path: readonly string[],
|
||||
edit: VariableEditing | undefined,
|
||||
): { row: HStack; mark: Widget } {
|
||||
): { row: HStack; mark: Grip } {
|
||||
const depth = path.length + 1;
|
||||
const name = nameCell(field.key, depth, edit && ((next) => edit.renameField(path, field, next)));
|
||||
const mark = markLabel(field.kind);
|
||||
const mark = new Grip(markLabel(field.kind));
|
||||
return { row: gridRow(depth, mark, name), mark };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user