Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
136f239
fix(list): hidden rows no longer cover the real ones, so a click sele…
nodemode-ai Dec 2, 2026
e619ff1
feat(fulltext): attach the open-access arXiv PDF when an arXiv item i…
nodemode-ai Dec 2, 2026
49a4034
feat(detail): the details pane as a tabbed inspector, with Open PDF, …
nodemode-ai Dec 2, 2026
5c14c8c
feat(shell): the agent and gear buttons at the far right of the top b…
nodemode-ai Dec 2, 2026
7b2ae4b
fix(menus): on a Mac the menus stay in the menu bar; a failed build n…
nodemode-ai Dec 2, 2026
a4e6144
fix(fulltext): stream the PDF to disk with a type, size, host and tim…
nodemode-ai Dec 2, 2026
f0af42f
fix(fulltext): read the PDF a socket read at a time so the download d…
nodemode-ai Dec 2, 2026
dec6345
fix(net): refuse a PDF cut off before its stated length, and turn a b…
nodemode-ai Dec 2, 2026
02c5ac3
feat(prefs): Preferences floats over the window as FormVis's dialog, …
nodemode-ai Dec 2, 2026
77e5b27
fix(shell): Preferences opens as the dialog, so the shell drops its P…
nodemode-ai Dec 2, 2026
a7d8787
feat(views): Items, the details pane, Duplicates, Trash and Needs a t…
nodemode-ai Dec 2, 2026
2292058
feat(views): the details pane opens on the empty state with its main …
nodemode-ai Dec 2, 2026
d8c6123
docs(hashout): why every view fits and none is an empty rectangle
nodemode-ai Dec 2, 2026
c531d43
fix(side): the navigation stays put, and Collections and Tags fold, r…
nodemode-ai Dec 2, 2026
ff4b4cb
docs(hashout): why the sidebar sections fold and scroll on their own
nodemode-ai Dec 2, 2026
9a80887
fix(views): opening and closing the dock moves nothing in the list, t…
nodemode-ai Dec 2, 2026
fe3be31
fix(prefs): Preferences shows and hides at once, with no fade, as the…
nodemode-ai Dec 2, 2026
ed51d0e
chore(release): 0.15.2
nodemode-ai Dec 2, 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
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 0.15.2

On a Mac the menus are in the menu bar only, the agent and Preferences buttons sit at the top right as in FormPortal, Preferences floats over the window as in FormVis, a row in Items opens its details again, and an arXiv paper comes with its PDF.

### Fixed
- **Clicking an item showed "No item selected".** The list keeps spare row boxes for scrolling. A style rule kept them laid out although they were hidden, so on the first screen they lay on top of the real rows and took the click. Hidden rows now take no room and no clicks, and a click or the arrow keys select the item and show its details.
- **On a Mac the window showed a menu bar of its own under the window buttons, and the system menu bar was missing the Library menu.** The system menu bar is now the only one on a Mac. It is built from the same list as the window's bar: FormCite, File, Edit, View, Library, Window and Help. One item the system refuses no longer stops the whole menu being set. If the system menu cannot be built at all, FormCite no longer opens a bar in the window in its place, so 0.15.0's note that it would no longer holds; the keys keep working. View, Menus in Window still puts the bar in the window, from the next start. Windows and Linux keep the bar in the window. If you turned on Menus in Window in 0.15.0, turn it off in View to get the menu bar back.
- **A broken or cut-off answer from a lookup service** is now reported as a network error and listed in Recent calls, where it could stop the engine's answer with an internal error.

### New
- **The paper itself.** Adding an arXiv paper also downloads its open-access PDF from arxiv.org and attaches it, when lookups are allowed and the arXiv service is on. The download is listed in Recent calls as arxiv-pdf, has its own switch in Preferences, Network, and stops at 100 MB or two minutes. If it fails, the item is still added. The details pane has **Open PDF**, which opens it in FormPDF when installed and otherwise in the system viewer, and **Open on arXiv**, which opens the paper's page in your browser. An arXiv item that has no PDF yet shows **Get PDF** in the same place.
- **The details pane is a compact inspector:** Info, Abstract, Tags, Files and Notes, one at a time, with their counts on the tabs. It fits at 1440 by 900 and at 1280 by 800 without scrolling.
- **Agent and Preferences buttons at the top right,** beside Add, with FormPortal's icons, size and spacing. The agent button opens and closes the agent dock and stays lit while it is open. The sidebar head holds only the app icon, name and version.
- **Preferences floats over the window,** as in FormVis: a dimmed window, the section rail at the dialog's left with a line drawn from the chosen section to the dialog, one section at a time, Esc or a click outside to close. It shows and hides at once, with no fade, as in the other Form apps. The gear, the sidebar's Preferences item, Cmd+, (Ctrl+, elsewhere) and the app menu all open it. Every setting is where it was.
- **Empty states with their main actions** in the details pane, an empty list, Duplicates, Trash and Needs a title, so no main area is an empty rectangle.

