Use shared reorder grips and unify Profile rows in Inbe

This commit is contained in:
waozi committed 2026-10-29 02:43:23 -03:00
1 parent b46306d1e3
commit f7e09e709c
7 files changed
+72 -55

No files matched your search

+2 -12
View File
@@ -91,20 +91,10 @@ app_launcher_update_drag :: (app: *InnerBreeze, point: Vector2) {
// Only the explicit handle captures a drag. The card retains its ordinary
// click and scroll gestures, even after another app has been moved.
app_launcher_drag_handle :: (app: *InnerBreeze, card: ButtonProps,
route: s32, vertical: bool) {
route: s32, vertical: bool, key: u64) {
if !app.launcher_editing { return }
key := card.key + cast(u64)29
handle: ButtonProps
handle.key = key
handle.label = LocaleText("launcher_move_app")
handle.icon_only = true
handle.icon_shape = "F:M7 4H10V7H7ZM14 4H17V7H14ZM7 10H10V13H7ZM14 10H17V13H14ZM7 16H10V19H7ZM14 16H17V19H14Z"
handle.emphasis = cast(ButtonEmphasis)ButtonEmphasisSoft
handle.bounds = Rectangle.{card.bounds.x + cast(float32)AppScale(4),
card.bounds.y + (card.bounds.height - cast(float32)AppScale(44)) * 0.5,
cast(float32)AppScale(44), cast(float32)AppScale(44)}
unused Button(app.ui.session, handle)
node := TreeSubmitted(app.ui.session, TreeCurrentParent(app.ui.session), key, WidgetKindButton)
TreeSetLabel(app.ui.session, node, LocaleText("launcher_move_app"))
TreeSetDragCapture(app.ui.session, node, !card.disabled)
previous := TreePrevious(app.ui.session, TreeCurrentParent(app.ui.session),
key, WidgetKindButton)
+17 -5
View File
@@ -209,8 +209,11 @@ LauncherAppWidgets :: (context: *void, module: *u8, function: *u8,
for index: cast(s32)0..group.count - 1 {
entry := group.entries[index]
// Editing exposes an explicit handle; the card keeps its own gestures.
handle := group.owner.launcher_editing && card.key == Rules.AppCardKey(TextUntilNul(entry.id[:]))
if !handle { continue }
tile_key := Rules.AppCardKey(TextUntilNul(entry.id[:]))
reorder_key := Rules.AppReorderKey(TextUntilNul(entry.id[:]))
tile_button := card.key == tile_key
reorder_button := card.key == reorder_key
if !group.owner.launcher_editing || (!tile_button && !reorder_button) { continue }
item := entry.route
if item < 0 {
for offer: cast(s32)0..NodeAppOfferCount() - 1 {
@@ -220,7 +223,16 @@ LauncherAppWidgets :: (context: *void, module: *u8, function: *u8,
}
}
}
app_launcher_drag_handle(group.owner, card, item, group.owner.launcher_grid_view)
if reorder_button {
tile := TreeSubmitted(group.owner.ui.session, TreeCurrentParent(group.owner.ui.session), tile_key, WidgetKindButton)
if tile >= 0 {
tile_card := card
tile_card.key = tile_key
tile_card.bounds = TreeNodeAt(group.owner.ui.session, tile).bounds
app_launcher_drag_handle(group.owner, tile_card, item, group.owner.launcher_grid_view, reorder_key)
}
break
}
name := LauncherLibraryName(item)
hidden := AppPropertiesHidden(name)
visibility: ButtonProps
@@ -433,9 +445,9 @@ LauncherAppCatalogEntry :: (group: *LauncherAppGroup, bytes: *Vec(u8), route: s3
// cards disabled for that one frame changed the catalog twice whenever
// Apps opened, and each change re-parses it in the Apps controller:
// about 0.4 s on a slow phone.
BuilderPrint(bytes, ",\"installed\":%,\"favorite\":%,\"bytes\":%,\"actions\":[\"open\"",
BuilderPrint(bytes, ",\"installed\":%,\"favorite\":%,\"reorderable\":%,\"bytes\":%,\"actions\":[\"open\"",
ifx installed then "true" else "false", ifx favorite then "true" else "false",
size)
group.owner.launcher_editing, size)
if installed {
if !builtin { BuilderPrint(bytes, ",\"uninstall\"") }
BuilderPrint(bytes, ",\"%\"", ifx favorite then "unpin" else "pin")
+4 -1
View File
@@ -2,7 +2,10 @@
// bytes, but cannot select or replace the host's controller trust anchor.
// Collections built before the ZX format carried ZIB controllers, which this
// runtime cannot run; earlier ZX controllers stay trusted for collections.
AppsControllerSha256 :: "a1b56259e0b8581188459cc366736feacda3969b2db3055e8425a81065b065e1"
AppsControllerSha256 :: "a4c32798cb17c56ffe052cd5a35ba800df82674fdf851ab79b00720455d13398"
// Existing collections keep the controller from before the reorder gutter.
AppsControllerBeforeReorderGutter :: "a1b56259e0b8581188459cc366736feacda3969b2db3055e8425a81065b065e1"
// Existing collections keep the controller from before shared saved records.
AppsControllerBeforeSharedRecords :: "a99851fc40d67a8ca820841722ce2ddde5ca51844e0778c4762681570c488289"
+1
View File
@@ -497,6 +497,7 @@ NodeTreeStart :: (runner: *NodeAppRunner, bytes: string, verified: string,
unused AppHostTrustHarness(host, AppsControllerBeforeDownload)
unused AppHostTrustHarness(host, AppsControllerBeforeSeparateDownloads)
unused AppHostTrustHarness(host, AppsControllerBeforeInstalledDownloads)
unused AppHostTrustHarness(host, AppsControllerBeforeReorderGutter)
platform := AppPlatform.{.context = cast(*void)runner, .allows = NodeTreeAllows, .call = NodeTreeCall,
.widgets = NodeTreeWidgets, .save = NodeTreeSave, .state = NodeTreeState,
.effect = NodeTreeEffect, .bundle = NodeChildBundle,
+19 -8
View File
@@ -400,9 +400,9 @@ with contextlib.ExitStack() as stack:
assert 0 not in active_pins, "Legacy Profile pin was not removed"
if width == 390 and placement == 4 and not pinned:
capture(window, name)
reveal_action("Connect Account")
driver.press(label="Connect Account", role="button")
driver.wait(contains="Create", role="button")
reveal_action("Import Account Key")
driver.press(label="Import Account Key", role="button")
driver.wait(label="Choose key file", role="button")
one_header("Profile")
driver.press(label="Back", role="button")
driver.wait(label="Change picture", role="button", visible=False)
@@ -410,9 +410,9 @@ with contextlib.ExitStack() as stack:
for label in ("Today", "Active days", "Sessions"):
driver.wait(label=label, role="text", visible=False)
assert not driver.find(label="Activity", role="button"), "Inline Activity still has a route"
reveal_action("Manage data")
driver.press(label="Manage data", role="button")
one_header("Data")
reveal_action("Friends")
driver.press(label="Friends", role="button")
one_header("Friends")
driver.press(label="Back", role="button")
driver.wait(label="Change picture", role="button", visible=False)
one_header("Profile")
@@ -420,7 +420,7 @@ with contextlib.ExitStack() as stack:
driver.wait(label="Pinned")
assert not driver.find(role="title_bar", visible=True)
print(f"{name}: one header and complete Back stack passed", flush=True)
print("Profile: one header, Account/Data Back stack, inline Activity, pinned/unpinned, saved top/bottom/side navigation passed")
print("Profile: one header, account import/Friends Back stack, inline Activity, pinned/unpinned, saved top/bottom/side navigation passed")
if arguments.profile_identity_only:
with tempfile.TemporaryDirectory(prefix="inbe-profile-identity-") as temporary:
@@ -516,6 +516,12 @@ with contextlib.ExitStack() as stack:
wait_setting(profile, "launcher_grid_view", 1)
pinned, more, tree = cards()
assert all(abs(card["height"] - 88) <= 1 for card in pinned + more), cards()
handles = driver.find(label="Move app", role="button", visible=True)
for card in pinned + more:
matches = [node for node in handles
if abs(node["y"] - card["y"]) < 2
and abs(node["x"] + node["width"] - card["x"]) < 2]
assert len(matches) == 1, (card, matches)
if width > 500:
assert abs(pinned[0]["y"] - pinned[1]["y"]) < 1 and pinned[1]["x"] > pinned[0]["x"], pinned
capture(window, f"views-{width}-grid")
@@ -954,6 +960,8 @@ with contextlib.ExitStack() as stack:
assert favorites(profile) == [11, 1, 2], "Restart changed personal pins"
assert settings(profile)["language_setup_done"] == "1"
assert [item["label"] for item in navigation()] == ["Diary", "Habits", "Practice", "Apps"]
if arguments.drag_only:
continue
with application(profile, name + "-manage", width, height) as (window, log):
open_apps()
with database(profile) as db:
@@ -1002,4 +1010,7 @@ with contextlib.ExitStack() as stack:
open_profile(log)
assert favorites(profile) == []
check_profile_navigation()
print("Launcher: first-run voice question, desktop defaults, clean sections, click/hold/drag, profile and persistence passed")
if arguments.drag_only:
print("Launcher: click/hold/scroll, edit-only reorder, saved order and Profile navigation passed")
else:
print("Launcher: first-run voice question, desktop defaults, clean sections, click/hold/drag, profile and persistence passed")
+28 -28
View File
@@ -10,14 +10,6 @@
"source": true,
"url": "https://github.com/raysan5/rini.git"
},
{
"commit": "3a42a897c443e9d008406cca34525373088d5ae4",
"dependencies": {"daochi_client": "pf7b24c15869d6839", "kryon": "p77028198b0e09537", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
"id": "p0bf36f16ae804efb",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "2944b2e668e735438d8ce24e47a39be3f5c36af5",
"dependencies": {},
@@ -28,7 +20,7 @@
},
{
"commit": "1cb9df183089a77c8a16448a556186f30b261a98",
"dependencies": {"kryon": "p77028198b0e09537"},
"dependencies": {"kryon": "p678dfe3877859170"},
"id": "p1b13dda539ed2a39",
"name": "Kss",
"ref": "master",
@@ -36,12 +28,20 @@
},
{
"commit": "bad2caaa84ef3eae61e40c99bf572d2b060d0ca2",
"dependencies": {"kryon": "p77028198b0e09537"},
"dependencies": {"kryon": "p678dfe3877859170"},
"id": "p20eb23d3e6db3711",
"name": "Game2D",
"ref": "master",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "d420622f7f530b573d28f52ca5fbebbaa9c3cc24",
"dependencies": {"daochi_client": "pf7b24c15869d6839", "kryon": "p678dfe3877859170", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
"id": "p2d0aef8034912fe3",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
@@ -51,6 +51,14 @@
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "2839954d916c614e562d6c25c448928923d4190b",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"id": "p678dfe3877859170",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "22d2ddbdc236796953c905a05a2cebf5ab1b4ff3",
"dependencies": {"liboqs": "pecdb097af6ab16f7"},
@@ -59,14 +67,6 @@
"ref": "master",
"url": "https://github.com/ziranlang/oqs.git"
},
{
"commit": "1d987043bf1c07bde429d3f8a30b74d5401bea45",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"id": "p77028198b0e09537",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "f5f0a19a5dc6c14a49adb3cd63ea79a60f6ba77b",
"dependencies": {},
@@ -85,22 +85,22 @@
"source": true,
"url": "https://github.com/waozixyz/practices.git"
},
{
"commit": "becce9220e092d33b26a2ec106b93e43714f3946",
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p678dfe3877859170"},
"id": "p9c41020c62c76410",
"name": "Apps",
"ref": "becce9220e092d33b26a2ec106b93e43714f3946",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
"dependencies": {"kryon": "p77028198b0e09537"},
"dependencies": {"kryon": "p678dfe3877859170"},
"id": "pab5377a2950368a2",
"name": "plot",
"ref": "master",
"url": "https://github.com/kryonlabs/plot.git"
},
{
"commit": "b31f9528acc99ac13c7d396edaa42c293be1325f",
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p77028198b0e09537"},
"id": "pb79af7eaf6037b09",
"name": "Apps",
"ref": "b31f9528acc99ac13c7d396edaa42c293be1325f",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "944826f70779a6b6cd53f6b06a75b36f4d8a2558",
"dependencies": {},
@@ -154,7 +154,7 @@
}
],
"root": {
"dependencies": {"apps": "pb79af7eaf6037b09", "crypto": "pc23fbf455e97614d", "curl": "pd4bcd11b7d623073", "daochi_client": "pf7b24c15869d6839", "entity": "p0bf36f16ae804efb", "game2d": "p20eb23d3e6db3711", "kryon": "p77028198b0e09537", "kss": "p1b13dda539ed2a39", "liboqs": "pecdb097af6ab16f7", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "peaa43c4b7ef72edf"},
"dependencies": {"apps": "p9c41020c62c76410", "crypto": "pc23fbf455e97614d", "curl": "pd4bcd11b7d623073", "daochi_client": "pf7b24c15869d6839", "entity": "p2d0aef8034912fe3", "game2d": "p20eb23d3e6db3711", "kryon": "p678dfe3877859170", "kss": "p1b13dda539ed2a39", "liboqs": "pecdb097af6ab16f7", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "peaa43c4b7ef72edf"},
"name": "Inbe"
},
"toolchain": {
+1 -1
View File
@@ -74,7 +74,7 @@ ref = "master"
[dependencies.apps]
git = "https://github.com/waozixyz/apps.git"
ref = "b31f9528acc99ac13c7d396edaa42c293be1325f"
ref = "becce9220e092d33b26a2ec106b93e43714f3946"
# The practices' pictures, course data and recordings (scripts/practice_media.py).
[dependencies.practices]