feat(orbit): Orbit-powered Code Intelligence panel for blob viewer

Summary

Adds a Code Intelligence side panel to the GitLab blob (file) viewer, powered by the Orbit knowledge graph. When opened, the panel shows every symbol defined in the current file with caller-count badges, and lets you drill into any symbol to see its inbound references and outbound calls — all with zero CI configuration required.

This is a WIP prototype, gated behind the orbit_code_intelligence feature flag and the :orbit licensed feature.

What's in this MR

blob_content_viewer.vue

  • "Code Intelligence" button in the blob header toolbar (secondary, earth icon)
  • Panel mounts as a sticky 30%-width column alongside the blob; blob reflows to fill remaining space
  • Button and panel both guarded by glFeatures.orbitCodeIntelligence && glLicensedFeatures.orbit

ee/orbit/components/orbit_code_panel.vue (new EE component)

  • Uses CrudComponent as the outer container (consistent GitLab panel styling, built-in collapse toggle)
  • Symbol list view: all definitions sorted by type, with caller-count badges and type-coloured icons (Method = code/blue, Function = formula/purple, Struct = object/orange)
  • Symbol detail view: back-arrow navigation, symbol name + FQN, Jump to Definition link, References tab (who calls this?), Calls tab (what does this call?), grouped by file with line links
  • Caller counts fetched in parallel with the symbol list on panel open; references/calls fetched on demand per symbol click

ee/config/feature_flags/wip/orbit_code_intelligence.yml (new)

  • WIP flag, disabled by default, owned by group::knowledge graph
  • Enable for team members: Feature.enable(:orbit_code_intelligence, Feature.group(:gitlab_team_members))

ee/app/controllers/ee/projects/blob_controller.rb

  • Pushes orbit_code_intelligence flag (actor-scoped to current_user) and :orbit licensed feature on blob show

Orbit queries

Query Fired when
File -[DEFINES]-> Definition Panel opens — fetches all symbols in file
Definition -[CALLS]-> Definition (file-scoped) Panel opens — fetches caller edges for badge counts
Definition -[CALLS]-> Definition (FQN inbound) Symbol selected — References tab
Definition -[CALLS]-> Definition (FQN outbound) Symbol selected — Calls tab

First two run in parallel on open; second two run in parallel on symbol click.

Demo

Testing instructions

Prerequisites

  1. GDK with an Orbit-indexed project
  2. Active EE/Ultimate dev licence
  3. Enable the flag in a Rails console:
    Feature.enable(:orbit_code_intelligence)
    # or scope to your user:
    Feature.enable(:orbit_code_intelligence, User.find_by_username('your-username'))

Steps

  1. Open any source file in an Orbit-indexed project (.rb, .go, .ts, etc.)
  2. Confirm the Code Intelligence button appears in the blob header toolbar
  3. Click it — panel opens to the right, blob reflows to ~70% width
  4. Verify the symbol list loads with coloured icons and grey caller-count badges
  5. Click any symbol — detail view opens with back arrow, name/FQN, and Jump to Definition
  6. Check References tab — callers grouped by file with line links
  7. Check Calls tab — outbound calls grouped by file with line links
  8. Click the back arrow — returns to symbol list
  9. Click × — panel closes, blob returns to full width
  10. Use the collapse toggle — panel body collapses, header stays visible
  11. Scroll the page — panel stays sticky with a small gap below the top nav
  12. Negative test: Feature.disable(:orbit_code_intelligence) — button disappears entirely

What to check

  • Panel header aligns flush with the blob file header (no vertical offset gap)
  • code (blue) and formula (purple) icons are visually distinct for Method vs Function
  • Caller badges are grey, not blue
  • Line links navigate to the correct line in the blob
  • Switching files resets the panel state cleanly (no stale symbols from previous file)

🤖 Generated with Claude Code

Edited by Kai Armstrong

Merge request reports

Loading