Add Flatpak welcome modal and sequential modal priority system

- Add FlatpakWelcomeModal component shown once for Flatpak users
- Add persistence for Flatpak welcome shown state (updates.db)
- Implement sequential modal priority: Flatpak > What's new > Update available
- Add Flatpak section to Settings navigation (only when running in Flatpak)
- Clean up duplicate Flatpak section and invalid style block in SettingsView
- Add copyable command styling for Flatpak section
This commit is contained in:
vicrodh committed 2026-01-27 04:37:17 -06:00
1 parent 4ff21312b2
commit 561f7487d0
6 files changed
+353 -144

No files matched your search

+2
View File
@@ -771,6 +771,8 @@ pub fn run() {
updates::is_release_ignored,
updates::has_whats_new_been_shown,
updates::mark_whats_new_shown,
updates::has_flatpak_welcome_been_shown,
updates::mark_flatpak_welcome_shown,
updates::get_current_version,
updates::check_for_updates,
updates::fetch_release_for_version,
+35
View File
@@ -123,6 +123,11 @@ impl UpdatesStore {
CREATE TABLE IF NOT EXISTS whats_new_shown (
version TEXT PRIMARY KEY,
shown_at INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS flatpak_welcome_shown (
id INTEGER PRIMARY KEY CHECK (id = 1),
shown_at INTEGER NOT NULL
);",
)
.map_err(|e| format!("Failed to create updates tables: {}", e))?;
@@ -233,6 +238,26 @@ impl UpdatesStore {
.map_err(|e| format!("Failed to mark whats_new_shown: {}", e))?;
Ok(())
}
pub fn has_flatpak_welcome_been_shown(&self) -> bool {
self.conn
.query_row(
"SELECT 1 FROM flatpak_welcome_shown WHERE id = 1 LIMIT 1",
[],
|_row| Ok(()),
)
.is_ok()
}
pub fn mark_flatpak_welcome_shown(&self) -> Result<(), String> {
self.conn
.execute(
"INSERT OR REPLACE INTO flatpak_welcome_shown (id, shown_at) VALUES (1, ?1)",
params![now_epoch_seconds()],
)
.map_err(|e| format!("Failed to mark flatpak_welcome_shown: {}", e))?;
Ok(())
}
}
/// Thread-safe state wrapper
@@ -448,6 +473,16 @@ pub fn mark_whats_new_shown(version: String, state: tauri::State<UpdatesState>)
state.with_store(|store| store.mark_whats_new_shown(&version))
}
#[tauri::command]
pub fn has_flatpak_welcome_been_shown(state: tauri::State<UpdatesState>) -> bool {
state.with_store(|store| store.has_flatpak_welcome_been_shown())
}
#[tauri::command]
pub fn mark_flatpak_welcome_shown(state: tauri::State<UpdatesState>) -> Result<(), String> {
state.with_store(|store| store.mark_flatpak_welcome_shown())
}
#[tauri::command]
pub fn get_current_version(state: tauri::State<UpdatesState>) -> String {
state.current_version()