Skip to content

File Change Detection and Auto-Update #52

@aedrax

Description

@aedrax

Description

Add functionality to detect when the currently opened log file has been modified externally and update the content accordingly. This is particularly useful when monitoring active log files that are being written to by other processes.

Use Cases

  • Monitoring active log files that are being appended to
  • Detecting when a log file has been rotated or truncated
  • Ensuring the displayed content stays synchronized with the file system

Proposed Features

  • Implement file change detection using QFileSystemWatcher
  • Add user preferences for auto-update behavior
  • Provide visual indication when file has changed
  • Add manual refresh option
  • Handle different types of file modifications:
    • Appended content
    • Truncated file
    • Complete file replacement
    • File deletion

Technical Implementation

  1. Use QFileSystemWatcher to monitor file changes
  2. Add configuration options:
    • Auto-update on/off
    • Update frequency
    • Scroll behavior (stay at current position vs follow tail)
  3. Add status bar indicator for file modifications
  4. Implement smart update logic to handle different change scenarios
  5. Add manual refresh button/action

UI/UX Considerations

  • Status indicator in UI when file has changed
  • Option in preferences dialog for auto-update settings
  • Keyboard shortcut for manual refresh
  • Toast notification or similar for file changes
  • Maintain scroll position appropriately based on user preference

Questions

  • Should we maintain the current filter/search state after updates?
  • How should we handle very frequent updates?
  • What should happen if the file is deleted?
  • Should we maintain a history of changes?

Acceptance Criteria

  • File changes are detected reliably
  • UI updates smoothly without freezing
  • User preferences are respected
  • Current view state (selections, filters) is maintained appropriately
  • Performance remains good with frequent updates
  • Clear user feedback about file state and changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions