Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ There are no tests. `.github/workflows/ci.yml` runs `npm ci`, the build (tsc cat
- `src/App.tsx` — the shell. It renders `GlPythonWorkspace` (stacked layout; its buttons go into the bar through `actionsContainer`, every file is a tab with `closeFileTabs: false`) and uses glpython-editor's project helpers (`addProjectFile`, `renameProjectFile`, …).
- `src/index.css` — the shell's styles (`ide-*` classes), from glpython-editor's `--glp-*` tokens. glpython-editor's `style.css` styles only the workspace (plus `icon-button`, `hidden-input` and `auth-notice`, which the shell uses too).
- `src/i18n.ts` — only the shell's own strings (`ShellStrings`, de/en). The workspace's strings come from glpython-editor's `coreStrings`, so don't copy them here. A new workspace string goes into glpython-editor's `src/i18n.ts`.
- `src/projectStorage.ts` (local storage, folder/ZIP) and `src/projectShare.ts` (`?project=` share links, lz-string, versioned payload).
- `src/tabProjects.ts`: per-tab projects (P25). The tab's id is in sessionStorage and `history.state` (never in the address); projects are in localStorage, one entry per id. Nothing is deleted when a tab goes away: a page can't tell a close from iPad Safari unloading it (only `history.state` survives that). Open tabs answer over a BroadcastChannel, which finds duplicated tabs and the projects for «Zuletzt geschlossen».
- `src/projectStorage.ts` (folder/ZIP) and `src/projectShare.ts` (`?project=` share links, lz-string, versioned payload).
- `src/auth.ts` — MSAL. Only active with `VITE_ENTRA_CLIENT_ID` in `.env.local` (README «Microsoft sign-in»).
- `vite.config.ts` — `optimizeDeps.exclude: ['glpython-editor']` keeps the editor's worker next to its `dist/index.js`. Don't remove it.

Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,33 @@ language settings and then remembered per browser via local storage.

## Project persistence

The current project is saved automatically in browser local storage. The
⋮ menu and the bar support:
**Each browser tab has its own project** (as in WebTigerPython), saved
automatically in the browser:

- Opening a share link starts a new tab project; it never replaces the work in
another tab. The address bar then shows only the start page, so there is no
link to copy from it - links come from **Teilen**.
- A reload keeps the tab's project, and so does iPad Safari rebuilding a
background tab. The tab's id is kept in its session storage and its history
entry (`history.state`), never in the address.
- **Closing or reloading** a tab whose project changed since the last
**Teilen** or **Projekt herunterladen** brings the browser's own question
(desktop browsers; iPad Safari never asks).
- A closed tab's project is kept for 14 days: ⋮ **Zuletzt geschlossen** lists
them («Öffnen» in this tab if it holds only the untouched starter, else in a
new tab; «Entfernen»). A new tab offers the last one changed within a day
right away («Zuletzt bearbeitet: auswerter.py (vor 2 Stunden).» · «Öffnen»),
since after quitting Safari or restarting the iPad a tab comes back empty.
- ⋮ **Neues Projekt** gives the tab the starter; opening a folder or a ZIP
gives it that project. The one before goes to «Zuletzt geschlossen».
- The one project the IDE kept before per-tab projects becomes the first
tab's project, once.
- A tab that stays open notices a newer IDE version (`version.json`, written
by the build, checked when the tab comes back into view and every 30
minutes): «Neue Version verfügbar.» · «Neu laden». The code survives the
reload; Python's session doesn't.

The ⋮ menu and the bar support:

- **Ordner öffnen** in browsers with the File System Access API
- **Projekt öffnen** (a ZIP) in all modern browsers with file upload support
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@azure/msal-browser": "^5.22.0",
"glpython-editor": "git+https://github.com/glpython-edu/glpython-editor.git#v0.1.19",
"glpython-editor": "git+https://github.com/glpython-edu/glpython-editor.git#v0.1.20",
"jszip": "^3.10.2",
"lucide-react": "^1.47.0",
"lz-string": "^1.5.0",
Expand Down
Loading
Loading