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

A `compose.yaml` or `docker-compose.yml` opens as its services: image or build, ports, volumes, depends_on and environment names #11279

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A `compose.yaml`, `compose.yml`, `docker-compose.yaml` or `docker-compose.yml` now opens as a table of its services instead of raw source. The change is pushed. Tests, `tsc`, `scripts/gate.ts` and `design-lint` pass.

shipped production is serving it deploy f21b126

opened this

A compose.yaml, compose.yml, docker-compose.yaml or docker-compose.yml now opens as a table of its services instead of raw source. The change is pushed. Tests, tsc, scripts/gate.ts and design-lint pass.

What changed

  • src/web/render/compose.ts is new. It draws one row per service with these columns:

- Image, or build plus the context. - Ports, in short or long form. - Volumes. - depends_on, as a list or a map. - Environment variable names only, from either the map or the NAME=value list form. Values are never rendered.

  • kinds.ts and renderers.ts each gain one-line entries (the kind, a 1 MB cap, a name matcher, and the registry entry).
  • It uses the YAML parser workflow.ts already uses, so there is no new dependency.
  • Every string is escaped and cut to 300 characters. The draw is capped at 100 services and 50 entries per column.
  • A file that fails to parse, has several documents, or has no services map falls back to source with the existing "shown as YAML" note, with no error banner.
  • test/render-compose.test.ts covers:

- two services with depends_on; - a build service, in both string and context: forms; - values (<script>, secrets) that must not appear; - escaping of service names, image, ports and env names; - the fallbacks; - the name matching and the registry entry.

Not done

  • No compose-aware handling of extends, include or profiles.
  • No terminal view.
  • The diff is too broad for scripts/fast.ts to name tests, so I ran the kind, render and blob tests (317 pass). I did not run the full suite.
  • I added an empty "Try:" commit because the pre-push hook requires one for changes to a page.

Try it: open any compose.yaml in a repository's file view. Source is one tap away.

🤖 Generated with Claude Code

Closes #11211

commented

A compose.yaml, compose.yml, docker-compose.yaml or docker-compose.yml now opens as a table of its services instead of raw source. The change is pushed. Tests, tsc, scripts/gate.ts and design-lint pass.

What changed

  • src/web/render/compose.ts is new. It draws one row per service with these columns:

- Image, or build plus the context. - Ports, in short or long form. - Volumes. - depends_on, as a list or a map. - Environment variable names only, from either the map or the NAME=value list form. Values are never rendered.

  • kinds.ts and renderers.ts each gain one-line entries (the kind, a 1 MB cap, a name matcher, and the registry entry).
  • It uses the YAML parser workflow.ts already uses, so there is no new dependency.
  • Every string is escaped and cut to 300 characters. The draw is capped at 100 services and 50 entries per column.
  • A file that fails to parse, has several documents, or has no services map falls back to source with the existing "shown as YAML" note, with no error banner.
  • test/render-compose.test.ts covers:

- two services with depends_on; - a build service, in both string and context: forms; - values (<script>, secrets) that must not appear; - escaping of service names, image, ports and env names; - the fallbacks; - the name matching and the registry entry.

Not done

  • No compose-aware handling of extends, include or profiles.
  • No terminal view.
  • The diff is too broad for scripts/fast.ts to name tests, so I ran the kind, render and blob tests (317 pass). I did not run the full suite.
  • I added an empty "Try:" commit because the pre-push hook requires one for changes to a page.

Try it: open any compose.yaml in a repository's file view. Source is one tap away.

🤖 Generated with Claude Code

Changes requested — before the latest push

The parser, escaping and fallback are right, and values never reach the page. Two things stop it. (1) First, fix this: the table has six columns inside a bare div, so at 360px it overflows the page. Wrap it in <div class="table-scroll"> as system.ts does, and drop the unstyled compose-view class. (2) There is no docs/features/file-compose.md, and every sibling kind has one (file-workflow.md, file-dockerfile.md). Add it. Smaller: add a test that the LIST_CAP, SERVICE_CAP and 'more services not shown' line work; the terminal has no view of a compose file, and I could not tell whether the other file kinds have one. Name that choice in the pull or add it.

commented

All three review points are fixed and pushed to the same branch (43d85be19). The tests I ran, tsc, scripts/gate.ts and design-lint all pass. I did not run the full suite.

What changed

  • Phone width: the services table now sits in <div class="table-scroll" role="region" tabindex="0" aria-label="Services">, so it scrolls sideways inside its own region at 360px. The unstyled compose-view class is gone, and the "more services not shown" line sits outside the scroll region.
  • Fallback wording: a file with no services map now says "This file has no services, so it is shown as YAML." Other parse failures read "This file is shown as YAML because it is not valid YAML." (or "…it is not one YAML document.").
  • Caps tested: new tests cover SERVICE_CAP (103 services draw 100, with "3 more services not shown"), LIST_CAP (55 ports keep 50), the scroll wrapper and the new fallback text.
  • Docs: docs/features/file-compose.md is added, in the shape of file-workflow.md.

Not done: terminal view. Workflow and Dockerfile have table views in src/tui/screens/workspace.ts. Compose does not; the terminal shows it as source, and the new doc says so. That means adding a table builder and its test, which is more than the issue asked for. It can follow as its own issue.

Sticky service-name column. The review offered a sticky lead column or stacked cells as options for the phone layout. I used only the scroll wrapper, because a sticky column needs new CSS and the system forbids adding components outside the area docs. The service name is a row header (th scope="row"), so it still reads as the lead cell.

🤖 Generated with Claude Code

commented

I pushed an empty commit (cf0e74481) carrying a Direction: line. I haven't confirmed the check now passes.

The "pipeline first" rule fails any pull that adds a feature doc but changes nothing under scripts/, src/flow/, src/nightly/, src/checks/ or forge.json. This pull is a file-kind renderer, so it has no pipeline change to make. The rule names a Direction: line in a commit message (10 or more characters) as the way past it. I used that rather than invent a pipeline change.

The commit says: "Direction: issue #11211 is an assigned, ready file-kind task that touches no pipeline file, so it ships as is". That is the whole justification. If a person judges the pipeline items should go first, they should hold this pull.

The rule isn't in my clone's scripts/gate.ts, which is behind main, so I couldn't run it locally. No code changed since the last push, so the earlier tests and gate results still stand.

🤖 Generated with Claude Code

Approved

Earlier asks are met: the table sits in a scroll region with a labelled region and tabindex, so it works at 360px and with the keyboard; the no-services fallback reads as a sentence; the caps are tested; docs/features/file-compose.md exists and README is untouched. Values are never rendered, every string is escaped, and the parser is the vendored one, so there is no new dependency.

Non-blocking: 1. Add a compose table to src/tui/screens/workspace.ts the way workflow and Dockerfile have one, so both doors match; open it as its own issue. 2. On a phone the service name scrolls away with the rest; a stacked layout would keep it in view, but that is new CSS and belongs in a design area doc.

The Direction: commit is a fair use of the pipeline-first rule, as this pull touches no pipeline file.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs