Skip to content

Conversation

@oasisk
Copy link
Contributor

@oasisk oasisk commented Nov 28, 2025

No description provided.

@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

@oasisk oasisk changed the title Chore: hide service graph from UI chore: hide service graph from UI Nov 28, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 28, 2025

Greptile Overview

Greptile Summary

This PR hides the service graph feature from the UI by adding a configuration flag (service_graph_enabled) that controls visibility of the service-maps tab in the traces interface.

Changes:

  • Backend exposes service_graph_enabled configuration field (true for enterprise with feature enabled, false otherwise)
  • Frontend conditionally renders service-maps tab toggle buttons based on the config flag
  • URL handling prevents navigation to service-maps tab when feature is disabled
  • Service-maps content is hidden when the feature is disabled

Minor issue:

  • The activeTab watcher mutates its own watched value, causing a double re-render (not critical, but not ideal for performance)

Confidence Score: 4/5

  • This PR is safe to merge with minor optimization opportunity
  • The implementation correctly hides the service graph feature through configuration flags. The backend changes are straightforward with proper feature flag usage. Frontend changes properly handle conditional rendering and URL state. One minor style issue exists where the activeTab watcher mutates its own watched value causing unnecessary re-renders, but this doesn't affect functionality.
  • web/src/plugins/traces/Index.vue has a minor optimization opportunity in the activeTab watcher

Important Files Changed

File Analysis

Filename Score Overview
src/handler/http/request/status/mod.rs 5/5 Added service_graph_enabled field to ConfigResponse struct with proper feature flags for enterprise/non-enterprise builds. The field is set from enterprise config when available, otherwise defaults to false.
web/src/plugins/traces/Index.vue 3/5 Added checks for service_graph_enabled config to conditionally render service-maps tab and prevent navigation when disabled. Minor issue found with potential infinite loop in activeTab watcher.
web/src/plugins/traces/SearchBar.vue 5/5 Wrapped tab toggle buttons with conditional rendering based on service_graph_enabled config. Clean implementation that hides the UI when feature is disabled.

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser
    participant Frontend
    participant Backend
    participant Config
    
    User->>Browser: Navigate to Traces page
    Browser->>Frontend: Load Index.vue
    Frontend->>Backend: GET /api/default/config
    Backend->>Config: Check service_graph.enabled
    alt Enterprise build
        Config-->>Backend: o2cfg.service_graph.enabled
    else Non-enterprise build
        Config-->>Backend: false
    end
    Backend-->>Frontend: ConfigResponse{service_graph_enabled}
    Frontend->>Frontend: Store config in Vuex (store.state.zoConfig)
    
    alt service_graph_enabled = true
        Frontend->>Frontend: Render SearchBar with tab toggle buttons
        Frontend->>Frontend: Allow service-maps tab selection
    else service_graph_enabled = false
        Frontend->>Frontend: Hide tab toggle buttons (v-if)
        Frontend->>Frontend: Hide service-maps content (v-if)
        alt URL has ?tab=service-maps
            Frontend->>Frontend: onBeforeMount: Force activeTab = 'search'
        end
    end
    
    Frontend-->>User: Display traces page (with or without service-maps tab)
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@oasisk oasisk merged commit a5b67d8 into branch-v0.20.0 Nov 28, 2025
47 of 49 checks passed
@oasisk oasisk deleted the chore-hide-service-graph-from-UI branch November 28, 2025 11:08
oasisk added a commit that referenced this pull request Nov 28, 2025
oasisk added a commit that referenced this pull request Nov 28, 2025
oasisk added a commit that referenced this pull request Nov 28, 2025
oasisk added a commit that referenced this pull request Nov 28, 2025
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.

3 participants