bus-ui — reusable UI component module for BusDK frontends

bus-ui — reusable UI component module for BusDK frontends

Synopsis

bus ui [global flags] [css | version | help]
bus-ui [css | version | help]

Description

bus-ui provides shared UI building blocks for BusDK frontend modules. It includes deterministic HTML escaping and attribute ordering helpers, reusable core controls, shared CSS tokens, generic authentication surfaces, generic form surfaces, shared download/link actions, reusable summary and metric cards, generic timeline and gallery renderers, and generic AI interface components.

The public surface is node-first: reusable components build gx.Node trees and HTML output happens through explicit render boundaries such as ui.RenderHTML, assistantui.RenderHTML, terminalui.RenderHTML, uiportal.RenderHTML, or gx.RenderHTML.

Current implemented UI roadmap milestone: FC-011 Assistant composer and attachments.

Use bus-ui when a BusDK frontend needs shared presentation pieces instead of module-local markup. Stable exported surfaces include form controls, buttons, cards, tables, shells, shared CSS, assistant panels, terminal panes, evidence surfaces, browser/WASM helpers, VDOM mounting, and compiled template helpers. The preferred public pkg/ui facade re-exports Fragment and RenderHTML for page-boundary composition. pkg/assistantui, pkg/terminalui, and pkg/uiportal provide the owner-package facades for assistant, terminal, and portal shells respectively.

For assistant frontends, bus-ui keeps generic panel rendering, message formatting, model selection, approval cards, activity status, close guards, and drop handling out of product modules. FC-011 uses the public assistantui.AIComposer and assistantui.AIAttachmentList facades for draft input and approved attachment chips, with assistantui.RenderHTML as the render boundary. Browser file access, upload policy, authorization, provider transfer, and product-specific behavior stay in the owning module.

The focused UI framework references describe the public contracts for assistant panels, assistant messages, assistant composer and attachments, forms, shells, and terminal panes.

Migration status

Legacy checked and string-returning helpers remain in the compatibility packages for older call sites, but new documentation should treat them as retained internals rather than preferred APIs.

Portal-family adoption readiness

bus-ui owns the shared readiness contract for bus-portal-* modules before they move to final compiled .gx roots and the shared MountedApp testkit path. Product policy stays outside bus-ui: accounting copy and evidence rules, auth session and CSRF behavior, Notes permission and Markdown safety, provider routes, DTO projection, and authorization decisions remain in the owning module or provider.

The pre-final bridge pattern is:

  • keep deterministic render seams that can later be replaced one shell at a time
  • keep module-owned action and resource registries explicit while using shared bus-ui validation, result, resource, and logging contracts
  • compose deferred runtime scripts through ui.ShellDeferredScript and AppShell.HeadNodes instead of post-render script insertion
  • declare WASM assets and runtime configuration through the portal host/module metadata instead of hidden module-local script behavior
  • cover fake-provider success and failure paths for action/resource dispatch
  • prove mounted runtime behavior with shared MountApp / MountedApp and uikittest harnesses before accepting compiled-root handoff

The current module-owned readiness plans are:

  • bus-portal-accounting/PLAN.md
  • bus-portal-auth/PLAN.md
  • bus-portal-notes/PLAN.md

Final compiled-root migration for those modules should wait until the shared MountedApp / testkit path and bus-portal host metadata handoff prove module metadata, declared assets, public runtime config, provider-origin CSP, teardown, rerender, and hook-state continuity.

Commands

css writes the embedded shared CSS bundle to stdout. Use shell redirection or the standard --output flag when a frontend needs a checked-in or served CSS asset. version prints module version information, and help prints usage text.

Examples

bus ui css > ./assets/bus-ui.css
bus ui --output ./assets/bus-ui.css css
bus ui version
bus-ui help

Using from .bus files

# same as: bus ui --output ./assets/bus-ui.css css
ui --output ./assets/bus-ui.css css