Skip to content

filter: seed regex Presets only on first run#274

Merged
webispy merged 1 commit intomainfrom
fix/regex-default-preset-seed-once
May 4, 2026
Merged

filter: seed regex Presets only on first run#274
webispy merged 1 commit intomainfrom
fix/regex-default-preset-seed-once

Conversation

@webispy
Copy link
Copy Markdown
Owner

@webispy webispy commented May 4, 2026

Summary

  • The default regex Presets group was re-seeded on every extension startup whenever no regex group existed in storage, so deleting the group only stuck until the next window reload.
  • Track a DefaultRegexPresetsSeeded flag in globalState and seed defaults in the FilterManager constructor exactly once per install. After the first run, deletion of the Presets group persists across restarts.
  • The clearRegexFilterData command path is unchanged — it calls initDefaultFilters() directly without checking the flag, so an explicit reset still restores the defaults.

Spec

  1. First install shows the default preset — covered by first-run seeding.
  2. Deleting the default preset does not auto-restore it — fixed by the flag.
  3. clearRegexFilterData reset shows the default preset again — preserved (direct call bypasses the flag).

Test plan

  • npm test — 622 passing, including 3 new regression tests in FilterManager Default Presets Seeding.
  • Manual: fresh install → Presets appears.
  • Manual: delete Presets → reload window → Presets stays gone.
  • Manual: run LogMagnifier: Clear Regex Filter Data → Presets is restored.
  • Manual: after step above, delete Presets again → reload → still gone.

The Presets default regex group was re-created on every extension
startup whenever no regex group existed in storage, which meant a user
who deleted the Presets group always saw it reappear after a window
reload — violating spec #2 (deletion must persist across restarts).

Track a DefaultRegexPresetsSeeded flag in globalState so the seeding in
the FilterManager constructor runs exactly once per install. The
clearRegexFilterData command path is unchanged: it calls
initDefaultFilters() directly without consulting the flag, satisfying
spec #3 (explicit reset still restores defaults).

Add three regression tests covering: first-run seeding, no auto-restore
after delete + reconstruct, and clear-still-restores even when the flag
is set.
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.57%. Comparing base (d7d1d61) to head (9f02d6a).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #274      +/-   ##
==========================================
+ Coverage   62.55%   62.57%   +0.01%     
==========================================
  Files          91       91              
  Lines       18519    18528       +9     
  Branches     1416     1418       +2     
==========================================
+ Hits        11584    11593       +9     
  Misses       6907     6907              
  Partials       28       28              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

📦 Artifact Ready

Download the extension package here:
logmagnifier-1.7.2-dev.20260504080436.vsix

@webispy webispy self-assigned this May 4, 2026
@webispy webispy added bug Something isn't working labels May 4, 2026
@webispy webispy modified the milestone: v1.7.3 May 4, 2026
@webispy webispy merged commit ac3555c into main May 4, 2026
5 checks passed
@webispy webispy deleted the fix/regex-default-preset-seed-once branch May 4, 2026 08:09
@github-project-automation github-project-automation Bot moved this from Todo to Done in LogMagnifier May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants