importSwiftUI/// `/tools` and `/database` (design note 26203e21): a board pushed over Home —/// the Tools screen's (`tools`: every tool, put-away ones too, and About) or/// the database page's (`database`: its name, its facts, a section for every/// tool holding records, its tools). Built through `HomeBoard` over Home's one/// read, and named as the window's shown database is.structBoardRoute: View {/// The board id: "tools" or "database".let board: Stringlet home: HomeModel/// The name a window that has not resolved its database yet falls back on.let fallbackName: String? @Environment(DatabaseScene.self) privatevar scene: DatabaseScene? @Environment(DatabasesModel.self) privatevar databases: DatabasesModel?var body: someView {let shown = databases.flatMap { scene?.shown(in: $0) }HomeBoard( home: home, databaseName: shown?.name ?? fallbackName, personal: shown?.kind != .shared, board: board) }}/// The shown database's own record page — what tray › "Name and picture" opens —/// for a route that names no database: a project's brand (`/projects/[slug]//// brand`), which is its database's (`DatabaseBrand`). The generic page of the/// table playing the database role, as "Name and picture" opens it. Nothing is/// drawn until the window has resolved which database it shows.structShownDatabasePage: View { @Environment(DatabaseScene.self) privatevar scene: DatabaseScene? @Environment(DatabasesModel.self) privatevar databases: DatabasesModel? @Environment(\.tableDefinitions) privatevar definitionsvar body: someView {iflet id = databases.flatMap({ scene?.shown(in: $0) })?.databaseId,let table = definitions.playing(.database)?.id {TablePageRoute(table: table, id: id) .settingsKeptFlows(table: table, record: id) } else {Color.clear } }}