Hide apps from the library and restore them through Edit
This commit is contained in:
1 parent
cee04c12a4
commit
b46306d1e3
17 files changed
+190
-4
No files matched your search
+5
-1
@@ -340,7 +340,11 @@ saved data and bundled package; the plus button adds it back immediately.
|
||||
Settings is fixed last and is absent
|
||||
from the editable list. Existing
|
||||
profiles retain their selection and saved sidebar order.
|
||||
Each app appears once, with active shortcuts in sidebar order and hidden apps
|
||||
The Apps library normally omits apps hidden with Edit → Hide app. Edit shows
|
||||
all hidden apps again with Show app so they can be restored. Hiding removes
|
||||
the app's pinned shortcut but keeps its package and saved data. Visibility is
|
||||
saved per app in the current account's device settings, including node offers.
|
||||
Each app appears once, with pinned apps in sidebar order and the remaining apps
|
||||
after them. The list shows icons, names and controls without status paragraphs.
|
||||
|
||||
## Practice content and narration
|
||||
|
||||
@@ -7593,3 +7593,11 @@ Nemáte dost Dew. Doplňte zůstatek a poté se vraťte potvrdit nákup.
|
||||
[launcher_move_app]
|
||||
Přesunout aplikaci
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Skrýt aplikaci
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Zobrazit aplikaci
|
||||
---
|
||||
@@ -7587,3 +7587,11 @@ Nicht genug Dew. Lade dein Guthaben auf und kehre zurück, um den Kauf zu bestä
|
||||
[launcher_move_app]
|
||||
App verschieben
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
App ausblenden
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
App einblenden
|
||||
---
|
||||
@@ -7611,3 +7611,11 @@ Not enough Dew. Top up, then return to confirm the purchase.
|
||||
[launcher_move_app]
|
||||
Move app
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Hide app
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Show app
|
||||
---
|
||||
@@ -7587,3 +7587,11 @@ No tienes suficiente Dew. Recarga y vuelve para confirmar la compra.
|
||||
[launcher_move_app]
|
||||
Mover aplicación
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Ocultar aplicación
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Mostrar aplicación
|
||||
---
|
||||
@@ -7575,3 +7575,11 @@ Pas assez de Dew. Rechargez votre solde, puis revenez confirmer l’achat.
|
||||
[launcher_move_app]
|
||||
Déplacer l’application
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Masquer l’application
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Afficher l’application
|
||||
---
|
||||
@@ -7576,3 +7576,11 @@ Dew tidak cukup. Isi saldo, lalu kembali untuk mengonfirmasi pembelian.
|
||||
[launcher_move_app]
|
||||
Pindahkan aplikasi
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Sembunyikan aplikasi
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Tampilkan aplikasi
|
||||
---
|
||||
@@ -7576,3 +7576,11 @@ Dew insufficienti. Ricarica il saldo, poi torna per confermare l’acquisto.
|
||||
[launcher_move_app]
|
||||
Sposta app
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Nascondi app
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Mostra app
|
||||
---
|
||||
@@ -7572,3 +7572,11 @@ Dewが不足しています。チャージしてから戻り、購入を確定
|
||||
[launcher_move_app]
|
||||
アプリを移動
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
アプリを非表示
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
アプリを表示
|
||||
---
|
||||
@@ -7582,3 +7582,11 @@ Dew가 부족합니다. 충전한 다음 돌아와 구매를 확정하세요.
|
||||
[launcher_move_app]
|
||||
앱 이동
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
앱 숨기기
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
앱 표시
|
||||
---
|
||||
@@ -7585,3 +7585,11 @@ Dew insuficiente. Recarregue e volte para confirmar a compra.
|
||||
[launcher_move_app]
|
||||
Mover aplicação
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Ocultar aplicativo
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Mostrar aplicativo
|
||||
---
|
||||
@@ -7581,3 +7581,11 @@ Inner Breeze обновлён до версии %s.
|
||||
[launcher_move_app]
|
||||
Переместить приложение
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
Скрыть приложение
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
Показать приложение
|
||||
---
|
||||
@@ -7587,3 +7587,11 @@ Dew不足。请充值后返回确认购买。
|
||||
[launcher_move_app]
|
||||
移动应用
|
||||
---
|
||||
|
||||
[launcher_hide_app]
|
||||
隐藏应用
|
||||
---
|
||||
|
||||
[launcher_show_app]
|
||||
显示应用
|
||||
---
|
||||
@@ -1,4 +1,5 @@
|
||||
#import, file "app_types.zi";
|
||||
#import, file "app_properties.zi";
|
||||
#import, file "route_types.zi";
|
||||
#import, file "../core/types.zi";
|
||||
#import, file "app_route_state.zi";
|
||||
@@ -365,6 +366,9 @@ app_draw_launcher :: (app: *InnerBreeze, dock_drawn: bool) {
|
||||
// Favorite order is account-owned. The shared module filters and groups
|
||||
// these entries, including native routes and undownloaded offers alike.
|
||||
for index: cast(s32)0..app.launcher_favorite_count - 1 {
|
||||
if !app.launcher_editing && AppPropertiesHidden(LauncherRouteName(app.launcher_favorites[index])) {
|
||||
continue
|
||||
}
|
||||
launcher_screen_routes[count] = app.launcher_favorites[index]
|
||||
count += 1
|
||||
}
|
||||
@@ -373,12 +377,16 @@ app_draw_launcher :: (app: *InnerBreeze, dock_drawn: bool) {
|
||||
for route: routes {
|
||||
if app_launcher_is_favorite(app, route) ||
|
||||
(AppNavNodeSlot(route) >= 0 && !app_nav_route_available(app, route)) { continue }
|
||||
if !app.launcher_editing && AppPropertiesHidden(LauncherRouteName(route)) {
|
||||
continue
|
||||
}
|
||||
more_catalog[more_catalog_count] = route
|
||||
more_catalog_count += 1
|
||||
}
|
||||
for offer: cast(s32)0..NodeAppOfferCount() - 1 {
|
||||
name := NodeAppOfferName(offer)
|
||||
if NodeAppOfferShown(offer) && NodeAppSlotFor(name) < 0 {
|
||||
if NodeAppOfferShown(offer) && NodeAppSlotFor(name) < 0 &&
|
||||
(app.launcher_editing || !AppPropertiesHidden(name)) {
|
||||
more_catalog[more_catalog_count] = -offer - 2
|
||||
more_catalog_count += 1
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#import "button_widget"
|
||||
#import "control_props"
|
||||
// Native launcher policy around the shared Apps cards and menus. Routes,
|
||||
// account preferences and deferred mutations remain owned by Inbe.
|
||||
Controller :: #import "apps/controller";
|
||||
@@ -219,6 +221,25 @@ LauncherAppWidgets :: (context: *void, module: *u8, function: *u8,
|
||||
}
|
||||
}
|
||||
app_launcher_drag_handle(group.owner, card, item, group.owner.launcher_grid_view)
|
||||
name := LauncherLibraryName(item)
|
||||
hidden := AppPropertiesHidden(name)
|
||||
visibility: ButtonProps
|
||||
visibility.key = card.key + cast(u64)30
|
||||
visibility.label = LocaleText(ifx hidden then "launcher_show_app" else "launcher_hide_app")
|
||||
visibility.icon_only = true
|
||||
visibility.icon_shape = ifx hidden then "S1.8rr:M3 12Q12 1 21 12Q12 23 3 12ZM15 12A3 3 0 1 1 9 12A3 3 0 1 1 15 12" else "S1.8rr:M3 12Q12 1 21 12Q12 23 3 12ZM3 3L21 21"
|
||||
visibility.selected = hidden
|
||||
visibility.emphasis = cast(ButtonEmphasis)ButtonEmphasis.ButtonEmphasisSoft
|
||||
visibility.bounds = Rectangle.{card.bounds.x + card.bounds.width - cast(float32)AppScale(44),
|
||||
card.bounds.y, cast(float32)AppScale(44), cast(float32)AppScale(44)}
|
||||
if Button(group.owner.ui.session, visibility) != 0 && AppPropertiesSetHidden(name, !hidden) {
|
||||
if !hidden && item >= 0 && app_launcher_is_favorite(group.owner, item) {
|
||||
group.owner.launcher_favorite_count = LauncherToggleFavorite(
|
||||
group.owner.launcher_favorites[:], group.owner.launcher_favorite_count, item)
|
||||
app_launcher_pins_changed(group.owner)
|
||||
}
|
||||
app_block_current_click(group.owner)
|
||||
}
|
||||
break
|
||||
}
|
||||
return called
|
||||
@@ -406,6 +427,8 @@ LauncherAppCatalogEntry :: (group: *LauncherAppGroup, bytes: *Vec(u8), route: s3
|
||||
LauncherAppQuoted(bytes, "icon_choice", AppPropertiesIcon(app_name))
|
||||
}
|
||||
favorite := route >= 0 && app_launcher_is_favorite(group.owner, route)
|
||||
BuilderPrint(bytes, ",\"hidden\":%", AppPropertiesHidden(
|
||||
ifx route >= 0 then LauncherRouteName(route) else NodeAppOfferName(offer)))
|
||||
// A blocked frame's actions are rejected in LauncherAppDrain. Marking the
|
||||
// cards disabled for that one frame changed the catalog twice whenever
|
||||
// Apps opened, and each change re-parses it in the Apps controller:
|
||||
|
||||
@@ -137,3 +137,17 @@ AppPropertiesSaveSeen :: (name: string, digest: string) -> bool {
|
||||
unused CopyCString(digest, app_properties[index].seen[:])
|
||||
return true
|
||||
}
|
||||
|
||||
// Hiding changes only launcher visibility; packages and saved data remain.
|
||||
AppPropertiesHidden :: (name: string) -> bool {
|
||||
value: [8]u8
|
||||
AppPropertiesRead("app_hidden_", name, value[:])
|
||||
return TextUntilNul(value[:]) == "1"
|
||||
}
|
||||
|
||||
AppPropertiesSetHidden :: (name: string, hidden: bool) -> bool {
|
||||
if name.count == 0 || name.count >= 32 {
|
||||
return false
|
||||
}
|
||||
return AppPropertiesStore("app_hidden_", name, ifx hidden then "1" else "0")
|
||||
}
|
||||
@@ -33,6 +33,7 @@ parser.add_argument("--views-only", action="store_true")
|
||||
parser.add_argument("--root-bundle", type=Path, help="Exercise an older root with the native launcher")
|
||||
parser.add_argument("--measure", action="store_true", help="Measure cold Apps opens in disposable profiles")
|
||||
parser.add_argument("--dock-only", action="store_true")
|
||||
parser.add_argument("--visibility-only", action="store_true")
|
||||
parser.add_argument("--properties-only", action="store_true",
|
||||
help="Rename an app and change its icon in Apps › Properties")
|
||||
parser.add_argument("--profile-navigation-only", action="store_true",
|
||||
@@ -189,7 +190,7 @@ with contextlib.ExitStack() as stack:
|
||||
# Each section's shared Apps group sits inside the page's scroll.
|
||||
grid = [node for node in tree if node["kind"] == "button"
|
||||
and under(tree, node, "scroll") and not under(tree, node, "navigation_bar")
|
||||
and node["label"] not in ("Install", "Download", "App options", "Move app")]
|
||||
and node["label"] not in ("Install", "Download", "App options", "Move app", "Hide app", "Show app")]
|
||||
divider = [node for node in tree if node["kind"] == "separator" and under(tree, node, "scroll")]
|
||||
more_top = divider[0]["y"] if divider else float("inf")
|
||||
pinned = [node for node in grid if node["y"] < more_top]
|
||||
@@ -676,7 +677,7 @@ with contextlib.ExitStack() as stack:
|
||||
print("Fitted dock: 3–5 pins, narrow windows, zoom, top/bottom and both rails passed")
|
||||
raise SystemExit(0)
|
||||
|
||||
if arguments.properties_only:
|
||||
if arguments.properties_only or arguments.visibility_only:
|
||||
with tempfile.TemporaryDirectory(prefix="inbe-properties-") as temporary:
|
||||
profile = Path(temporary)
|
||||
user = None
|
||||
@@ -693,6 +694,46 @@ with contextlib.ExitStack() as stack:
|
||||
def labels():
|
||||
return [item["label"] for item in navigation()]
|
||||
|
||||
if arguments.visibility_only:
|
||||
def card_names():
|
||||
pinned, more, _ = cards()
|
||||
return [node["label"] for node in pinned + more]
|
||||
|
||||
def visibility_action(label, action):
|
||||
pinned, more, tree = cards()
|
||||
card = next(node for node in pinned + more if node["label"] == label)
|
||||
buttons = [node for node in tree if node["label"] == action
|
||||
and card["x"] <= node["x"] < card["x"] + card["width"]
|
||||
and card["y"] <= node["y"] < card["y"] + card["height"]]
|
||||
assert len(buttons) == 1, (card, buttons)
|
||||
press(buttons[0])
|
||||
|
||||
with application(profile, "visibility", width=390, height=844):
|
||||
open_apps()
|
||||
installed_before = {key: value for key, value in settings(profile).items()
|
||||
if key.startswith("app_used_")}
|
||||
driver.press(label="Edit apps", role="button")
|
||||
driver.wait(label="Done", role="button")
|
||||
visibility_action("Habits", "Hide app")
|
||||
wait_setting(profile, "app_hidden_habits", "1")
|
||||
assert "Habits" in card_names(), "Edit must keep hidden apps reachable"
|
||||
driver.press(label="Done", role="button")
|
||||
wait_for(lambda: "Habits" not in card_names(), "Hidden app remains in Apps")
|
||||
assert "Habits" not in labels(), "Hidden app remains pinned"
|
||||
with application(profile, "visibility-restart", width=390, height=844):
|
||||
open_apps()
|
||||
assert "Habits" not in card_names(), "Restart lost hidden state"
|
||||
driver.press(label="Edit apps", role="button")
|
||||
driver.wait(label="Done", role="button")
|
||||
visibility_action("Habits", "Show app")
|
||||
wait_setting(profile, "app_hidden_habits", "0")
|
||||
driver.press(label="Done", role="button")
|
||||
wait_for(lambda: "Habits" in card_names(), "Restored app is missing")
|
||||
assert {key: value for key, value in settings(profile).items()
|
||||
if key.startswith("app_used_")} == installed_before, "Hiding changed app installation"
|
||||
print("Launcher visibility: Edit, hide, restart and restore passed")
|
||||
raise SystemExit(0)
|
||||
|
||||
def open_properties(label):
|
||||
pinned, more, tree = cards()
|
||||
card = next(card for card in pinned + more if card["label"] == label)
|
||||
|
||||
Reference in new issue
Block a user