fix: draw the settings on the plugin card, not a click deeper
The page was registered into `plugins.row.config`, keyed
`<package>#<row id>`. That seat puts a page behind the ROW's title button on the
bundle's card — the right home for one row of a bundle that declares several,
and the reasoning the previous commit wrote down. What it missed is that this
bundle declares exactly one row, so its settings became reachable only by
opening the card and noticing that the row title had turned into a button.
Reported from a real install as "it shows the plugin just no settings", while
the sibling plugin's settings were visible: that one registers into
`plugins.bundle.config`.
`plugins.bundle.config` is the same document, dispatched on the card itself:
`PackageDetail` gates a section on `ledger.bundles.has(pkg.name)` and renders
`renderSlot("plugins.bundle.config", { view: "page" }, { entryKey: pkg.name })`
between the description and the rows. So the key becomes the bundle's package
name, and the form draws where someone opening "dsh-recall" is already looking.
The section gets no `form` prop at this seat, unlike the row page — which is
fine, because the card reads its own form from `configForms` rather than
depending on the one handed in.
Verified by serving the bundle from a profile that links this checkout and
reading the artifact back: the served `client.js` carries
`plugins.bundle.config` at the registration and names the retired seat only in
prose. The tests pin the new key and now fail if either the seat or the key
drifts.
This commit is contained in:
1 parent
1f42d2a821
commit
233215e6c9
3 files changed
+55
-36
No files matched your search
+18
-13
@@ -7,10 +7,13 @@
|
||||
* leaving the page to be eyeballed in a running app, because the failures this
|
||||
* file exists to catch are structural and invisible until someone opens Plugins:
|
||||
*
|
||||
* - the configuration page is registered into `plugins.row.config` under
|
||||
* `<bundle package>#<row id>`. The 0.1.5 seat (`settings.plugin.item`, bound
|
||||
* through `settingsScope`) does not exist in 0.1.7, so a page left in it
|
||||
* registers against a slot nobody declares and simply never appears.
|
||||
* - the configuration page is registered into `plugins.bundle.config` under
|
||||
* the bundle's package name, which is the seat the Plugins page draws as a
|
||||
* section on the plugin's own card. The 0.1.5 seat (`settings.plugin.item`,
|
||||
* bound through `settingsScope`) does not exist in 0.1.7, so a page left in
|
||||
* it registers against a slot nobody declares and simply never appears; the
|
||||
* sibling seat `plugins.row.config` renders one click deeper instead, on a
|
||||
* single row's page, which is not where someone opening the card looks.
|
||||
* - the right-sidebar tab needs a TYPE registered before its body means
|
||||
* anything: the keyed body slot is dispatched under the definition's `id`.
|
||||
* - the field list here and the `Config` schema in index.js must name the same
|
||||
@@ -322,7 +325,7 @@ function mount(options = {}) {
|
||||
* does, so the component under test sees the props a real render would give it.
|
||||
*/
|
||||
const card = (view) => {
|
||||
const item = byName.get('plugins.row.config')
|
||||
const item = byName.get('plugins.bundle.config')
|
||||
assert.ok(item !== undefined, 'no settings page was registered')
|
||||
const props = { ...item.meta.inject(), view }
|
||||
delete props.hooks
|
||||
@@ -364,13 +367,15 @@ test('the client module claims the slot registry in its inject list', () => {
|
||||
assert.deepEqual(module.inject, ['slots'])
|
||||
})
|
||||
|
||||
test('the configuration page claims the 0.1.7 seat, keyed as the patch declares it', () => {
|
||||
test('the configuration page claims the seat the plugin card draws', () => {
|
||||
const { registered } = mount()
|
||||
const page = registered.find((item) => item.meta.name === 'plugins.row.config')
|
||||
assert.ok(page !== undefined, 'the page must register into plugins.row.config')
|
||||
// `<bundle package name>#<row id>`: the row id is the one this bundle's own
|
||||
// cordis.patch.yml declares, which is what the Plugins page dispatches by.
|
||||
assert.equal(page.meta.key, 'dsh-recall#dsh-recall')
|
||||
const page = registered.find((item) => item.meta.name === 'plugins.bundle.config')
|
||||
assert.ok(page !== undefined, 'the page must register into plugins.bundle.config')
|
||||
// Keyed by the BUNDLE's package name, which is what the Plugins page
|
||||
// dispatches this seat with (`entryKey: pkg.name`). The sibling seat,
|
||||
// `plugins.row.config`, would be keyed `<package>#<row id>` and would render
|
||||
// one click deeper, on the row's own page.
|
||||
assert.equal(page.meta.key, 'dsh-recall')
|
||||
assert.equal(typeof page.meta.inject, 'function')
|
||||
})
|
||||
|
||||
@@ -385,7 +390,7 @@ test('no page is registered for a namespace the Host does not serve', () => {
|
||||
// onto fields nothing would accept.
|
||||
const { registered } = mount({ served: ['some-other-plugin'] })
|
||||
assert.equal(
|
||||
registered.some((item) => item.meta.name === 'plugins.row.config'),
|
||||
registered.some((item) => item.meta.name === 'plugins.bundle.config'),
|
||||
false,
|
||||
)
|
||||
})
|
||||
@@ -431,7 +436,7 @@ test('the browser half contributes three seats, none of them the retired 0.1.5 o
|
||||
const { registered } = mount()
|
||||
assert.deepEqual(registered.map((item) => item.meta.name).sort(), [
|
||||
'conversation.session.header.corner',
|
||||
'plugins.row.config',
|
||||
'plugins.bundle.config',
|
||||
'sidebar.right.pane.tab',
|
||||
])
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user