Start new installs with Diary installed, like Lists and Leaderboard

A new profile, or one that never chose its apps, comes with every app Inner
Breeze ships: Lumi, Habits and Practice pinned, and Lists, Diary and
Leaderboard ready under them. A Diary choice still at its untouched default
becomes installed, as Lists and Leaderboard did; a removal stays removed.
This commit is contained in:
waozi committed 2026-10-24 00:14:19 -03:00
1 parent 2b3dc7967f
commit cbcf115c3a
9 files changed
+34 -21

No files matched your search

+1
View File
@@ -5,6 +5,7 @@
- Practice illustrations keep clean, smooth edges on desktop, without dark seams across the Sun Salutation guide.
- Smoother on phones: the How to guides, still screens and paused practices draw far less.
- Apps and practices use the new ZX format and update themselves after installing.
- New installs start with Diary, Lists and Leaderboard installed, along with Lumi, Habits and Practice.
- Diary and Photos keep each photo once for your account, privately, shared by all your apps. Photos saved before move there by themselves, and their old copies are removed only once the new ones are safely stored.
## [2.1.44] - 2026-10-23
+8 -3
View File
@@ -696,9 +696,14 @@ picker on a private Xvfb display.
## Account app choices
A new profile comes with Lumi, Habits and Practice installed and pinned, in
that order; Lists, Diary and Leaderboard are added from More apps. Existing
profiles keep their apps.
A new profile comes with every app Inner Breeze ships installed: Lumi, Habits
and Practice pinned, in that order, and Lists, Diary and Leaderboard ready
under them. Existing profiles keep their apps; a profile whose Lists, Diary or
Leaderboard choice is still the untouched default gets that app installed
(`storage_migrate_preinstalled_apps`), while a removal stays removed. Each
release builds these apps from the current source into the app, so it ships
their newest versions; a package the node publishes later reaches devices as
an update, and an older one never replaces the shipped copy.
Sync v6 uses `private.inbe.v1.app-preferences`. Each of the six `app_used_*`
keys is a separate timestamped record, including explicit zero values for
+4 -4
View File
@@ -823,10 +823,10 @@ app_load_settings :: (app: *InnerBreeze) -> s32 {
load_bool_setting(*app.guide_narration_enabled, "guide_narration_enabled",
app.voice_narration_enabled)
load_bool_setting(*app.guide_narration_muted, "guide_narration_muted", 0)
// Existing profiles retain their app choices. A new profile comes with
// Lumi, Habits and Practice; the other apps are added from More apps.
app.enabled_apps = SettingsCacheInt("enabled_apps",
ifx settings_missing != 0 then APP_RECOMMENDED else APP_LISTS | APP_RECOMMENDED) & APP_ALL
// Existing profiles retain their app choices. A new profile, or one that
// never chose its apps, comes with every app the app ships: Lumi, Habits,
// Practice, Lists, Diary and Leaderboard.
app.enabled_apps = SettingsCacheInt("enabled_apps", APP_ALL) & APP_ALL
for index: cast(s32)1..cast(s32)(PackageCount - 1) {
key := PackagePreferenceKey(index)
if SettingsCacheContains(key) {
+2
View File
@@ -12,6 +12,8 @@ APP_PRACTICE :: 4
APP_DIARY :: 8
APP_LUMI :: 16
APP_LEADERBOARD :: 32
// The apps an older root release with three dependencies may name
// (package_release.zi). A new profile comes with APP_ALL.
APP_RECOMMENDED :: 55
APP_ALL :: 63
+2 -2
View File
@@ -87,7 +87,7 @@ local_bundle_path: [4096]u8;
local_bundle_index: s32 = -1;
inbe_message: InbeMessage;
inbe_codec: InbeMessageCodec;
enabled_apps: s32 = APP_RECOMMENDED;
enabled_apps: s32 = APP_ALL;
package_required: bool;
lists_message: ListsMessage;
habits_message: HabitsMessage;
@@ -476,7 +476,7 @@ CellsClose :: () {
module_prepared_revisions[index] = 0
index += 1
}
enabled_apps = APP_RECOMMENDED
enabled_apps = APP_ALL
package_required = false
PackageFree(diary_text)
PackageFree(diary_document)
+4 -3
View File
@@ -11,12 +11,13 @@ LOG_INFO :: 3
c :: #system_library "c";
MigrationChanges :: (database: *void) -> s32 #foreign c "sqlite3_changes";
// Lists and Leaderboard ship in the APK. Upgrade only the old untouched
// defaults; an explicit removal here or on another device remains a choice.
// Lists, Diary and Leaderboard ship in the APK. Upgrade only the old
// untouched defaults; an explicit removal here or on another device remains
// a choice.
#program_export
storage_migrate_preinstalled_apps :: () {
if storage_db_handle() == null { return }
unused exec_sql("UPDATE settings SET value='1' WHERE user_id=(SELECT id FROM users LIMIT 1) AND key IN ('app_used_lists','app_used_leaderboard') AND value='0' AND updated_at=1")
unused exec_sql("UPDATE settings SET value='1' WHERE user_id=(SELECT id FROM users LIMIT 1) AND key IN ('app_used_lists','app_used_diary','app_used_leaderboard') AND value='0' AND updated_at=1")
if MigrationChanges(storage_db_handle()) > 0 { storage_schedule_persist() }
}
+9 -7
View File
@@ -150,10 +150,11 @@ with tempfile.TemporaryDirectory(prefix="inbe-app-choices-") as temporary:
saved = settings(profile)
assert saved["apps_setup_done"] == "0"
assert saved["language_setup_done"] == "1"
# A new profile comes with Lumi, Habits and Practice, pinned in that
# order. They are defaults, not choices: stored at time 1 and not
# queued, so an account's apps replace them after sign-in.
assert saved["enabled_apps"] == "55"
# A new profile comes with every app the app ships, Lumi, Habits and
# Practice pinned in that order. They are defaults, not choices:
# stored at time 1 and not queued, so an account's apps replace them
# after sign-in.
assert saved["enabled_apps"] == "63"
assert saved["launcher_favorite_count"] == "3"
assert [int(saved[f"launcher_favorite_{i}"]) for i in range(3)] == [12, 1, 2]
with database(profile) as db:
@@ -161,7 +162,7 @@ with tempfile.TemporaryDirectory(prefix="inbe-app-choices-") as temporary:
"SELECT key,value,updated_at FROM settings WHERE key LIKE 'app_used_%'")}
queued = db.execute("SELECT COUNT(*) FROM sync_outbox WHERE entity_type IN "
"('app_preference','app_order')").fetchone()[0]
assert defaults == {f"app_used_{name}": (str(int(name in ("lists", "habits", "practices", "lumi", "leaderboard"))), 1)
assert defaults == {f"app_used_{name}": ("1", 1)
for name in ("lists", "habits", "practices", "diary", "lumi", "leaderboard")}, defaults
assert queued == 0, "a new profile queued its default apps"
assert "app_order" not in saved, "a new profile sent its default pins"
@@ -284,8 +285,9 @@ with tempfile.TemporaryDirectory(prefix="inbe-app-choices-") as temporary:
db.execute("UPDATE settings SET value='1' WHERE key IN ('tutorial_seen','habits_guide_seen')")
db.execute("UPDATE settings SET value='0' WHERE key='main_tab'")
with application(profile, "existing-profile") as (window, log):
# Upgrading also installs Leaderboard once, without pinning it.
wait_setting(profile, "enabled_apps", 55)
# A profile that never chose its apps gets every app the app ships,
# without pinning them.
wait_setting(profile, "enabled_apps", 63)
wait_setting(profile, "main_tab", 0)
routes = [int(settings(profile)[f"bottom_nav_route_{index}"])
for index in range(int(settings(profile)["bottom_nav_route_count"]))]
+2 -2
View File
@@ -730,7 +730,7 @@ with contextlib.ExitStack() as stack:
assert settings(profile)["language_setup_done"] == "0", "Fresh start skipped the language picker"
assert settings(profile)["apps_setup_done"] == "0"
assert favorites(profile) == [12, 1, 2], "New profiles do not pin Lumi, Habits and Practice"
assert settings(profile)["enabled_apps"] == "55", "Lists and Leaderboard must ship preinstalled alongside Lumi, Habits and Practice"
assert settings(profile)["enabled_apps"] == "63", "Lists, Diary and Leaderboard must ship preinstalled alongside Lumi, Habits and Practice"
assert settings(profile)["theme"] == "9" and settings(profile)["theme_source"] == "0"
assert settings(profile)["theme_mode"] == "2"
# Merely opening and closing the picker does not complete setup.
@@ -753,7 +753,7 @@ with contextlib.ExitStack() as stack:
wait_setting(profile, "package_updates_allowed", 0)
driver.wait_gone(label="Don't allow", role="button")
assert not driver.find(label="More apps"), "The old section heading remains"
for label in ("Lists", "Leaderboard"):
for label in ("Lists", "Diary", "Leaderboard"):
card = next(node for node in cards()[1] if node["label"] == label)
assert corner(card, driver.tree())["label"] == "App options", f"{label} is not preinstalled"
# Practice is the third pinned card in the same grid as the rest.
+2
View File
@@ -56,9 +56,11 @@ Check :: () -> s32 {
storage_get_setting_text("sync_server_url") == "https://sync.example")
check_int("reconnect enables synchronization", storage_sync_enabled(), 1)
storage_set_setting_default_text("app_used_lists", "0")
storage_set_setting_default_text("app_used_diary", "0")
storage_set_setting_default_text("app_used_leaderboard", "0")
storage_migrate_preinstalled_apps()
check_true("old untouched Lists default becomes preinstalled", storage_get_setting_text("app_used_lists") == "1")
check_true("old untouched Diary default becomes preinstalled", storage_get_setting_text("app_used_diary") == "1")
check_true("old untouched Leaderboard default becomes preinstalled", storage_get_setting_text("app_used_leaderboard") == "1")
storage_set_setting_int("app_used_lists", 0)
storage_migrate_preinstalled_apps()