Skip to content

Dev Tools: Draw the slot flash where the item ended up - #2303

Merged
marcoroth merged 2 commits into
mainfrom
dev-tools/flash-timing
Aug 19, 2026
Merged

Dev Tools: Draw the slot flash where the item ended up#2303
marcoroth merged 2 commits into
mainfrom
dev-tools/flash-timing

Conversation

@marcoroth

Copy link
Copy Markdown
Owner

Follow up on #2299 and #2300. With the flash drawing again, and telling a branch swap apart from a value write, what it says about collections is the part still worth fixing.

An item-added drew over the wrong row. #buildItem inserts a new item in front of the first one already there and announces it from that position, and the index puts it in its real place afterwards, so the flash was drawing where the item was at that instant instead of where it ended up. On the inline-edit table that is the first row every time, whichever row was actually added.

Measuring on the next task reads the position after the whole batch has settled, ordering included. A microtask is not enough, since the reordering runs in the same task as the announcement.

An item on its way out is the one case that cannot wait. #dropItem announces before it deletes the range, so a removal is still measured while its markers are in the document. That is the only operation left drawing synchronously.

This also gets a nested slot inside a freshly built row off measuring zero by zero, since a slot in a row that has not been placed yet has no box.

An item update now also outlines the collection it belongs to, dashed and unfilled so it never competes with what is drawn inside it, in the color of the operation.

`#buildItem` inserts a new item in front of the first one already there and
announces it from that position, and the index puts it in its real place
afterwards. The flash measured the item the moment it heard about it, so an
`item-added` on a collection drew over whatever sat at the top of it. On the
inline-edit table that is the first row every time, whichever row was actually
added.

Measuring on the next task instead reads the position after the whole batch has
settled, ordering included. A microtask is not enough, since the reordering runs
in the same task as the announcement.

An item on its way out is the one case that cannot wait. `#dropItem` announces
before it deletes the range, so a removal is still measured while its markers are
in the document.

This also gets the flash off a nested slot inside a freshly built row measuring
zero by zero, since that slot has no box until the row it lives in is placed.
An item flash fills the row that changed, and any slot inside that row draws its
own flash on top of it. On the inline-edit table the row is mostly one input, so
the blue value write covers the green fill almost entirely, and the one thing the
flash existed to say, that a row was added, is the part you cannot see.

An item update now also outlines the collection it belongs to. The outline is
dashed and unfilled, so it says where the collection is without competing with
whatever is drawn inside it, and it takes the colour of the operation: green
around an addition, red around a removal, the same colours the fill already uses.
It sits under both the fill and the label by z-index, so nothing it frames is
obscured by it.

Only an update that carries an item draws one. A plain value or branch write is
not about a collection and gets nothing.
@github-actions github-actions Bot added typescript TypeScript source across the javascript/ packages dev-tools @herb-tools/dev-tools visual debugging for HTML+ERB templates labels Aug 19, 2026
@marcoroth marcoroth added the reactivity Reactive ERB templates: diff and re-render only what changed label Aug 19, 2026
@nx-cloud

nx-cloud Bot commented Aug 19, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 50e95bc

Command Status Duration Result
nx run-many -t test --all --parallel --exclude=... ✅ Succeeded 2m 51s View ↗
nx run-many -t build --all --exclude=herb-langu... ✅ Succeeded 17s View ↗
nx build @herb-tools/tailwind-class-sorter ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-19 23:29:58 UTC

@marcoroth
marcoroth enabled auto-merge (squash) August 19, 2026 23:33
@marcoroth
marcoroth disabled auto-merge August 19, 2026 23:33
@marcoroth
marcoroth merged commit 5bccaf6 into main Aug 19, 2026
21 of 22 checks passed
@marcoroth
marcoroth deleted the dev-tools/flash-timing branch August 19, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-tools @herb-tools/dev-tools visual debugging for HTML+ERB templates reactivity Reactive ERB templates: diff and re-render only what changed typescript TypeScript source across the javascript/ packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant