feat: add JSON export and import for settings persistence (#800)

* feat: add JSON export and import for settings persistence

* Update src/components/UnifiedSettings.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/utils/settings-persistence.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/settings-main.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat: Add localization for unified settings data management, export, and import.

* fix(settings): address PR feedback on export/import security and i18n

* style(i18n): ensure trailing newline in locale files

* fix: address review feedback on settings export/import

- Replace denylist with allowlist of known settings key prefixes
- Add version check and Array.isArray guard on import
- Remove window.alert/confirm — use inline toast and setActionStatus
- Restore deleted countryBrief.noMarkets and components i18n keys
- Move settings i18n keys to components.settings namespace
- Replace inline styles with CSS classes
- Return ImportResult from importSettings for caller feedback

---------

Co-authored-by: ValMtp3 <ValMtp3@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elie Habib <elie.habib@gmail.com>
This commit is contained in:
ValMtp
2026-03-04 17:46:50 +01:00
committed by GitHub
parent 124085edd6
commit 6fb227db00
7 changed files with 282 additions and 0 deletions

View File

@@ -14490,6 +14490,45 @@ a.prediction-link:hover {
flex-shrink: 0;
}
/* Data management buttons in settings */
.us-data-mgmt {
display: flex;
gap: 10px;
padding: 0 16px 12px;
}
.us-data-mgmt .settings-btn {
flex: 1;
}
.us-hidden-input {
display: none;
}
.us-data-mgmt-toast {
padding: 0 16px;
font-size: 12px;
min-height: 0;
transition: opacity 0.2s;
}
.us-data-mgmt-toast:empty {
display: none;
}
.us-data-mgmt-toast.ok {
color: #34d399;
}
.us-data-mgmt-toast.error {
color: #f87171;
}
.us-toast-reload {
color: #60a5fa;
margin-left: 6px;
}
/* Footer status */
.ai-flow-popup-footer {
display: flex;