Store remembered tabs in app database instead of preferences (#1541)

## Description
Moves storing the remembered tabs from app preferences to the app
database. This means deleting the user will remove the remembered tabs
and the app preferences file is smaller and faster to load.

The remembered tabs are migrated automatically when the app is updated.

There are no significant user facing changes in this PR.

### Related issues
N/A

### Testing
Emulator

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Damontecres 2026-06-08 13:45:38 -04:00 • committed by GitHub
parent a4ee1e5175
commit b49926f80b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1379 additions and 599 deletions

View file

@ -1,45 +0,0 @@
package com.github.damontecres.wholphin.util
import com.github.damontecres.wholphin.preferences.UserPreferences
import java.util.UUID
/**
* Functions to remember tabs choices for a library
*/
interface RememberTabManager {
/**
* If enabled, get the remembered tab index for the given item
*/
fun getRememberedTab(
preferences: UserPreferences,
itemId: UUID,
defaultTab: Int,
): Int = getRememberedTab(preferences, itemId.toString(), defaultTab)
/**
* If enabled, get the remembered tab index for the given item
*/
fun getRememberedTab(
preferences: UserPreferences,
itemId: String,
defaultTab: Int,
): Int
/**
* If enabled, save the remembered tab index for the given item
*/
fun saveRememberedTab(
preferences: UserPreferences,
itemId: UUID,
tabIndex: Int,
) = saveRememberedTab(preferences, itemId.toString(), tabIndex)
/**
* If enabled, save the remembered tab index for the given item
*/
fun saveRememberedTab(
preferences: UserPreferences,
itemId: String,
tabIndex: Int,
)
}