fix: put the recall chip in the header utilities, not the cell the sidebar's expand button owns
Release / release (push) Successful in 6s
Release / release (push) Successful in 6s
The chip registered into `conversation.session.header.corner`, which is a
SINGLE cell the product already occupies: the client catalog lists its
occupants as `client-ui-sidebar-right ExpandButton` and its replaceRisk as
`shadows-shipped-ui`. Two registrations at priority 0 in a single cell are a
hard error inside the slot registry, and the error lands in the OTHER
plugin's `slots.inject()` callback: the renderer's `changed` handler catches
it, calls `stop()` on that inject controller — killing that contribution for
the rest of the fiber's life — and rethrows it from a microtask, which is the
uncaught `single slot ... already has a registration at priority 0 (registered
by dsh-recall)` in the console. So the chip was not merely racing the shipped
right-sidebar expand control; it was taking it down.
It now registers into `conversation.session.header.utilities`, a list cell
(`replaceRisk: none`, right-aligned, same Session scope and therefore the same
`useProjection` prop) as `{ id: 'dsh-recall', order: 20 }`, so it stays at the
right-hand end without competing for a seat.
The suite could not have caught this: the slot stub accepts any registration
and knows nothing about cardinality, keys or collisions. It now asserts the
chip carries a list id and that this plugin registers nothing into the corner.
This commit is contained in:
1 parent
811871e978
commit
28df7a0e56
3 files changed
+61
-26
No files matched your search
+25
-7
@@ -4,7 +4,7 @@
|
||||
* Three contributions, each into a seat the Harness 0.1.7 composition declares:
|
||||
*
|
||||
* 1. the plugin's configuration page, in the **Plugins** panel;
|
||||
* 2. a one-line usage chip in a conversation's header corner;
|
||||
* 2. a one-line usage chip in a conversation's header utilities;
|
||||
* 3. a right-sidebar tab with the same figures and room for their caveats.
|
||||
*
|
||||
* **Where plugin settings live now.** 0.1.5 drew plugin configuration as cards
|
||||
@@ -620,8 +620,8 @@ window.__ModuleLoader__.load({
|
||||
|
||||
function RecallChip(props) {
|
||||
const usage = useUsage(props)
|
||||
// The corner is laid out only while its occupant renders something, so a
|
||||
// conversation that never called the tool costs no layout at all.
|
||||
// The utilities list draws nothing for an entry that renders nothing, so
|
||||
// a conversation that never called the tool costs no layout at all.
|
||||
if (usage === undefined || !usage.searches) return null
|
||||
return h(
|
||||
'span',
|
||||
@@ -735,10 +735,28 @@ window.__ModuleLoader__.load({
|
||||
)
|
||||
})
|
||||
|
||||
// The chip: the header's far-right corner, which the framework lays out
|
||||
// only while its occupant renders something.
|
||||
ctx.slots.inject('conversation.session.header.corner', () =>
|
||||
ctx.slots.register({ name: 'conversation.session.header.corner' }, (props) => h(RecallChip, props)),
|
||||
// The chip: a right-aligned session utility, next to the header's
|
||||
// far-right corner.
|
||||
//
|
||||
// It is in the `utilities` LIST, not the corner, and that is not a
|
||||
// cosmetic choice. The corner is a `single` cell whose occupant the
|
||||
// product already declares — `client-ui-sidebar-right ExpandButton`, the
|
||||
// right sidebar's expand control — and the client catalog reports it as
|
||||
// `replaceRisk: "shadows-shipped-ui"`. A second registration at the same
|
||||
// priority is a hard error inside the slot registry, thrown while the
|
||||
// other plugin's `slots.inject()` callback runs: the renderer catches it,
|
||||
// STOPS that inject controller for the rest of the fiber's life, and
|
||||
// rethrows it uncaught. So squatting there did not merely race — it took
|
||||
// the shipped expand control down and logged an uncaught error. A list
|
||||
// entry carrying its own id cannot collide with anyone, and the framework
|
||||
// draws nothing for an entry that renders nothing.
|
||||
ctx.slots.inject('conversation.session.header.utilities', () =>
|
||||
ctx.slots.register(
|
||||
// `order` ascends left to right, so a high value keeps the chip at
|
||||
// the right-hand end of the utilities, where it was before.
|
||||
{ name: 'conversation.session.header.utilities', id: 'dsh-recall', order: 20 },
|
||||
(props) => h(RecallChip, props),
|
||||
),
|
||||
)
|
||||
|
||||
// The right-sidebar tab is registered in two stages, and the second is
|
||||
|
||||
Reference in new issue
Block a user