Terminal predicate: a stranger opens apps/webdesktop, signs in as each demo account, and finds that the desktop icons, the start menu and its submenus offer exactly the apps that account may use; double-clicking an icon opens that app's window animated out of the icon; icons rearrange by drag and drop; and the Portal lists the demo with what it proves.
Context
A community question on Slack asked for "the proper way" to build navigation that follows backend permissions: a user signs in, the backend returns permission flags (can_view_X, …), a menu offers only the allowed items, and a sub menu does the same. The proposed design was a service whose methods check the flags and return the components each menu may render. The attached mock-up is a desktop: a drop-down menu and rows of launcher icons, all gated by permissions.
The operator (@tobiu) read it as an indirect request for a web desktop demo with a polished design for Engine 14, and set what makes it real: drag and drop, and a double-click on an icon that opens a dialog animated out of that icon (animateTargetId).
The Problem
- No example shows the pattern. Permission-driven navigation is the first thing most business apps need after sign-in. Without an example, developers reach for the imperative shape: a service that builds component lists per permission for each menu. In Neo that copies state into every menu, puts authorization rules into view code, and re-creates components whenever permissions change.
- The engine cannot yet express the declarative answer for submenus. A
Neo.menu.List cascade driven by a Neo.data.TreeStore ignores that store's filters (reproduced on dev @ 9e0c8f8f72; its own leaf).
- A desktop is more than a launcher. Windows that open from their icon, a taskbar that lists them, and icons that move by drag and drop are separable deliverables, each with its own review.
Why an epic: the outcome needs several one-PR leaves that build on each other (engine fix → permission shell → windows, drag and drop) and finish the same sentence.
Intended Solution Shape
Permissions are state, navigation is data, visibility is one filter.
- State. The signed-in account and its permission keys live in the app's root
state.Provider. Signing in loads the account from a JSON resource through a store url, the way an app reads its backend.
- Data. Every launchable app and every group is a record in one
Neo.data.TreeStore (parentId hierarchy, a permission key on apps). Groups carry no permission: TreeStore filtering keeps a group when one of its children is kept, so a submenu appears exactly when it has something to offer.
- One filter.
{property: 'permission', operator: 'included', value: <granted keys>, includeEmptyValues: false}. The provider writes the granted keys into value; every bound view follows. includeEmptyValues: false is load-bearing: by default an empty value disables a filter (collection.Filter#effective), so an account with no permissions would see every app.
- Views bind, never derive. The launcher (a
list.Base over the tree store's visible projection: groups render as section headers, apps as icons) and the start menu (a menu.List cascade over the same store) read the one filtered store. No view holds a copy of the rule; no component exists per permission.
- Windows are
dialog.Base instances opened with animateTargetId set to the launcher icon; a store of window records drives the taskbar.
- Drag and drop writes record fields; the launcher re-renders from the records, never from moved DOM.
- Design: an app-owned palette in
neo-theme-neo-dark / neo-theme-neo-light, following apps/workstation's theme files.
The README states the boundary: hiding UI is not authorization; the backend enforces every permission on its own endpoints.
Out of Scope
- Authentication: demo accounts are picked, not signed in with credentials.
- Moving a window into its own browser window (
apps/shareddialog already proves dialogs cross windows); a follow-up once the single-window desktop exists.
- A window manager in
src/: the demo composes existing primitives; promoting any part into the engine is a later decision.
Avoided Traps
- A service that returns components per permission: copies state into each menu and re-creates components on change.
bind: {hidden: data => …} on every item: fine for one or two fixed buttons; for navigation it still creates every item and hard-codes permission keys into view configs.
- A filter per menu, or a store per submenu: splits one rule across stores that can disagree.
Related
- Roadmap: beside the Engine 14 gate; its Portal entry feeds #20498 ("every example names what it proves").
- Precedents:
apps/workstation (app theme palette), apps/email (ViewportStateProvider, dialog), apps/shareddialog.
- Prior art: #17839 (menu cascades over a TreeStore; its Out of Scope names "ancestor-aware filtering" as adopted).
Structure map: N/A — app and engine-component work; no ai/, Agent OS or substrate placement.
Live latest-open + closed sweep: latest 20 open + open/closed search ("menu TreeStore filter", "menu filter submenu", "web desktop", "permission menu", "launcher desktop icons"; #17839 Out of Scope / Avoided Traps read) at 2026-11-15T23:54Z; no equivalent or prior exclusion found. Backlog: 51 open (red); no owning ticket or epic to fold into.
MC sweep: "submenu shows items that the tree store filter hides", "no example shows navigation menus that follow user permissions", 12 results, no prior decision found.
Own-assignment sweep: 4 open, none overlapping.
Epic sweep: 7 open predicates + closed search ("demo app desktop") read; #20498 is the examples overview this demo joins, not the same terminal predicate.
A2A claim sweep: last 30 messages, no overlapping claim.
Origin Session ID: f1b70a0d-406f-4b7d-a69c-20d35c843303
Retrieval Hint: "web desktop demo permission-driven menus tree store filter includeEmptyValues"
Terminal predicate: a stranger opens
apps/webdesktop, signs in as each demo account, and finds that the desktop icons, the start menu and its submenus offer exactly the apps that account may use; double-clicking an icon opens that app's window animated out of the icon; icons rearrange by drag and drop; and the Portal lists the demo with what it proves.Context
A community question on Slack asked for "the proper way" to build navigation that follows backend permissions: a user signs in, the backend returns permission flags (
can_view_X, …), a menu offers only the allowed items, and a sub menu does the same. The proposed design was a service whose methods check the flags and return the components each menu may render. The attached mock-up is a desktop: a drop-down menu and rows of launcher icons, all gated by permissions.The operator (
@tobiu) read it as an indirect request for a web desktop demo with a polished design for Engine 14, and set what makes it real: drag and drop, and a double-click on an icon that opens a dialog animated out of that icon (animateTargetId).The Problem
Neo.menu.Listcascade driven by aNeo.data.TreeStoreignores that store's filters (reproduced ondev@ 9e0c8f8f72; its own leaf).Why an epic: the outcome needs several one-PR leaves that build on each other (engine fix → permission shell → windows, drag and drop) and finish the same sentence.
Intended Solution Shape
Permissions are state, navigation is data, visibility is one filter.
state.Provider. Signing in loads the account from a JSON resource through a storeurl, the way an app reads its backend.Neo.data.TreeStore(parentIdhierarchy, apermissionkey on apps). Groups carry no permission: TreeStore filtering keeps a group when one of its children is kept, so a submenu appears exactly when it has something to offer.{property: 'permission', operator: 'included', value: <granted keys>, includeEmptyValues: false}. The provider writes the granted keys intovalue; every bound view follows.includeEmptyValues: falseis load-bearing: by default an empty value disables a filter (collection.Filter#effective), so an account with no permissions would see every app.list.Baseover the tree store's visible projection: groups render as section headers, apps as icons) and the start menu (amenu.Listcascade over the same store) read the one filtered store. No view holds a copy of the rule; no component exists per permission.dialog.Baseinstances opened withanimateTargetIdset to the launcher icon; a store of window records drives the taskbar.neo-theme-neo-dark/neo-theme-neo-light, followingapps/workstation's theme files.The README states the boundary: hiding UI is not authorization; the backend enforces every permission on its own endpoints.
Out of Scope
apps/shareddialogalready proves dialogs cross windows); a follow-up once the single-window desktop exists.src/: the demo composes existing primitives; promoting any part into the engine is a later decision.Avoided Traps
bind: {hidden: data => …}on every item: fine for one or two fixed buttons; for navigation it still creates every item and hard-codes permission keys into view configs.Related
apps/workstation(app theme palette),apps/email(ViewportStateProvider, dialog),apps/shareddialog.Structure map: N/A — app and engine-component work; no
ai/, Agent OS or substrate placement. Live latest-open + closed sweep: latest 20 open + open/closed search ("menu TreeStore filter", "menu filter submenu", "web desktop", "permission menu", "launcher desktop icons"; #17839 Out of Scope / Avoided Traps read) at 2026-11-15T23:54Z; no equivalent or prior exclusion found. Backlog: 51 open (red); no owning ticket or epic to fold into. MC sweep: "submenu shows items that the tree store filter hides", "no example shows navigation menus that follow user permissions", 12 results, no prior decision found. Own-assignment sweep: 4 open, none overlapping. Epic sweep: 7 open predicates + closed search ("demo app desktop") read; #20498 is the examples overview this demo joins, not the same terminal predicate. A2A claim sweep: last 30 messages, no overlapping claim.Origin Session ID: f1b70a0d-406f-4b7d-a69c-20d35c843303 Retrieval Hint: "web desktop demo permission-driven menus tree store filter includeEmptyValues"