138c: the object page (holger-ui h40-objects)
Holger's H40-LIST 138c, HOLGER-V4-DESIGN.md §12 and holger's docs/review/OBJECTS-PLAN.md. This plan comes before the code. The console before it is tag h40-pre-objects (6efe259).
1. The page
-
One page for any kind, at
/object?ref=<ref>(a ref holds slashes:acme/rust-quarantine/serde-1.0.228.crate).- The header is the kind and the ref.
- The fields are a table, in the server's order.
- The children are links to their own object page.
- Each action is a row with its args (a choice when the arg names its values, a text field otherwise; a required arg is marked) and its button. When the action is not allowed, the button is disabled and the server's
why_notstands beside it in words. - The last act's answer stands under the actions: done (the object is drawn again), refused (the server's words; the object stays as it was), or a job (its ref, as a link).
-
Live. The page watches the ref (
ObjectService.Watch). The first message is the object as Get answers it; each later one draws it again;gonesays its words and the last object stays, marked as gone. A watch that fails before its first object is followed by one Get, and the page says it is not live and why. -
No ref: a field for one.
-
Mounted beside the viewer and the dashboard: the route
/objectand a menu entry "Objects" after Flow. The old screens stay. -
The client decides nothing. What may be done, and why not, is the server's, on each action, and again when it is taken.
2. All the code it touches
| file | what |
proto/holger-object.proto |
holger's file, byte for byte |
build.rs |
compiles it (client only) |
src/grpc.rs |
pb_object and the accessor objects() |
src/object_view.rs (new, host-tested) |
ObjectModel (the shown object, the form's values, the last answer; one writer), the traits ObjectFeed (Watch) and ObjectDoor (Get, Act), follow, act, and page: the pure description the page renders |
src/pages/object.rs (new, wasm only) |
mounts the model; the gRPC-web side of both traits |
src/pages/mod.rs, src/app.rs, src/util.rs |
the module, the route, the menu entry |
tests/proto_is_holgers.rs |
the object proto is holger's, byte for byte |
tests/every_call_is_a_cli_command.rs |
the accessor objects; Holger 4's door read from holger-object.proto too |
No new crate. The release wasm is measured before and after (116e: 6.9 MB).
3. Tests
-
object_view, over a fake door and a fake watch (nativecargo test):- held package: the fields in order; the child links to its repository; sign allowed, with the
onchoice; release disabled, with "the right Approve is not held"; - repository: the children as links; seal's two text args; remove's
forcechoice; - a refused act shows the server's words and keeps the object; done draws the answer; a job shows its ref;
- a watch message draws again (the page is told once, the field changes); gone; a watch that fails first falls back to Get.
- held package: the fields in order; the child links to its repository; sign allowed, with the
-
Screenshots on dwarf, over Holger 4 with 138a (serde held in rust-quarantine, brought in by bo):
30-object-anna-0-of-2: serde as anna, sign allowed;31-object-anna-signed-1-of-2: after anna's sign, from the answer and the watch;32-object-cilla-why-not: serde as cilla, release disabled with its why_not;33-object-cilla-repository: rust-quarantine as cilla, serde as a link, each action with its why_not.
-
Reds: the page not told after a watch message, a refusal read as done, and holger's
allowednot read each turn a test red (lane g42'sredui.sh).
4. The old screens it replaces, in order
Each screen moves when its kind is on the server, and goes when the page does all that it did.
/security/artifact(one package's state, evidence and buttons): the held package kind (138a: sign, quarantine, release). The trail waits for the account kind's Get with audit args (138d)./repo/:name: the repository kind (138a: its fields, its held packages as children; seal, send, collect, remove)./repositories: the account kind's children (138d)./mine(my repositories, create, grant): the account kind's acts (138d)./tokens(mint, list, revoke): the account kind's actmint tokenand the token kind (138d)./apps/:name: the application kind, actsbuild,stop-build,remove(138d); since 138f step 5 it is the application's object page, and/depgraphis gone (its graph is the application's fields). Since step 5b its graph is drawn under the object, too: the drawing holger kept with the latest version (Arch, Metro), one Get withdrawing=<view>when the version changes or a tab is pressed (holger's D87).- A followed job (
job_follow): the job kind's Get and Watch (138d). /securityand the Overview's cards: the account kind's Get (138d).
They stay: /flow (the viewer is a picture; its sign becomes the held package's act sign in 138f), the Overview's health and server profile, /datasets (capabilities) and /account (the sign-in). The admin, migrate, replicate, search and downstream screens are not in Holger 4.