Skip to content

Hide Empty Category if nothing is inside of the category#2603

Open
Philip-Carneiro wants to merge 4 commits intokubeflow:mainfrom
Philip-Carneiro:hide-empty-built-in-cat
Open

Hide Empty Category if nothing is inside of the category#2603
Philip-Carneiro wants to merge 4 commits intokubeflow:mainfrom
Philip-Carneiro:hide-empty-built-in-cat

Conversation

@Philip-Carneiro
Copy link
Copy Markdown
Contributor

Description

Add changes to hide categories:

  • In Model Catalog
  • In MCP Catalog

Before the changes:

  • Non PF-mode
Screenshot 2026-04-16 at 13 29 25
  • PF-mode
Screenshot 2026-04-16 at 13 29 00

After the changes:

  • Non PF-mode
Screenshot 2026-04-16 at 13 30 23
  • PF-mode
Screenshot 2026-04-16 at 13 30 54

How Has This Been Tested?

It was manually tested.
To test it manually, need to edit the file clients/ui/bff/internal/mocks/static_data_mock.go

Adding this as part of the return object of method func GetCatalogSourceMocks() []models.CatalogSource {

		{
			Id:      "empty-models-source",
			Name:    "Empty Models Source",
			Enabled: &enabled,
			Labels:  []string{"empty models category"},
			Status:  &availableStatus,
		},

Adding this as part of the return object of method func GetCatalogLabelListMock() models.CatalogLabelList {

		{
			Name:        func() *string { s := "empty models category"; return &s }(),
			DisplayName: func() *string { s := "Empty Models Category"; return &s }(),
			Description: func() *string {
				s := "This category has no models — used for testing empty category hiding."
				return &s
			}(),
		},

Adding this as part of the return object of method func GetMcpServerCatalogSourceMocks() []models.CatalogSource {

		{
			Id:      "empty-mcp-source",
			Name:    "Empty MCP Source",
			Enabled: &enabled,
			Status:  &availableStatus,
			Labels:  []string{"empty mcp category"},
		},

Adding this as part of the return object of method GetMcpServerCatalogLabelListMock() models.CatalogLabelList {

		{
			Name:        func() *string { s := "empty mcp category"; return &s }(),
			DisplayName: func() *string { s := "Empty MCP Category"; return &s }(),
			Description: func() *string {
				s := "This category has no servers — used for testing empty category hiding."
				return &s
			}(),
		},

Run it make build; make run; from bff directory.

  • Without this PR change, navigate to the Model Catalog and MCP Catalog and the empty category will be present at the category toggle bar
  • With the PR changes, these categories will not be present

Merge criteria:

  • The commits have meaningful messages
  • Automated tests are provided as part of the PR for major new functionalities; testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.
  • For first time contributors: Please reach out to the Reviewers to ensure all tests are being run, ensuring the label ok-to-test has been added to the PR.

If you have UI changes

  • The developer has added tests or explained why testing cannot be added.
  • Included any necessary screenshots or gifs if it was a UI change.
  • Verify that UI/UX changes conform the UX guidelines for Kubeflow.

@google-oss-prow google-oss-prow Bot requested review from chambridge and fege April 16, 2026 13:26
@Philip-Carneiro Philip-Carneiro changed the title Hide empty built in cat Hide Empty Category if nothing is inside of the category Apr 16, 2026
Copy link
Copy Markdown
Contributor

@YuliaKrimerman YuliaKrimerman left a comment

Choose a reason for hiding this comment

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

Couple of small things here

Comment thread clients/ui/frontend/src/app/pages/modelCatalog/screens/CatalogCategorySection.tsx Outdated
Comment thread clients/ui/frontend/src/app/context/modelCatalog/ModelCatalogContext.tsx Outdated
Comment thread clients/ui/frontend/src/app/pages/modelCatalog/screens/ModelCatalog.tsx Outdated
Comment thread clients/ui/frontend/src/app/pages/modelCatalog/screens/ModelCatalog.tsx Outdated
@Philip-Carneiro Philip-Carneiro force-pushed the hide-empty-built-in-cat branch 3 times, most recently from b6b33d9 to 3732763 Compare April 23, 2026 10:58
@google-oss-prow google-oss-prow Bot added size/L and removed size/XL labels Apr 23, 2026
@manaswinidas
Copy link
Copy Markdown
Contributor

/retest

Comment thread clients/ui/frontend/src/app/hooks/useEffectiveCategories.ts Outdated
Comment thread clients/ui/frontend/src/app/hooks/useReportCategoryEmpty.ts Outdated
Comment thread clients/ui/frontend/src/app/hooks/useEffectiveCategories.ts Outdated
Comment thread clients/ui/frontend/src/app/hooks/useEmptyCategoryTracking.ts Outdated
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
@Philip-Carneiro Philip-Carneiro force-pushed the hide-empty-built-in-cat branch from 3732763 to 15e17a7 Compare April 30, 2026 09:41
@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from ppadti. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Philip-Carneiro Philip-Carneiro requested a review from ppadti April 30, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants