diff --git a/AGENTS.md b/AGENTS.md index 86f2918..2711343 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,7 +14,7 @@ The name splits into its two halves: **Eterna** for permanence and **Libre** for * **Mission**: Reclaiming high-performance Rust web development under copyleft terms (GPLv3+). Rejecting heavy client-side JavaScript frameworks and proprietary note silos in favor of software freedom, privacy, and near-zero memory footprint. * **UI Paradigm**: **"Apple Elegance meets Classic Desktop GUI"** * **Apple Notes Polish**: Fluid sidebars, smooth note item previews, refined typography, generous padding, subtle contrast, and graceful theme transitions. -* **Traditional Desktop Utility**: Top menu bar (`File`, `Edit`, `View`, `Theme`, `Help`), quick action toolbars, split-pane resizers, keyboard shortcuts, and visible document state. +* **Traditional Desktop Utility**: Top menu bar (`File`, `Edit`, `View`, `Theme`, `Help`), quick action toolbars, collapsible editor/preview panes, keyboard shortcuts, and a status bar. Panes are not draggable/resizable. --- @@ -24,9 +24,9 @@ The application layout follows a classic 3-column / top-menu layout rendered cle ``` +-----------------------------------------------------------------------------------+ -| [File] [Edit] [View] [Theme] [Help] [EternaLibre Notes v0.1] | <-- Classic Menu Bar +| [File] [Edit] [View] [Theme] [Help] [EternaLibre Notes v{CARGO_PKG_VERSION}] | <-- Classic Menu Bar; version is manifest-derived +-----------------------------------------------------------------------------------+ -| [+ New Note] [Delete] | Search... | Theme: [ Dark v ] [Preview] | <-- Apple-style Toolbar +| [+ New Note] [Delete] | Search... | Theme: [ Dark v ] | <-- Apple-style Toolbar +-------------------+-----------------------------------+---------------------------+ | Sidebar | Editor Pane | Live Preview Pane | | ----------------- | --------------------------------- | ------------------------- | @@ -46,7 +46,9 @@ The application layout follows a classic 3-column / top-menu layout rendered cle 1. **Fluid Typography**: Inter/SF Pro or high-quality system sans-serif for the interface; Monospace for Markdown source; clean sans for HTML preview. 2. **Subtle Elevation & Borders**: Soft 1px borders using `--ui-border` / `--app-bg` contrast shades rather than heavy drop shadows. 3. **Apple-style Note List**: Sidebar lists show note title, relative timestamp, and a single line preview snippet in muted text. -4. **Progressive Enhancement**: Note editing, search, theming, and the login form all work with JavaScript disabled, via HTML forms and page reloads. Three things are JS-dependent by design: the menu bar (dropdowns open from an Alpine-driven `.open` class), the mobile tab bar, and live preview. +4. **Progressive Enhancement**: Note editing, server-side search, and the login form work with JavaScript disabled via HTML forms and page reloads. The visible theme selector currently submits through Alpine's change handler, so theme changes from the UI require JavaScript. Menu dropdowns, mobile tab switching, live preview, and automatic opening of the PDF print dialog are also JavaScript-dependent. + +The status bar currently displays `Saved` as a static label; it does not track unsaved editor changes. The toolbar has no separate Preview button: Preview is a pane and a mobile tab. --- @@ -59,14 +61,16 @@ The application layout follows a classic 3-column / top-menu layout rendered cle * **Reactivity / Live Swap**: **Alpine.js 3.14** (vendored locally in `static/`, ~15 KB) * **Markdown Engine**: `pulldown-cmark` (with table, tasklist, strikethrough, and footnote extensions) * **Syntax Highlighting**: `syntect` 5 (for fenced code blocks, themed per active palette) -* **Serialization**: `serde` / `serde_json` +* **Serialization**: `serde` derives for note models * **Dates**: `chrono` * **IDs**: `uuid` v4 -* **Error Handling**: `anyhow` for application errors, `thiserror` for library-style errors +* **Error Handling**: `anyhow` plus the local `AppError` response wrapper. `thiserror` is declared in `Cargo.toml` but is currently unused. * **CLI Parsing**: `clap` 4 (derive API) -* **Static Assets**: `tower-http` `ServeDir` for `/static` +* **Static Assets**: Alpine.js is embedded with `include_bytes!` and served at `/static/alpine.min.js`; `app.js` is embedded and inlined in the notes app page, while `style.css` is embedded and inlined in rendered HTML documents. There is no `ServeDir` or general `/static/*` route. * **License**: **GNU General Public License v3.0 or later** (`GPL-3.0-or-later`). All dependency crates in `Cargo.toml` must be compatible with GPLv3+. +`serde_json`, `thiserror`, and `percent-encoding` are currently declared direct dependencies with no references in `src/`; verify whether they are needed before treating them as active runtime components. + ### Actual Project Structure ``` @@ -129,7 +133,7 @@ The Gentoo palette is ported from Konsole: `Background` and `Foreground` supply ### Theme Selection -The active theme is stored in a `theme` cookie. The server reads it from the `Cookie` header on every request and injects the matching CSS variable block into the `
`. No JavaScript is required to change themes — a plain `