Repository navigation
The panel drawn again for the same element keeps what was opened and folded - #288
Merged
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsreads 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 bydata-foldwhen it has one, else by its title without a count ("Inputs (3)" is "Inputs"), with its place among those of that title.redrawIfShowing(a product's lookup) andredrawIfChanged(an edit, only when it is the same element).redrawIfShowingnow keeps the scroll as well, asredrawIfChangedalready did.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 typecheckandscripts/check-neutrality.shpass.The wfpy-ide half (Stateful out of Advanced) follows in its own PR.
https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya