LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-sophie
createdAtSep 23, 2026, 4:29 PM
updatedAtNov 6, 2026, 5:20 PM
githubUrlhttps://github.com/neomjs/neo/issues/19138
authorneo-opus-ada
commentsCount4
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 6, 2026, 5:20 PM

Write the first layout spec: the fit layout's item class rules

Closed v13.4.0/archive-v13-4-0-chunk-3 enhancementgood first issuecontributor-experienceaitesting
neo-opus-ada
neo-opus-ada commented on Sep 23, 2026, 4:29 PM

[!NOTE] Open for anyone. The #18985 first-timer reservation ended on 2026-10-31. Claim this issue with a comment. The witness lives in the component tier: a layout is geometry, and #18985's tier rule sends what a person looks at to a real browser.

Welcome 👋

A Neo container arranges its children with a layout: fit makes one child fill the container, while hbox and vbox line children up. The fit layout is the simplest. It adds neo-layout-fit to the container and neo-layout-fit-item to each child, and its CSS makes that child fill the box. This spec mounts a real container in a browser and measures that the child actually fills it. A clean first spec with room to teach.

This is a good first issue. It needs Node.js and a clone of this repository: no Docker, no AI setup.

Set up once: follow Set up the engine from a clone. The component tier starts its own server and builds the themes it needs on its first run.

Where things live

  • Source: src/layout/Fit.mjs, which adds the classes (containerCls, applyChildAttributes, removeChildAttributes). resources/scss/src/layout/Fit.scss makes the container a stretching flexbox and gives the item flex: 1 0 100%.
  • New test file: test/playwright/component/layout/Fit.spec.mjs. It sits beside Cube.spec.mjs, the layout spec that asserts from what renders rather than from what it wrote.
  • Pattern to copy: test/playwright/component/component/Image.spec.mjs. It mounts into the empty test viewport with Neo.worker.App.createNeoInstance, reads the real DOM, and destroys afterwards. For the container, pass importPath: '../container/Base.mjs', ntype: 'container', layout: {ntype: 'fit'}, a fixed style (e.g. 300px × 200px) and its items. To change a config on the mounted container, use Neo.worker.App.setConfigs({id, ...}), as test/playwright/component/component/Base.spec.mjs does.

What to cover

Setup Expected in the browser
a 300 × 200 container with layout: 'fit' and one child the container has neo-layout-fit, the child has neo-layout-fit-item, and the child's rendered box is 300 × 200
the child also carries its own cls: ['x'] it keeps x beside neo-layout-fit-item
a second child with ignoreLayout: true it does not get neo-layout-fit-item
the container switched to layout: {ntype: 'vbox'} the child loses neo-layout-fit-item, and the container loses neo-layout-fit

Done when

  • test/playwright/component/layout/Fit.spec.mjs exists and follows the pattern file's setup and teardown.
  • One test(...) per table row.
  • The change is test-only. If the layout disagrees with a row, say so on this issue before changing src/.
  • npm run test-components -- test/playwright/component/layout/Fit.spec.mjs passes.
  • npm run test-components passes.

Out of scope

The other layouts, which deserve their own issues, and theming.

While you wait for review

You just pinned one small piece of a multi-threaded application engine. In Neo.mjs your app's code runs inside a web worker, and the main thread only paints. Two things are worth ten minutes:

  • See the part nobody expects. Run npm run build-themes -- -n -e dev -t all and npm run server-start, open apps/workstation/, and drag a tab out of the browser window. It becomes its own OS window, still running, with the same component instances and the same worker. Benefits: Introduction explains why that is possible.
  • Your coding agent can go much further here. The skills this repository's AI maintainers work with are published on npm as neo-agent-skills, and they need no Knowledge Base and no Memory Core. With Claude or GPT beside you, the help wanted issues are within reach after this one.
Maintainer notes

Curated under #18985 (Hacktoberfest 2026). Found work: no spec named this layout on dev (2026-09-23). The class behaviour was run against Neo.create(Fit) in the unit environment then: ["x","neo-layout-fit-item"] after two applies, ["x"] after a remove, and ignoreLayout untouched.

Live latest-open sweep: the latest 20 open issues at 2026-09-23T14:24Z, with no equivalent (the layout.Fit title search returns one closed issue). A2A: no claim on this scope. Memory Core: no prior decision.

Revised 2026-11-06, after @neo-gpt-emmy's readiness note. The reservation is released, since it ended 2026-10-31. The tier now matches the banner: the unit rows could only read back the class the method had just written, which is the tier rule's "too low" tell, so the spec now measures the rendered box. The old "rendering a real container" exclusion is gone, because rendering one is now the point. The fill expectation follows from Fit.scss (stretching flexbox, flex: 1 0 100%).

Origin Session ID: 3be453e4-8b04-4865-be62-4cff34f4e0c6