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 .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
out
.gitignore
test-results
playwright-report
11 changes: 2 additions & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { error } = require('console')

module.exports = {
extends: [
'eslint:recommended',
Expand All @@ -8,14 +6,9 @@ module.exports = {
'@electron-toolkit/eslint-config-ts/recommended',
'@electron-toolkit/eslint-config-prettier'
],
settings: { react: { version: 'detect' } },
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'prettier/prettier': [
'error',
{
endOfLine: 'auto'
}
]
'prettier/prettier': ['error', { endOfLine: 'auto' }]
}
}
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Bug report
description: Something in NoteMark isn't working as expected
labels: [bug]
body:
- type: textarea
id: what
attributes:
label: What happened?
description: What did you do, what did you expect, and what happened instead?
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
placeholder: |
1. Create a note called ...
2. Type ...
3. See ...
- type: input
id: version
attributes:
label: NoteMark version
placeholder: 2.0.0
- type: dropdown
id: os
attributes:
label: Operating system
options: [Windows, macOS, Linux]
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Feature request
description: Suggest an idea for NoteMark
labels: [enhancement]
body:
- type: textarea
id: problem
attributes:
label: What problem would this solve?
validations:
required: true
- type: textarea
id: idea
attributes:
label: What would you like to happen?
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## What does this change?

## How was it tested?

- [ ] `npm run verify` passes
- [ ] Tried it in the app (`npm run dev`)
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
verify:
name: Typecheck, lint, test and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run verify
- run: npx electron-vite build
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

# Push a version tag (e.g. `git tag v2.0.0 && git push origin v2.0.0`) to build installers for
# Windows, macOS and Linux. They are attached to a draft GitHub Release you can review and publish.
on:
push:
tags: ['v*']
workflow_dispatch:

permissions:
contents: write

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: --win
- os: macos-latest
target: --mac --x64 --arm64
- os: ubuntu-latest
target: --linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run build
- name: Package and upload to the draft release
run: npx electron-builder ${{ matrix.target }} --publish always
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ dist
out
.DS_Store
*.log*
test-results
playwright-report
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
out
dist
pnpm-lock.yaml
package-lock.json
LICENSE.md
tsconfig.json
tsconfig.*.json
context
47 changes: 47 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# AGENTS.md

Instructions for AI coding agents working on NoteMark. Read this first, then `context/` as needed.
After any meaningful change to this project, update this file, `context/PROGRESS_TRACKER.md`, and the
"Project Overview" section of `README.md` to reflect the current state. Do this proactively, without being asked.

## Overview

Electron desktop app for local-first Markdown notes. Each note is `<title>.md` directly inside the
notes folder (`~/NoteMark` by default); there is no database.

## Tech stack

Electron 45 + electron-vite 2 (Vite 5), React 18, TypeScript, Jotai, MDXEditor 3 (Lexical), cmdk,
Sonner, Tailwind CSS 3 + Typography, marked (export), Vitest 3, Playwright (Electron e2e). npm, Node ≥ 22.12.

## Commands

- Install: `npm install` (this machine has npm `ignore-scripts=true`; afterwards run `node node_modules/electron/install.js`)
- Dev: `npm run dev` · set `NOTEMARK_NOTES_DIR` / `NOTEMARK_USER_DATA` to keep real notes and settings out of it
- Verify: `npm run verify` (typecheck + lint + unit tests; same as CI)
- E2E: `npm run test:e2e` (builds first) · screenshots: `NOTEMARK_SCREENSHOTS=1 npx playwright test screenshots`
- Package: `npm run build:win` / `build:mac` / `build:linux`; release = push a `v*` tag (draft GitHub Release)
- Icon/social preview: `node scripts/render-assets.mjs` (sources: `build/icon.svg`, `scripts/social-preview.html`)

## Conventions

- Renderer never calls Node/Electron. New capability = method on `NoteMarkApi` (`src/shared/types.ts`) + channel in `ipcChannels` + handler in `src/main/lib/ipc.ts` + action in `src/renderer/src/store/actions.ts`.
- Components call actions, not `window.context`. State lives in the single jotai `appStore` (`store/atoms.ts`).
- File logic in `src/main/lib/notes.ts` takes the notes folder as its first argument and must not import Electron (it is unit-tested on temp dirs). Every path goes through `notePath()`.
- Pure helpers go in `src/shared/notes.ts` with tests in `notes.test.ts`.
- Autosave: always via `createAutosaver`; never write a note directly from a component. Rename/delete use `holdEdits`/`releaseEdits`.
- Colours only via tokens (`bg-canvas`, `text-muted`, `fg/10`, `accent`); see `context/UI_TOKENS.md`.
- Commits use gitmoji + conventional type (`✨ feat: ...`).
- Shell gotcha: a local guard hook blocks commands containing the word "format".

