Repository navigation
feat(studio): group the event models page by namespace owner - #210
Conversation
Signed-off-by: Erik Nilsen <enilsen16@live.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR SummaryLow Risk Overview A shared
Unit tests cover Reviewed by Cursor Bugbot for commit f3c94e3. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 83fd046. Configure here.
…ed namespace Signed-off-by: Erik Nilsen <enilsen16@live.com>

Problem
The Studio "Event models" page groups models by namespace only. Example, probe and copied namespaces all show as top-level peers, so the page grows with each experiment. The registry already records an owner for each namespace (
NamespaceRecord.parent), and the Namespaces page shows it, but the models page does not use it.Change
lib/namespace-owner.ts. It holdsDEFAULT_OWNERandownerLabel, moved fromNamespacesPage.tsx, and a new pure functiongroupByOwner. The function groups models by owner, then by namespace, both sorted.groupByOwnermatches a model's namespace to the registry row id, then to the row name. Entity keys carry the namespace id, and an unregistered row has only a name.null, so a real owner with the nameunregisteredstays in its own group.api.namespaceRegistry()next to the overview fetch. It shows one collapsible section per owner, open by default, with the namespace groups inside.NamespacesPage.tsxnow importsownerLabelfrom the shared module. Its behavior does not change.Test
src/lib/namespace-owner.test.ts: pure tests. Namespaces that share a parent go under one owner. A mintedns_...id matches. Unregistered and unknown namespaces go last. An owner with the nameunregistereddoes not merge into the no-owner group. No registry gives one group without an owner.src/components/OverviewPage.test.tsx:acme-ordersandacme-probeunder owneracmeandother-nsunderdefaultgive two owner sections, and both acme namespaces are in the acme section. A failed registry read still lists all three namespaces.pnpm --filter trogon-atlas-studio test,typecheckandlintpass. The only failure isserver/devops-contract.test.mjs, which needs the Pythonyamlmodule and is not related to this change.Not in this PR (maintainer decision)
supersedesor changeset history, and the rule for which version is the head of a lineage needs your decision.docs/explanation/branching.mdis close; please confirm the wording you want.Closes #110
Need help on this PR? Tag
@codesmith-botwith what you need.