Skip to content

Conversation

@wilsonrivera
Copy link
Contributor

@wilsonrivera wilsonrivera commented Sep 17, 2025

Summary by CodeRabbit

  • New Features
    • Enhanced search to recognize namespace matches: when a namespace matches the filter, all graphs and subgraphs within it are returned.
    • Updated search placeholder to “Search namespace, graphs and subgraphs” for clearer guidance.
    • Refined no-results message to “No namespace, graph or subgraph matches your criteria.”

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

Adds a namespace-level match shortcut in the workspace command wrapper: if the filter text matches a namespace via Fuse, the whole namespace is added to results without per-item filtering. Also updates the search placeholder and no-match message. Existing per-namespace/graph/subgraph filtering remains for non-matching namespaces.

Changes

Cohort / File(s) Summary
Search/filter logic update
studio/src/components/dashboard/workspace-command-wrapper.tsx
Introduces a pre-check using Fuse against namespace names; on match, pushes entire namespace to search results and skips deeper filtering. Updates UI text: search placeholder and no-match message. Leaves existing detailed filtering intact when namespace doesn’t match.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: filter by namespace" is concise and accurately summarizes the primary change (adding namespace-level filtering to the graph/subgraph search) described in the diff and PR objectives. It follows Conventional Commits style, is specific to the implemented behavior, and avoids vague or noisy wording. This makes it clear for reviewers and for project history.
✨ Finishing touches
  • 📝 Generate Docstrings

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
studio/src/components/dashboard/workspace-command-wrapper.tsx (3)

50-56: Clone the namespace when short‑circuiting; also tighten Fuse typing and enable scores

  • To keep consistency with the later cloning (Lines 58-61) and avoid accidental mutations by consumers, push a clone here.
  • Use a precise Fuse generic and enable includeScore so the later manual sort on score (Lines 87-89) is meaningful.

Apply in-range change:

-      fuse.setCollection([wns]);
-      if (fuse.search(filterValue).length > 0) {
-        // The namespace contains the filter value, add it with all the graphs/subgraphs to the search results
-        searchResults.push(wns);
+      fuse.setCollection([wns]);
+      if (fuse.search(filterValue).length > 0) {
+        // The namespace contains the filter value, add it with all the graphs/subgraphs to the search results
+        searchResults.push(wns.clone());
         continue;
       }

And (outside range) update the Fuse construction (Line 42):

-    const fuse = new Fuse<unknown>([], { keys: ['name'], threshold: 0.3, });
+    const fuse = new Fuse<WorkspaceNamespace | WorkspaceFederatedGraph | WorkspaceSubgraph>([], {
+      keys: ['name'],
+      threshold: 0.3,
+      includeScore: true,
+    });

Please confirm that GraphCommandGroup does not mutate the namespace object; if it does, cloning here prevents side effects.


116-117: Minor copy tweak: pluralize and add Oxford comma

Improves readability and matches the list below.

-          placeholder="Search namespace, graphs and subgraphs"
+          placeholder="Search namespaces, graphs, and subgraphs"

123-123: Minor copy tweak: pluralize and subject‑verb agreement

Aligns grammar with list form and uses plural “match”.

-                  No namespace, graph or subgraph matches your criteria.
+                  No namespaces, graphs, or subgraphs match your criteria.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29c7b00 and 0274e2a.

📒 Files selected for processing (1)
  • studio/src/components/dashboard/workspace-command-wrapper.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build_test
  • GitHub Check: build_push_image
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)

@wilsonrivera wilsonrivera merged commit 395372e into main Sep 17, 2025
10 checks passed
@wilsonrivera wilsonrivera deleted the wilson/eng-8176-filtering-by-namespace-in-graph-search branch September 17, 2025 14:06
@Noroth Noroth mentioned this pull request Sep 30, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants