LearnNewsExamplesServices
Frontmatter
id19138
titleWrite the first layout spec: the fit layout''s item class rules
stateOpen
labels
enhancementcontributor-experienceaitesting
assignees[]
createdAtSep 23, 2026, 4:29 PM
updatedAtSep 23, 2026, 4:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/19138
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

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

Open Backlog/active-chunk-25 enhancementcontributor-experienceaitesting
neo-opus-ada
neo-opus-ada commented on Sep 23, 2026, 4:29 PM

[!NOTE] Held in the #18985 reserve: not open for claiming yet. Curated issues are released in batches as review capacity frees up. Please pick an issue labelled good first issue instead. This one is also being moved to the component tier first: it tests something a human looks at, and #18985's tier rule sends those to a real browser.

Welcome 👋

A Neo container arranges its children with a layout: fit makes one child fill the container, hbox and vbox line children up. Surprisingly, no layout has a unit spec yet, so this one opens the folder. The fit layout is the simplest: it adds one CSS class to each child and removes it again. A clean first spec with room to teach.

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

[!IMPORTANT] Reserved for first-time Neo.mjs contributors. The maintainer team will not claim, edit, or implement this issue through 2026-10-31. Comment here to claim it, and ask anything on this issue.

Set up once: follow Set up the engine from a clone, including npm run bundle-browser-deps: without it the unit suite selects zero tests.

Where things live

  • Source: src/layout/Fit.mjs: applyChildAttributes(item, index), removeChildAttributes(item, index) and containerCls
  • New test file: test/playwright/unit/layout/Fit.spec.mjs (the folder is new)
  • Pattern to copy: test/playwright/unit/util/Array.spec.mjs (the setup() call and imports)
  • Tip: Neo.create(FitLayout) works without a container, and a plain object such as {wrapperCls: ['x']} works as the item, because these methods only read wrapperCls and ignoreLayout.

What to cover

Action Expected
applyChildAttributes(item) adds 'neo-layout-fit-item' to item.wrapperCls and keeps the item's other classes
calling it twice the class is still there once, not twice
an item with ignoreLayout: true wrapperCls is untouched
removeChildAttributes(item) removes 'neo-layout-fit-item' and keeps the item's other classes
containerCls 'neo-layout-fit'

Done when

  • test/playwright/unit/layout/Fit.spec.mjs exists, following the pattern file's setup.
  • One test(...) per table row.
  • Test-only: if the layout disagrees with a row, say so on this issue before changing src/.
  • npm run test-unit -- test/playwright/unit/layout/Fit.spec.mjs passes.
  • npm run test-unit passes.

Out of scope

The other layouts (they deserve their own issues), and rendering a real container.

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 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: test/playwright/unit/layout/ does not exist on dev (2026-09-23). The first four rows were run against Neo.create(Fit) in the unit environment: ["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; no equivalent (the layout.Fit title search returns one closed issue). A2A: no claim on this scope. Memory Core: no prior decision.

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