Public: anyone can read this; the crew can change it.

A machine's containers in the cloud tree read as a table: name, state, CPU, memory, started #17954

opened this

Merged 17h 22m ago, live in production

A machine's pane on /infra now shows its containers as one table: name, state, CPU limit, memory limit and started. Name links to the container, and started reads as an ago. A missing value, or no limit set, shows as —, never 0.

Notes

opened this

A machine's pane on /infra now shows its containers as one table: name, state, CPU limit, memory limit and started. Name links to the container, and started reads as an ago. A missing value, or no limit set, shows as —, never 0. The terminal screen draws the same five columns. (Direction: #17951.)

test/cloud-containers.test.ts has a new test that renders a machine with two containers and checks the cells on the page and in the terminal. I also updated that file's older terminal test, because the old "fresh · running" row line is now a table row. The tests I ran pass: that file, plus unused-exports, cloud-tree, infra-page, cloud-doors and cloud-page-shape. tsc --noEmit, design-lint and gate --fix are clean. I did not run the whole suite.

What changed

  • Container record (src/cloud/containers.ts): Container gets three new fields, cpuLimit, memoryLimit and startedAt, which are empty when unknown. The existing cpu, memory and uptime strings mix the current figure with the limit, so they could not fill the columns.
  • Shared columns (src/cloud/containers.ts): CONTAINER_COLUMNS and containerCell hold the labels and cell text, so both doors show the same words.
  • Page (src/web/pages/cloud_tree.ts): the old row list became a table.
  • Terminal (src/tui/screens/cloudtree.ts): drawn with the existing tableLines.
  • Docs (docs/features/infra.md): updated for the table.

Choices

  • Started is empty when the container is stopped, when its box has been silent for two minutes, or when the box only said "Up 3 hours". In those cases it shows — rather than a guessed time.
  • No new dependency and no new function was written from scratch. I reused agoWords, the .table markup and tableLines.
  • I did not make the table sortable or filterable.

To try it: open /infra, pick a machine that is a game box, and read its containers table. In the terminal, open Cloud resources and open the machine.

[
  {"go":"/infra","look":"Open a machine that is a game box (a cloud row with containers).","expect":"Its pane shows a Containers table with columns Name, State, CPU limit, Memory limit, Started; the name is a link."},
  {"go":"/infra","look":"A container that is stopped or has no limit set.","expect":"Those cells read — and never 0."}
]

🤖 Generated with Claude Code

Closes #17951

4 earlier comments
commented

A machine's pane on /infra now shows its containers as one table: name, state, CPU limit, memory limit and started. Name links to the container, and started reads as an ago. A missing value, or no limit set, shows as —, never 0. The terminal screen draws the same five columns. (Direction: #17951.)

test/cloud-containers.test.ts has a new test that renders a machine with two containers and checks the cells on the page and in the terminal. I also updated that file's older terminal test, because the old "fresh · running" row line is now a table row. The tests I ran pass: that file, plus unused-exports, cloud-tree, infra-page, cloud-doors and cloud-page-shape. tsc --noEmit, design-lint and gate --fix are clean. I did not run the whole suite.

What changed

  • Container record (src/cloud/containers.ts): Container gets three new fields, cpuLimit, memoryLimit and startedAt, which are empty when unknown. The existing cpu, memory and uptime strings mix the current figure with the limit, so they could not fill the columns.
  • Shared columns (src/cloud/containers.ts): CONTAINER_COLUMNS and containerCell hold the labels and cell text, so both doors show the same words.
  • Page (src/web/pages/cloud_tree.ts): the old row list became a table.
  • Terminal (src/tui/screens/cloudtree.ts): drawn with the existing tableLines.
  • Docs (docs/features/infra.md): updated for the table.

Choices

  • Started is empty when the container is stopped, when its box has been silent for two minutes, or when the box only said "Up 3 hours". In those cases it shows — rather than a guessed time.
  • No new dependency and no new function was written from scratch. I reused agoWords, the .table markup and tableLines.
  • I did not make the table sortable or filterable.

To try it: open /infra, pick a machine that is a game box, and read its containers table. In the terminal, open Cloud resources and open the machine.

[
  {"go":"/infra","look":"Open a machine that is a game box (a cloud row with containers).","expect":"Its pane shows a Containers table with columns Name, State, CPU limit, Memory limit, Started; the name is a link."},
  {"go":"/infra","look":"A container that is stopped or has no limit set.","expect":"Those cells read — and never 0."}
]

🤖 Generated with Claude Code

commented

<!-- look-pages e70ae4a80fc3 --> Look pages for e70ae4a, from the gate:

  • look pages (none): this pull changes src/web/pages/cloud_tree.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

Both of sentinel's points are fixed on the page markup in src/web/pages/cloud_tree.ts.

  • Keyboard scrolling: the containers table's scroll wrapper now has role="region" tabindex="0" aria-label="Containers", as forges.ts:208 does. The test asserts it.
  • Caption: the sr-only <caption> is gone, since it repeated the <h2>. The region's aria-label now names the table.

test/cloud-containers.test.ts passes (14 tests), tsc --noEmit and design-lint are clean, and I did not rerun the wider suite. The new commit carries the issue number, a Try: line and Looks: /infra.

The terminal screen is unchanged.

[
  {"go":"/infra","look":"Open a game box's machine and press Tab until the Containers table is focused.","expect":"The table takes focus and scrolls sideways with the arrow keys; a screen reader announces the region as Containers."}
]

🤖 Generated with Claude Code

commented

<!-- look-pages b2ceb0bccbbb --> Look pages for b2ceb0b, from the gate:

  • look pages (none): "Looks: /infra" is not a page of app.looks in forge.json; this pull changes src/web/pages/cloud_tree.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The look-pages complaint is answered, and no code changed in this round.

I had written Looks: /infra, but /infra isn't in app.looks in forge.json, so the gate refused it. It can't be added: the containers table only appears for a machine that is a game box under a cloud account, and no look page has that data. I replaced it with a No look: line in a new empty commit, 69d4aa3b5. It says /infra is not in app.looks and needs a cloud account with a game-box machine. I did not rerun the tests or the gate this round, because only the commit message changed.

Earlier rounds are unchanged: the table and its shared columns, the terminal door, and the keyboard-reachable scroll wrapper with the caption removed.

[
  {"go":"/infra","look":"Open a game box's machine and read its Containers table.","expect":"Columns Name, State, CPU limit, Memory limit, Started; a value not known shows as —, never 0."}
]

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs