Skip to content

feat: what a unit ID scan actually found - #47

Merged
Harted merged 4 commits into
mainfrom
feat/scan-unit-id-results
Aug 29, 2026
Merged

feat: what a unit ID scan actually found#47
Harted merged 4 commits into
mainfrom
feat/scan-unit-id-results

Conversation

@Harted

@Harted Harted commented Aug 29, 2026

Copy link
Copy Markdown
Member

A unit that answers with a Modbus exception is a unit that is there and talking: it answered the question with no. One that says nothing is not on the bus. Both used to be the same red chip.

Telling them apart

modbus-serial hangs modbusCode on the error it builds from an exception frame, and on nothing else it throws: a timeout is a TransactionTimedOutError, a closed port a PortNotOpenError. So the code is the whole test, and the result now carries the types that refused beside the ones that answered.

In the grid

The cell carries the answer instead of a chip inside it: green OK, amber EXCEPTION, red NO REPLY, and the matching line in the error column takes the same colour, so the two cannot disagree. The columns are single selects, so filtering offers those three answers rather than a text box. Nothing is editable; the type is for the filter.

The register type toggles carry the short names the columns use, and the count is gone from this dialog: the grid lists every unit it asked, which is more than a number can say. It stays in the register scan, where you only see the first rows.

Manners

The cog menu stayed open behind this dialog, because only the register scan closed it, and the dialog was rendered inside that menu: a Popover unmounts its children when it closes, so closing the menu took the dialog with it. It is mounted beside the client view now, where the register dialog already was. Closing clears the results. The close button lost its cross.

The grid is keyed on the chosen register types, because it carries width state across a change of columns and the error column, the only one on flex, came back at zero often enough to look like it had vanished.

What was run

Lint, typecheck, 573 unit tests, and the full e2e suite at 556. One of the new specs pins down something worth knowing: against Modbux's own server every scanned unit ID answers, so the results come back amber and never red. ServerTCP and ServerSerial ignore a request whose unit ID is not theirs unless theirs is 255, and Modbux passes none, which is right for a server holding several units. Testing a real silence needs an opponent that can be told to stay quiet.

Harted added 4 commits August 29, 2026 23:42
A unit that answers with an exception is a unit that is there and
talking; one that says nothing is not on the bus at all. Both arrived as
a message string, so nothing downstream could tell them apart.

modbus-serial hangs `modbusCode` on the error it builds from an exception
frame and on nothing else it throws, so that code is the whole test. The
result carries the types that refused beside the ones that answered.
A row of chips reads as decoration and cost the space of a badge to say
one word. The cell carries it now: green for a reply with data, amber for
a unit that answered by refusing, red for one that said nothing, with the
word in it and the same colour on the matching line in the error column.

The column is a single select, so filtering offers those three answers
rather than asking you to type one. Nothing here is editable; the type is
for the filter.
The menu behind it stayed open, because only the register scan closed it,
and the dialog itself was rendered inside that menu: a Popover unmounts
its children when it closes, so closing the menu took the dialog with it.
It lives beside the client view now, where the register dialog already
did.

Closing clears the results, so the next scan does not fill in around the
last one. The toggles carry the short names the result columns use, and
the count is gone: that grid lists every unit it asked, which is more than
a number can say. The close button lost its cross.

The grid is keyed on the chosen register types. It carries width state
across a change of columns otherwise, and the error column, the only one
on flex, came back at zero often enough to look like it had disappeared.
@Harted
Harted marked this pull request as ready for review August 29, 2026 22:00
@Harted
Harted merged commit 76b9e77 into main Aug 29, 2026
1 check passed
@Harted
Harted deleted the feat/scan-unit-id-results branch August 29, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant