Compare commits

...

9 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
6f65b46b14 Save version when skipping reporting to prevent re-prompting
When users click "Skip reporting" without the checkbox, now saves
the current version to version-info.json. This prevents the prompt
from appearing again until the version actually changes.

Behavior:
- Skip without checkbox: Saves version, will prompt on next version
- Skip with checkbox: Sets neverAsk=true, never prompts again

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2026-02-26 14:24:25 +00:00
Will Tatam
231fb5a7ca Remove default checked state from versionSaveChoice 2026-02-26 08:52:34 +00:00
copilot-swe-agent[bot]
354da8fdc0 Fix automatic reporting to preserve alwaysReport preference
When automatic reporting was triggered, the third parameter (alwaysReport)
was missing in the reportUpgradeEvent call. This caused the preference to
be lost after the first automatic report, requiring the user to be prompted
again on the next upgrade.

Fixed by passing 'true' as the third parameter to maintain the user's
preference for all future automatic reports.

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2026-01-31 11:26:02 +00:00
copilot-swe-agent[bot]
39bf31d3a1 Change button text from "Report this update" to "Report update"
Per feedback, simplified button text since the checkbox already
provides context about saving choices for future updates.

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2026-01-30 08:57:31 +00:00
copilot-swe-agent[bot]
50ef8db595 Fix double toast messages and improve error handling
- Remove duplicate toast messages when checkbox is checked
- Show appropriate message based on saveChoice state
- Ensure error toasts are visible after overlay is removed

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2026-01-30 08:53:30 +00:00
copilot-swe-agent[bot]
d4f365e7e5 Simplify prompt to 2 buttons + checkbox per feedback
- Replace 4-button design with 2 buttons: "Report this update" and "Skip reporting"
- Add checkbox "Save my choice for future updates" (checked by default)
- When checkbox is checked:
  - "Report this update" enables automatic reporting for future upgrades
  - "Skip reporting" saves "never ask" preference
- When unchecked, choice applies only to current prompt

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2026-01-30 08:50:11 +00:00
copilot-swe-agent[bot]
6ca8ed65e8 Address code review feedback: use boolean coercion instead of logical OR
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-12-09 17:24:04 +00:00
copilot-swe-agent[bot]
6a2b7995e9 Add "Yes, Always" option to upgrade prompt and improve messaging
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-12-09 17:18:23 +00:00
copilot-swe-agent[bot]
247a7a51d7 Initial plan 2025-12-09 17:10:22 +00:00

View File

@@ -3343,8 +3343,14 @@ function checkVersionUpgrade(info) {
const storedVersion = versionInfo.version || '';
if (storedVersion && storedVersion !== currentVersion) {
// Version has changed, show upgrade prompt
showVersionUpgradePrompt(info, storedVersion, currentVersion);
// Version has changed
if (versionInfo.alwaysReport) {
// Automatically report if user opted in for always reporting
reportUpgradeEvent(info, storedVersion, true);
} else {
// Show upgrade prompt
showVersionUpgradePrompt(info, storedVersion, currentVersion);
}
} else if (!storedVersion) {
// Empty version in file, show install prompt
showVersionUpgradePrompt(info, null, currentVersion);
@@ -3354,7 +3360,7 @@ function checkVersionUpgrade(info) {
console.log('Failed to load version-info.json', e);
// On error, save current version for next time
if (info && info.ver) {
updateVersionInfo(info.ver, false);
updateVersionInfo(info.ver, false, false);
}
});
}
@@ -3380,7 +3386,7 @@ function showVersionUpgradePrompt(info, oldVersion, newVersion) {
? `You are now running WLED <strong style="text-wrap: nowrap">${newVersion}</strong>.`
: `Your WLED has been upgraded from <strong style="text-wrap: nowrap">${oldVersion}</strong> to <strong style="text-wrap: nowrap">${newVersion}</strong>.`;
const question = 'Help make WLED better with a one-time hardware report? It includes only device details like chip type, LED count, etc. — never personal data or your activities.'
const question = 'Help make WLED better by sharing hardware details like chip type and LED count? This helps us understand how WLED is used and prioritize features — we never collect personal data or your activities.'
dialog.innerHTML = `
<h2 style="margin-top:0;color:var(--c-f);">${title}</h2>
@@ -3389,10 +3395,15 @@ function showVersionUpgradePrompt(info, oldVersion, newVersion) {
<p style="color:var(--c-f);font-size:0.9em;">
<a href="https://kno.wled.ge/about/privacy-policy/" target="_blank" style="color:var(--c-6);">Learn more about what data is collected and why</a>
</p>
<div style="margin-top:20px;">
<button id="versionReportYes" class="btn">Yes</button>
<button id="versionReportNo" class="btn">Not Now</button>
<button id="versionReportNever" class="btn">Never Ask</button>
<div style="margin-top:15px;margin-bottom:15px;">
<label style="display:flex;align-items:center;gap:8px;color:var(--c-f);cursor:pointer;">
<input type="checkbox" id="versionSaveChoice" style="cursor:pointer;">
<span>Save my choice for future updates</span>
</label>
</div>
<div style="margin-top:20px;display:flex;flex-wrap:wrap;gap:8px;">
<button id="versionReportYes" class="btn">Report update</button>
<button id="versionReportNo" class="btn">Skip reporting</button>
</div>
`;
@@ -3401,23 +3412,27 @@ function showVersionUpgradePrompt(info, oldVersion, newVersion) {
// Add event listeners
gId('versionReportYes').addEventListener('click', () => {
reportUpgradeEvent(info, oldVersion);
const saveChoice = gId('versionSaveChoice').checked;
d.body.removeChild(overlay);
// Pass saveChoice as alwaysReport parameter
reportUpgradeEvent(info, oldVersion, saveChoice);
});
gId('versionReportNo').addEventListener('click', () => {
// Don't update version, will ask again on next load
const saveChoice = gId('versionSaveChoice').checked;
d.body.removeChild(overlay);
});
gId('versionReportNever').addEventListener('click', () => {
updateVersionInfo(newVersion, true);
d.body.removeChild(overlay);
showToast('You will not be asked again.');
if (saveChoice) {
// Save "never ask" preference
updateVersionInfo(newVersion, true, false);
showToast('You will not be asked again.');
} else {
// Save current version to prevent re-prompting until version changes
updateVersionInfo(newVersion, false, false);
}
});
}
function reportUpgradeEvent(info, oldVersion) {
function reportUpgradeEvent(info, oldVersion, alwaysReport) {
showToast('Reporting upgrade...');
// Fetch fresh data from /json/info endpoint as requested
@@ -3457,8 +3472,12 @@ function reportUpgradeEvent(info, oldVersion) {
})
.then(res => {
if (res.ok) {
showToast('Thank you for reporting!');
updateVersionInfo(info.ver, false);
if (alwaysReport) {
showToast('Thank you! Future upgrades will be reported automatically.');
} else {
showToast('Thank you for reporting!');
}
updateVersionInfo(info.ver, false, !!alwaysReport);
} else {
showToast('Report failed. Please try again later.', true);
// Do NOT update version info on failure - user will be prompted again
@@ -3471,10 +3490,11 @@ function reportUpgradeEvent(info, oldVersion) {
});
}
function updateVersionInfo(version, neverAsk) {
function updateVersionInfo(version, neverAsk, alwaysReport) {
const versionInfo = {
version: version,
neverAsk: neverAsk
neverAsk: neverAsk,
alwaysReport: !!alwaysReport
};
// Create a Blob with JSON content and use /upload endpoint