Refactoring: Added File Operation Service, for all File related stuff, fixed White / Black Lines when Buffers could not be found#569
Merged
Hirogen merged 10 commits intoDevelopmentfrom Apr 21, 2026
Conversation
…into refactoring
…into refactoring
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.
This pull request introduces several improvements and refactorings to the log file buffer management, UI error handling, and file operation abstractions. The most significant changes include the addition of a new
IFileOperationServiceinterface to centralize file/tab operations, enhancements to the log buffer eviction process for better memory management, improved error handling in the UI for missing log lines, and updates to logging for better diagnostics.File Operation Service Abstraction:
IFileOperationServiceinterface as a centralized facade for all file loading, tab creation, history management, and related operations. This abstraction is designed for future extensibility and clearer separation of concerns.FileOpenedEventArgsto carry detailed context when a file tab is created, supporting richer event-driven UI updates.IFileOperationService, ensuring test coverage and compatibility. [1] [2]Log Buffer Memory Management:
EvictContentmethod toLogBuffer, which clears the buffer's content to free memory but preserves metadata for efficient buffer lookup and reloading from disk. This helps optimize memory usage without losing buffer tracking.EvictContentinstead of returning buffers to the pool prematurely, preventing accidental loss of buffer metadata.ClearLinesmethod inLogBufferto ensure proper initialization and clearing, and to reset debug tracking in debug builds.UI and Logging Improvements:
CellPaintingmethod in the log window UI to gracefully handle missing log lines by painting empty cells and logging a warning, preventing rendering issues.GetLogLineMemoryWithWaitto provide clearer diagnostics when fast-fail mode is triggered, aiding in debugging and support.Minor Cleanups:
PositionAwareStreamReaderSystemfor code clarity. [1] [2] [3]