Summary#
A kit knows when it has a better part than the one a page reaches for — the Osyrin look has its own dropdown, drawn as
its boards draw it, where the browser's <select> looks different in every browser. The kit says so once, in its
package.osy, and every app that uses it hears it from osy lint on the page that drew the other part.
replaces "Select" {
use "LookSelect";
why "the browser's own select cannot be drawn as the boards' §22 dropdown";
}Signature#
replaces "<Part>" { use "<KitPart>"; [unless "<argument>";] [why "<reason>";] }<Part>— the replaced part's bare name: a platform atom (Select) or another kit's component (SelectField).use(required) — the kit's own component to draw instead. One the kit does not declare is a compile error in the kit (PACKAGE_REPLACES_UNKNOWN_PART).unless— an argument whose presence makes the call a face the kit does not replace.why— the reason the finding gives.
Description#
What the app hears#
ui-kit-replaces-this-part is a SHOULD finding on each call of a replaced part in one of the app's own components:
SHOULD ui-kit-replaces-this-part ShopPage (Select → LookSelect)
'ShopPage' draws `Select`, and Osysharp.Look, which this app uses, offers `LookSelect` for it instead. The browser's own
select cannot be drawn as the boards' §22 dropdown.
→ draw `LookSelect` here (`osy kit LookSelect` for its signature).When is it silent?#
- The app does not use a kit that declares the replacement.
- The call carries the entry's
unlessargument (SelectField(…, detail: …)draws its own list). - The app declares its own component of the replaced name — that is not the part the kit means.
- The call is inside a kit's code. The rule judges the app's own pages.
Turning it off#
For one page, say why on the component: [SuppressWarning("ui-kit-replaces-this-part")]. For the whole app, put it on
the app { } manifest. The kit an app uses is an app-wide choice, so this rule also accepts the manifest form, which
covers every page:
[SuppressWarning("ui-kit-replaces-this-part")]
app Shop { use Osysharp.Look@0; }What Osysharp.Look replaces#
| Replaced | Use | Unless |
|---|---|---|
Select (the browser's select) | LookSelect | — |
SelectField | LookSelect (over an enum LookEnumSelect, over rows LookRefPicker) | detail |
A page that draws the look's own dropdown instead of Select gets no finding:
using Osysharp.Look;
[Route("/shop")]
[AllowAnonymous]
component ShopPage() {
string size = "M";
render {
LookSelect("Size", size, ["S", "M", "L"]);
}
}See also#
- package.osy —
package.osy, where a kit writesreplaces - A picker over every row — the SearchPicker — a picker over rows the database answers
- [SuppressWarning] — accepting one finding about one declaration