Skip to content

The panel drawn again for the same element keeps what was opened and folded - #288

Merged
endrix merged 2 commits into
mainfrom
fix/panel-folds-kept
Dec 4, 2026
Merged

endrix merged 2 commits into
mainfrom
fix/panel-folds-kept

Conversation

@endrix

@endrix endrix commented Dec 4, 2026

Copy link
Copy Markdown
Owner

The property panel is built anew from the model each time. When a product's lookup answers (wfpy-ide's skills and presets) or an edit changes the element, the panel draws it again, and every section went back to its default. In wfpy-ide this closed the Advanced section, with Stateful in it, right after the reader opened it.

  • panel-folds.ts reads what is open and folded before the redraw and sets it again after. That covers the panel's own sections (createPropertySection, collapsed) and a product's <details>. Each is known by data-fold when it has one, else by its title without a count ("Inputs (3)" is "Inputs"), with its place among those of that title.
  • Both ways the panel draws the shown element again keep them: redrawIfShowing (a product's lookup) and redrawIfChanged (an edit, only when it is the same element). redrawIfShowing now keeps the scroll as well, as redrawIfChanged already did.
  • Selecting another element still starts from the defaults.

Tests: panel-folds.test.ts (happy-dom): the folds come back after a redraw whose counts changed, ones the drawing did not have are left alone, and both redraw paths use them. npm test, npm run typecheck and scripts/check-neutrality.sh pass.

The wfpy-ide half (Stateful out of Advanced) follows in its own PR.

https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya

… and folded

The panel is built anew from the model each time, so a product's lookup
that answered, or an edit, closed a section the reader had just opened
(a product's Advanced, with its fields in it) and opened one they had
folded. A redraw of the element shown now reads the folds before and
sets them again after (`panel-folds.ts`): the panel's own sections and a
product's `<details>`, each known by `data-fold` or its title without a
count, and its place among those of that title. A redraw for a lookup
keeps the scroll too, as one after an edit already did.

Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
- A count drawn apart from its title (`Validators2`) is no part of the
  fold's key, so the fold is kept when the count changes.
- A port renamed falls back to its node, whose card the panel showed:
  its folds are kept too.
- The network's panel drawn again keeps its folds.
- The test reads each redraw up to the next member of the class, and
  checks the three ways.

Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
@endrix
endrix merged commit a00fd1a into main Dec 4, 2026
1 check passed
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