Skip to content

feat(studio): group the event models page by namespace owner - #210

Merged
yordis merged 2 commits into
TrogonStack:mainfrom
enilsen16:enilsen16/feat-studio-models-by-parent
Oct 20, 2026
Merged

yordis merged 2 commits into
TrogonStack:mainfrom
enilsen16:enilsen16/feat-studio-models-by-parent

Conversation

@enilsen16

@enilsen16 enilsen16 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Add lib/namespace-owner.ts. It holds DEFAULT_OWNER and ownerLabel, moved from NamespacesPage.tsx, and a new pure function groupByOwner. The function groups models by owner, then by namespace, both sorted.
  • groupByOwner matches 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.
  • A namespace with no owner goes into a "no owner" group. This group is always last. Its key is null, so a real owner with the name unregistered stays in its own group.
  • The models page loads api.namespaceRegistry() next to the overview fetch. It shows one collapsible section per owner, open by default, with the namespace groups inside.
  • If the registry read fails (for example, a scoped key), the page shows the namespace groups without owner sections, as before.
  • NamespacesPage.tsx now imports ownerLabel from the shared module. Its behavior does not change.
  • The page is navigated, not filtered, so this change adds no filter.

Test

  • src/lib/namespace-owner.test.ts: pure tests. Namespaces that share a parent go under one owner. A minted ns_... id matches. Unregistered and unknown namespaces go last. An owner with the name unregistered does not merge into the no-owner group. No registry gives one group without an owner.
  • src/components/OverviewPage.test.tsx: acme-orders and acme-probe under owner acme and other-ns under default give 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, typecheck and lint pass. The only failure is server/devops-contract.test.mjs, which needs the Python yaml module and is not related to this change.

Not in this PR (maintainer decision)

  • One card per model lineage. This depends on supersedes or changeset history, and the rule for which version is the head of a lineage needs your decision.
  • A filter that hides scratch namespaces. Main has no "scratch" tag convention yet, and the Overview page records that the studio is navigated, not filtered.
  • The doc line "a revised model belongs on a branch of the same namespace". docs/explanation/branching.md is close; please confirm the wording you want.
  • Owner sections are open by default. The issue asks for collapsed by default; that hides every model on the landing page, so tell me if you want that instead.

Closes #110


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Signed-off-by: Erik Nilsen <enilsen16@live.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1861622b-924c-45cb-947b-bc9c92e27683
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@enilsen16
enilsen16 marked this pull request as ready for review October 20, 2026 15:19
@cursor

cursor Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Studio UI-only grouping with graceful fallback when the registry cannot be read; no auth or data mutation paths.

Overview
The Studio Models view on Overview now nests event models under registry owners, then under namespace, instead of a flat namespace list.

A shared lib/namespace-owner module adds groupByOwner (and moves ownerLabel / DEFAULT_OWNER out of NamespacesPage). Grouping resolves namespace keys to registry row ids (minted ns_…) or unregistered names, puts ownerless namespaces last (null owner), and treats empty parent as default.

OverviewPage loads api.namespaceRegistry() alongside the overview fetch and renders collapsible owner sections when the registry is available; registry errors or a still-loading registry keep the previous flat-by-namespace layout. NamespacesPage behavior is unchanged aside from the shared import.

Unit tests cover groupByOwner edge cases and Overview owner sections plus registry-failure fallback.

Reviewed by Cursor Bugbot for commit f3c94e3. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 83fd046. Configure here.

Comment thread tsworkspace/webapps/studio/src/lib/namespace-owner.ts
…ed namespace

Signed-off-by: Erik Nilsen <enilsen16@live.com>
@yordis
yordis merged commit a854929 into TrogonStack:main Oct 20, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio models page: group by namespace owner or project, one card per model lineage

2 participants