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
CrudComponentas 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_intelligenceflag (actor-scoped tocurrent_user) and:orbitlicensed feature on blobshow
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
- GDK with an Orbit-indexed project
- Active EE/Ultimate dev licence
- 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
- Open any source file in an Orbit-indexed project (
.rb,.go,.ts, etc.) - Confirm the Code Intelligence button appears in the blob header toolbar
- Click it — panel opens to the right, blob reflows to ~70% width
- Verify the symbol list loads with coloured icons and grey caller-count badges
- Click any symbol — detail view opens with back arrow, name/FQN, and Jump to Definition
- Check References tab — callers grouped by file with line links
- Check Calls tab — outbound calls grouped by file with line links
- Click the back arrow — returns to symbol list
- Click × — panel closes, blob returns to full width
- Use the ∧ collapse toggle — panel body collapses, header stays visible
- Scroll the page — panel stays sticky with a small gap below the top nav
- 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) andformula(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)
Edited by Kai Armstrong