Skip to content

Pick which combats to delete, load combats on startup, and refresh only on change - #7

Open
raman78 wants to merge 3 commits into
AnotherNathan:masterfrom
raman78:pr/logs
Open

Pick which combats to delete, load combats on startup, and refresh only on change#7
raman78 wants to merge 3 commits into
AnotherNathan:masterfrom
raman78:pr/logs

Conversation

@raman78

@raman78 raman78 commented Jul 25, 2026

Copy link
Copy Markdown

What & why

Three related combats-list improvements, all on top of the existing analysis handler (no new platform deps).

Pick which combats to delete

  • Replaces the blunt "Clear Log File" with a dialog that lists every combat with checkboxes (select all / none; all but the newest selected by default).
  • Deletion keeps the chosen combats' byte ranges and rewrites the log atomically (temp file + fsync + rename), aborting without touching the log if any kept combat can't be read.
  • Opening the dialog refreshes the list first, so it always reflects what's in the log.

Load combats on startup

  • The combats dropdown is populated on launch instead of only after the first "Refresh Now".
  • Shows ~15 combats before it scrolls.

Refresh only when the log actually changed

  • Auto-refresh now skips no-op events (tracked by file size), so it no longer rebuilds the view — which collapsed any expanded damage tree — when nothing changed.
  • The auto-refresh watcher is re-created after a delete (the atomic rewrite replaces the file's inode).

Includes a unit test for the atomic rewrite helper.

🤖 Generated with Claude Code

raman78 and others added 3 commits July 25, 2026 17:25
- Replace "Clear Log File" with a dialog listing every combat with
  checkboxes (select all / none; all but the newest selected by default);
  deletion keeps the chosen combats' byte ranges and rewrites the log
  atomically, aborting if any kept combat can't be read.
- Show ~15 combats in the dropdown before it scrolls.
- Load the combats list on startup and push the latest combat to the
  overlay as soon as it is enabled, instead of only after Refresh Now.
- Only notify handlers when the log actually changed (tracked by size), so
  auto refresh no longer rebuilds the view (collapsing expanded trees) for
  no-op events, and re-create the auto-refresh watcher after a delete.
- On Linux, watch the log folder while consolidating so the game's writes
  to a rotating file still drive the live view.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Opening "Clear Log File" now triggers a manual refresh so the dialog
always lists every combat in the log, instead of relying on the user
having refreshed first. Drops the now-obsolete "refresh first" hint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The two ignored tests that need a real combat log had a developer's
absolute path baked in, which is useless to anyone else. They now read
CLA_TEST_COMBATLOG and skip with a note when it is not set.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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