Skip to content

web: Link only the components of an app's UI set that the app imports - #4066

Merged
madcodelife merged 34 commits into
mainfrom
ui-set-parts
Dec 3, 2026
Merged

madcodelife merged 34 commits into
mainfrom
ui-set-parts

Conversation

@madcodelife

@madcodelife madcodelife commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Description

A TSX app that imports one component from a Rust UI set (nsh.json "rust", #[native_module]) kept the whole set on the web: every component of a large library shipped with an app that renders a single button. The app's imports already say which components it uses, so the framework now uses them. Library authors write nothing new.

Size

A component library of 117 components, unchanged (its #[native_module] function is one chain of register calls ending in two module calls), packaged with the release CLI of this branch at 685cb840d (the gallery row with the CLI of e660ddfea, an earlier head that packages the same). "Whole" is the same library with an early return added, which the macro does not split: the one gate every set had before this change, with the same CLI. nsh.wasm raw / gzip / brotli; on the gallery the split costs the gates of every component, and pruning has nothing to remove:

app whole split
imports Button only (a) 7.61 / 2.68 / 1.83 MB 4.54 / 1.71 / 1.27 MB
Button, and a page loaded with import() that uses DatePicker and DataTable (b) 7.61 / 2.68 / 1.83 MB main 4.57 / 1.73 / 1.27 MB; loaded with the page: DatePicker 0.72 / 0.24 / 0.17, DataTable 0.47 / 0.16 / 0.12
the library's gallery, which imports nearly every component (c) 9.17 / 3.22 / 2.21 MB 9.18 / 3.22 / 2.22 MB

What it does

#[native_module("acme/ui")]
fn native(registry: &mut Registry) {
    registry.tokens_from(read_tokens); // kept whenever the app imports `acme/ui`
    registry.register::<Button>(); // kept when the app imports `Button`
    registry
        .register::<DatePicker>() // each component on its own
        .register::<DateRangePicker>()
        .module::<Dates>(); // kept whenever the app imports `acme/ui`
}
  • #[native_module] leaves its function and registry() exactly as on main, and adds the parts beside them. Each top-level statement that is a chain of the registry's own methods on the parameter (register, module, class, setup, tokens_from, assets, … and gpu_renderer / rich_extension) gives each component it registers a hidden function of its own, __nsh_native_part_<Type> (a repeated name gets _2). The chain's other calls go to the rest, in order.
  • The rest of the body is one more part, __set, kept whenever the app imports the set (side-effect, named or submodule import). A component registered any other way (in a loop, a block, a helper function, under a cfg) is in __set.
  • A hidden entry, __nsh_native_module_split(), lists the parts (__set first). Registry knows nothing of parts: a part is a plain fn(&mut Registry), and the web runtime calls the parts of one set into one Registry, in the set's order.
  • The parts keep the function's lint attributes (allow, warn, deny, expect as allow, forbid as deny, also under cfg_attr, before or after the attribute) and the spans of its register calls, so a crate clean under -D warnings stays clean (also with a statement under a cfg that is off), a #[forbid(..)] on the function still compiles, and "registered twice" points at the user's line.
  • registry(), native runners and cargo test run the function as written. Only the describe program and the TSX web runtime use the parts.
  • The CLI: the web runtime has one gate per part (ui_set_part!), and nsh package keeps the gates of the components the app imports plus __set. Components used only by code loaded with import() load with that code. Cross-component use (DatePicker using Calendar) is handled by wasm reachability pruning, as for nsh/base. A Rust app's root still gets the whole set.
  • In a TSX app's web runtime, a component made by name that no linked set registers logs at warn (was debug), once per name.

What is split, what is not

The macro does not split a function where splitting could change what compiles or what it means (the web runtime runs __set before the components):

  • it returns early (return outside closures);
  • it declares an item other than a use, or defines a macro (macro_rules!, at any depth);
  • it rebinds its parameter (a top-level let binding it, or a parameter that is not a plain name);
  • a top-level statement before a component's calls a macro, unless it is the standard library's or log's named by its crate (log::info!, std::println!): a macro could declare something the components' statements name;
  • it names the registry in code under a cfg (#[cfg(..)], #[cfg_attr(..)] at any depth, or cfg!), other than in a plain chain of the registry's methods: what such code does depends on the target, and the check below runs on the machine that builds the app.

Everything else is checked on the machine that builds the app. When nsh describes the app, the describe program runs itself again as a fresh process for each split set (--split <i>), makes the set from its parts there, and compares that set with the function's as written, which the describe program made in its own process: their descriptions, and what a description leaves out (the names of fakes and GPU renderers, how many setups, whether tokens and scroll bars are set). Each way runs once in a process of its own. It keeps the parts only when the two are equal; otherwise (different, or making the parts panics) the set is linked whole, and -v shows what making the parts wrote to stderr (a panic's message). A function that does something only once per process therefore compares correctly. This catches a helper that registers depending on what the set has (a component, a setup or a fake), a crate's own macro named like log's, an assert! on the set and a Clone::clone_from of it.

Limits of the check:

  • It runs on the host, not on wasm: code whose effect differs per target is out of its reach. The macro keeps whole the functions that name the registry under a cfg; a helper function that has a cfg inside its own body is not seen.
  • A read with no effect on what is registered is not caught: a function that reads the set while registering (through a helper or a macro it passes the registry to) sees it without the split components in the web runtime. Natively it runs as written.
  • A function that registers something different on each run (randomness, time) is compared on one run each way.
  • Setups, tokens and scroll bars are compared by how many there are, not by what their functions do; fakes and GPU renderers by name.

nsh package --target web warns, one line per set, when an app imports only some of the components a set links whenever it is imported: a set kept whole (by the macro, or by the describe check), or components in __set. One wording, with the reason and how to write the function so it splits; for a set from a library the app depends on (an nshm, a Cargo dependency), it says "the library of the UI set …" and to report it to the library's authors:

warn the UI set "probe/whole" links all 3 of its components whenever the app imports it, 2 of them not imported: its `#[native_module]` function is kept whole. To link only the components the app imports, register them in statements of their own through the registry's methods (`registry.register::<Button>();`), in a function with no early `return`, no items but `use`s, no `macro_rules!` and no macro statement before them but `log`'s or the standard library's by its crate (`log::info!`), that does not rebind the registry and names it under a `cfg` only in such statements
warn the UI set "probe/helper" links all 2 of its components whenever the app imports it, 1 of them not imported: its `#[native_module]` function would register something else made of parts: it reads the set while registering (in a helper function or a macro), or making the set from its parts failed. To link only the components the app imports, register them in statements of their own, with no code that reads the set before they are all registered
warn the UI set "probe/native" links 1 of its components whenever the app imports it, 1 of them not imported: its `#[native_module]` function registers them other than in statements of their own (in a block, a loop, a helper function or under a `cfg`). To link only the components the app imports, register each in a statement of its own (`registry.register::<Button>();`)

For library authors

  • A plain registration function, a chain of register calls, or a chain mixing register with module / class / setup / … needs no change.
  • A function that cannot be split is linked whole, as before, and nsh package --target web says so when an app uses only some of its components.

Public API

  • No new public authoring API: no attribute, method or type for library authors. Nothing released changes: Registry, SetDescription and Description are exactly as in 0.8.0 (Registry only gets a pub(crate) method the check uses).

  • New public but #[doc(hidden)], for nsh's tools (may change), in nsh_core::element::description:

    • type Split = (&'static str, &'static [(&'static str, fn(&mut Registry))]): a set's specifier and its parts;
    • PartDescription { name, exports, set_level, submodules } and SetParts { specifier, parts, split_changes }, both #[non_exhaustive];
    • describe_split(sets: &[fn() -> Registry], split: &[fn() -> Option<Split>]) -> String: the describe program's body;
    • parts_from_json(&str) -> Result<Vec<SetParts>, String>.

    The JSON description carries a split set's parts under its own "parts" key (or "split_changes"), which readers of format 2, 0.8.0's included, skip; FORMAT stays 2.

  • Hidden, for generated code only: nsh_core::element::__private::native_module_unsplit, nsh_platform_web::{add_ui_set_part, ui_set_part!}, and, in the user's crate, #[doc(hidden)] pub fn __nsh_native_module_split() and one #[doc(hidden)] pub fn __nsh_native_part_<Type>(registry: &mut Registry) per part.

Breaking Changes

None.

Tests

  • nsh-macros integration tests: the set made of the parts against the function as written (full description) for a mixed chain; each part on its own; the rest kept with __set; a component in a block kept with __set; bodies not split (early return, rebound parameter, local items, macro_rules! in a block, a crate macro before the components, a helper under cfg, an if cfg! branch); bodies split that only read the set; the describe check dropping the parts of bodies that register otherwise when split (a read, in the body or a closure, that decides what to register, Clone::clone_from, a helper that registers on specs().is_empty(), a crate's own info!, assert! on the set) and keeping them otherwise; lint attributes before and after the attribute in a module under #[deny(warnings)], including a statement under #[cfg(any())] that names the registry, and #[forbid(non_snake_case)] and #[forbid(unused_variables)] on a split function; a component registered twice panics at the user's line; part names (Badge_2, r#type, Of<Pin> → Of). Unit tests: which bodies split, the std/log macro exemption, the cfg cases, a mixed chain's __set statements in order, and the lint attributes the parts get.
  • nsh-core: a split set keeps its parts only when they register the same, a setup included; a part without later keys is read.
  • nsh-cli: the describe program; parts read from the description; gates; the warning for a set kept whole, kept whole by the check, from a library, and with components in __set, and none for a set imported wholly or taken whole.
  • nsh-platform-web (tests/text): the parts of a set make up one set in the set's order.
  • cargo clippy … -D warnings for nsh-macros, nsh-core, nsh-platform-web, nsh-cli, tasks-rs; the library above builds clean under its own clippy --all-targets -D warnings.
  • An adversarial set of 74 small crates compared function, registry() and parts, with the describe check in fresh processes: registry() always equals the function; every body whose parts would register a different set ends linked whole (helper_cond, assert_capture, crate_macro_named_info, clone_from_ufcs, helper_reads_then_registers, a closure or a shadowed registry that decides what to register, a return inside a crate macro, a helper that registers a fake or a setup only when the set has a component, a part that exits); bodies that run differently the second time in a process (once_flag, once_panic) keep their parts; bodies with target-dependent code are not split; read-only bodies are split with the same set (the limit above). Twenty lint crates are clean under clippy -D warnings on the host and on wasm, including one under #![deny(warnings)] with a statement under a cfg that is off, and forbid on the function (non_snake_case, unused_variables, unused, warnings) or on the crate.
  • Packaged with the release CLI: the library above unchanged (a, b with a headless check that the page's components load only with the page, c), the same kept whole (the "whole" column), a set with a plain side effect next to one component (headless Chrome: init ran: true), and sets for each warning.

Follow-ups

  • nsh/base on the same mechanism. Not in this PR: its nsh_part_* gate names and nsh-<part> file names are documented as stable, and its hand-made groups (core, menu, overlays, …) differ from a per-component split, so moving it changes those names: a separate change.
  • Every component lazy in its own chunk gets close to MAX_LAZY (127) lazy gates, past which gates fold into the main module without a warning; merging the gates that the same chunks load into one side module would be a packaging change only.
  • A helper function that takes the registry runs in __set in the web runtime, before the components; one that only reads the set sees it without them. Refusing such calls would be possible later without API change.

`#[native_module]` also goes on an inline module: each `pub fn` in it is
a part of the set. The describe program records each part's exports, and
the web runtime gets one gate per part (`ui_set_part!`), so `nsh package`
keeps the parts the app imports and splits off those of code loaded with
`import()`. A set of one function keeps its one gate.

The web runtime's library is written once the app is described, and in
part mode has no function for the whole set.
A part is now a function marked `#[part]` in `#[native_module]`'s module,
of any visibility; other functions are helpers. Parts are registered with
`Registry::part`, which records what each adds: its exports, and whether
it registers for the set as a whole (a setup, files, tokens, scroll bars,
a GPU renderer, a fake or a submodule). The description reads that from
the registry, so the part table, its stand-in and `Description::with_parts`
are gone.

`nsh package` keeps the set-level parts whenever the app imports the set
or one of its submodules, an import for effects only included, and an
import from a submodule keeps the part that registered it. The web
runtime registers a set's parts in the set's order, whichever order their
gates run in. A part's `#[cfg]`s are copied onto what is made for it, a
raw identifier names its part without `r#`, and two sets or parts whose
web gates come out alike are refused, naming both.
…parts part by part

A part a side module brings after the app started now registers into the
set the runtime made, instead of the set being made again: the core keeps
the setups it ran and runs only the new part's. Before the app starts the
parts still register in the set's order.

A set is described in parts, and gated part by part, only when
`#[native_module]` on a module made it (each part has a function of its
own) and everything it registers is in a part; any other set, including
one whose `#[native_module]` function calls `Registry::part` itself, keeps
one gate for the whole set.

A part's function is now made on every target, calling the part under
its `cfg`s, and of a part's `cfg_attr`s only the `cfg`s are copied. A
part's name is ASCII, and `#[part]` in a `cfg_attr` is refused. An import
of a name no part of a set exports, which keeps every part, is warned of.
@huacnlee

huacnlee commented Dec 2, 2026

Copy link
Copy Markdown
Member

💡 Needs a maintainer call on API: this adds public surface right before the 0.9.0 freeze.

Reviewed e0c13de (diff only). New public items: #[native_module] on inline modules, #[part], Registry::part, PartDescription (nsh-core element/description.rs) and add_ui_set_part. The goal (TSX app importing one component should not ship the whole Rust UI set) fits the size targets; the "part" naming should be checked against the existing nsh/base part model, and a measured size drop would help. CI pending.

🤖 Noop (reviewer) · AI agent acting for @huacnlee

The set is described on the machine that builds the app, so a part under a `cfg` of the target (`target_arch`, `unix`, ...) was described as one thing and linked as another on the web: it compiled and the part was silently missing or never linked. `#[native_module]` now fails on such a `cfg` on a part, in `all`/`any`/`not` and in a `cfg_attr` too. Features, `test` and `debug_assertions` stay allowed.
An import by name of a name the set lacks fails the build, so the warning for a name no part exports is reached by a member read off `import * as` or by a re-export, which the bundle imports by name. The warning now names that, and its test reads the names from such code.
@huacnlee

huacnlee commented Dec 2, 2026

Copy link
Copy Markdown
Member

💡 The two new commits tighten the macro: a UI-set part under a target cfg (target_*, unix, windows, wasm, also inside all/any/not and cfg_attr) is now a compile error, with a unit test, and the docs say a namespace read or re-export keeps every part. Code looks correct. The earlier open point remains: this adds public authoring surface before the 0.9.0 freeze, so it is still the owner's call. Reviewed head 3fef208; CI is still running.

🤖 Noop (reviewer) · AI agent acting for @huacnlee

madcodelife and others added 6 commits December 2, 2026 19:34
…nsh` generates uses

They are the protocol between `nsh` and the runtime of the same version, so they are `#[doc(hidden)]` and may change. Their docs now say that before the app starts parts register in `index` order, and that a part added after joins the running set last, whatever its `index`. They take a part as a plain `fn(&mut Registry)`.

`nsh` gives a set one gate or a gate per part, never both, so `AppSets` asserts in debug builds that no set is added both whole and in parts instead of silently keeping the first.
…ption` non-exhaustive

`element::Part` is gone: a bare `Part` at the root of `element` reads as a component's part, and callers pass a function item or a closure that captures nothing without naming the type. `nsh_base::parts::Part` is the same type, and a test registers nsh/base's parts with `Registry::part`.

`SetDescription` is `#[non_exhaustive]`, since adding `parts` already broke struct literals: other crates build it with `SetDescription::of` or `From<Registry>`. `PartDescription::submodules` is `#[doc(hidden)]`, for nsh's tools.

`Registry::part`'s docs say first to write parts as `#[part]` functions of `#[native_module]` on a module: called by hand it only groups what the set registers. A test covers the panic of a part registered from another part. `part_registering` is now `record_registration`, which says that it records.
`AppSet::unexported` serves both the gates an import keeps (every part, for such a name) and the warning, so the two cannot disagree.
Drop `#[part]`, `#[native_module]` on a module and the public
`Registry::part`: the macro gives each component its function registers
directly a hidden part of its own, and the rest of the function one more,
so a TSX app's web runtime links only the components it imports.

Agent: lead
@huacnlee huacnlee changed the title web: Link only the parts of an app's UI set that the app imports web: Link only the components of an app's UI set that the app imports Dec 3, 2026
huacnlee and others added 6 commits December 3, 2026 12:42
…iption`

The rest of a function `#[native_module]` splits is registered through the
hidden `__private::native_module_rest`, which marks it for the set as a
whole: any import of the set keeps it, so a plain side effect runs on the
web and a component registered in a block is always linked.

`PartDescription` and `SetDescription::parts` are `#[doc(hidden)]`: only
nsh's tools read them. A component Rust code makes by name that no linked
set registers logs at `warn`, naming it.
A chain of the registry's own methods on the parameter is split too: its
components are parts, its other calls `__set` statements in order, so a
chain ending in `module` calls splits unchanged.

A body is kept whole when splitting could change it: an early `return` or
`?`, an item other than `use`, a rebound or `mut` parameter, a method on the
registry other than its registering ones, an assignment or swap of it, or a
macro other than std's and `log`'s outside closures.

The function itself gets `#[allow(dead_code)]` once split, so a split crate
builds clean under `-D warnings`; the tests no longer call it and deny dead
code.
`nsh package --target web` says, one line per set, when an app imports only
some of the components a set links whenever it is imported: a set kept
whole, or the components its `__set` registers. The gate name clash error
says what the user can change now that parts are named after types.
@huacnlee

huacnlee commented Dec 3, 2026

Copy link
Copy Markdown
Member

💡 The rework follows the agreed direction (no new public API, per-component hidden parts), but two promised pieces are missing.

Reviewed 2dbbab5 (diff read-only).

  • Registry::part is pub(crate), PartDescription hidden, #[part] removed, and packaging warns when it must keep the whole set. Good.
  • nsh-base/src/lib.rs still iterates the hand-written parts::ALL; nsh/base is not yet on the new mechanism, and the test only checks the list matches the registry.
  • No before/after wasm size yet; that number is what justifies ~+2.9k lines of macro/CLI machinery.
  • CI pending at review time.

🤖 Noop (reviewer) · AI agent acting for @huacnlee

`the_parts_register_as_parts_of_a_set` fed `parts::ALL` to the parts of
an app's split set, which `nsh/base` does not use: it checked nothing
the change relies on. `nsh/base` keeps its own parts here; moving it to
the per-component split is a change of its own.
…on` as released

`registry()` runs the `#[native_module]` function as written again; a
hidden entry makes the set from its parts. The describe program makes
each set both ways and keeps the parts only when both register the
same, else links the set whole and `nsh package` says why.

The parts carry the function's lint attributes (`expect` as `allow`)
and the spans of its `register` calls. A body is not split when a macro
names the parameter (a format string's implicit argument too), when it
defines a macro, or when it uses the parameter other than through the
registry's own methods or by passing it to a function.

`SetDescription` loses the `parts` field and `#[non_exhaustive]`, as in
0.8.0: the parts travel under a key of their own, through hidden
functions of `description`. The packaging warning names a library the
app depends on as such.
…nd check them in a process of their own

`#[native_module]` now lists the parts of a set it splits
(`__nsh_native_module_split` returns their names and functions), so
`Registry` is back to what it was: the describe program derives each
component part's exports by registering it into an empty set, and
`__set` has the rest. It makes the set of parts in a process of its own
(`--split <index>`), so a function that does something only once is no
longer described as registering something else, and `catch_unwind` goes.

The macro's check keeps only what the build or the describe check could
not catch: items other than `use`, `macro_rules!`, an early `return`, a
rebound parameter, a macro statement before a component's (it could
declare what that names), and the registry named in code under a `cfg`
other than a chain of its own methods (the check runs on the machine
that builds the app). `__set` always allows unused variables: the
parameter may be used only under a `cfg` that is off, and the function
itself reports the user's own. The parts are hidden functions at the
crate's root, and the warning for a set linked whole has one wording.
madcodelife and others added 10 commits December 3, 2026 00:55
…its components

A macro statement before a component's keeps the function whole, as it
could declare what that statement names; the standard library's and
`log`'s, named through their crate, expand to expressions.
… beside it

`expand` takes the function again and checks its signature where it
did; the parts and their list come from one function next to it, and
the list names `description::Split`.
A part allows lints of the code the macro adds (`unused_variables` on
`__set`, `non_snake_case` on a component's part), which a copied
`#[forbid(..)]` refused with E0453. The function keeps its `forbid`.
The describe check compared descriptions only, so parts that lost a
setup or a fake (a helper that registers one depending on what the set
has) were kept. The process that makes the set of parts now also writes
its fakes' and GPU renderers' names, how many setups it has and whether
it has tokens and scroll bars, and the parts are kept only when that
matches too. The `description` module doc no longer links the hidden
`describe_split`.
@madcodelife
madcodelife merged commit 0b172b6 into main Dec 3, 2026
17 of 34 checks passed
@madcodelife
madcodelife deleted the ui-set-parts branch December 3, 2026 12:31
madcodelife added a commit to longbridge/nsh-longbridge that referenced this pull request Dec 3, 2026
…eb app imports (#164)

Builds on longbridge/nsh#4066 (merged), which makes `#[native_module]`
split a UI set by the components its function registers, so a web app
links only the components it imports. The `[patch.crates-io]` here
points at the commit #4066 was merged as (`0b172b6e3` on nsh `main`,
every nsh crate at the full revision, `Cargo.lock` updated). Once an nsh
release has the change, the patch goes and `nsh-core` / `nsh-base` are
raised to that release.

## Size

Measured with `nsh package --target web` built from #4066's head
(`685cb840d`; the gallery row with the CLI of `e660ddfea`, an earlier
head that packages the same), this library at `main` (raw / gzip /
brotli of the app's `nsh.<digest>.wasm`; "whole" is the same library
with an early `return` added, which the macro does not split, so it is
one gate as before #4066, packaged with the same CLI):

| App | Whole | Split |
|---|---|---|
| Renders one `Button` | 7.61 / 2.68 / 1.83 MB | 4.54 / 1.71 / 1.27 MB |
| `Button`, and a page loaded with `import()` that uses `DatePicker` and
`DataTable` | 7.61 / 2.68 / 1.83 MB | main 4.57 / 1.73 / 1.27 MB;
`DatePicker` (0.72 / 0.24 / 0.17) and `DataTable` (0.47 / 0.16 / 0.12)
load with the page |
| The gallery (nearly every component) | 9.17 / 3.22 / 2.21 MB | 9.18 /
3.22 / 2.22 MB |

The lazy page was checked in headless Chrome: its two modules and the
page load only when it opens, and the date picker opens.

## Description

The library's UI set was one gate on the web, so an app that imports one
component linked all 117. With #4066 the set needs no change for this:
`src/lib.rs` is the same as on `main` (one chain of `register` calls
ending in two `module` calls), and the macro splits it into one part per
component plus the rest (`Labels`, `Toasts`), which every import keeps.
While describing the app, on the machine that builds it, nsh checks that
the parts register the same set as the function (its components, modules
and files, and its setups, fakes, tokens and renderers). Native builds,
tests and apps whose root is Rust run the function as written, as
before.

What this pull request changes:

- `Cargo.toml` / `Cargo.lock`: the nsh patch moves to #4066's merged
commit, with a comment saying why and when it goes.
- `CHANGELOG.md`: a new entry, web apps link only the components they
import; this needs the NSH release after 0.8.0, and with 0.8.0 the
library still works, linked whole. The existing "NSH 0.8" entry is
unchanged.
- Two specs and their tests follow behavior changes of `nsh/base`'s that
the new patch brings in from nsh `main` (not from #4066, whose split
changes no behavior): both tests already failed at nsh `main` before
#4066 was merged, and a bisect between the previous patch (`2e2afa01d`)
and `main` lands on each of these commits.
- **Tab leaves a menu in one press** (longbridge/nsh#4015, `f61086222`).
Tab and Shift+Tab in an open `DropdownMenu` or `ContextMenu` close every
level and move the focus on to the stop after the trigger (before it, on
Shift+Tab), as WAI-ARIA's menu button does; the focus used to stop on
the trigger.
`tab_from_a_submenu_closes_every_level_and_the_focus_goes_to_the_trigger`
expected the old stop; it becomes `…_the_focus_moves_past_the_trigger`
and checks both directions (its fixture gets a button before the
trigger, so Shift+Tab does not wrap around to the same button).
`DropdownMenu`'s NSH gap 16 and `ContextMenu`'s gap 6, which described
the old stop, move to their Decisions; the later gaps are renumbered
with their references.
- **A shown tooltip binds no key** (longbridge/nsh#4163, `62e112a99`).
Escape no longer hides a tooltip, and `onOpenChange` no longer reports
`"cancel"`, so on Windows, whose keyboard focus shows a tooltip, the
first Escape on a `SelectionBar`'s focused "×" clears.
`escape_in_the_bar_asks_to_clear` expects that now. `Tooltip`'s spec,
`TooltipEvent::OpenChange`'s doc and the generated skill reference, and
the Escape wording of `SelectionBar` and `Popover`, follow;
`SelectionBar`'s gap 7 moves to its Decisions. This failure was hidden
on CI behind the first one (the test run stops at the first failing test
binary).
  - `CHANGELOG.md`: an entry for both.

An earlier revision restructured the set as a module of `#[part]`
functions, one per file, with a test and a convention to keep it that
way; nsh dropped that form, so those are gone and `src/lib.rs`,
`tests/api.rs` and `docs/conventions.md` match `main`.

## Public API

No change. Two behavior changes come with the new nsh (Tab leaving a
menu in one press, Escape passing a tooltip by), listed above and in
`CHANGELOG.md`.

## Tests

`cargo check --all-targets`, `cargo clippy --all-targets --locked -- -D
warnings`, `cargo fmt --check`, `cargo test --test api --test tokens
--test skill` and `cargo test --no-fail-fast --tests` (every test
binary) pass against the patched nsh.
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