Repository navigation
Fix #2462: [Bug]: JS/TS Editor - The log window is cleared when the show/hide button of the 'script list' is used. - #2463
Merged
Conversation
…how/hide button of the 'script list' is used. The editor log lost all its lines when the script list or the log was hidden and shown again, because `Log` is mounted anew on these layout changes and kept its lines in component state. The log lines are now kept at module level in `Log.tsx` (next to the existing copy buffer `gText`), so they survive remounting. Lines are also collected while the log is hidden: `App` registers one log handler per socket via `Log.attach()` in `onConnectionReady` and keeps the list of edited scripts up to date with `Log.setEditing()`. A mounted `Log` only subscribes for re-renders, and when it is shown again it displays all collected lines and scrolls to the bottom if "follow" is active. Filtering by the edited scripts, the limit of 300 lines per script, clearing and copying work as before (#2462). Fixes #2462
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 editor log lost all its lines when the script list or the log was hidden and shown again, because
Logis mounted anew on these layout changes and kept its lines in component state. The log lines are now kept at module level inLog.tsx(next to the existing copy buffergText), so they survive remounting. Lines are also collected while the log is hidden:Appregisters one log handler per socket viaLog.attach()inonConnectionReadyand keeps the list of edited scripts up to date withLog.setEditing(). A mountedLogonly subscribes for re-renders, and when it is shown again it displays all collected lines and scrolls to the bottom if "follow" is active. Filtering by the edited scripts, the limit of 300 lines per script, clearing and copying work as before (#2462).Fixes #2462