### Improved
- The list's columns follow its width, so titles have more room on smaller windows.
- **The sidebar no longer scrolls as one long column:** the views stay in place, and Collections and Tags each fold (remembered) and scroll within their own share, with tags shown as chips.
- On a Mac the top-left inset also drops in a window that opens in full screen.

### Known issues
- The open-access PDF attachment through Crossref, for papers known only by a DOI, is not in this release: Crossref points at publishers' own hosts, which FormCite does not call. arXiv papers, including DOIs of the form 10.48550/arXiv.*, get their PDF.
- Not yet seen on a real Mac: the system menu bar, the window buttons and full screen were checked in a stand-in of the Mac shell.

### Under the hood
- `net.fetch_to_file` streams a download to disk with a content type, size, host and time limit. Redirects for the PDF may reach only arxiv.org, and Recent calls lists the last hop. Gzip answers are inflated with a cap. New routes: `GET /api/library/items/{id}/fulltext`, `POST /api/library/items/{id}/fulltext/pdf` and `POST /api/library/items/{id}/open-arxiv`.
- Checked for this version, on Linux x64, on 1 December 2026 (EST):
- the window's type check and production build;
- the backend compile and the style regression set, 12 of 12;
- live arXiv adds with the PDF attached, Get PDF, the switches, and a concurrent Get PDF giving one download;
- fault probes for size, type, gzip, slow and cut-off answers;
- the built window in headless Chrome at four times slower CPU with a stand-in for the Mac desktop shell: the menus, the top bar, Preferences, the details pane and the empty states at 1440 by 900 and 1280 by 800, with no layout shift;
- the Linux desktop shell built and run under a virtual display, where Tauri accepted the full FormCite menu list when the Mac menu path was forced on.
Not run: a build or launch on macOS or Windows.

## 0.15.1

The desktop app opens in a few seconds instead of twenty or more, the Mac window's buttons no longer sit on the FormCite name, arXiv lookups work again, Preferences looks and works like the other Form apps, and the agent dock has its button at the top left.
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.15.1" src="https://img.shields.io/badge/version-0.15.1-eef0f4?style=flat-square">
<img alt="version 0.15.2" src="https://img.shields.io/badge/version-0.15.2-eef0f4?style=flat-square">
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-Vite-3178c6?style=flat-square&logo=typescript&logoColor=white">
<img alt="Python 3.12 or later" src="https://img.shields.io/badge/Python-FastAPI-3776ab?style=flat-square&logo=python&logoColor=white">
<img alt="macOS, Windows, Linux" src="https://img.shields.io/badge/macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-desktop-2f7bf5?style=flat-square">
Expand Down
41 changes: 40 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.15.1
Current build version: v0.15.2
Last updated: 2026-11-27 (US Eastern) · the lean rows route for the window's list and opening an attachment

---
Expand Down Expand Up @@ -1744,3 +1744,42 @@ Before, quoted from `fetch`: `answer = parse(net.fetch_text(SERVICE, QUERY_URL,
## app/lookup/guess.py · old-style arXiv ids and a kind word followed by a space {#app-guess-forms}

New in v0.15.1 (2026-12-01, EST). Checked every form the owner listed against `guess`: `arXiv:2402.06196`, `arxiv:2402.06196v2`, `2402.06196`, `https://arxiv.org/abs/2402.06196`, `https://arxiv.org/pdf/2402.06196v1` (and `.pdf`), `doi:10.x/...`, `https://doi.org/10.x/...`, hyphenated ISBNs and `PMID: 123` were already detected. Two were not: a bare old-style id (`hep-th/9901001` answered "cannot tell what kind of identifier") and a kind word followed by a space instead of a colon (`arXiv 2402.06196`, `DOI 10.1038/...`). `guess` now also tries `ARXIV_OLD` (the pattern `_clean` already used) after the URL and new-style checks, and `PREFIX` takes a space as well as `:` or `=` after the kind word. `ISBN-13: ...` still goes through `ISBN_SHAPE`, since `PREFIX` needs the bare word. Before: `PREFIX = re.compile(r"^\s*(doi|arxiv|isbn|pmid|pubmed)\s*[=:]\s*(.+?)\s*$", re.IGNORECASE)` and `if ARXIV_URL.match(raw) or ARXIV_NEW.match(raw):`.