## Boundaries

- Don't loosen the CSP in `src/renderer/index.html`, `sandbox: true`, or the `isSafeExternalUrl` checks.
- Don't change the default notes folder name (`appDirectoryName`): existing users' notes live there.
- `docs/screenshots/*` and `build/icon.png` are generated; regenerate rather than hand-edit.

## More

- `README.md`: plain-language overview, features, shortcuts
- `context/PROGRESS_TRACKER.md`: current state and session log
- `context/ARCHITECTURE.md`, `context/LIBRARY_DOCS.md`, `context/UI_TOKENS.md`, `context/BUILD_PLAN.md`
Binary file removed App Screenshot.png
Binary file not shown.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog

All notable changes to NoteMark. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [2.0.0] - 2026-11-05

A rewrite of almost every part of the app.

### Added

- Full Markdown editor toolbar: tables, code blocks with syntax highlighting, links, images, checklists, horizontal rules and a raw source mode.
- Command palette (`Ctrl/⌘ + P`) to open notes, search inside every note and run commands.
- Instant note creation with inline naming, and rename from the title bar (`F2`).
- Export notes to PDF or HTML.
- Right-click menu on notes: rename, show in folder, export, delete.
- Light, dark and system themes; a custom title bar; focus mode.
- Sidebar filter, note previews, relative edit times, word count and reading time, save status.
- Changes made to the notes folder by other apps appear automatically.
- Choose a different notes folder. Window size, position, theme and last open note are remembered.
- Unit tests (Vitest), end-to-end tests (Playwright), CI and tag-based release builds for Windows, macOS and Linux.
- A new app icon.

### Changed

- Deleting a note moves it to the system trash instead of removing it permanently.
- Autosave waits until you pause typing, is tied to the note being edited, and finishes before the window closes.
- Upgraded to Electron 45 and switched from Yarn to npm.

### Fixed

- Edits could be saved into the wrong note when switching notes quickly.
- The selected note could change when the list re-sorted.
- Note titles could point outside the notes folder.
- Edit times were shown in UTC instead of local time.
- The welcome note reappeared whenever the folder was empty.

## [1.0.0] - 2024-04-30

- First release: a sidebar of Markdown notes with a WYSIWYG editor and autosave.

[2.0.0]: https://github.com/AbdulDevHub/NoteMark/releases/tag/v2.0.0
[1.0.0]: https://github.com/AbdulDevHub/NoteMark/commits/main
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing to NoteMark

Thanks for taking the time to help. Bug reports, ideas and pull requests are all welcome.

## Reporting bugs and ideas

Use the [issue templates](https://github.com/AbdulDevHub/NoteMark/issues/new/choose). For bugs, include your OS, the NoteMark version and the steps that trigger the problem.

## Local setup

You need Node.js 22.12 or newer.

```bash
npm install
npm run dev
```

While developing, point the app at a scratch folder so your real notes stay untouched:

```bash
# macOS / Linux
NOTEMARK_NOTES_DIR=/tmp/notemark-dev npm run dev
# Windows (PowerShell)
$env:NOTEMARK_NOTES_DIR="$env:TEMP\notemark-dev"; npm run dev
```

## Before opening a pull request

```bash
npm run verify # typecheck, lint, unit tests (CI runs the same)
npm run test:e2e # builds the app and drives it with Playwright
```

- Keep pull requests focused on one change.
- Add or update tests when you change behaviour. Pure logic belongs in `src/shared/` or `src/main/lib/` where it is easy to unit test.
- The renderer must not use Node or Electron APIs directly. Add a typed method to `NoteMarkApi` in `src/shared/types.ts`, handle it in `src/main/lib/ipc.ts`, and call it from `src/renderer/src/store/actions.ts`.
- If you change the UI, regenerate the README screenshots: `npm run build`, then `NOTEMARK_SCREENSHOTS=1 npx playwright test screenshots`.

## Project layout

```
src/main/ Electron main process: window, IPC handlers, file layer, export, watcher
src/preload/ The typed bridge exposed to the page as window.context
src/renderer/ React UI: components, Jotai store, autosave
src/shared/ Types and pure helpers used by both sides
e2e/ Playwright tests that launch the real app
```
Loading
Loading