Skip to main content

Module workspace

Module workspace 

Source
Expand description

The workspace screen: the rail of open workspaces on the left, the tabs of one workspace on top, the container’s terminal in the middle and the widget panel on the right.

The rail holds the workspaces the person opened and nothing else, the way a browser holds its windows: a workspace joins it when it is opened from the list, leaves it when it is closed, and the rail and every tab in it are what “Continue” on the home screen brings back.

The screen’s whole reason for existing is one line of ContainerPlan::enter: a tab spawns the engine binary with exec, so the program a tab shows always runs inside a container and never on the machine QCode runs on. Everything else here is around that: which container a tab enters, what a tab says when its container is not there, and what the panel shows.

The screen speaks its own Msg: update answers with commands of it and view draws for it, and the application maps both to its own message, so the screen is drawn and tested without naming anything of the application.

Re-exports§

pub use plan::ASSETS_DIR;
pub use plan::Bridge;
pub use plan::CODE_DIR;
pub use plan::ContainerPlan;
pub use plan::HOME_DIR;
pub use plan::KEEP_ALIVE;
pub use plan::LaunchFailure;
pub use plan::MCP_DIR;
pub use plan::PLAN_LABEL;
pub use plan::SHELL;
pub use plan::ensure_running;
pub use plan::ensure_running_noting;
pub use plan::give_window_login;
pub use plan::open_page;

Structs§

Bridge
The bridge a profile container carries.
ContainerPlan
A container QCode keeps for a workspace: everything needed to create it and to enter it.
Farewell
The workspaces to back up once QCode has closed.
HistoryKey
The conversations of one profile in one workspace, as far as the page knows them.
LaunchFailure
An engine command that did not do what was asked, kept as text so a tab can show the engine’s own words.
Leaving
The workspaces open as QCode closes, with the engine that backs them up.
Letter
A message that was taken and waits in the tab it was sent to.
OpenWorkspace
One workspace the rail can switch to, with its own tabs and its own panel content.
Pages
Where a PDF tab stands among its pages.
Panel
What the panel carries and how it stands. The application owns all of it, so it could be saved and given back exactly as it was left.
Read
What one look’s reading of a container found, which is what Msg::Looked carries.
Tab
One tab: a container to enter, the state it is in and the session it draws while it runs.
TabKey
A tab’s identity, which stays the same while tabs are closed and dragged around it.
Taken
Text taken out of a file in the container, ready for a tab.
WorkspaceScreen
The workspace screen.

Enums§

Back
Where the way back of a window’s sign-in stands: QCode listening on this machine for the browser to be sent back, and carrying what arrives to the application.
BackupOf
What a list of backups is of.
BackupTrouble
Why a backup was not made, carried back from the thread that tried.
Choice
What a blank tab can turn into.
DocumentTrouble
Why a document of the workspace could not be read.
Letters
What can be done with the letters waiting in a tab.
Msg
Everything that can happen on the workspace screen.
Noting
What went wrong noting a container QCode started, so that it can be stopped once no QCode is open.
Opening
What came of asking to open a window.
PanelWidget
A widget the panel can carry.
Part
A part of a round besides the workspace’s own snapshot, named when it could not be backed up.
Shown
Where the page a window asked to have opened was shown.
TabKind
What a tab opens.
TabState
Where a tab stands.
Undelivered
Why the messages waiting in a tab have not been typed into its harness.

Constants§

MOST_TEXT
The most text a tab keeps and shows, in bytes. A long PDF gives megabytes of text, and all of it would be laid out again on every frame; past this much the person reads on in the page pictures, which reach every page.
PLAN_LABEL
The label a container carries the digest of the plan it was made from in.
SHELL
What an empty terminal tab runs: a login shell in the workspace’s base container.
SWITCHES
The keymap’s actions that switch tabs, which reach QCode from inside a harness so that one chord both switches and leaves the keyboard in the tab switched to.
WORKSPACE_BASE_LABEL
The label a workspace’s image carries the identity of the profile’s image it was made on in.

Functions§

action
The message a keymap action of the workspace screen stands for, when it is one: new-tab opens a blank tab, leave-terminal takes the keyboard back into the open tab’s harness, rename-tab names the open tab and the switching keys (SWITCHES) go to another tab with the keyboard in it. The application sends them only while a workspace is open.
add
Adds workspace to the rail and opens it, or only opens it when the rail has it already; the tabs of every workspace stay as they are either way.
agents_at_work
How many tabs of the open workspaces have an agent in them that is running or starting: a harness in a terminal, or a harness’s window. A shell, a file or a tab that has ended is left out, since quitting takes nothing from it that opening the workspace again does not give back.
ensure_running
Makes sure the container of plan is up, creating it when it has never existed and starting it when it is only stopped.
ensure_running_noting
ensure_running, answering the administrator’s command that could not be run again when the profile’s image was rebuilt under a workspace that installed things of its own: the workspace then stays on the image it had, and the person is to be told which command it was.
enter_admin
The command an “As administrator” tab runs: bash as root in the container of plan, recording each command in the workspace’s home as it is run.
entry
The control that takes the keyboard when the screen opens: the terminal of the open tab, the page of a blank one, or the strip’s + that opens the first tab while there is none.
escape
What Esc means on the workspace screen before it means leaving it: while an entry of the file tree is cut or copied, Esc lets it go, and it stays where it is. The application asks this when Esc reaches it, which is only after every nearer widget and dialog passed it on.
give_window_login
Gives the home of plan’s window the profile’s stored login, before the window opens, when the home has no login of its own.
hints
The keys of the workspace screen that are not in the keymap, for the key list.
leaving
What is backed up when QCode closes with screen as it is: every workspace of the rail, or nothing when backups are off or there is no engine to make them.
open_page
Shows address in the sign-in window inside the container of plan, and answers whether it is up: false when the image has no sign-in window, which an image built before it existed does not.
opened
The work the screen needs the moment it is shown: reading the open workspace’s folder and asking the engine which of its containers are up.
switch
The message of the keymap action name when it switches tabs.
update
Applies a message to the screen.
view
Draws the workspace screen for an application whose messages are P: wrap turns the screen’s own messages into the application’s, above draws what the application puts over the tabs (its header) and below what it puts under the terminal (its footer).
waking_on_the_way_out
The engine commands that wake every container the screen has frozen, one name each and in an order of their own, for the moment QCode is going.
workspace_image
The image a workspace keeps what its administrator installed for one of its profiles in.