feat(tui): add first-run error reporting opt-in prompt#566
Merged
wizzomafizzo merged 12 commits intomainfrom Mar 20, 2026
Merged
feat(tui): add first-run error reporting opt-in prompt#566wizzomafizzo merged 12 commits intomainfrom
wizzomafizzo merged 12 commits intomainfrom
Conversation
Show a modal dialog on TUI launch asking users to opt in to anonymous error reporting. Three options: "Enable" (turns on via API, marks as prompted), "Not Now" (dismisses, re-shows next launch), and "Don't Ask Again" (permanently suppresses the prompt). Adds ErrorReportingPrompted field to TUIConfig in tui.toml to persist the user's permanent decision. Only shows when the service is running (required for API call) and error reporting isn't already enabled.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…/Get/Set Covers the new ErrorReportingPrompted field in applyTUIDefaults, plus existing TUI config functions that had no test coverage.
…focus SetRoot with enableFocus=true resets focus to the root widget, which was overriding the modal's focus set by ShowErrorReportingPrompt.
…al config The service daemon runs as a separate process with its own in-memory config. When settings are updated via the API, the daemon's Save() writes its entire in-memory config to disk, overwriting manual edits. Checking the service's actual state prevents the prompt from showing when the daemon already has error reporting enabled. Also moves SetRoot before the prompt so focus isn't stolen.
The slug search cache build reads 129K entries on MiSTer and takes ~21 seconds on its hardware. This blocked the entire service startup sequence, preventing the API server from binding until complete. The cache is stored behind an atomic.Pointer and all consumers already check for nil and fall back to SQL queries, so building it asynchronously is safe.
Move the slug search cache build from OpenMediaDB to after the API server starts in service.go. MediaDB uses SetMaxOpenConns(1), so the cache's 129K row scan was monopolizing the single SQLite connection and blocking migrations and all other DB access during startup.
The Connected() assert after max errors was racy — the reader goroutine may not have called Close() yet when the test checks. Use WaitForCondition polling instead of sleep.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
error_reporting_promptedfield totui.tomlto persist permanent decisionstui.tomlwill see the prompt since the new field defaults tofalse