No description
Adds a full automated test suite with CI. ## Vitest Unit Tests (41 tests) - Extracted `buildRepoTree`, `matchesSearch`, and `splitPath` from the Svelte component into `repo-browser.ts` so they can be unit tested - Tests cover: path splitting, tree construction (nested folders, sorting, file vs folder), search matching (substring, tokenized, subsequence), and all 6 file operation functions (`createFile`, `createDirectory`, `renameFile`, `renameDirectory`, `deleteFile`, `deleteDirectory`) using mocked `FileSystemDirectoryHandle` - Run with: `npm run test:unit` ## Playwright E2E Tests (17 tests) Uses `page.addInitScript` to inject a mock `FileSystemDirectoryHandle` that intercepts `window.showDirectoryPicker` — no real filesystem or browser permission prompt needed. Also stubs `indexedDB` so the mock handles (which can't be structured-cloned) don't break persistence. **app.test.ts** (12 tests): - Page load, title, editor visible - Open folder → folder name in sidebar, file tree appears - Folder/file nodes in tree, selecting a file loads content - Folder expand/collapse - Search filtering and clear - Sidebar collapse/expand **file-ops.test.ts** (5 tests): - Create new file (inline input → Enter → appears in tree) - Create new folder (inline input, Escape to cancel) - Rename file via context menu - Delete file via context menu (with `window.confirm` mock) - Cancel rename with Escape Run with: `npm run test:e2e` ## Forgejo Actions CI (`.forgejo/workflows/ci.yml`) Two jobs on PR and push to main: - **unit**: `npm ci` → `svelte-check` → `vitest run` - **e2e**: `npm ci` → install Chromium → `npm run build` → `playwright test` Failed E2E runs upload the Playwright HTML report as an artifact. Co-authored-by: exe.dev user <exedev@kwila-notebook.exe.xyz> Reviewed-on: #4 Co-authored-by: Kwila Dev Bot <dev-bot@kwila.cloud> Co-committed-by: Kwila Dev Bot <dev-bot@kwila.cloud> |
||
|---|---|---|
| .forgejo/workflows | ||
| assets | ||
| e2e | ||
| scripts | ||
| src | ||
| static/assets | ||
| .gitignore | ||
| AGENTS.md | ||
| justfile | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| svelte.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
Kwila Notebook
A local-first markdown editor built with SvelteKit and OverType.
What's included
- SvelteKit app shell
- OverType markdown editor with toolbar
- live preview and mobile-friendly editing behavior
- local draft persistence in the browser
justrecipes for running, testing, and installing a systemd service
Storage model
- notes are edited as markdown
- the first version stores the draft locally in the browser
- the service runs the built app on port
8000
Planned Work
- Git-based version history and synchronization
- Mobile-friendly interface
- Desktop web experience
- File attachments
- Mermaid diagrams
- Note organization and search
- Offline support
- Backlinks and references
Principles
Kwila Notebook favors:
- permanence over trends
- clarity over complexity
- ownership over platforms
- simple tools that age well
Development
just run
just test
just deploy
License
See LICENSE for license terms.