## app/services/fulltext.py, app/net/fetch.py, app/lookup/arxiv.py, app/services/lookup.py, app/routers/library.py · the paper itself, attached {#app-fulltext-pdf}

New in v0.15.2 (2026-12-01, EST). The owner added arXiv 2402.06196 and had no way to read the paper. Adding an arXiv item now also attaches its open-access PDF from `https://arxiv.org/pdf/<id>`. It is fetched through `net` like every other call, so it needs lookups allowed and the `arxiv` service on (`net.check(arxiv.SERVICE)`), and it is its own registered service, `arxiv-pdf` on `arxiv.org`, with its own switch, 3 s pace and a row in Recent calls. `fetch.py` gains `fetch_bytes(service, url, limit=...)`; `_read`, `_once`, `_call` and `_request` take a `limit` (default the old 5 MB) and `_read` now refuses early on a `Content-Length` over it. The PDF limit is 100 MB, the same as `routers/upload.py` `MAX_BYTES` for a dropped PDF. The body must start with `%PDF-`. It is written to a temporary file and stored with `library.attachment_add(..., "copy", "arXiv-<id>.pdf")`, the existing content-addressed store, and the temporary file is removed. An item that already has a PDF attachment is left as it is.

`lookup.add` calls `fulltext.try_fetch_pdf` after the item's transaction and session are closed (the library session lock is not re-entrant), only for `source.kind == "arxiv"`, and returns its result as `pdf`: `{"attached": true, "attachment": ...}` or `{"attached": false, "error": "..."}`. A failure never undoes the add. New routes: `GET /api/library/items/{id}/fulltext` (`arxiv_id`, `arxiv_url`, `pdf_attachment_id`, `can_fetch_pdf`) and `POST /api/library/items/{id}/fulltext/pdf` (the window key guard covers the POST). The arXiv id comes from the record's `number` (`arXiv:...`), an arxiv.org abs or pdf URL, or a `10.48550/arXiv.*` DOI, read with `arxiv_id.clean`.

Not done: an open-access PDF from Crossref for other DOIs. Crossref's `link` entries point at publisher hosts (for example `dx.plos.org` with `intended-application: similarity-checking` for 10.1371/journal.pone.0000308), and FormCite only calls hosts a registered service declares, so following them would mean declaring arbitrary publisher hosts; that is not simple, so it was left out. Checked live: adding 2402.06196 attached `arXiv-2402.06196.pdf` (4,882,035 bytes) in about 1 s, Recent calls listed `arxiv-pdf arxiv.org /pdf/2402.06196 200`; with `arxiv-pdf` switched off, adding hep-th/9901001 still added the item and returned the switch-off message as `pdf.error`, and `fulltext/pdf` attached it once switched back on.

`services/opener.py` `open_arxiv(item_id)` and `routers/window.py` `POST /api/library/items/{id}/open-arxiv` (behind `window_only`, like opening an attachment): the URL is only ever `https://arxiv.org/abs/<id>` built from the item's own arXiv id through `fulltext.links`, never a URL from the request, and it is opened with `open` on macOS, `xdg-open` on Linux and `os.startfile` on Windows.

### The engine-tests review of the PDF fetch, and what changed (v0.15.2, 2026-12-01, EST)
The engine-tests role found seven faults in 2700267 (E1 to E7 in `handoff/fc152-requests.md`). All seven are fixed:
- **E1, two attachments from a double click.** `fetch_pdf` now runs under a per-item `threading.Lock` (`_item_lock`) and checks for a PDF again inside the lock. Two threads at once gave one download and `already: [False, True]`.
- **E2, a redirect to any declared host.** `_next_url` takes `hosts`, and `fetch_to_file` passes `PDF_HOSTS` (`arxiv.org`, `export.arxiv.org`), so the PDF call can never land on Crossref, PubMed and the like.
- **E3, Recent calls named only the first URL.** `_call` collects every hop in `hops`, and `_request` records the last one.
- **E4, no content-type check.** The streaming reader requires `Content-Type: application/pdf` before reading a byte, then `%PDF-` on the file.
- **E5, gzip inflated in full before the cap.** `_read` inflates through `zlib.decompressobj(...).decompress(body, limit + 1)` and refuses on an unconsumed tail. The streaming path asks for `Accept-Encoding: identity` and refuses any other encoding.
- **E6, the whole PDF in memory.** `net.fetch_to_file` streams 1 MiB chunks into the `mkstemp` file, counts the bytes against the 100 MB cap, and `fulltext` checks the magic on the file before `attachment_add`.
- **E7, no overall time limit.** The urllib timeout is now 30 s per read, and the chunk loop also stops at a 120 s total.

`fetch_bytes` is gone. `_once` and `_call` now take a `read` callable instead of `limit`. The text and JSON paths use `_read` as before.

Checked: 2402.06196 attached through the stream (Recent calls `arxiv-pdf /pdf/2402.06196 200`), nature12373 added through the JSON path, and no `formcite-pdf-*` file was left.

**E7, re-check.** The engine-tests re-check found the deadline still checked only once per full MiB: `HTTPResponse.read(n)` waits for all n bytes, up to 30 s on each socket read. A server sending 1 byte every 0.5 s held a 3 s deadline for 12 s. The chunk loop now calls `response.read1(CHUNK)`, which returns after one socket read, so the deadline is checked each time data arrives (3.0 s in the same test). Before: `chunk = response.read(CHUNK)`.

**E10.** `read1` returns `b""` when a length-delimited body ends early, so a cut-off PDF passed. The loop now raises "the download stopped early, after N of M bytes" when a declared `Content-Length` was not reached.

**E11.** `http.client.HTTPException`, for example `IncompleteRead` from a broken chunked body, escaped `_once`. That meant a 500, no Recent calls row, and an Add that answered 500 after committing its item. `_once` now turns it into a `NetworkError`, for the text and JSON lookups as well.

**E9 (cosmetic) is left as it is:** `get_content_type()` reports `text/plain` for an answer with no type, so it is refused with that wording.

**E8, not in 0.15.2:** Crossref open-access PDFs.

Before, quoted:
- `body = gzip.decompress(body)`;
- `body = net.fetch_bytes(arxiv.PDF_SERVICE, f"{arxiv.PDF_URL}{identifier}", limit=MAX_BYTES, accept=PDF_MIME)`;
- `with os.fdopen(fd, "wb") as handle: handle.write(body)`.
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.15.1"
__version__ = "0.15.2"
13 changes: 12 additions & 1 deletion backend/app/lookup/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
KIND = "arxiv"
SERVICE = "arxiv"
OAI_SERVICE = "arxiv-oai"
SERVICES = (SERVICE, OAI_SERVICE)
PDF_SERVICE = "arxiv-pdf"
SERVICES = (SERVICE, OAI_SERVICE, PDF_SERVICE)
HOST = "export.arxiv.org"
OAI_HOST = "oaipmh.arxiv.org"
PDF_HOST = "arxiv.org"
QUERY_URL = f"https://{HOST}/api/query"
OAI_URL = f"https://{OAI_HOST}/oai"
PDF_URL = f"https://{PDF_HOST}/pdf/"
ABS_URL = f"https://{PDF_HOST}/abs/"
INTERVAL_SECONDS = 3.0

net.register(
Expand All @@ -31,6 +35,13 @@
"https://info.arxiv.org/help/oa/index.html",
interval=INTERVAL_SECONDS,
)
net.register(
PDF_SERVICE,
PDF_HOST,
"Download a preprint's open-access PDF from arXiv to attach it to the item, only while the arxiv service is also on.",
"https://info.arxiv.org/help/bulk_data.html",
interval=INTERVAL_SECONDS,
)

__all__ = ["KIND", "SERVICES", "clean", "fetch"]

Expand Down
6 changes: 3 additions & 3 deletions backend/app/net/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from app.net.errors import NetworkError, NetworkOff, RemoteNotFound
from app.net.fetch import fetch_json, fetch_text
from app.net.fetch import fetch_json, fetch_text, fetch_to_file
from app.net.services import register
from app.net.switches import contact
from app.net.switches import check, contact

__all__ = ["NetworkError", "NetworkOff", "RemoteNotFound", "contact", "fetch_json", "fetch_text", "register"]
__all__ = ["NetworkError", "NetworkOff", "RemoteNotFound", "check", "contact", "fetch_json", "fetch_text", "fetch_to_file", "register"]
Loading
Loading