Skip to content

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
refactoring
Apr 21, 2026
Merged

Refactoring: Added File Operation Service, for all File related stuff, fixed White / Black Lines when Buffers could not be found#569
Hirogen merged 10 commits intoDevelopmentfrom
refactoring

Conversation

@Hirogen
Copy link
Copy Markdown
Collaborator

@Hirogen Hirogen commented Apr 21, 2026

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 IFileOperationService interface 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:

  • Introduced a new IFileOperationService interface 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.
  • Added FileOpenedEventArgs to carry detailed context when a file tab is created, supporting richer event-driven UI updates.
  • Updated unit tests to mock and inject the new IFileOperationService, ensuring test coverage and compatibility. [1] [2]

Log Buffer Memory Management:

  • Added an EvictContent method to LogBuffer, 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.
  • Updated the LRU cache garbage collection logic to use EvictContent instead of returning buffers to the pool prematurely, preventing accidental loss of buffer metadata.
  • Improved the ClearLines method in LogBuffer to ensure proper initialization and clearing, and to reset debug tracking in debug builds.

UI and Logging Improvements:

  • Enhanced the CellPainting method in the log window UI to gracefully handle missing log lines by painting empty cells and logging a warning, preventing rendering issues.
  • Updated logging in GetLogLineMemoryWithWait to provide clearer diagnostics when fast-fail mode is triggered, aiding in debugging and support.

Minor Cleanups:

  • Removed unused or redundant fields and comments from PositionAwareStreamReaderSystem for code clarity. [1] [2] [3]
  • Improved XML documentation comments for readability and maintainability in various files. [1] [2]
  • Cleaned up obsolete commented-out code in the log window reload logic.

@Hirogen Hirogen merged commit ed1a1f4 into Development Apr 21, 2026
1 check passed
@Hirogen Hirogen deleted the refactoring branch April 22, 2026 07:44
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