Skip to content

Navigation and pages as data

The TUI's tabs are not built in: they are a navigation structure, a JSON document of nodes that the web app follows too (openspec navigation-specs). The structure says what is reachable and how it is grouped; each client has its own representation profile that says how it is drawn. In the TUI the first level is the top tabs and the second the sub-tabs; in the web app the same tree is tabs and a sidebar.

Keeping the two layers apart is what lets the two clients share one structure: an admin shares a structure once on the context (cfg.navigation, from the web app's Navigation editor) and both clients follow it live, and a user may keep a structure of their own (navigation.json) that takes precedence in their client. A view one client lacks shows a placeholder naming it instead of breaking the structure.

A saved structure is a snapshot, but the built-in views keep growing. So a structure records the built-in views it was saved with (knownViews): a view added to the default later is one the structure has never seen, and the client adds it under Config; a view the structure knows but lacks is one someone removed on purpose, and stays out.

Pages work the same way: a page is a document (a page spec, cfg.page.<name>), validated against a component catalog both clients know, written and shared in the web app. The TUI draws the components it supports, opens a whole-view component as that pane, and shows a placeholder for the rest. Custom panes are the TUI's own extension: Python files on your machine, outside the shared structure's documents.

The fields, the keys and the custom-pane conventions: Pages, navigation and custom panes.