Skip to content

Split six more large test modules into packages by subject - #3089

Merged
max-sixty merged 5 commits into
mainfrom
split-test-files
Oct 16, 2026
Merged

max-sixty merged 5 commits into
mainfrom
split-test-files

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The second round after #3087: six more test modules of 6k–7.7k lines become packages by subject, laid out the same way.

Source Package Modules
browser/test_render_projection.py browser/projection/ 10
browser/test_render_drafts.py browser/drafts/ 10
browser/test_render_startup.py browser/startup/ 10
browser/test_render_controls.py browser/controls/ 9
model/test_interact_contract.py model/interact_contract/ 10
process/test_website_server.py process/website_server/ 9

New in this round. website_server's autouse fixture has to reach every module, so the package's conftest.py imports it, and tests/AGENTS.md now says that. The three regtest recordings move beside their tests' new modules, and the reset command they quote names the new path. The three modules that took leaf_page through test_render_controls import it from render_harness, where it is defined. Definitions only a journeys module reached, directly or through another such definition, move into that module (most of them into journeys/test_render_controls.py).

Nothing else in the moved code changed. Each package collects the same test ids as its source, and every definition's AST matches main's except for the quoted paths above, function-local imports ruff dropped where the new module imports the same name at the top, one Path(__file__).parents[N] deepened, and a docstring that pointed at "the rule above" across what is now a module boundary.

All model and process tests in the new packages and their importers pass (494), as does the first browser test of each new module.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 5 commits October 15, 2026 15:19
test_render_navigation, _threads, _widgets and _margin (11k-15k lines
each) become tests/browser/{navigation,threads,widgets,margin}/, 47
modules of 400-2000 lines, each named and documented for the behavior
it protects. A helper one module uses moves with it; the package's
__init__.py holds those several modules or other directories import.
Constants only a journeys module used move into that module.

Every definition is unchanged except the widgets tests that located
examples through Path(__file__).parents[N], which now read
render_harness.ROOT. The collected test ids are identical before and
after.

--changed-since read base sources only one directory deep, so every
test in a package would have counted as edited on each landing; it now
reads them at any depth. tests/AGENTS.md states the package layout.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	tests/browser/test_render_margin.py
#	tests/browser/test_render_navigation.py
#	tests/browser/test_render_widgets.py
#	tests/journeys/test_render_drafts.py
browser/test_render_projection, _drafts, _startup and _controls,
model/test_interact_contract and process/test_website_server (6k-7.7k
lines each) become packages of 58 modules, laid out as the first round
was. Definitions only a journeys module reached, directly or through
another such definition, move into that module.

New in this round: website_server's autouse fixture, which must reach
every module, is imported by the package's conftest.py; the three
regtest recordings move beside their tests' new modules, with the
reset command they quote naming the new path; and the three modules
that took leaf_page through test_render_controls import it from
render_harness, its home.

Every definition's AST is unchanged apart from those quoted paths,
function-local imports ruff dropped where the module now imports the
same name, one `parents[N]` deepened, and a docstring that pointed at
"the rule above" across what is now a module boundary. Each package
collects the same test ids as its source.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	tests/process/test_website_server.py
@max-sixty
max-sixty merged commit ad532b3 into main Oct 16, 2026
3 checks passed
@max-sixty
max-sixty deleted the split-test-files branch October 16, 2026 08:29
leaf-agent added a commit that referenced this pull request Nov 7, 2026
Comments, docstrings and one note that point at names the code no longer
has. Each now names the rule or function it means. Nothing that runs
changes.

- **Renamed `browser/AGENTS.md` sections.** `floating-panel.js` cited
"News never moves what the reader is reading", and
`composing/text-field.js` cited "Editing in place" and "Stability". None
of these is a heading or rule any more. They now name "News moves what
the reader reads only in the thread they are in", "Editing something
keeps it where it stood and as it read" and "The page holds still under
the user's aim".
- **`keyboard/layer-stack.js`, `nativeModes`.** The comment counted hint
popovers among the modes, but since #5614 `pushNativeLayer` returns
`null` for `popover="hint"`, so no hint popover ever joins the stack.
The module header already says so.
- **Functions that were removed or never existed:**
- `floating-panel.css` cited `rowNotice`, which #5613 deleted. It now
cites `rowNoticeTemplate`.
- `thread/messages.js` cited `preview.js`'s `fitList`, which has never
existed. The fitter is `fit`.
- **`packages/diff/widget-shadow.css`.** Two z-index comments gave the
full-name path box as their reason, and #5614 removed that box. The
values stay. The comments now give the stacking they keep: the line
numbers sit at 2, the pinned name at 3 and the file's actions at 4.
- **`notes/fork-replies.md`.** It said a `forked-replies` branch builds
the design, and that the fork posts "the reply". `forks.py` has been on
main since #4892, and since #5552 the fork posts only the working line.
The rest of the note, the research and the unbuilt "fork that takes the
work", stays.
- **Smaller fixes:**
  - The `plans.py` docstrings now name the `items` parameter.
- The `structure.py` allocation comment now points at
`AUTHORED_ALLOCATIONS`, which also holds `data-height` and the page-wide
allocations.
  - A runtime test now names `tokens.css`, where the card widths live.
- A test comment now names `test_admission.py`, where #3089 moved the
named-dependency test.
- **`packages/default/styles/sample.css`.** A trailing comment governing
no rule repeated the exhibit rule that `options.css` states and applies,
so it is deleted.

Verification: pre-commit (ruff, prettier, eslint, ty, knip, typos)
passes on the changed files, and
`tests/runtime/comment-placement.test.mjs` passes. No test is added,
since nothing that runs changes.

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants