Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b3621b3
feat(detail): plain enter saves the title like every one-line field
nodemode-ai Nov 28, 2026
cb9a227
feat(detail): show the title hint only while the title has focus
nodemode-ai Nov 28, 2026
42846db
feat(look): store the window look in the engine data folder
nodemode-ai Nov 28, 2026
a5ed69f
feat(look): write the saved look into the served index page
nodemode-ai Nov 28, 2026
0af7655
feat(detail): cut the fixed title box at three lines and fade when it…
nodemode-ai Nov 28, 2026
bf0f860
feat(prefs): list fixed height first in the title field select
nodemode-ai Nov 28, 2026
c3c548c
feat(look): read the served look in the pre-paint boot
nodemode-ai Nov 28, 2026
0d55445
feat(look): add a client that saves the look to the engine
nodemode-ai Nov 28, 2026
ade8dde
feat(look): send theme and accent changes to the engine
nodemode-ai Nov 28, 2026
8becd53
feat(trash): show a centered placeholder after restore or delete
nodemode-ai Nov 28, 2026
66637ea
feat(duplicates): say which title a merged set went into
nodemode-ai Nov 28, 2026
a6f993d
chore(splash): remove the unused old splash page
nodemode-ai Nov 28, 2026
6d71da4
docs(look): log the engine held window look
nodemode-ai Nov 28, 2026
47856dc
fix(detail): measure title overflow again when the box changes size
nodemode-ai Nov 28, 2026
d3bec2a
fix(duplicates): say the extra is in the trash for a single merged copy
nodemode-ai Nov 28, 2026
7968e7b
fix(detail): keep the title fade one size so it never shifts
nodemode-ai Nov 28, 2026
4d3d2e1
fix(trash): undo a restore in place without reloading the list
nodemode-ai Nov 28, 2026
9345e36
docs(frontend): log the title keys, fixed title cut and gone placehol…
nodemode-ai Nov 28, 2026
a134eda
docs(notice): say the old splash file was removed
nodemode-ai Nov 28, 2026
9880a7c
chore(release): 0.13.9
nodemode-ai Nov 28, 2026
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
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## 0.13.9

Your theme and settings now stay with your library, the title saves on Enter, and a removed row says what happened.

### New
- **Your look stays put:** the theme, accent and Title field setting are kept with the library's data, not in the browser, and the first frame of the window already shows them. In the desktop app they no longer reset each time it opens. A look chosen in an older version is carried over the first time this one opens.
- **Undo for a restore:** after restoring an item from Trash, "Undo" puts it back in the trash, in place.

### Improved
- **Merged, restored and deleted rows** leave a clear placeholder in their place, for example "Merged into [the kept title]. The extra copy is in the trash.", until the list is next loaded.
- **Fixed-height title:** the box cuts cleanly at three lines, with a soft fade at the bottom only when the title is longer.
- **System appearance:** checked with the system on dark and on light; the window opens in the right theme both ways.

### Changed
- **Enter saves the title,** like the other one-line fields. Shift+Enter and Ctrl or Cmd+Enter still save. The "Enter to save" hint shows only while the title has focus.
- **Preferences** lists "Fixed height" first for the Title field.

### Removed
- The old splash file `splash.html`. The desktop app has used `splash/index.html` since 0.12.0.

### Known issues
- In the desktop app the splash follows the system's light or dark setting, not a named theme: it is shown before the engine has started.
- A merge cannot be undone from the placeholder.

### Under the hood
- The desktop shell was compiled on Linux for the first time for this version and built without errors or warnings. Not run: the packaged desktop app on macOS or Windows.

## 0.13.0

Themes can be picked from one list, the title field has a setting, and removing a row no longer moves the rows below it.
Expand Down
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A file brought over from another Form repository gets a row here with its source
| Source | License | What came over |
| --- | --- | --- |
| formtxt v0.38.0 (`nodemode-dev/formtxt`) | Apache-2.0 | `backend/`: the engine entry, `app/main.py`, `app/core/` (config, runtime, startup, local_guard, window_key), the system router, `boot_backend`, `oc_install` and the requirements files, reduced to a skeleton and renamed; the one-time launch code in `window_key.py` is new. `frontend/`: `vite.config.ts`, `tsconfig.json`, `package.json`, `src/io/api.ts`, `src/io/window-key.ts`, `boot_frontend.bat`. The root launcher, installer and `build_app`, and the `setup/` suite, renamed, with the feature commands removed. `src-tauri/`: the whole shell (configuration, capabilities, entitlements, `build.rs` and the eight Rust sources), renamed, with the launch code added |
| formsubstrate v0.25.4 (`nodemode-dev/formsubstrate`) | GPL-3.0-only | `frontend/`: `index.html` (critical style and theme boot), `public/splash.html`, `src/ui/dom.ts`, `src/ui/icons.ts`, `src/ui/themes.ts`, `src/ui/toast.ts`, the shell styles (`tokens`, `shell`, `light-mode`, `scrollbars`), `oc_install` and `boot_frontend`, all reduced. formsubstrate's own notice credits formvis (Apache-2.0, same owner) as the origin of these shell files. Also `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, `SECURITY.md`, `.github/` and `.claude/settings.json`, rewritten for this repository |
| formsubstrate v0.25.4 (`nodemode-dev/formsubstrate`) | GPL-3.0-only | `frontend/`: `index.html` (critical style and theme boot), `public/splash.html` (removed in 0.13.9, replaced by `public/splash/index.html`), `src/ui/dom.ts`, `src/ui/icons.ts`, `src/ui/themes.ts`, `src/ui/toast.ts`, the shell styles (`tokens`, `shell`, `light-mode`, `scrollbars`), `oc_install` and `boot_frontend`, all reduced. formsubstrate's own notice credits formvis (Apache-2.0, same owner) as the origin of these shell files. Also `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, `SECURITY.md`, `.github/` and `.claude/settings.json`, rewritten for this repository |
| formDAM v1.32.0 (`nodemode-dev/formDAM`) | Apache-2.0 | Patterns, adapted and not copied: the registry of libraries (`backend/app/libraries.py`) and the copy, move or reference import with SHA-256 (`services/libraryfs.py`) behind `backend/app/store/libraries.py` and `files.py`; the connection set-up and saved searches kept as rules in JSON behind `backend/app/store/db.py` and `searches.py` |
| formvfx v0.60.0 (`nodemode-dev/formvfx`) | Apache-2.0 | The way a Rust crate is built into a Python module (`native/fvx-core` and `setup/build_native`), followed in `native/formcite-style` and `setup/build_style`; rewritten, not copied |
| formtxt v0.38.0 (`nodemode-dev/formtxt`), since 0.6.0 | Apache-2.0 | `setup/agents.py`: the install half of FormTxt's `setup/agents.py` (the four agent clients, each config file's format, the timestamped backup, the skill copy), rewritten from it with the sync, manifest and dock parts left out. `backend/app/mcp/stdio.py`: the shape of FormTxt's `setup/mcp_stdio.py` (one JSON-RPC message a line, logs on stderr, the parse error), with the library opened in-process instead of forwarding to a running engine |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
<img alt="version 0.13.0" src="https://img.shields.io/badge/version-0.13.0-eef0f4?style=flat-square">
<img alt="version 0.13.9" src="https://img.shields.io/badge/version-0.13.9-eef0f4?style=flat-square">
<img alt="Python 3.12 or later" src="https://img.shields.io/badge/Python-3.12%2B-3776ab?style=flat-square&logo=python&logoColor=white">
<img alt="License: GPL-3.0-only" src="https://img.shields.io/badge/license-GPL--3.0--only-3a3a3a?style=flat-square">
<img alt="Status: early" src="https://img.shields.io/badge/status-early-d69e2e?style=flat-square">
Expand Down
6 changes: 5 additions & 1 deletion backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for this side of the repo. Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. This file is also the compressed contextual map of this side: read it first, then edit code surgically.

Current build version: v0.13.0
Current build version: v0.13.9
Last updated: 2026-11-27 (US Eastern) · the lean rows route for the window's list and opening an attachment

---
Expand Down Expand Up @@ -1685,3 +1685,7 @@ Opening a stored PDF attachment now hands it to FormPDF by launching the install
## app/routers/pair.py, app/routers/service.py, app/routers/cite_read.py, app/routers/cite_write.py, app/service/ {#app-cite-service-real-run}

Run in v0.12.0 work (2026-11-27), no code changed. A stand-in Python client asked to pair with scope `write`, a click on Approve in the Connections view in headless Chrome approved it, the client collected the token and ran search, get, cite (apa), bibliography (ieee), add and import against a 2,000-item library: 200, 200, 200, 200, 201, 201. Before approval every call was 403 (`none was sent` without a token, `not known` with a made-up one); after Remove access, 403 `was revoked`. Writes by a revoked token are refused in `auth.check` before `_write`, so they are not in `service-log.jsonl`; that matches the rule that a refusal without a valid holder is not logged. An unknown route under `/api/cite/v1` answers Starlette's 404 `Not Found` to GET and 405 to POST; the 405 is a route outside this slice matching the path for GET only. FormCite answers no JSON-RPC codes; -32001 and -32601 belong to the host that wraps these calls. One data folder was shared across the two runs, so the first click on Remove access in the first run hit the older token row; the revoke result above is from a second run aimed at the live token's row by `data-key`.

## app/core/look_store.py, app/routers/look.py, app/main.py {#app-window-look}

New in v0.13.9 (2026-11-27). The window look (mode, dark theme, light theme, accent, title field) lives in `window-look.json` in the data folder, written the same way as `network.json` in `app/net/switches.py`: a temp file in the same folder, `fsync`, `os.replace`, under a lock. Every value is checked against a fixed list (themes match `frontend/index.html` and `ui/themes.ts`; accent is `#rrggbb` lowercased or empty for the default), and anything else is dropped, so the file can never feed a bad value into the page. `state()` adds `saved`, true once the file exists. `GET` and `PUT /api/window/look` both depend on `window_only`. The router is included from `main.py` because `routers/registry.py` belongs to the orchestrator; moving it into the registry is a one-line change there. `main.py` now answers `GET /` and `GET /index.html` itself, before the static mount, with `Cache-Control: no-store`: when the look is saved it adds `data-fc-...` attributes to the first `<html>` tag, each value passed through `html.escape(quote=True)`. No page script is added and the engine sends no Content-Security-Policy header, so nothing about that changes. Checked across ports 8812 and 8822 on one data folder; the numbers are in the frontend entry `src-look-in-engine`.
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.13.0"
__version__ = "0.13.9"
85 changes: 85 additions & 0 deletions backend/app/core/look_store.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import json
import os
import re
import tempfile
import threading
from pathlib import Path
from typing import Any

from app.core.config import data_dir

FILE_NAME = "window-look.json"
MODES = ("system", "light", "dark")
DARK = ("default", "studio", "night", "graphite", "midnight", "forest", "ember", "violet", "slate", "mono", "ocean", "rose", "terminal", "amoled", "contrast")
LIGHT = ("default", "paper", "sand", "sage", "mist", "contrast")
TITLE_FIELDS = ("fixed", "grow")
HEX = re.compile(r"^#[0-9a-fA-F]{6}$")
DEFAULTS: dict[str, str] = {"mode": "system", "dark": "default", "light": "default", "accent": "", "title_field": "fixed"}

_LOCK = threading.Lock()


def path() -> Path:
return data_dir() / FILE_NAME


def _clean(key: str, value: Any) -> str | None:
if not isinstance(value, str):
return None
if key == "mode":
return value if value in MODES else None
if key == "dark":
return value if value in DARK else None
if key == "light":
return value if value in LIGHT else None
if key == "title_field":
return value if value in TITLE_FIELDS else None
if key == "accent":
return value.lower() if value == "" or HEX.match(value) else None
return None


def _read() -> dict[str, Any] | None:
try:
data = json.loads(path().read_text(encoding="utf-8"))
except (OSError, ValueError):
return None
return data if isinstance(data, dict) else None


def _write(data: dict[str, str]) -> None:
target = path()
fd, tmp = tempfile.mkstemp(prefix=".window-look.", suffix=".tmp", dir=target.parent)
try:
with os.fdopen(fd, "w", encoding="utf-8") as handle:
json.dump(data, handle, indent=2)
handle.flush()
os.fsync(handle.fileno())
os.replace(tmp, target)
except BaseException:
Path(tmp).unlink(missing_ok=True)
raise


def state() -> dict[str, Any]:
raw = _read()
out: dict[str, Any] = dict(DEFAULTS)
if raw is not None:
for key in DEFAULTS:
value = _clean(key, raw.get(key))
if value is not None:
out[key] = value
out["saved"] = raw is not None
return out


def update(patch: dict[str, Any]) -> dict[str, Any]:
with _LOCK:
current = {k: v for k, v in state().items() if k in DEFAULTS}
for key in DEFAULTS:
if key in patch:
value = _clean(key, patch[key])
if value is not None:
current[key] = value
_write(current)
return state()
30 changes: 29 additions & 1 deletion backend/app/main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import html
import json
import mimetypes
import os
import re
import time
from contextlib import asynccontextmanager
from pathlib import Path

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles

from app.core import config
from app.core import config, look_store
from app.routers import look as look_routes
from app.core.local_guard import LocalGuard
from app.core.window_key import WindowKeyGuard
from app.routers import registry
Expand Down Expand Up @@ -47,7 +52,30 @@ async def lifespan(_: FastAPI):
app.add_middleware(WindowKeyGuard)
app.add_middleware(LocalGuard, origins=config.cors_origins())
registry.mount(app)
app.include_router(look_routes.router)

_HTML_TAG = re.compile(r"<html\b[^>]*>", re.IGNORECASE)
_NO_STORE = {"Cache-Control": "no-store", "Pragma": "no-cache"}


def _served_index(dist: Path) -> str:
page = (dist / "index.html").read_text(encoding="utf-8")
look = look_store.state()
if not look["saved"]:
return page
attrs = "".join(f' data-fc-{k.replace("_", "-")}="{html.escape(str(look[k]), quote=True)}"' for k in look_store.DEFAULTS)
match = _HTML_TAG.search(page)
if match is None:
return page
tag = match.group(0)
return page[: match.start()] + tag[:-1] + attrs + ' data-fc-saved="1">' + page[match.end():]


_dist = config.dist_dir()
if _dist is not None:
def _index(dist: Path = _dist) -> HTMLResponse:
return HTMLResponse(_served_index(dist), headers=_NO_STORE)

app.add_api_route("/", _index, methods=["GET"], include_in_schema=False)
app.add_api_route("/index.html", _index, methods=["GET"], include_in_schema=False)
app.mount("/", StaticFiles(directory=str(_dist), html=True), name="frontend")
26 changes: 26 additions & 0 deletions backend/app/routers/look.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from fastapi import APIRouter, Depends
from pydantic import BaseModel

from app.core import look_store
from app.routers.service import window_only

GROUP = "look"
router = APIRouter(prefix="/api/window", tags=[GROUP], dependencies=[Depends(window_only)])


class LookPatch(BaseModel):
mode: str | None = None
dark: str | None = None
light: str | None = None
accent: str | None = None
title_field: str | None = None


@router.get("/look")
def read_look() -> dict:
return look_store.state()


@router.put("/look")
def write_look(body: LookPatch) -> dict:
return look_store.update(body.model_dump(exclude_none=True))
Loading
Loading