You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/vscode/CLAUDE.md
+52-2Lines changed: 52 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,14 @@
2
2
3
3
## Project Overview
4
4
5
-
This is a VS Code extension that provides a custom Jupyter Notebook editor with integrated Datalayer platform authentication. It uses the `@datalayer/jupyter-react` component library and supports both local Jupyter servers and the Datalayer cloud platform.
5
+
This is a VS Code extension that provides a custom Jupyter Notebook editor with integrated Datalayer platform authentication and a Spaces tree view for managing cloud documents. It uses the `@datalayer/jupyter-react` component library and supports both local Jupyter servers and the Datalayer cloud platform.
6
6
7
7
## Architecture
8
8
9
9
-**Extension Code** (`src/`): Runs in VS Code's Node.js context, handles authentication and server communication
10
10
-**Webview Code** (`webview/`): Runs in an iframe, contains the React-based notebook editor
11
11
-**Authentication System** (`src/auth/`): Token-based authentication with GitHub profile enrichment
12
+
-**Spaces Tree View** (`src/spaces/`): Explorer sidebar for browsing Datalayer spaces and documents
12
13
-**Communication**: Message passing between extension and webview with JWT token injection
13
14
14
15
## Development Setup
@@ -20,11 +21,25 @@ This is a VS Code extension that provides a custom Jupyter Notebook editor with
20
21
21
22
## Key Components
22
23
24
+
### Core Extension
25
+
23
26
-`src/extension.ts`: Main extension entry point with auth command registration
27
+
-`src/notebookEditor.ts`: Custom editor provider with authenticated connections
28
+
29
+
### Authentication System
30
+
24
31
-`src/auth/authService.ts`: Authentication service with secure token storage
25
32
-`src/auth/githubService.ts`: GitHub profile enrichment service
26
33
-`src/auth/tokenProvider.ts`: User interface for authentication flows
27
-
-`src/notebookEditor.ts`: Custom editor provider with authenticated connections
34
+
35
+
### Spaces Tree View
36
+
37
+
-`src/spaces/spacesTreeProvider.ts`: Tree data provider for Datalayer spaces
38
+
-`src/spaces/spacerApiService.ts`: API service for fetching spaces and documents
39
+
-`src/spaces/spaceItem.ts`: Data models for tree items
40
+
41
+
### Webview
42
+
28
43
-`webview/NotebookVSCode.tsx`: React component for the notebook UI
29
44
-`webview/serviceManager.ts`: Handles Jupyter service connections with JWT tokens
30
45
@@ -70,6 +85,9 @@ This is a VS Code extension that provides a custom Jupyter Notebook editor with
70
85
-`datalayer.login`: Authenticate with Datalayer platform
71
86
-`datalayer.logout`: Sign out and clear credentials
72
87
-`datalayer.showAuthStatus`: View authentication status
88
+
-`datalayer.refreshSpaces`: Refresh the Spaces tree view
89
+
-`datalayer.openDocument`: Open a document from the Spaces tree
90
+
-`datalayer.createNotebookInSpace`: Create a new notebook in a selected space
73
91
74
92
## Configuration
75
93
@@ -89,3 +107,35 @@ This is a VS Code extension that provides a custom Jupyter Notebook editor with
89
107
90
108
- View Type: `datalayer.jupyter-notebook`
91
109
- File Pattern: `*.ipynb`
110
+
111
+
## Spaces Tree View
112
+
113
+
The extension includes a tree view in the Explorer sidebar that displays:
114
+
115
+
- User's Datalayer spaces (with default space marked)
116
+
- Documents within each space:
117
+
- Notebooks (`.ipynb` files)
118
+
- Lexical documents (`.lexical` files)
119
+
- Exercises and other document types
120
+
- Real-time sync with the Datalayer platform
121
+
- Context menu actions for creating new notebooks
122
+
123
+
### API Endpoints Used
124
+
125
+
-`/api/spacer/v1/spaces/users/me` - Get user's spaces
126
+
-`/api/spacer/v1/spaces/{id}/items` - Get items in a space
127
+
-`/api/spacer/v1/notebooks` - Create new notebooks
0 commit comments