Skip to content

Remove Phoenix & Notebooks - Phase 2: Remove in-app notebook authorin…#2515

Draft
jawelton74 wants to merge 1 commit into
masterfrom
users/jawelton/removenotebooks-phase2-061526
Draft

Remove Phoenix & Notebooks - Phase 2: Remove in-app notebook authorin…#2515
jawelton74 wants to merge 1 commit into
masterfrom
users/jawelton/removenotebooks-phase2-061526

Conversation

@jawelton74

@jawelton74 jawelton74 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Preview this branch

Summary

This PR implements Phase 2 of the multi-phase effort to remove the Notebooks / Phoenix / Juno / GitHub feature set from Cosmos Explorer, while preserving the database shell terminals (which now run purely on CloudShell after Phase 1).

Phase 2 removes the in-app notebook authoring and rendering experience: the nteract rendering engine, notebook tabs, panes, the read-only notebook viewer, the Schema Analyzer (pulled forward from Phase 3 because it renders through the same engine), and all UI entry points that open notebooks.

Surviving files that are still needed by later phases (GitHub in Phase 4; Phoenix / notebook container core in Phase 5) are decoupled with minimal edits rather than deleted.

Net change: 108 files changed, ~148 insertions, ~14,500 deletions.

What changed

Deleted — rendering engine & content

  • src/Explorer/Notebook/NotebookComponent/, NotebookRenderer/, SecurityWarningBar/
  • NotebookClientV2.ts (+ notebookClientV2.test.ts), NTeractUtil.ts, NotebookContentClient.ts, FileSystemUtil.ts

Deleted — tabs, panes, viewers

  • src/Explorer/Tabs/NotebookV2Tab.ts, NotebookTabBase.ts, SchemaAnalyzerTab.ts
  • src/Explorer/Panes/CopyNotebookPane/, src/Explorer/Panes/StringInputPane/ (became unused once renameNotebook / onCreateDirectory were removed)
  • src/Explorer/Controls/NotebookViewer/, src/CellOutputViewer/

Deleted — Schema Analyzer (pulled forward from Phase 3)

  • src/Explorer/Notebook/SchemaAnalyzer/ and its tab/command-bar/tree entry points

Decoupled — surviving files (full removal deferred to Phase 5)

  • Explorer.tsx — removed notebook authoring methods (openNotebook, import/copy/rename/createDir/read/download/upload/delete/refresh, notebookToImport); refreshNotebookList reduced to a no-op; kept openNotebookTerminal / connectToNotebookTerminal and the Phoenix container methods.
  • NotebookManager.tsx — stripped content-provider / content-client / CopyNotebookPane / Schema Analyzer usage; kept GitHub / Juno / NotebookContainerClient wiring.
  • useNotebook.ts — removed the notebook content-client tree initialization block.
  • ResourceTreeAdapter.tsx — neutralized the dead "My Notebooks" file/dir context-menu actions and refresh handlers that called removed Explorer methods.
  • useTabs.ts — dropped the NotebookTabV2 import; closeAllNotebookTabs now uses TabsBase (still closes Terminal tabs).
  • Contracts/ViewModels.ts — removed the onSchemaAnalyzerClick interface method (CollectionTabKind enum values retained for Phase 6 cleanup).
  • OpenActions.tsx — removed OpenSampleNotebook and Schema Analyzer branches.
  • MostRecentActivity.ts — removed the OpenNotebook type/item; migration and getItems now filter out stale notebook entries.
  • SplashScreen.tsx — removed notebook recent-activity rendering and unused notebook icon import.

Config

  • webpack.config.js — removed the cellOutputViewer entry, its HTML plugin, and the now-unused InlineChunkHtmlPlugin / HTMLInlineCSSWebpackPlugin.
  • tsconfig.strict.json — removed entries for deleted files (kept NotebookContentItem.ts, deferred to Phase 5).
  • jest.config.js — removed the orphaned @nteract/stateful-components module mapper.
  • package.json — removed 22 zero-importer notebook-only deps (@jupyterlab/*, @phosphor/widgets, and unused @nteract/*). Deferred @nteract/core, @nteract/commutable, @nteract/markdown, @nteract/fixtures, and rx-jupyter (still imported by surviving GitHub / markdown code).
  • patches/ — removed the obsolete @phosphor+virtualdom+1.2.0.patch; @phosphor/virtualdom was a transitive dep of the removed @phosphor/widgets and is no longer installed, so patch-package (postinstall) failed until it was deleted.

⚠️ Phantom (transitively-hoisted) dependencies

Removing the @nteract/* packages stripped several packages that surviving code still imports but were never declared directly (they were hoisted transitively). These were re-added as explicit direct dependencies:

Package Version Used by (kept code)
xterm 4.19.0 CloudShell terminal
xterm-addon-fit 0.5.0 CloudShell terminal
d3-collection 1.0.7 Graph D3ForceGraph
@nteract/myths 0.1.9 kept @nteract/core

Note: tsc passed even when these were missing, but Jest and Webpack failed with Cannot find module. This gotcha will recur in Phases 4/5 as more deps are removed.

Tests

  • Updated NotebookUtil.test.ts (removed the findCodeCellWithDisplay test + nteract fixtures) and OpenActions.test.tsx (removed onSchemaAnalyzerClick).
  • Regenerated 3 Jest snapshots (SettingsComponent, AddGlobalSecondaryIndexPanel, GitHubReposPanel) — each change is solely the removal of the now-deleted copyNotebook function from the serialized Explorer object.
  • Snapshots for deleted components were removed with their directories.

Verification

All checks pass:

Check Result
npm run compile ✅ 0 errors
npm run compile:strict ✅ 0 errors
npm run lint ✅ 0 errors (pre-existing warnings only)
npm run format:check ✅ pass
npm test ✅ 1945 passing, 190 snapshots
npm run build:ci (webpack) ✅ exit 0

Scope / follow-ups

  • Phase 3 (Schema Analyzer) was folded into this PR — no separate work remains.
  • Phase 4 — remove GitHub integration (src/GitHub/, GitHub panel/OAuth, GitHubUtils) and the deferred @nteract/core/commutable/fixtures deps.
  • Phase 5 — remove Phoenix + the notebook container/allocation core and the remaining deferred files (NotebookContentItem.ts, NotebookUtil.ts, useNotebook, "My Notebooks" tree in ResourceTreeAdapter).
  • Phase 6 — clean up residual enums (CollectionTabKind) and leftover comments.

See docs/remove-notebooks-plan.md for the full phased plan.

…g & rendering

Delete the nteract rendering engine, notebook tabs, panes, the read-only viewer, Schema Analyzer (pulled forward from Phase 3), and all UI entry points that open notebooks. Decouple surviving files (Explorer, NotebookManager, useNotebook, ResourceTreeAdapter) with minimal edits, keeping GitHub/Juno/Phoenix wiring for later phases.

Removed 22 zero-importer notebook-only npm deps; re-added phantom transitively-hoisted deps still used by surviving code: xterm, xterm-addon-fit (CloudShell), d3-collection (Graph), @nteract/myths (@nteract/core).

Verified: compile, compile:strict, lint (0 errors), format:check, test (1945 passing), build:ci all green.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Playwright tests ✅ passed

Passed Failed Flaky Duration
642 0 14 994s

📁 Report: 27557296949-1/report.zip
Open container (Azure sign-in required) → click into 27557296949-1 folder → click report.zipDownload → unzip → open index.html · Workflow run

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.

1 participant