Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ these entries stays in the GitHub releases and the Git history.
- Let an agent read the locked packages with the `packages` grant: the `list`, `why` and `info` operations answer `wf list --tree`, `wf why` and `wf info`, in environment 1.2.1 or later (#685, `docs/AUTOMATION.md`).
- Browse in the **Packages** panel of the inspectors the locked packages as a tree under the roots of the manifest, with the requested ranges and the `peer`, `deduped` and multiple-version marks; search a package by name and open its detail with its `wf why` chains; the tree follows `wf install` and `wf restore` (#683, ADR-027, `docs/DEVELOPER_ENVIRONMENT.md`).
- See in the **Bridge** panel of the inspectors the state of the bridge in the interface's page: `webFront.ready` (pending, resolved, or rejected and why), the pending `cppFunction` calls and their duration, the Promises rejected lately, and the JavaScript functions that C++ calls; a bridge that no inspector reads records nothing (#684, ADR-027, `docs/DEVELOPER_ENVIRONMENT.md`).
- See more at once in the inspectors: a compact tab menu and panels for the mouse (44 px targets under a coarse pointer), the kind of like elements shown once, and a container of strings of the same length, such as the grid of Life, shown as a block of square character cells, with a Tree button to show its elements one by one (#723, `docs/WATCHES.md`).
- Declare what the inspectors show with `app.watch(name, source)`, whose handle removes the watch when it is destroyed; the Watches panel follows their registrations and removals. Outside the developer environment and in a distribution build, `watch` registers nothing (#680, ADR-027).
- Embed a plain interface directory (HTML, JavaScript, CSS, vendored files) from CMake with `webfront_embed_directory(app ui CLASS AppUI)`, without the developer environment: the build regenerates the provider when a file changes, and `fs::DocumentRootFirstFSWith<AppUI>` lets a development root serve in front of it (#675, `docs/EMBEDDED_ASSETS.md`).
- Set from the configuration `Referrer-Policy` (`contentPolicy.referrerPolicy`: `"no-referrer"` forbids explicitly that a capability in your URLs leaves in `Referer`), `X-Content-Type-Options: nosniff` (`noSniff`) and the `Cache-Control` of HTML pages (`htmlCacheControl`), on files, route and generated replies unless a reply sets its own (#674, `docs/CONTENT_POLICY.md`).
Expand Down
12 changes: 10 additions & 2 deletions docs/DEVELOPER_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,12 @@ environment's `mount`, not to the embedded bootstrap page):
The arrow beside a watch unfolds its content as a tree: scalars, strings, containers, described and formattable types,
read by pages of 200 children and refreshed at the chosen period, the values that changed highlighted. A value the
application made writable is edited in place (Enter writes, Escape cancels); a value that is cut offers its full text.
Elements that are all leaves of one kind show that kind once, on their container (`sequence [3] of string`), with their
indices in a narrow column and their values aligned. A sequence of strings of the same length, such as the grid of
Life, shows as a **block**: one line per element, without index or kind, in square character cells, so that a grid of
32 by 32 characters is square. The lines keep the highlighting of what changed, the full value and the edition in place.
Its **Tree** button shows the elements one by one again and **Block** returns to the block; the choice is kept per watch
in this browser, as the period is. The layout changes only what is shown: the pages read are the same.
[Watches](WATCHES.md) tells how to declare them, under which lock or on which thread they are read, and their bounds.

The **Functions** panel lists what the application registered with `cppFunction`, the functions of its spaces included
Expand Down Expand Up @@ -544,8 +550,10 @@ environment's `mount`, not to the embedded bootstrap page):
announcement is refused with `webfront.inspector.unavailable`, and its detached panel says that the page is not
connected.

The tab is a button (`aria-expanded`, `aria-haspopup="menu"`, 44 px target), its menu a `menu` of `menuitem`s of 44 px,
and the window a non-modal dialog. The interface stays in the preview
The tab is a button (`aria-expanded`, `aria-haspopup="menu"`, 44 px target), its menu a `menu` of compact `menuitem`s
(28 px, 24 px at least, and 44 px under a coarse pointer such as a touch screen), and the window a non-modal dialog. The
inspector panels are dense in the same way: their controls keep 24 px at least, 44 px under a coarse pointer, and a
visible focus. The interface stays in the preview
frame, as before: the layout adds nothing to the application's documents except the shortcut's listener and the preview page's announcement, installed in the interface
and in the same-origin frames it embeds (not in a frame of another origin, nor one inside a shadow tree: click the interface
or the tab first). This is a layout, not a
Expand Down
17 changes: 17 additions & 0 deletions docs/WATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,23 @@ write never waits for the end of a pass: it interrupts it, and the next pass fin
(`webfront.inspector.children`, `changes`, `value`, `fold`, `reset`, `limits`, `write`) is described in section 3 of the
ADR; it uses the bridge's existing types only.

## How the panel shows a container

Elements that are all leaves of one kind show that kind once, on their container (`sequence [32] of string`), with their
indices in a narrow column and their values aligned, so that more of them fit in the window.

A sequence (a vector, an array) of two or more strings of the same length, labelled by their index, such as `grid`
above, shows as a **block**: one line per element, without index or kind, in a monospace font whose letter spacing
widens the advance of a character to the line height, so that each character is a square cell and a grid of 32 by 32
characters is square; the grid of Life fits in the default inspector window. The block keeps what the tree offers: the
lines that the last pass changed are highlighted, a line that is cut offers its full value (with a 24 px button, which
makes that line as high), and a line of a writable watch is edited in place (click it, or Enter or F2; with a mouse it
is as high as its line of text, and **Tree** gives rows of 24 px, 44 px under a coarse pointer as in the block). Its
**Tree** button shows the elements one by one again, and **Block** returns to the block; the choice is kept per watch
and container in this browser, as the period is. A line that no longer has the length of the others turns the block back
into a tree until they agree. The fields of an object, the entries of a map and strings that break their line keep the
tree. The layout changes only what is shown: the pages of 200 elements and the passes are the same (ADR-027, section 3).

## Reading a watch from an agent

An application that enables [automation](AUTOMATION.md#reading-the-applications-state) with the `state` grant gives an MCP
Expand Down
12 changes: 6 additions & 6 deletions js/developer/environment/bundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"js/developer/environment/testing.mjs": "48695dc7c368d5f0671a0549a61d06c732e10604c56e98f7254f3c4dd21a792c",
"js/developer/environment/terminal.mjs": "e7c3ca8f9833f10e07939277996eb01fb989c986420c96052271ff469fa59062",
"js/developer/environment/workspace.mjs": "e82ec4df21ffb2b112550e0212504aba05af4f924b5645c0712f40f8466257fc",
"js/developer/environment/menu.mjs": "b4fe4c38e6b8cc6c1101df842e282ab85e6c6e029b2225738b9d27bc5efbc88d",
"js/developer/environment/menu.mjs": "29535371e75ecbb5e402397cf47e0970b664b75d6c663d33915724f6a3fa3af8",
"js/developer/environment/inspector-host.mjs": "304a8a6713026939d66088dd0bb68a96ff4ee14e970c6886d61c82ebde611ac5",
"js/developer/environment/inspector.mjs": "183ece8ad6581c458315211b3edea6fa2823c2212d3999e7e9e069a1e78309e5",
"js/developer/environment/inspector-packages.mjs": "1c3f6350780b841784f83bc20ead2945157c48a1f136c47e3a7a90d89bea8522",
"js/developer/environment/inspector-registry.mjs": "6653afc473fcef677d8b02541085943da3f7d15c5b64d23dafd43c750a9e28d8",
"js/developer/environment/inspector-watches.mjs": "f5b8f901b86969bfe349d0e875cce9fba375d922f95f4fb213dc2f690083175e",
"js/developer/environment/inspector-bridge.mjs": "fa891a6098edccd4fdae288c07d5b5d766919021acece61f6d3e5a3e55882bbc",
"js/developer/environment/inspector.mjs": "44b6cd4443a3ed55a1bb188be96eafb64fc8b40b9a80500b3c47977740a6b336",
"js/developer/environment/inspector-packages.mjs": "de7ee0bcd85df4eadb434e52bd571951eea3314eb1b0d1fd3ada52cf21a0b14c",
"js/developer/environment/inspector-registry.mjs": "bcc15ef9801ad9a60e377eaa26582febb05c472d5e9b9678ee8b5ec369a2a15e",
"js/developer/environment/inspector-watches.mjs": "d913f20f3b2d36788b6e2d831065a8cccbd242abc7a86d366e27533b91ee56e7",
"js/developer/environment/inspector-bridge.mjs": "b3f269245870d1a7e126cab5f80b2918164a5c24b3d351015cf52d44bf343cb8",
"js/developer/environment/inspector.html": "66bfb80d6bd29bc9aabf71e0dd9b163dfcd1f1c77d1a41818645af1a4f9b8616",
"js/developer/environment/tarball.mjs": "1c1e1aea067910e1fec74e85b4bf9fbefed9b38187a04d8d2764f0b9a96fca39",
"js/developer/environment/commands.mjs": "a759f48584b78aed79e9965fd202d2ec108a6948ef6f1b8d689fed87a458b265",
Expand Down
2 changes: 1 addition & 1 deletion js/developer/environment/inspector-bridge.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ const readyTexts = {
export const describeReady = ready => ready.state === 'rejected' && ready.reason ? `rejected: ${ready.reason}` : readyTexts[ready.state] ?? ready.state;

export const bridgeStyles = `
dl.bridge{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:0 0 12px}
dl.bridge{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;margin:0 0 8px}
dl.bridge dt{color:#a9b3c4}
dl.bridge dd{margin:0;overflow-wrap:anywhere}
dl.bridge dd.rejected{color:#ffbd2e}`;
Expand Down
21 changes: 11 additions & 10 deletions js/developer/environment/inspector-packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ export function searchPackages(lock, query) {
const pathOf = (parent, id) => parent ? `${parent}>${id}` : id;

export const packagesStyles = `
.packages-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.packages-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
@media (min-width:720px){.packages-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
ul.packages,ul.packages ul,ul.matches,ol.chains,ul.files{list-style:none;margin:0;padding:0}
ul.packages ul{padding-left:18px}
ul.packages li>.row{display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;min-height:28px;padding:0 4px;border-radius:4px;cursor:pointer}
ul.packages ul{padding-left:14px}
ul.packages li>.row{display:flex;flex-wrap:wrap;align-items:center;gap:0 6px;min-height:24px;padding:0 4px;border-radius:4px;cursor:pointer}
ul.packages li:focus{outline:none}
ul.packages li:focus-visible>.row{outline:2px solid #d7fa85;outline-offset:-2px}
ul.packages li[aria-selected=true]>.row,ul.matches button[aria-pressed=true]{background:#2f3a50}
Expand All @@ -65,21 +65,22 @@ ul.packages li[aria-expanded=false]>ul{display:none}
.badge{padding:0 6px;border:1px solid #46536a;border-radius:8px;color:#a9b3c4;font-size:11px;white-space:nowrap}
.badge.peer{color:#8fd0ff;border-color:#8fd0ff}
.badge.versions{color:#ffbd2e;border-color:#ffbd2e}
ul.matches button,.package-detail button.package-link{min-height:28px;padding:0 6px;border:0;border-radius:4px;background:none;color:#8fd0ff;font:13px ui-monospace,monospace;text-align:left;cursor:pointer;overflow-wrap:anywhere}
ul.matches button,.package-detail button.package-link{min-height:24px;padding:0 6px;border:0;border-radius:4px;background:none;color:#8fd0ff;font:13px ui-monospace,monospace;text-align:left;cursor:pointer;overflow-wrap:anywhere}
ul.matches li{display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px}
ul.matches button:focus-visible,.package-detail button:focus-visible{outline:2px solid #d7fa85;outline-offset:-2px}
.package-detail{min-width:0;padding:8px 12px;border:1px solid #2f3a50;border-radius:4px;align-self:start}
.package-detail{min-width:0;padding:4px 8px;border:1px solid #2f3a50;border-radius:4px;align-self:start}
.package-detail h2:focus{outline:none}
.package-detail h2{margin:0 0 4px;font:600 14px ui-monospace,monospace;overflow-wrap:anywhere}
.package-detail h3{margin:12px 0 4px;font-size:12px;font-weight:600;color:#a9b3c4}
.package-detail p{margin:0 0 8px}
.package-detail dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 12px;margin:0}
.package-detail h3{margin:8px 0 2px;font-size:12px;font-weight:600;color:#a9b3c4}
.package-detail p{margin:0 0 4px}
.package-detail dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px 8px;margin:0}
.package-detail dt{color:#a9b3c4;font-size:12px}
.package-detail dd{margin:0;overflow-wrap:anywhere}
.package-detail .code{font-family:ui-monospace,monospace;font-size:12px}
.package-detail .note,ul.matches .note{color:#a9b3c4;font-size:12px}
ol.chains li{padding:2px 0;border-bottom:1px solid #2f3a50}
ul.files{max-height:12em;overflow:auto;font-family:ui-monospace,monospace;font-size:12px}`;
ol.chains li{padding:1px 0;border-bottom:1px solid #2f3a50}
ul.files{max-height:12em;overflow:auto;font-family:ui-monospace,monospace;font-size:12px}
@media (pointer:coarse){ul.packages li>.row,ul.matches button,.package-detail button.package-link{min-height:44px}}`;

/**
* Shows the panel in `body`. `load(bridge)` reads the project and `state(bridge)` the token of its state (tests replace
Expand Down
19 changes: 10 additions & 9 deletions js/developer/environment/inspector-registry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,17 @@ export const commandColumns = [
];

export const registryStyles = `
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 8px}
.toolbar input[type=search]{flex:1 1 160px;min-width:0;min-height:32px;padding:0 8px;border:1px solid #46536a;border-radius:4px;background:#0f131b;color:inherit;font:inherit}
.toolbar select{min-height:32px;padding:0 6px;border:1px solid #46536a;border-radius:4px;background:#2f3a50;color:inherit;font:inherit}
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 0 4px}
.toolbar input[type=search]{flex:1 1 160px;min-width:0;min-height:26px;padding:0 6px;border:1px solid #46536a;border-radius:4px;background:#0f131b;color:inherit;font:inherit}
.toolbar select{min-height:26px;padding:0 4px;border:1px solid #46536a;border-radius:4px;background:#2f3a50;color:inherit;font:inherit}
.toolbar label{display:flex;align-items:center;gap:6px;color:#a9b3c4;font-size:12px}
.toolbar :focus-visible{outline:2px solid #d7fa85;outline-offset:1px}
.scroll{overflow-x:auto;margin:0 0 16px}
table.registry{border-collapse:collapse;width:100%;font-size:13px}
table.registry caption{text-align:left;font-weight:600;padding:4px 0}
table.registry th,table.registry td{padding:4px 8px;border-bottom:1px solid #2f3a50;text-align:left;vertical-align:top;white-space:nowrap}
.scroll{overflow-x:auto;margin:0 0 8px}
table.registry{border-collapse:collapse;width:100%;font-size:12px;line-height:16px}
table.registry caption{text-align:left;font-weight:600;padding:2px 0}
table.registry th,table.registry td{padding:2px 6px;border-bottom:1px solid #2f3a50;text-align:left;vertical-align:top;white-space:nowrap}
table.registry th{position:sticky;top:0;background:#202737;padding:0}
table.registry th button{width:100%;min-height:32px;padding:0 8px;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-align:inherit;cursor:pointer}
table.registry th button{width:100%;min-height:24px;padding:0 6px;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-align:inherit;cursor:pointer}
table.registry th button:focus-visible{outline:2px solid #d7fa85;outline-offset:-2px}
table.registry th[aria-sort=ascending] button::after{content:" ▲";color:#d7fa85}
table.registry th[aria-sort=descending] button::after{content:" ▼";color:#d7fa85}
Expand All @@ -342,7 +342,8 @@ table.registry .name{font-weight:600}
table.registry .code{font-family:ui-monospace,monospace;font-size:12px;color:#d7fa85}
table.registry .location{color:#a9b3c4;font-size:12px}
table.registry .error-text{color:#ffbd2e;white-space:normal;overflow-wrap:anywhere;min-width:12em}
.summary{margin:0 0 8px}`;
.summary{margin:0 0 4px}
@media (pointer:coarse){.toolbar input[type=search],.toolbar select,table.registry th button{min-height:44px}}`;

// --- Panels ----------------------------------------------------------------------------------------------------

Expand Down
Loading
Loading