Repository navigation
Replies: 1 comment
|
This looks like a bug or an unintentional oversight at least. The default behaviour should be to add tabs at the end, with support for ordering. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Dynamic Cordis plugins registering into list slots always sort before shipped entries (
orderignored)Category: Bug report + proposed fix
Summary
When a dynamic Cordis plugin registers UI into a list slot (view tabs, composer tool rows, settings rows, β¦), the client guard forces a negative shadowing priority on the entry, so it always sorts before shipped entries β even when the caller provides an explicit
order.Example: a dynamic plugin registers a new conversation view tab (
conversation.view, idjupyter-notebook,order: 20). The shipped tabs arechat(order 0) andtrajectory(order 10). Expected position: third. Actual: first, because the guard overwrites the entry's priority with-1and list slots sort by(priority ?? 0) || (order ?? 0).Root cause
packages/extensions/cordis-client-runner/src/client/guard.tsβguardedSlots():The comment scopes the page-local rank to shadowing kinds β single/keyed cells, where a later dynamic entry is supposed to replace the shipped occupant. List slots never shadow (entries coexist; the ledger order is
(priority ?? 0) || (order ?? 0), seeui-slots/src/index.ts), so applying the forced rank there makes additive dynamic entries jump to the front of every ordered list regardless of their declaredorder.Proposed fix (one condition)
Behavior matrix:
orderTests
Added to
packages/extensions/cordis-client-runner/tests/guard.client.spec.ts(both pass, file 19/19):order: 20/order: 5) into a declared list slot β ledger ordered[b(5), a(20)], priorities remainundefined(previously they became-1/-2and the sort ignoredorder);[-2, -1].Verified locally:
vitest19/19,oxlintclean, pre-commit hooks pass.Questions for the team
All reactions