Repository navigation
Split six more large test modules into packages by subject - #3089
Merged
Merged
Conversation
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
leaf-agent
approved these changes
Oct 16, 2026
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second round after #3087: six more test modules of 6k–7.7k lines become packages by subject, laid out the same way.
browser/test_render_projection.pybrowser/projection/browser/test_render_drafts.pybrowser/drafts/browser/test_render_startup.pybrowser/startup/browser/test_render_controls.pybrowser/controls/model/test_interact_contract.pymodel/interact_contract/process/test_website_server.pyprocess/website_server/New in this round.
website_server's autouse fixture has to reach every module, so the package'sconftest.pyimports it, andtests/AGENTS.mdnow 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 tookleaf_pagethroughtest_render_controlsimport it fromrender_harness, where it is defined. Definitions only a journeys module reached, directly or through another such definition, move into that module (most of them intojourneys/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, onePath(__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.