Skip to content

fix(editor): add 'graph' to the activity bar tab union (Closes #138) - #173

Merged
harsharajkumar-273 merged 1 commit into
harsharajkumar-273:mainfrom
SakethSumanBathini:fix/138-graph-tab-union
Aug 4, 2026
Merged

fix(editor): add 'graph' to the activity bar tab union (Closes #138)#173
harsharajkumar-273 merged 1 commit into
harsharajkumar-273:mainfrom
SakethSumanBathini:fix/138-graph-tab-union

Conversation

@SakethSumanBathini

@SakethSumanBathini SakethSumanBathini commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Closes #138

Opening this per your go-ahead on the issue. As noted there, neither cause in the original report exists on main — this fixes the error that actually breaks the build.

Cause

frontend/package.json defines "build": "tsc -b && vite build", and EditorPage.tsx declares the activity bar tab as a closed union:

useState<'explorer' | 'search' | 'git' | 'problems' | 'import' | 'debug' | 'extensions' | 'history'>('explorer')

'graph' is not a member, but the render branch compares against it:

{activityBarTab === 'graph' && (
  <EditorGraphPane activeFilePath={activeTab?.path} />
)}

That is TS2367 — a comparison between types with no overlap — which tsc -b treats as an error. It fails npm run build, and therefore RUN NODE_OPTIONS=--max-old-space-size=1536 npm run build at line 16 of docker/Dockerfile.nginx, which is the step this issue reports.

It arrived with #152, which added EditorGraphPane and this branch without widening the union.

Change

'graph' added to the union.

Something I found while fixing it

'graph' appears exactly once in EditorPage.tsx — that comparison. There is no setActivityBarTab('graph') anywhere, no entry in the panes array at line ~2022 that backs the command palette, and no activity bar button.

So after this change the build passes, but EditorGraphPane still cannot be opened by any user action — the branch is unreachable. This PR fixes the build failure the issue is about; it does not make the feature usable.

I'd rather flag that than quietly widen the type and leave dead UI. Two options if you want it wired up:

  • add { id: 'graph', label: 'Graph Explorer' } to panes, which makes it reachable from the command palette — a small addition I can fold in here; or
  • add an activity bar button alongside the others, which is a real UI change and belongs in its own PR.

Say which and I'll do it.

Verification

  • npm run build --prefix frontend — full tsc -b && vite build — completes successfully on this branch (2494 modules transformed, built in 19.4s). The same command fails on main with TS2367 at EditorPage.tsx:3197.
  • Diff is 5 insertions, 1 deletion: the union plus a comment recording why 'graph' is a member.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a build issue affecting the graph panel in the editor.
    • The graph view can now be selected and displayed correctly.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c39ec7e-e07a-451d-bb67-1806a28ff904

📥 Commits

Reviewing files that changed from the base of the PR and between 44cd432 and 988e3d1.

📒 Files selected for processing (1)
  • frontend/src/components/EditorPage.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: test
🔇 Additional comments (1)
frontend/src/components/EditorPage.tsx (1)

377-381: LGTM!


📝 Walkthrough

Walkthrough

EditorPage extends the activityBarTab state union with 'graph', matching the existing graph panel render branch and resolving the related TypeScript build error.

Changes

Editor activity bar

Layer / File(s) Summary
Support the graph activity tab
frontend/src/components/EditorPage.tsx
The activityBarTab state accepts 'graph' and includes comments documenting the render-branch type comparison constraint.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: harsharajkumar-273

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change in the PR.
Linked Issues check ✅ Passed The change addresses a frontend TypeScript build error in EditorPage.tsx, matching the issue's goal of fixing the production build.
Out of Scope Changes check ✅ Passed The diff is narrowly scoped to the build fix and does not show unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@harsharajkumar-273 harsharajkumar-273 added ELUSOC Required Tracking VETERAN Advanced (50 pts) labels Aug 4, 2026
@harsharajkumar-273
harsharajkumar-273 merged commit 1a0d246 into harsharajkumar-273:main Aug 4, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ELUSOC Required Tracking VETERAN Advanced (50 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docker] Production Nginx Image Build Fails (Dockerfile.nginx)

2 participants