Skip to content

Refactor: dedupe status emission, region resolution, config save#28

Merged
yarikleto merged 1 commit into
mainfrom
cleanup/dedup-refactor
Jun 27, 2026
Merged

Refactor: dedupe status emission, region resolution, config save#28
yarikleto merged 1 commit into
mainfrom
cleanup/dedup-refactor

Conversation

@yarikleto

Copy link
Copy Markdown
Owner

What

Behavior-preserving cleanup of three small duplication spots, ahead of review.

  • monitor.js — merged the two byte-identical baseline branches (first frame / size change) into one `isBaseline` guard; added `emitStatus()` helper that removes 3× repeated `new Date().toLocaleTimeString()` and verbose status objects. Resolution-change rationale preserved in comment.
  • main.js — added `resolveRegion(value)` helper replacing the `if (regionResolve) { regionResolve(x); regionResolve = null; }` pattern repeated 3×.
  • config.js — collapsed `save()` loop to `store.set(cfg)` (electron-store v8 accepts an object; same per-entry iteration, single atomic write).

Not done

  • Skipped rewriting `config.getAll()` to derive keys from defaults — explicit, greppable key list beats indirection.

Verification

  • `npm test` — 8/8 pass
  • `npm run lint` — clean
  • No behavior change.

- monitor.js: merge identical baseline branches into one isBaseline guard
  and add emitStatus() helper (removes repeated timestamp + status objects)
- main.js: add resolveRegion() helper for the repeated resolver-clear pattern
- config.js: collapse save() loop to store.set(cfg) (electron-store object form)

No behavior change. Tests and lint pass.
@yarikleto
yarikleto merged commit 5867ed3 into main Jun 27, 2026
2 checks passed
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