diff --git a/CHANGELOG.md b/CHANGELOG.md index febb173..e44f17b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## 0.15.0 + +FormCite now builds into a desktop app for macOS, Windows and Linux, and the window gains a menu bar, a Home screen, Preferences in sections, a right-click menu on items, an agent dock, and three demo libraries with templates to start from. + +### New +- **A menu bar** in the window: FormCite, File, Edit, View, Library and Help (and Window in the desktop app on Linux and Windows), with the keys shown beside each item. On a Mac the same list is the system menu bar, and Preferences has a Menus in Window switch for people who want it inside the window instead. A menu taller than the window scrolls, with a hint at the foot while there is more below. +- **A right-click menu on an item row:** Open Attachment, Copy Citation, Copy Bibliography Entry and Move to Trash. The citation and the entry are made in the first common style (APA) and copied. +- **Home**, the start screen: Add by identifier, Import a file and Choose a PDF in one place, with a drop area for a PDF, the counts of your items, unfiled items, collections and tags, and your newest collections to open. General in Preferences has Show Home at launch; turn it off and FormCite opens on Items. Home is also in the side panel and in the File menu. +- **Preferences in sections:** a rail with General, Appearance, Network, Libraries and Agents, each section folding in place, and Menus on a Mac. Every setting that was there is still there, in the same words. +- **An agent dock** (View, Agent Dock, or Ctrl+J, Cmd+J on a Mac): shell tabs that the engine starts on your computer, and a tab for Claude Code, Codex, Cursor or Antigravity when that program is installed. Each agent tab gets its own token, which is revoked when the tab closes. Only the FormCite window can open or use one. The dock asks no question of its own: an outside agent is still approved by pairing under Connections. Preferences, Agents has a switch to show the dock, and whether it is open is remembered with your library. +- **Three demo libraries** in `demos/`: a thesis on urban heat (260 references), a history reading list (215) and a cell biology lab's methods library (240), each with collections, tags and notes, ready to open, and each also as a BibTeX file. The references are invented. `demos/README.md` says how to open one. +- **Templates** in `templates/`: 41 citation styles to format with as your own style file, 40 of them unmodified from the Citation Style Language project (CC BY-SA 3.0, credited in `templates/CREDITS.md`), and 10 library starters with collections and tags already in place, for a thesis, a grant, a course, a systematic review and more. + +### Improved +- **The Form look:** glass surfaces and the family's token names and layer order across the window, in dark and light and in every theme. Your theme, accent and the new Home, menu and dock choices are kept with the library and are on the first frame the window paints. + +### Fixed +- **The desktop app could not be built, and no packaged FormCite had ever started.** The build stopped at its last step because the desktop tool it calls was never listed among the window's packages. Behind that, the engine inside the app had been packed with almost none of its own code, so it failed its own check on start. Its database schema files were left out as well, which would have given every library with no tables. On Windows the engine needed time zone data it did not carry. The build also used whichever Python was newest on the machine. All of that is fixed, and the desktop shell now finds the engine by a port it hands over, not by a line on the engine's console. A build now ends in a `.deb`, an `.rpm` and an AppImage on Linux; see "Checked for this version". +- **A false error at start:** the window could show "The engine did not accept this window. Relaunch FormCite." although it had been accepted, and a window opened in a browser could lose its key and then be refused every change. The window now claims its key once, and every part waits for that one answer. +- **Switching library left the old one's collections and tags** in the side panel. It now loads the new library's. +- **The item list after a search** could show rows from the earlier search under the new count, for example "8 items" over ten rows, when the answer to a new search arrived before the old one had been cleared. The list now waits for the first page of its own search, ignores older answers, and holds no row past the count. The fault could not be made to happen on demand, so this follows the cause found in the code and the checks that followed it. +- **The Needs a title view** had lost the line height of its rows. They have it again. +- **On a Mac, if the system menu could not be built,** the window's own menu bar now opens in its place. +- **Stopping the engine now closes the dock's tabs and their tokens** instead of leaving them to the next start. + +### Known issues +- Each agent tab leaves a revoked token named after it, such as "Claude Code tab", in Connections after the tab closes. There is no way to delete one yet. +- The right-click menu has no "Show in collection": the engine does not say which collections an item is in. +- The Windows engine is frozen with no console window and the shell reads its port from the number it handed over; this is read and fixed in the code, not run. + +### Under the hood +- The dock is the family's shared module, written out in `frontend/src/dock/`, with FormCite's own words, routes and token map in `dock-adapter.ts`; the engine side is `/api/terminal`, `/api/agent/status` and a consent bridge that answers no questions. New permissive packages are in `NOTICE.md`: `@xterm/xterm`, `@xterm/addon-fit`, `@tauri-apps/api`, `@tauri-apps/cli`, `ptyprocess`, `pywinpty` and `tzdata`. +- `NOTICE.md` points to `templates/CREDITS.md` for the CC BY-SA styles. +- The registry entry for formcompiler in `packaging/formcompiler/apps/formcite.json` is brought to this version, with the macOS minimum made explicit in the desktop configuration. +- Checked for this version, on Linux x64, on 1 December 2026 (EST): the contract build (`./formcite install`, `install-desktop`, `desktop build --config`) from a fresh clone with Python 3.12; the style regression set, 12 of 12; the frozen engine's own check, its health answer, an APA citation formatted and a new library made with all its tables; a dock terminal echoing over its socket from the frozen engine; the `.deb`, `.rpm` and AppImage built, and the AppImage opened its window under a virtual display, claimed its key and stopped its engine on exit. The window was checked in headless Chrome at four times slower CPU: Home on the first frame, the bar row reserved before first paint with no layout shift, theme and look kept across an engine restart, the dock opening and closing without moving the panes, and the menus kept inside the window. Not run: any build or run on macOS or Windows (formcompiler's runners build those), the macOS system menu, and the Codex, Cursor and Antigravity tabs, since none of those programs is installed here. + ## 0.14.0 The desktop app starts, a copied library stands on its own, and an extension has searched a real FormCite. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0a7c93..947dd10 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,8 @@ # Contributing to FormCite Thank you for helping. FormCite aims to be a free, local-first personal research -library, with everything kept on your own computer. It is a scaffold today: an engine -skeleton, a window and a desktop shell, and not much more. It grows through real use -and real contributions. +library that runs in a browser or on the desktop and keeps your references on your own +computer, and it gets there through real use and real contributions. ## Where to start @@ -14,17 +13,22 @@ and real contributions. ## Setting up -Clone the repository and run `./formcite_oc_install`, then `./formcite`. The first -installs what the engine and the window need; the second starts both. The README has -the details and the requirements. +Clone the repository and run `./formcite install`, then `./formcite` (or +`formcite.bat install` and `formcite.bat` on Windows). The first installs what the +engine and the window need; the second starts both. `./formcite help` lists every +command, and the README's "Run it from source" section has the details and the +requirements. The code lives in: | Folder | What is there | | --- | --- | -| `backend` | the engine (Python, FastAPI): the entry is `backend/formcite_engine.py`, and `GET /api/health` answers on `127.0.0.1:8330` | -| `frontend` | the window (TypeScript, Vite): npm scripts `dev` (port 5330), `build`, `preview` and `check` | +| `backend/app` | the engine (Python, FastAPI): the library store, lookups, the command line, the cite service and the MCP server; the entry is `backend/formcite_engine.py`, and `GET /api/health` answers on `127.0.0.1:8330` | +| `native/formcite-style` | the citation style engine, a Rust module built on Hayagriva and made into a Python wheel with maturin | +| `frontend/src` | the window (TypeScript, Vite): the command registry and store in `engine`, the views and panes in `ui`, the tokens and themes in `styles`; npm scripts `dev` (port 5330), `build`, `preview` and `check` | | `src-tauri` | the desktop shell (Rust, Tauri 2) | +| `setup` | install, build, freeze and boot scripts behind `./formcite` | +| `docs` | one page per part of the app | | `.github` | the CI workflow and the code owners | ## Before you open a pull request @@ -38,18 +42,30 @@ python backend/formcite_engine.py & curl -fsS http://127.0.0.1:8330/api/health ``` -Stop the engine afterwards. CI runs a `window` job and an `engine` job on every pull -request and on every push to `main`. It has no job for the desktop shell, so build -that yourself if you change `src-tauri`. +Stop the engine afterwards. If you change `native/formcite-style` or the code that +calls it, build the style wheel and run its regression set too: + +```sh +./setup/build_style --wheel +(cd backend && python -m app.style.regression.run) +``` + +CI runs a `window` job, an `engine` job and a `style` job (the wheel built on macOS, +Linux and Windows, then the regression set) on every pull request and on every push +to `main`. It has no job for the desktop shell, so build that yourself if you change +`src-tauri` (`./formcite desktop build`). - Keep each pull request to one change, and say in it what you ran and what you could not run. - Write commit subjects in Conventional Commits: `feat(window): ...`, - `fix(engine): ...`, `docs(...)`. Leave the version alone; a maintainer bumps it - when releasing. + `fix(engine): ...`, `docs(...)` (the history shows the scopes in use). Leave the + version alone; a maintainer bumps it when releasing. - Do not add tests unless the owner asks for them. - Keep the engine on loopback. [SECURITY.md](SECURITY.md) sets out what matters; a change that widens it is discussed in an issue first. +- Every outbound connection goes through `backend/app/net`, to a service declared + there and described in [docs/NETWORK.md](docs/NETWORK.md). Nothing runs in the + background, and a new service is discussed in an issue first. - Code carries near-zero comments. Markdown has no em dash and no text has an emoji. - Every new dependency, binary, font or data file gets a row in `NOTICE.md` before it is used. @@ -66,18 +82,22 @@ Reach them through issues and pull requests. ## How changes land -Work reaches `main` only through a pull request from a working branch. Nobody pushes to `main` directly. A pull request merges when both CI jobs, `window` and `engine`, pass on an up-to-date branch and a maintainer has approved it after its last push. Pull requests are merged with a merge commit, never squashed and never rebased. +Work reaches `main` only through a pull request, and nobody pushes to `main` directly. Contributors fork the repository and open a pull request into `main`; maintainers work from a branch of their own. A pull request merges when its CI jobs (`window`, `engine` and `style`) pass on an up-to-date branch and a maintainer has approved it after its last push. Pull requests are merged with a merge commit, never squashed and never rebased. ## Releases -Packaging and releases are done by FormCompiler (`nodemode-dev/formcompiler`), not in this repository. No push from a contributor starts a release. +A release is a version, and only a maintainer makes one: after the version is bumped on +`main`, a maintainer cuts a `compile_vX.Y.Z` branch, and formcompiler +(`nodemode-dev/formcompiler`) builds every platform and publishes them together. No +push from a contributor starts a release. ## Licensing FormCite is licensed under the GNU General Public License v3.0 only ([LICENSE](LICENSE), SPDX `GPL-3.0-only`). By contributing, you agree that your -contribution is licensed under the same terms. Only add code you have the right to -contribute, and name any third-party code and its license in the pull request. +contribution is licensed under GPL-3.0-only, the same terms. Only add code you have +the right to contribute under them, and name any third-party code and its license in +the pull request. ## Patents and other people's IP diff --git a/NOTICE.md b/NOTICE.md index 0efd815..2641a64 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -19,6 +19,7 @@ A file brought over from another Form repository gets a row here with its source | FormLedger v0.11.0 (`nodemode-dev/formledger`), since 0.12.0 | Apache-2.0 | The splash card's shape, from `src-tauri/splash/index.html`, and the shape of `src-tauri/src/reveal.rs` | | FormLedger v0.10.0 (`nodemode-dev/formledger`), since 0.11.0 | Apache-2.0 | The token names and values for the dark and light themes in `frontend/src/styles/tokens.css` | | formcompiler and formslot (`nodemode-dev/formcompiler`, `nodemode-dev/formslot`) at their `main` of 2026-11-27, since 0.11.0 | GPL-3.0-only | Patterns, adapted and not copied: the registry entry shape of `apps/formrig.json` behind `packaging/formcompiler/apps/formcite.json`, the five build runners in the `style` CI job, and the prebuilt-before-source order of formslot's installer in `setup/build_style` | +| FormVis 2.9.0 (`nodemode-dev/formvis`), with FormDeck (`nodemode-dev/formdeck`) as the second reference, since 0.15.0 | Apache-2.0 | `frontend/src/dock/`: the shared agent dock module 2.2.1, every file byte for byte as its `MANIFEST.json` lists them (the module is the same in every app). Written for FormCite, after FormDeck's and FormVis's adapters: `frontend/src/dock-adapter.ts`, `frontend/src/styles/dock-tokens.css`, `frontend/src/styles/terminal.css`. Rewritten for FormCite from FormVis's `backend/app/services/terminal.py`, `services/agent_programs.py`, `services/claude_code.py` and `routers/terminal.py`: `backend/app/services/terminal.py`, `backend/app/services/agent_programs.py`, `backend/app/routers/dock.py` | ## Third-party software @@ -29,12 +30,19 @@ Each component gets a row here with its license and its use before it is added. | fastapi 0.141.1, with starlette and pydantic | MIT | engine | | uvicorn 0.53.0 | BSD-3-Clause | engine | | pypdf 7.2.0, pinned exactly; it pulls in no other package | BSD-3-Clause, read from the installed package's metadata and license file (Copyright (c) 2006-2008, Mathieu Fenniak, and later contributors) | reading a PDF's metadata and the text of its first pages to find an identifier | +| ptyprocess 0.7.0, pinned exactly, on macOS and Linux; it pulls in no other package | ISC, read from the wheel's license file (Copyright (c) 2013-2014, Pexpect development team; Copyright (c) 2012, Noah Spurrier) | the terminals of the agent dock, since 0.15.0 | +| pywinpty 3.0.5, pinned exactly, on Windows only; its wheel carries `winpty.dll` (winpty, MIT) and `conpty.dll` (Microsoft, MIT) | MIT, read from the wheel's metadata and license file | the terminals of the agent dock on Windows, since 0.15.0 | +| @xterm/xterm 6.0.0 and @xterm/addon-fit 0.11.0, pinned exactly, the same versions as FormVis and FormDeck; they pull in no other package | MIT, read from each installed package's license file (Copyright (c) 2017-2019, The xterm.js authors; 2014-2016, SourceLair Private Company; 2012-2013, Christopher Jeffrey) | the terminal emulator in the agent dock, loaded when the first terminal tab opens, since 0.15.0 | +| tzdata 2026.6, pinned exactly; it pulls in no other package | Apache-2.0, read from the wheel's metadata and license file | the IANA time zone data for the engine's Eastern-time logs where the system has none (Windows always), since 0.15.0 | | hayagriva 0.10.1, pinned exactly, with its style parser citationberg | MIT OR Apache-2.0 | the citation style engine, built into the Python module `formcite_style` | | The other crates in `native/formcite-style/Cargo.lock` (pyo3 0.29, serde, serde_json and the rest) | MIT OR Apache-2.0 for most; Unicode-3.0, MIT, Apache-2.0, BSD-2-Clause, Unlicense OR MIT and 0BSD OR CC0-1.0 for the others; `target-lexicon` is Apache-2.0 WITH LLVM-exception and is used at build time only. The full list is in `docs/STYLE_ENGINE.md` | the citation style engine | | Citation Style Language styles and locales, as bundled inside hayagriva | CC BY-SA 3.0 Unported, by the CSL project and its contributors (citationstyles.org); shipped unmodified, with each style's author and contributor metadata kept | the citation styles the engine renders | +| 40 independent citation styles from the Citation Style Language style repository (commit `38e17c7`), in `templates/styles/` | CC BY-SA 3.0 Unported, by the CSL project and the authors named in each file; shipped unmodified. The list, the licence terms and FormCite's own style and starters are in `templates/CREDITS.md` | styles to format with as your own style file (`format --style-file`) | | maturin | a build tool; its license has not been read for this repository yet | building the style engine; not shipped | | typescript 7.0.2 | Apache-2.0 | building the window; not shipped | +| @tauri-apps/cli 2.12.5, pinned exactly, with its platform binary | Apache-2.0 OR MIT, read from the installed package's metadata | building the desktop app (`./formcite desktop build`); not shipped | | vite 8.3.5 and what it pulls in (rolldown, postcss and others: MIT; lightningcss: MPL-2.0; picocolors: ISC; source-map-js: BSD-3-Clause; tslib: 0BSD) | MIT | building the window; not shipped | +| @tauri-apps/api 2.12.5, pinned exactly; it pulls in no other package | Apache-2.0 OR MIT, read from the installed package's metadata | the macOS system menu in the desktop window (`frontend/src/ui/native-menu.ts`); loaded only inside the desktop shell, since 0.15.0 | | Tauri 2 with tauri-plugin-shell and tauri-plugin-dialog, fontdb, regex, serde, serde_json, windows-sys, objc2 and its companions | the same crates formtxt's shell uses; their licenses have not been read for this repository yet | desktop shell, which has not been compiled yet | -The window has no runtime dependency and uses the system font stack. +The window's runtime dependencies are @tauri-apps/api, for the macOS system menu, and @xterm/xterm with @xterm/addon-fit, for the agent dock's terminals; it uses the system font stack. diff --git a/README.md b/README.md index 0a904cb..1b3bb7d 100644 --- a/README.md +++ b/README.md @@ -7,24 +7,52 @@

Library; the Form family's personal research library.
Collect sources, organize them and cite them from the app you are writing in.
- Python and SQLite, on your own computer. + Python and SQLite, on your own computer. No account, and agents can use it over MCP.

- version 0.14.0 - Python 3.12 or later + version 0.15.0 + TypeScript + Python 3.12 or later + macOS, Windows, Linux License: GPL-3.0-only Status: early

+

+ Download FormCite · + Run it from source +

+

Features · - Apps and agents · - Network · + In the box · + Agents · + Under the hood · Download · - Run from source + Run from source · + Network +

+ +

+ FormCite's Items view in the dark theme, with the menu bar across the top, the Urban ecology collection open with 31 items, one reference selected in the list and its details at the right: type, title, two creators, date, container, volume, issue and pages +
+ FormCite 0.15.0 on the Items view: the menu bar, the collections and tags at the left, the list, and the details of the selected reference at the right. The references in these captures are invented.

+
+ + + + + + + + +

Yours

Your references, files and notes stay on your own computer, in a library you can copy or move as a folder.

Quick to fill

Add from a DOI, an arXiv id, an ISBN or a PubMed ID, drop a PDF on the window, or import BibTeX, RIS and CSL-JSON.

Cites anywhere

Citations and bibliographies in the styles the engine bundles, or in your own style file, from the window, the command line or another app.

Agent-ready

A cite service and an MCP server, both closed until you approve a token, for Claude Code, Codex, Cursor and Antigravity.
+ +
+ ## Features @@ -50,31 +78,128 @@ + +

A window

Items, Duplicates, Trash, Connections and Preferences views (docs/WINDOW.md). It follows the system's light or dark theme. Stored PDFs open in FormPDF when it is installed, and other files in your system viewer. +

From 0.15.0: a menu bar in the window (on a Mac, the system menu bar, with Menus in Window to switch back), a right-click menu on the rows of the item list, a Home start screen with the ways to add references, Preferences in sections (General, Appearance, Network, Libraries and Agents) and the Form glass look.

Other apps and agents

A cite service and an MCP server, both closed until you approve a token. The command line needs no engine. +

From 0.15.0: an agent dock in the window, with terminal tabs and a Claude Code tab. +
+ + + + + + + + +
+ The Items view in the dark theme with the agent dock open along the foot of the window, its terminal showing the command line's APA result for four references: a citation line and the four bibliography entries beneath it +
A bibliography in APA, printed by FormCite's command line in the agent dock's terminal. +

Cite from the terminal

+ The dock runs the same command line you would use in any shell, on the same library. +
+ FormCite's Home start screen in the dark theme: a drop area with the buttons Add by identifier, Import a file and Choose a PDF, four count cards and a row of recent collection cards +
Home: the ways to add references, the library at a glance and recent collections. +

Home

+ From 0.15.0. Add by identifier, import a file or choose a PDF, then pick up where you left off. +
+ FormCite's Preferences in the dark theme, with a rail listing General, Appearance, Network, Libraries and Agents, the Show Home at launch switch turned on and a grid of dark theme swatches under Appearance +
Preferences in sections, with the dark theme swatches under Appearance. +

Preferences

+ From 0.15.0. General, Appearance, Network, Libraries and Agents. +
+ The Items view in the light theme, with the Urban ecology collection open, one reference selected and its details at the right +
The Items view in the light theme. +

Dark and light

+ The window follows the system's light or dark theme, or you pick one in Preferences.
+The captures show a sample library made for these pictures; its references are invented. + The details of each part are in [`docs/`](docs/README.md). +## Everything in the box + + + + + + + + + + + + +

Library

References · Collections and subcollections · Tags · Notes · Attached files · Full-text search · Duplicates and merge · Trash · Several libraries · A data folder you can copy

Add and cite

DOI · arXiv id · ISBN · PubMed ID · PDF drop and identify · Paste or pick a file · Citations and bibliographies · Your own style file · Locators

Formats

Opens: BibTeX · RIS · CSL-JSON · Saves: BibTeX · RIS · CSL-JSON · Styles: the engine's bundled names, or your own .csl file

Window (from 0.15.0)

Menu bar (File · Edit · View · Library · Help) · Home with Add by identifier, Import a file and Choose a PDF · Library counts and recent collections · Preferences in sections · Right-click menu on the item list · Form glass look in dark and light

Apps and agents

Cite service · MCP server over stdio and local HTTP · Service tokens you approve and revoke · Write log · ./formcite agents install

Agent dock (from 0.15.0)

Shell tabs started by the engine · A Claude Code tab with FormCite's tools when Claude Code is installed · Codex, Cursor and Antigravity tabs when those are installed · Opens from View, or with Ctrl+J (Cmd+J on a Mac)
+ +## Built for agents + +The window, the command line, the cite service and the MCP server all work on the same library, so a change made in one place shows up in the others. Another app on this computer, or an agent you run, can use your library only with a token you approved. + +```sh +./formcite cli --help # the library from the command line, no engine needed +./formcite mcp # MCP server on stdio, read-only unless --allow-write +./formcite agents install --dry-run # shows what it would register for Claude Code, Codex, Cursor and Antigravity +``` + +- An app asks; the request shows in the window's Connections view (and in `./formcite cli service requests`), where you approve it to read, or to read and add, or deny it. You can remove its access there at any time. +- With a token, an app searches, reads and formats citations through the cite service at `/api/cite/v1` ([`docs/CITE_SERVICE.md`](docs/CITE_SERVICE.md)). Without one it gets no answer. +- Agents use the MCP server: `./formcite mcp` (read-only unless you start it with `--allow-write`), or `POST /mcp` on the running engine with a token ([`docs/MCP.md`](docs/MCP.md)). `./formcite agents install` registers it with the agent clients it knows; `--dry-run` shows what it would write. +- `./formcite cli service log` shows everything a token holder added. +- From 0.15.0 the window has an agent dock (View, Agent Dock): shell tabs the engine starts on this computer, and a tab for Claude Code, Codex, Cursor or Antigravity when that program is installed. Each agent tab gets its own token, which is revoked when the tab closes. Only the FormCite window can open one. The dock asks no question of its own: an outside agent is approved by pairing under Connections, as above. + +See [`AGENTS.md`](AGENTS.md). + +## Under the hood + +- **Engine:** a FastAPI service over a SQLite library, with the command line, the cite service and the MCP server on top of the same store. +- **Citations:** a Rust module built on Hayagriva (pinned, `=0.10.1`), made into a Python wheel with maturin and checked by a regression set of twelve cases. +- **Window:** vanilla TypeScript and Vite, with a DOM-free command registry and an inline-SVG icon set and no UI framework. +- **Desktop:** a Tauri 2 shell around the same window, with the engine frozen as a sidecar. + ## Download -There is no downloadable desktop app yet. The shell in `src-tauri/` has never been compiled, so a release is not out; until then you run FormCite from source. +From 0.15.0 FormCite is built for macOS, Windows and Linux by [FormCompiler](https://github.com/nodemode-dev/formcompiler) and released on [FormCite's releases page](https://github.com/nodemode-dev/formcite/releases). Earlier versions have no download; you run them from source. In the file names, `X.Y.Z` is the version, for example `0.15.0`. + +| Your computer | File to download | What it is | +| --- | --- | --- | +| Mac with Apple silicon (M1 or newer) | `formcite-X.Y.Z-macos-arm64.dmg` | Disk image. Open it and drag FormCite to Applications. | +| Mac with an Intel processor | `formcite-X.Y.Z-macos-x64.dmg` | The same for Intel Macs. | +| Windows PC (64-bit Intel or AMD) | `formcite-X.Y.Z-windows-x64-setup.exe` | Installer. The one most people on Windows want. | +| Windows PC (64-bit Intel or AMD) | `formcite-X.Y.Z-windows-x64.msi` | The same app as an MSI installer, for IT teams that install on many PCs. | +| Linux PC (64-bit Intel or AMD) | `formcite-X.Y.Z-linux-x64.AppImage` | One file that runs on most Linux systems with no install. | +| Linux PC (64-bit Intel or AMD) | `formcite-X.Y.Z-linux-x64.deb` | Package for Debian, Ubuntu, Linux Mint and Pop!_OS. | +| Linux PC (64-bit Intel or AMD) | `formcite-X.Y.Z-linux-x64.rpm` | Package for Fedora, Red Hat, Rocky Linux and openSUSE. | + +Other files on a release: `SHA256SUMS.txt` has the checksum of every file, to confirm that a download arrived whole; `form-app.json` is the app's description card, which FormPortal reads; `formcite-skills-vX.Y.Z.zip` is the optional skill pack that teaches an agent program to use FormCite. Builds for Windows on Arm and Linux on Arm are not released yet. + +Needs macOS 10.13 or newer (the version the build targets; it has not been read back from a built app yet), Windows 10 or newer, or a Linux with glibc 2.35 or newer, such as Ubuntu 22.04. +All FormCite builds are compiled and released from [FormCompiler](https://github.com/nodemode-dev/formcompiler); this repo holds the source. ## Run it from source -**Requires:** Python 3.12 or later and Node 22. Rust is needed only if no prebuilt citation style engine is found for your platform. +Prefer it in your browser, or want to contribute? Run the window straight from this repo. + +**Requires:** Python 3.12 or later and Node 22. Rust is needed only if no prebuilt citation style engine is found for your platform; the desktop shell also needs Rust and the Tauri 2 system packages. ```sh -./formcite_oc_install # engine venv and window packages +git clone git@github.com:nodemode-dev/formcite.git +cd formcite +./formcite install # engine venv and window packages ./formcite # engine on 127.0.0.1:8330, window at http://localhost:5330 ./formcite serve # the engine alone, with no window ./formcite cli --help # the library from the command line, no engine needed +./formcite desktop dev # the desktop window instead of the browser ``` +On Windows use `formcite.bat install` and `formcite.bat`. + The install puts in a prebuilt citation style engine when it finds one (in `wheels/`, in `native/formcite-style/dist/`, or in the folder `FORMCITE_STYLE_WHEELS` names). Otherwise it builds the engine from source, which needs Rust (`./setup/build_style`). With neither, everything works except formatting a citation, which answers 503 until you run `./setup/build_style --from-source` with Rust installed. No wheel is shipped in this repository yet. A few commands to try, once the install is done: @@ -99,15 +224,6 @@ A few commands to try, once the install is done: | 5330 | the window's dev server | `FORMCITE_UI_PORT` | | 5331 | the window's preview server | | -## Other apps and agents - -Another app on this computer, or an agent you run, can use your library only with a token you approved. - -- An app asks; the request shows in the window's Connections view (and in `./formcite cli service requests`), where you approve it to read, or to read and add, or deny it. You can remove its access there at any time. -- With a token, an app searches, reads and formats citations through the cite service at `/api/cite/v1` ([`docs/CITE_SERVICE.md`](docs/CITE_SERVICE.md)). Without one it gets no answer. -- Agents use the MCP server: `./formcite mcp` (read-only unless you start it with `--allow-write`), or `POST /mcp` on the running engine with a token ([`docs/MCP.md`](docs/MCP.md)). `./formcite agents install` registers it with the agent clients it knows; `--dry-run` shows what it would write. -- `./formcite cli service log` shows everything a token holder added. - ## What FormCite sends over the network Nothing, unless you ask for a lookup. `./formcite cli add doi=...` (or `arxiv=`, `isbn=`, `pmid=`) and `./formcite cli identify FILE.pdf` send the identifier, and only the identifier, to the service that knows it. The window does the same when you add by identifier or drop a PDF on it, and so do the lookup tools an agent calls. A PDF and its text never leave your computer. There is no timer, no update check and no call at start-up. @@ -125,29 +241,38 @@ In the window, Preferences lists every service with a switch for each. `./formci The data folder is `~/FormCite`; `FORMCITE_DATA_DIR` moves it. +## Demos and templates + +- **Demos** ([`demos/`](demos/README.md)): three complete sample libraries, each with collections, tags and notes: a thesis on urban heat (260 references), a history reading list (215) and a cell biology lab's methods library (240). Each is ready to open, and each also comes as a BibTeX file you can import. +- **Templates** ([`templates/`](templates/README.md)): 41 citation styles to format with as your own style file (`format --style-file`), 40 of them unmodified from the Citation Style Language project under CC BY-SA 3.0 ([`templates/CREDITS.md`](templates/CREDITS.md)). Also 10 library starters with collections and tags already in place, for a thesis, a grant, a course, a systematic review and more. + > [!IMPORTANT] -> **Status:** early. The library, the command line, the cite service and the MCP server work; the window is new and only partly checked in a browser; the desktop app in `src-tauri/` has not been compiled. +> **Status:** early. The library, the command line, the cite service and the MCP server work, and the window runs in a browser and in the desktop shell. The downloadable desktop apps are new in 0.15.0; [`CHANGELOG.md`](CHANGELOG.md) says what was run on which system. -**Contributing:** see [`CONTRIBUTING.md`](CONTRIBUTING.md), the [code of conduct](CODE_OF_CONDUCT.md), [`SECURITY.md`](SECURITY.md) and [`AGENTS.md`](AGENTS.md). +**Contributing:** branch from `main`, keep changes to source here, and leave packaging and releases to FormCompiler. See [`CONTRIBUTING.md`](CONTRIBUTING.md), the [code of conduct](CODE_OF_CONDUCT.md), [`AGENTS.md`](AGENTS.md) and [`docs/`](docs/README.md). Report security issues privately as [`SECURITY.md`](SECURITY.md) describes. ## Repository | Path | What it is | | --- | --- | | `backend/` | the engine: Python and FastAPI, the library store, the command line, the cite service and the MCP server | -| `frontend/` | the window: TypeScript and Vite | +| `frontend/` | the window: TypeScript and Vite, with the command registry in `src/engine` and the views in `src/ui` | | `native/formcite-style/` | the citation style engine, a Rust module built on Hayagriva | -| `src-tauri/` | the desktop shell, not yet compiled | +| `src-tauri/` | the Tauri 2 desktop shell and the engine sidecar | | `docs/` | one page per part ([`docs/README.md`](docs/README.md)) | -| `setup/` | install, build and boot scripts | +| `setup/` | install, build, freeze and boot scripts behind `./formcite` | | `assets/brand/` | the logo and icon art | +
+ +--- + ## Maintainers | Maintainer | Role | | --- | --- | -| [@nodemode-ai](https://github.com/nodemode-ai) | Code owner | -| [@gbarnai](https://github.com/gbarnai) | Code owner | +| [@nodemode-ai](https://github.com/nodemode-ai) | Owner | +| [@gbarnai](https://github.com/gbarnai) | Co-owner | Code owners are set in [`.github/CODEOWNERS`](.github/CODEOWNERS). diff --git a/SECURITY.md b/SECURITY.md index ba99784..d210584 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -27,15 +27,27 @@ is fixed and credit you, unless you would rather not be named. FormCite runs on your own machine, so the things that matter most are the ways something could reach it from outside: -- **The engine** listens on loopback (port 8330). Anything that makes it reachable - from another machine, or lets a web page on another origin drive it. +- **The engine** listens on loopback (port 8330 in development, a random loopback + port in the desktop app). Anything that makes it reachable from another machine, or + lets a web page on another origin drive it. - **Your library**: anything that lets a program or web page other than FormCite's - own window read or change what FormCite keeps on your computer. -- **Secrets**: anything that leaks a credential FormCite is given. - -FormCite is a scaffold today. It has an engine skeleton that answers -`GET /api/health` and no features that hold a library or secrets yet, so this list -describes what the policy covers as the app grows. + own window read or change what FormCite keeps on your computer. The engine gives the + window a key when it starts; requests that change something, and the routes that list + credentials, are refused without it. +- **The cite service, service tokens and the MCP server**: an app or an agent getting + an answer before the person approved a token, a token reading more than its scope + (read or write) allows, or a revoked token still working. Only the FormCite window + can approve, deny or revoke. Every method on `/api/cite/v1/` and `/mcp` asks for a + token, and the engine keeps only each token's hash. +- **The agent dock** (from 0.15.0): anything other than FormCite's own window on this + computer reaching a terminal or an agent program through it. +- **Lookups and the network**: any connection other than one a person or an agent + asked for, to a host that is not declared, or made while the network is switched + off. The rules are in `docs/NETWORK.md`. +- **Files**: an import, a dropped PDF or an attached file handled in a way that writes + outside where it should, or that lets something other than the window open one. +- **Secrets**: anything that leaks a credential FormCite is given, a service token + above all. Bugs that need someone to already control your machine, or to run a modified build of FormCite, are ordinary bugs: please open an issue for those. @@ -44,15 +56,19 @@ of FormCite, are ordinary bugs: please open an issue for those. FormCite has three parts on one computer: the window (`frontend`), the engine (`backend`, a local HTTP server) and the desktop shell (`src-tauri`). This is the -summary of the intended model. +summary of the model. ### The engine listens on this computer only -The engine is meant to bind `127.0.0.1` and nothing else (`backend/formcite_engine.py`). A page on another machine therefore cannot reach it. +The engine binds `127.0.0.1` and nothing else (`backend/formcite_engine.py`). A page on another machine therefore cannot reach it. + +### Only the window changes things + +The window trades a one-time launch code for its key. Routes that change something need the key, so another program on this computer, or a web page, cannot change your library. Another app or an agent reaches the library only through the cite service and the MCP server, with a token you approved (`docs/SERVICE_TOKENS.md`). ### Network -FormCite has no telemetry, no crash reporting and no update check. +FormCite has no telemetry, no crash reporting and no update check. It goes on the network only when you or an agent ask for a lookup, to the services `docs/NETWORK.md` lists, and every call is logged. ## Outside this policy diff --git a/assets/screens/bibliography.webp b/assets/screens/bibliography.webp new file mode 100644 index 0000000..0c805fc Binary files /dev/null and b/assets/screens/bibliography.webp differ diff --git a/assets/screens/home.webp b/assets/screens/home.webp new file mode 100644 index 0000000..c3ef574 Binary files /dev/null and b/assets/screens/home.webp differ diff --git a/assets/screens/items-light.webp b/assets/screens/items-light.webp new file mode 100644 index 0000000..d7a4528 Binary files /dev/null and b/assets/screens/items-light.webp differ diff --git a/assets/screens/items.webp b/assets/screens/items.webp new file mode 100644 index 0000000..19731be Binary files /dev/null and b/assets/screens/items.webp differ diff --git a/assets/screens/preferences.webp b/assets/screens/preferences.webp new file mode 100644 index 0000000..376b3fa Binary files /dev/null and b/assets/screens/preferences.webp differ diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 06d8e02..9e8e470 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -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.14.0 +Current build version: v0.15.0 Last updated: 2026-11-27 (US Eastern) · the lean rows route for the window's list and opening an attachment --- @@ -238,6 +238,13 @@ Ported from FormTxt `backend/formtxt_engine.py`. `--selfcheck` prints a JSON lin ``` FormTxt could print the key on stdout for its shell. FormCite hands the key over through the one-time launch code exchange instead, so this mode and `FORMTXT_PORT` as a port fallback were not ported. +### formcite_engine.py · serve · the SIGTERM handler closes the dock's tabs +- refers-to: formcite_engine.py :: serve, `leave` +- kind: fix +- logged: v0.15.0 · 2026-12-01 14:22 EST + +The handler ends the process with `os._exit(0)`, which runs no `atexit` hook, so the agent dock's open tabs kept their tokens and terminals past the engine's end. It now calls `app.services.agent_programs._leave()` first (forget every live token, close every terminal), then releases the data folder as before. Imported inside the handler so a plain engine start loads nothing extra. Asked for by the lead. + --- ## requirements.txt and requirements_macos.txt {#requirements} @@ -1697,3 +1704,31 @@ Run in v0.14.0 work (2026-11-27), no code changed. form.ext 0.12.0 (`affacd2`) h ## app/core/config.py, app/core/data_folder.py, app/routers/registry.py {#app-data-folder-copy-and-api-404} New in v0.14.0 (2026-11-27). Cause of the shared copies: `store/libraries.py` writes each library's `root` as a full path, so `cp -a A B` left B's `libraries.json` naming `A/Library`. `data_dir()` now runs `data_folder.settle` once per process per resolved folder, before anything reads `libraries.json`, in the engine and in the CLI alike. `settle` keeps an entry inside the folder, keeps a relative entry untouched, and rewrites an absolute entry outside it to `folder / basename` when that holds `library.sqlite` and the old place is missing or sits in a folder that holds its own `libraries.json`; anything else is a library placed elsewhere and keeps its path. The write is temp file, `fsync`, `os.replace`, as `store/libraries.py` does. The stored value is still absolute because `Library.__post_init__` resolves a relative root against the working folder; storing `Library` relative needs that file changed, which belongs to another slice. Checked on 2,000 items: copy then edit through the copy left the original's title as it was, and the reverse; `mv` to a new name listed 2000 of 2000; an old-format copy written before the fix opened its own library and was rewritten once; a library at `/tmp/R2/ext/Thesis` kept its path through a copy. `registry.mount` now ends with `/api/{rest:path}` for every method raising 404 `Not Found`, after every group, the MCP route and the look routes, so StaticFiles at `/` no longer answers 405 to a POST on an unknown api path. The look router is included here as well as in `main.py`; the first match wins, and the openapi path table hashes the same before and after (90 paths, 112 operations). + +## app/services/terminal.py, app/services/agent_programs.py, app/routers/dock.py, app/routers/registry.py {#app-agent-dock} + +New in v0.15.0 (2026-12-01 13:40 EST, agent `cite-dock`). The engine side of the family's agent dock, module 2.2.1 (`frontend/src/dock/CONTRACT.md`), rewritten from FormVis 2.9.0's `services/terminal.py`, `services/agent_programs.py`, `services/claude_code.py` and `routers/terminal.py`. One registration line in `routers/registry.py`: `register("dock", __import__("app.routers.dock", fromlist=["mounted"]).mounted)`, so every route sits under `/api` before the `/api/{rest:path}` 404. + +Who may call (clauses 1, 2). Every HTTP route depends on `window_only` from `routers/service.py`, reads included: `WindowKeyGuard` lets GET through without the key, and the terminal list must answer only the window. A service token is never accepted here. `LocalGuard` already covers `websocket` scopes (loopback `Host`, own or listed `Origin`, close 4403), and uvicorn binds 127.0.0.1. The stream cannot carry the window key header, so `POST /api/terminal/ticket` (window key) returns a ticket that `?ticket=` spends once within 60 s; a wrong or spent ticket is closed before accept (HTTP 403 to the client). + +Routes: `GET|POST /api/terminal`, `POST /api/terminal/claude`, `POST /api/terminal/agent` (`codex`, `cursor`, `antigravity`), `POST /api/terminal/{id}/restart`, `DELETE /api/terminal/{id}` (repeatable), `WS /api/terminal/{id}/stream`, `GET /api/agent/status`, `GET /api/mcp/bridge/questions`, `POST /api/mcp/bridge/result`. A missing program answers 409 with the install line, which the adapter maps to `notInstalled`. Frames as FormVis: output as text, `{"type":"exit"}` as a binary frame, input and resize as JSON text; scrollback (256 KiB) replayed on every attach, an exit frame at once for an ended program; a reader that falls 4,000 chunks behind loses output, the PTY never blocks. The event loop is bound from the ticket route and the stream, since `main.py`'s lifespan is not this slice's. + +Agent programs (clauses 10, 11). Found with `shutil.which` on PATH plus the usual home and system bin folders, so a desktop launch with a short PATH still finds them; `--version` is cached by the binary's mtime and the whole answer for 30 s; Claude Code's `signedIn` comes from `claude auth status` (`loggedIn`), null when unreadable, and is null for the others. Each agent tab gets a fresh write-scope service token, issued through `service/store.py` with host `FormCite dock`, in `FORMCITE_MCP_TOKEN` beside `FORMCITE_MCP_URL`; Claude Code gets `--mcp-config` naming `Authorization: Bearer ${FORMCITE_MCP_TOKEN}`, so the token is never on a command line; Antigravity's `formcite_tab` entry goes into `/agent-tabs/antigravity/.agents/mcp_config.json`, mode 0600, other entries kept, removed on close. The token is revoked when its tab closes. `formcite_engine.py` ends on SIGTERM with `os._exit`, so `atexit` does not run there; tokens of tabs alive at that moment are revoked by a sweep on the next status or tab open (checked: one left unrevoked by SIGTERM, revoked by the next `GET /api/agent/status`). The shell's environment drops `FORMCITE_LAUNCH_CODE` and any inherited `FORMCITE_MCP_TOKEN`. Revoked tab tokens stay listed under Connections, as every revoked token does; `store.py` has no delete. + +The consent bridge answers no questions (clause 15). FormCite's approval of outside agents is a pairing: the agent asks once, the person approves it under Connections with a read or write scope, and the agent collects a standing service token. That is the clause's first kind, a credential given on the app's own page, so the adapter gives neither `consent` nor `storedChoice`. Mapping pairing requests onto the dock's dialog does not fit cleanly: there is no per-call wait for `once` to answer, `always` would have to mint a token without the scope choice Connections offers, and the Connections view with its asks toast already answers each request, so a second surface would race it. `GET /api/mcp/bridge/questions` returns `{"questions": [], "asks": false, "detail": ...}` and `POST /api/mcp/bridge/result` answers 409 with the same sentence. + +Run (13:30 to 13:40 EST): venv in `/tmp/cite-dock-venv` from `requirements.txt` (Python 3.12.3, ptyprocess 0.7.0), engine `formcite_engine.py 8391` on a data folder in `/tmp`, script `/tmp/cite-dock-check/ws_check.py`. Without the key: list 403, open 403. With it: shell opened; bad ticket refused; over the stream `echo dock-$((40+2)); stty size` after a resize to 90 by 20 printed `dock-42` and `20 90`; `exit` gave the exit frame; a reattach replayed 252 characters then the exit frame; a spent ticket refused; restart kept the id; close twice 200; a foreign `Origin` on the stream refused. Agent status found Claude Code 2.1.333 (`signedIn` false) and gave install lines for the other three; a Claude Code tab opened and its token was revoked on close. Not run: Windows (pywinpty), macOS, the frozen engine, Codex, Cursor or Antigravity tabs (none installed here). + +## app/core/look_store.py, app/routers/look.py {#app-window-look-shell} + +New in v0.15.0 (2026-12-01 EST, agent `cite-home`). The window look gains three choices so they survive the per-launch port like the theme does: `home` (`launch` or `off`, default `launch`), `menus` (`bar` or `window`, default `bar`) and `dock` (`shown` or `hidden`, default `hidden`), each checked against `CHOICES` and accepted by `LookPatch`. `main.py` already writes every `DEFAULTS` key onto the served `html` as `data-fc-*`; single-word names keep that working, since it replaces only the first underscore. Removed line, quoted: `DEFAULTS: dict[str, str] = {"mode": "system", "dark": "default", "light": "default", "accent": "", "title_field": "fixed"}`. Checked: a run that set them wrote `window-look.json` with all eight keys, and after an engine restart the served page carried `data-fc-home="off" data-fc-dock="shown" data-fc-menus="bar"`. + +## demos/, templates/ {#demos-and-templates} + +New in v0.15.0 (2026-12-01 EST, agent `cite-home`). No engine feature was added. A demo or starter is a library folder (`library.sqlite`), which FormCite already opens: copy it into the data folder under a name and run `library new NAME`. `libraries.create` only makes the `files/` folder, so it adopts the copied database as it is. Import alone cannot carry collections or notes (an import makes items and, with `--keywords-as-tags`, tags), so each demo also ships its `references.bib` for importing only the references. + +`demos/make_demos.py` writes everything from fixed seeds through the engine's own code. It points `FORMCITE_DATA_DIR` at a temporary folder and calls `transfer.import_file(..., keywords_as_tags=True)`, then `collections.create` and `add_items`, `notes.create` and `tags.ensure` (for the starters' tags, which have no items). It then checkpoints the WAL, sets `journal_mode=DELETE`, runs VACUUM and copies only `library.sqlite`. References are invented, with no DOI. The history demo adds 15 public-domain classics cited by first edition (Herodotus, Thucydides, Tacitus, Bede, Froissart, Machiavelli, Gibbon, Carlyle, Prescott, Macaulay, Tocqueville, Motley, Burckhardt in its 1878 English edition, Seeley, Parkman). Counts: urban-heat 260 items, 9 collections, 14 tags, 30 notes; history-reading 215, 10, 11, 30; lab-methods 240, 9, 12, 30. + +Templates: 40 independent styles from citation-style-language/styles `master` at 38e17c7 (2026-12-01), unmodified (CC BY-SA 3.0, `templates/CREDITS.md`), and FormCite's own `formcite-plain-author-date.csl`, copied from `app/style/regression/custom/`. 41 candidates were fetched, and `bibtex.csl` was dropped because it writes BibTeX rather than a citation style. Ten starters: thesis, grant, course, systematic-review, journal-article, book-project, lab-group, conference-talk, teaching-portfolio and policy-brief. `templates/index.json` lists all 51. + +Checked: each demo copied into a fresh data folder, registered with `library new` and listed with the CLI (260, 215 and 240 items). In the built window under 4x CPU throttling, switching to each in Preferences showed its item count, its own collections and tags in Items. Every style rendered the 20 regression references (bibliography complete, citations non-empty) through `render_with_style` and formatted three demo items through `./formcite cli format --style-file` (41 of 41). Every starter opened with its collection and tag counts as listed in its about.json. The style engine came from the 0.14.0 abi3 wheel C1 built (`formcite_style`, Hayagriva 0.10.1). diff --git a/backend/app/__init__.py b/backend/app/__init__.py index 9e78220..9da2f8f 100644 --- a/backend/app/__init__.py +++ b/backend/app/__init__.py @@ -1 +1 @@ -__version__ = "0.14.0" +__version__ = "0.15.0" diff --git a/backend/app/core/look_store.py b/backend/app/core/look_store.py index 3f2bfa0..bb0dc50 100644 --- a/backend/app/core/look_store.py +++ b/backend/app/core/look_store.py @@ -13,8 +13,9 @@ 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") +CHOICES: dict[str, tuple[str, ...]] = {"home": ("launch", "off"), "menus": ("bar", "window"), "dock": ("shown", "hidden")} HEX = re.compile(r"^#[0-9a-fA-F]{6}$") -DEFAULTS: dict[str, str] = {"mode": "system", "dark": "default", "light": "default", "accent": "", "title_field": "fixed"} +DEFAULTS: dict[str, str] = {"mode": "system", "dark": "default", "light": "default", "accent": "", "title_field": "fixed", "home": "launch", "menus": "bar", "dock": "hidden"} _LOCK = threading.Lock() @@ -34,6 +35,8 @@ def _clean(key: str, value: Any) -> str | None: return value if value in LIGHT else None if key == "title_field": return value if value in TITLE_FIELDS else None + if key in CHOICES: + return value if value in CHOICES[key] else None if key == "accent": return value.lower() if value == "" or HEX.match(value) else None return None diff --git a/backend/app/routers/dock.py b/backend/app/routers/dock.py new file mode 100644 index 0000000..9d532bb --- /dev/null +++ b/backend/app/routers/dock.py @@ -0,0 +1,178 @@ +import asyncio +import json +from typing import Literal + +from fastapi import APIRouter, Depends, HTTPException, Request, WebSocket, WebSocketDisconnect +from pydantic import BaseModel, Field + +from app.core import config +from app.routers.service import window_only +from app.services import agent_programs, terminal + +GROUP = "dock" +MAX_SOCKETS = 24 +NO_QUESTIONS = ("FormCite does not ask in the dock: an outside agent pairs once, the person approves the pairing " + "under Connections, and the agent then holds its own service token.") +router = APIRouter(tags=[GROUP], dependencies=[Depends(window_only)]) +stream = APIRouter(tags=[GROUP]) +_sockets = {"open": 0} + + +class OpenBody(BaseModel): + cols: int = Field(100, ge=1, le=10_000) + rows: int = Field(30, ge=1, le=10_000) + + +class ClaudeBody(OpenBody): + prompt: str | None = Field(None, max_length=100_000) + resume: str | None = Field(None, max_length=200) + + +class AgentBody(OpenBody): + kind: Literal["codex", "cursor", "antigravity"] + + +class ResultBody(BaseModel): + id: str = Field(max_length=80) + result: dict = Field(default_factory=dict) + + +def _port(request: Request) -> int: + server = request.scope.get("server") + return int(server[1]) if server and server[1] else config.port() + + +def _known(sid: str) -> terminal.Session: + try: + return terminal.get(sid) + except KeyError: + raise HTTPException(404, "There is no such terminal.") from None + + +@router.get("/terminal") +def list_terminals() -> dict: + return {"terminals": terminal.listing()} + + +@router.post("/terminal") +def open_terminal(body: OpenBody) -> dict: + try: + return terminal.open_session(cols=body.cols, rows=body.rows).describe() + except OSError as exc: + raise HTTPException(500, f"The shell could not start: {exc}") from None + + +@router.post("/terminal/ticket") +async def stream_ticket() -> dict: + terminal.bind(asyncio.get_running_loop()) + return {"ticket": terminal.ticket(), "seconds": terminal.TICKET_SECONDS} + + +@router.post("/terminal/claude") +def open_claude(body: ClaudeBody, request: Request) -> dict: + try: + return agent_programs.open_claude(_port(request), *terminal.clamp(body.cols, body.rows), body.prompt, body.resume) + except LookupError as exc: + raise HTTPException(409, str(exc)) from None + except OSError as exc: + raise HTTPException(500, f"Claude Code could not start: {exc}") from None + + +@router.post("/terminal/agent") +def open_agent(body: AgentBody, request: Request) -> dict: + try: + return agent_programs.open_program(body.kind, _port(request), *terminal.clamp(body.cols, body.rows)) + except LookupError as exc: + raise HTTPException(409, str(exc)) from None + except OSError as exc: + raise HTTPException(500, f"The program could not start: {exc}") from None + + +@router.post("/terminal/{sid}/restart") +def restart_terminal(sid: str) -> dict: + _known(sid) + try: + return terminal.restart(sid).describe() + except OSError as exc: + raise HTTPException(500, f"The program could not start again: {exc}") from None + + +@router.delete("/terminal/{sid}") +def close_terminal(sid: str) -> dict: + terminal.close(sid) + return {"ok": True} + + +@router.get("/agent/status") +def agent_status(fresh: bool = False) -> dict: + return agent_programs.status(fresh) + + +@router.get("/mcp/bridge/questions") +def bridge_questions() -> dict: + return {"questions": [], "asks": False, "detail": NO_QUESTIONS} + + +@router.post("/mcp/bridge/result") +def bridge_result(body: ResultBody) -> dict: + raise HTTPException(409, NO_QUESTIONS) + + +@stream.websocket("/terminal/{sid}/stream") +async def attach(ws: WebSocket, sid: str) -> None: + if not terminal.spend(ws.query_params.get("ticket")): + await ws.close(code=4403) + return + if _sockets["open"] >= MAX_SOCKETS: + await ws.close(code=4429) + return + try: + session = terminal.get(sid) + except KeyError: + await ws.close(code=4404) + return + terminal.bind(asyncio.get_running_loop()) + _sockets["open"] += 1 + await ws.accept() + queue: asyncio.Queue = asyncio.Queue() + session.subscribers.add(queue) + exit_frame = json.dumps({"type": "exit"}).encode() + + async def outbound() -> None: + await ws.send_text(session.scrollback()) + if not session.alive: + await ws.send_bytes(exit_frame) + while True: + text = await queue.get() + if text is None: + await ws.send_bytes(exit_frame) + else: + await ws.send_text(text) + + sender = asyncio.create_task(outbound()) + try: + while True: + try: + msg = json.loads(await ws.receive_text()) + except ValueError: + continue + if not isinstance(msg, dict): + continue + if msg.get("type") == "input" and session.alive: + terminal.write(sid, str(msg.get("data", ""))) + elif msg.get("type") == "resize": + try: + terminal.resize(sid, int(msg.get("cols", 80)), int(msg.get("rows", 24))) + except (TypeError, ValueError, KeyError): + continue + except (WebSocketDisconnect, RuntimeError): + pass + finally: + _sockets["open"] = max(0, _sockets["open"] - 1) + sender.cancel() + session.subscribers.discard(queue) + + +mounted = APIRouter() +mounted.include_router(router) +mounted.include_router(stream) diff --git a/backend/app/routers/look.py b/backend/app/routers/look.py index b174669..aee5223 100644 --- a/backend/app/routers/look.py +++ b/backend/app/routers/look.py @@ -14,6 +14,9 @@ class LookPatch(BaseModel): light: str | None = None accent: str | None = None title_field: str | None = None + home: str | None = None + menus: str | None = None + dock: str | None = None @router.get("/look") diff --git a/backend/app/routers/registry.py b/backend/app/routers/registry.py index dc543bb..81c7141 100644 --- a/backend/app/routers/registry.py +++ b/backend/app/routers/registry.py @@ -49,3 +49,4 @@ def mount(app: FastAPI) -> None: register("window", __import__("app.routers.window", fromlist=["router"]).router) register("upload", __import__("app.routers.upload", fromlist=["router"]).router) register("titles", __import__("app.routers.titles", fromlist=["router"]).router) +register("dock", __import__("app.routers.dock", fromlist=["mounted"]).mounted) diff --git a/backend/app/services/agent_programs.py b/backend/app/services/agent_programs.py new file mode 100644 index 0000000..29cdb7d --- /dev/null +++ b/backend/app/services/agent_programs.py @@ -0,0 +1,259 @@ +import atexit +import json +import os +import shutil +import subprocess +import threading +import time +from pathlib import Path + +from app.core import config +from app.service import store +from app.services import terminal + +CONTRACT = "2.2.1" +CACHE_SECONDS = 30 +CHECK_WAIT = 6 +TOKEN_VAR = "FORMCITE_MCP_TOKEN" +URL_VAR = "FORMCITE_MCP_URL" +TAB_HOST = "FormCite dock" +TAB_ENTRY = "formcite_tab" +WINDOWS = os.name == "nt" +PROGRAMS = { + "claude": {"title": "Claude Code", "names": ("claude",), "home": (".claude/local", ".claude/bin", ".local/bin"), + "install": "curl -fsSL https://claude.ai/install.sh | bash", "install_windows": "irm https://claude.ai/install.ps1 | iex"}, + "codex": {"title": "Codex", "names": ("codex",), "home": (".local/bin", ".npm-global/bin"), + "install": "npm install -g @openai/codex", "install_windows": "npm install -g @openai/codex"}, + "cursor": {"title": "Cursor", "names": ("cursor-agent",), "home": (".local/bin",), + "install": "curl https://cursor.com/install -fsS | bash", "install_windows": ""}, + "antigravity": {"title": "Antigravity", "names": ("agy",), "home": (".local/bin",), + "install": "curl -fsSL https://antigravity.google/cli/install.sh | bash", "install_windows": "irm https://antigravity.google/cli/install.ps1 | iex"}, +} +TABS = ("codex", "cursor", "antigravity") +TAB_NOTE = ("You are running inside FormCite's terminal dock. FormCite's MCP server is connected as formcite; " + "use its tools to read and change the person's citation library.") +_cache: dict = {"at": 0.0, "value": None} +_versions: dict[str, tuple[str, str | None]] = {} +_lock = threading.Lock() +_open_lock = threading.Lock() +_live: set[str] = set() + + +def _search_path() -> str: + home = Path.home() + extra = [str(home / sub) for p in PROGRAMS.values() for sub in p["home"]] + if not WINDOWS: + extra += ["/opt/homebrew/bin", "/usr/local/bin", "/usr/bin", "/snap/bin", "/home/linuxbrew/.linuxbrew/bin"] + seen: list[str] = [] + for part in os.environ.get("PATH", "").split(os.pathsep) + extra: + if part and part not in seen: + seen.append(part) + return os.pathsep.join(seen) + + +def find(kind: str) -> str | None: + where = _search_path() + for name in PROGRAMS[kind]["names"]: + path = shutil.which(name, path=where) + if path: + return path + return None + + +def install_line(kind: str) -> str: + p = PROGRAMS[kind] + return p["install_windows"] if WINDOWS else p["install"] + + +def _run(argv: list[str]) -> subprocess.CompletedProcess: + return subprocess.run(argv, capture_output=True, text=True, timeout=CHECK_WAIT, env=terminal.base_env({"PATH": _search_path()}), + stdin=subprocess.DEVNULL, creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0)) + + +def _version(path: str) -> str | None: + try: + stamp = str(os.stat(path).st_mtime) + except OSError: + return None + known = _versions.get(path) + if known and known[0] == stamp: + return known[1] + try: + out = _run([path, "--version"]) + text = (out.stdout or out.stderr).strip().splitlines() + value = text[0].strip()[:60] if out.returncode == 0 and text else None + except (OSError, subprocess.SubprocessError): + value = None + _versions[path] = (stamp, value) + return value + + +def _signed_in(path: str) -> bool | None: + if os.environ.get("ANTHROPIC_API_KEY") or os.environ.get("CLAUDE_CODE_OAUTH_TOKEN"): + return True + try: + data = json.loads(_run([path, "auth", "status"]).stdout) + except (OSError, subprocess.SubprocessError, ValueError): + return None + return bool(data.get("loggedIn")) if isinstance(data, dict) and "loggedIn" in data else None + + +def _one(kind: str) -> dict: + path = find(kind) + version = _version(path) if path else None + runs = path is not None and version is not None + out = {"installed": runs, "version": version, "install": "" if runs else install_line(kind), "signedIn": None, "label": PROGRAMS[kind]["title"]} + if path and not runs: + out["note"] = f"{PROGRAMS[kind]['title']} was found at {path} but does not start." + if kind == "claude" and runs: + out["signedIn"] = _signed_in(path) + return out + + +def status(fresh: bool = False) -> dict: + with _lock: + if not fresh and _cache["value"] is not None and time.time() - _cache["at"] < CACHE_SECONDS: + return _cache["value"] + value = {kind: _one(kind) for kind in PROGRAMS} | {"contract": CONTRACT} + _cache["value"], _cache["at"] = value, time.time() + _sweep() + return value + + +def mcp_url(port: int) -> str: + return f"http://127.0.0.1:{port}/mcp" + + +def _sweep() -> None: + for rec in store.tokens(): + if rec["host"] == TAB_HOST and not rec["revoked"] and rec["id"] not in _live: + _forget(rec["id"]) + + +def _tab_token(kind: str) -> tuple[str, str]: + _sweep() + rec = store.issue(TAB_HOST, f"{PROGRAMS[kind]['title']} tab", "write") + _live.add(rec["id"]) + return rec["id"], rec["token"] + + +def _forget(token_id: str) -> None: + _live.discard(token_id) + try: + store.revoke(token_id) + except Exception: + pass + + +def _leave() -> None: + for token_id in list(_live): + _forget(token_id) + terminal.close_all() + + +def tab_folder(kind: str) -> Path: + folder = config.data_dir() / "agent-tabs" / kind + folder.mkdir(parents=True, exist_ok=True) + return folder + + +def _write_private(path: Path, data: dict) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + part = path.with_name(path.name + f".part-{os.getpid()}") + with os.fdopen(os.open(part, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600), "w", encoding="utf-8") as f: + f.write(json.dumps(data, indent=2) + "\n") + os.replace(part, path) + + +def _servers(path: Path) -> dict: + try: + data = json.loads(path.read_text(encoding="utf-8") or "{}") if path.exists() else {} + except ValueError: + data = None + if not isinstance(data, dict) or not isinstance(data.get("mcpServers", {}), dict): + raise OSError(f"{path} is not an MCP servers file FormCite can read, so it was left alone") + return data + + +def _entry_file(folder: Path) -> Path: + return folder / ".agents" / "mcp_config.json" + + +def write_tab_entry(folder: Path, port: int, token: str) -> None: + path = _entry_file(folder) + data = _servers(path) + data.setdefault("mcpServers", {})[TAB_ENTRY] = {"serverUrl": mcp_url(port), "headers": {"Authorization": f"Bearer {token}"}} + _write_private(path, data) + + +def remove_tab_entry(folder: Path, token: str) -> None: + path = _entry_file(folder) + try: + data = _servers(path) + entry = data.get("mcpServers", {}).get(TAB_ENTRY) + if not isinstance(entry, dict) or (entry.get("headers") or {}).get("Authorization") != f"Bearer {token}": + return + del data["mcpServers"][TAB_ENTRY] + _write_private(path, data) + except (OSError, ValueError): + return + + +def claude_config(port: int) -> str: + return json.dumps({"mcpServers": {"formcite": {"type": "http", "url": mcp_url(port), "headers": {"Authorization": "Bearer ${" + TOKEN_VAR + "}"}}}}) + + +def _start(argv: list[str]) -> list[str]: + if WINDOWS and argv[0].lower().endswith((".cmd", ".bat")): + return [os.environ.get("COMSPEC", "cmd.exe"), "/c", *argv] + return argv + + +def _launch(kind: str, port: int, cols: int, rows: int, argv: list[str], folder: str, title: str, own: Path | None = None) -> dict: + token_id, token = _tab_token(kind) + env = terminal.base_env({TOKEN_VAR: token, URL_VAR: mcp_url(port), "PATH": _search_path()}) + try: + if own is not None: + write_tab_entry(own, port, token) + session = terminal.open_session(folder, cols, rows, title, _start(argv), env, kind) + except Exception: + _forget(token_id) + if own is not None: + remove_tab_entry(own, token) + raise + session.on_close.append(lambda: _forget(token_id)) + if own is not None: + session.on_close.append(lambda: remove_tab_entry(own, token)) + return session.describe() + + +def open_claude(port: int, cols: int, rows: int, prompt: str | None = None, resume: str | None = None) -> dict: + with _open_lock: + running = terminal.live("claude") + if running is not None and not resume: + if prompt: + terminal.write(running.id, prompt.replace("\r\n", "\n").replace("\r", "\n") + "\r") + return running.describe() + path = find("claude") + if path is None or _version(path) is None: + raise LookupError(f"Claude Code is not installed. Install it with: {install_line('claude')}") + argv = [path, "--mcp-config", claude_config(port), "--append-system-prompt", TAB_NOTE] + if resume: + argv += ["--resume", resume] + if prompt: + argv += ["--", prompt] + return _launch("claude", port, cols, rows, argv, terminal.home_folder(), "Claude Code (resumed)" if resume else "Claude Code") + + +def open_program(kind: str, port: int, cols: int, rows: int) -> dict: + if kind not in TABS: + raise ValueError(f"No agent program called {kind}") + path = find(kind) + if path is None or _version(path) is None: + raise LookupError(f"{PROGRAMS[kind]['title']} is not installed. Install it with: {install_line(kind)}") + own = tab_folder(kind) if kind == "antigravity" else None + folder = str(own) if own is not None else terminal.home_folder() + return _launch(kind, port, cols, rows, [path], folder, PROGRAMS[kind]["title"], own) + + +atexit.register(_leave) diff --git a/backend/app/services/terminal.py b/backend/app/services/terminal.py new file mode 100644 index 0000000..feaf7ab --- /dev/null +++ b/backend/app/services/terminal.py @@ -0,0 +1,227 @@ +import asyncio +import os +import secrets +import shutil +import threading +import time +import uuid +from collections import deque + +from app.core import config + +if os.name == "nt": + from winpty import PtyProcess +else: + from ptyprocess import PtyProcessUnicode as PtyProcess + +SCROLLBACK = 256 * 1024 +MIN_COLS, MAX_COLS = 10, 500 +MIN_ROWS, MAX_ROWS = 4, 200 +QUEUE_LIMIT = 4000 +TICKET_SECONDS = 60 +KINDS = ("shell", "claude", "codex", "cursor", "antigravity") +SECRET_ENV = ("FORMCITE_LAUNCH_CODE", "FORMCITE_MCP_TOKEN") + + +class Session: + def __init__(self, sid: str, title: str, cwd: str, proc, kind: str, argv: list[str] | None, env: dict | None) -> None: + self.id = sid + self.title = title + self.cwd = cwd + self.proc = proc + self.kind = kind + self.argv = argv + self.env = env + self.chunks: deque[str] = deque() + self.size = 0 + self.alive = proc is not None + self.subscribers: set[asyncio.Queue] = set() + self.lock = threading.Lock() + self.gen = 0 + self.cols = 100 + self.rows = 30 + self.on_close: list = [] + + def describe(self) -> dict: + return {"id": self.id, "title": self.title, "alive": self.alive, "kind": self.kind, "tip": self.cwd} + + def keep(self, text: str) -> None: + with self.lock: + self.chunks.append(text) + self.size += len(text) + while self.size > SCROLLBACK and len(self.chunks) > 1: + self.size -= len(self.chunks.popleft()) + + def scrollback(self) -> str: + with self.lock: + return "".join(self.chunks) + + +SESSIONS: dict[str, Session] = {} +TICKETS: dict[str, float] = {} +_loop: asyncio.AbstractEventLoop | None = None + + +def bind(loop: asyncio.AbstractEventLoop) -> None: + global _loop + _loop = loop + + +def clamp(cols: int, rows: int) -> tuple[int, int]: + return max(MIN_COLS, min(MAX_COLS, int(cols))), max(MIN_ROWS, min(MAX_ROWS, int(rows))) + + +def ticket() -> str: + now = time.time() + for old in [t for t, at in TICKETS.items() if now - at > TICKET_SECONDS]: + TICKETS.pop(old, None) + value = secrets.token_urlsafe(24) + TICKETS[value] = now + return value + + +def spend(value: str | None) -> bool: + at = TICKETS.pop(value, None) if value else None + return at is not None and time.time() - at <= TICKET_SECONDS + + +def login_shell() -> list[str]: + if os.name == "nt": + return [os.environ.get("COMSPEC", "cmd.exe")] + shell = os.environ.get("SHELL") or shutil.which("bash") or "/bin/sh" + return [shell, "-l"] + + +def home_folder() -> str: + return str(config.data_dir()) + + +def base_env(extra: dict | None = None) -> dict: + env = {k: v for k, v in os.environ.items() if k not in SECRET_ENV} + env["TERM"] = "xterm-256color" + env["COLORTERM"] = "truecolor" + env["FORMCITE_TERMINAL"] = "1" + env["FORMCITE_ENGINE_URL"] = f"http://127.0.0.1:{config.port()}" + return env | (extra or {}) + + +def _deliver(session: Session, text: str | None) -> None: + for q in list(session.subscribers): + if q.qsize() < QUEUE_LIMIT: + q.put_nowait(text) + + +def _send(session: Session, text: str | None) -> None: + if _loop is not None and not _loop.is_closed(): + _loop.call_soon_threadsafe(_deliver, session, text) + + +def _pump(session: Session, proc, gen: int) -> None: + while True: + try: + text = proc.read(65536) + except (EOFError, OSError): + break + if not text: + continue + if session.gen != gen: + return + session.keep(text) + _send(session, text) + if session.gen != gen: + return + session.alive = False + _send(session, None) + + +def _spawn(cwd: str, cols: int, rows: int, argv: list[str] | None, env: dict | None): + return PtyProcess.spawn(argv or login_shell(), cwd=cwd, env=env or base_env(), dimensions=(rows, cols)) + + +def open_session(cwd: str | None = None, cols: int = 100, rows: int = 30, title: str | None = None, + argv: list[str] | None = None, env: dict | None = None, kind: str = "shell") -> Session: + if kind not in KINDS: + raise ValueError(f"No terminal kind called {kind}") + where = cwd or home_folder() + if not os.path.isdir(where): + raise FileNotFoundError(f"There is no folder {where}.") + cols, rows = clamp(cols, rows) + proc = _spawn(where, cols, rows, argv, env) + sid = uuid.uuid4().hex[:12] + shells = sum(1 for s in SESSIONS.values() if s.kind == "shell") + session = Session(sid, title or f"Terminal {shells + 1}", where, proc, kind, argv, env) + session.cols, session.rows = cols, rows + SESSIONS[sid] = session + threading.Thread(target=_pump, args=(session, proc, 0), name=f"pty-{sid}", daemon=True).start() + return session + + +def restart(sid: str) -> Session: + session = get(sid) + session.gen += 1 + gen = session.gen + try: + session.proc.terminate(force=True) + except Exception: + pass + where = session.cwd if os.path.isdir(session.cwd) else home_folder() + proc = _spawn(where, session.cols, session.rows, session.argv, session.env) + with session.lock: + session.chunks.clear() + session.size = 0 + session.proc = proc + session.alive = True + _send(session, "\x1bc") + threading.Thread(target=_pump, args=(session, proc, gen), name=f"pty-{sid}-{gen}", daemon=True).start() + return session + + +def write(sid: str, data: str) -> None: + session = get(sid) + if session.proc is not None and session.alive: + session.proc.write(data) + + +def resize(sid: str, cols: int, rows: int) -> None: + session = get(sid) + session.cols, session.rows = clamp(cols, rows) + if session.alive and session.proc is not None: + session.proc.setwinsize(session.rows, session.cols) + + +def close(sid: str) -> None: + session = SESSIONS.pop(sid, None) + if session is None: + return + session.gen += 1 + if session.proc is not None: + try: + session.proc.terminate(force=True) + except Exception: + pass + for done in session.on_close: + try: + done() + except Exception: + pass + _send(session, None) + + +def get(sid: str) -> Session: + session = SESSIONS.get(sid) + if session is None: + raise KeyError(sid) + return session + + +def live(kind: str) -> Session | None: + return next((s for s in SESSIONS.values() if s.kind == kind and s.alive), None) + + +def listing() -> list[dict]: + return [s.describe() for s in SESSIONS.values()] + + +def close_all() -> None: + for sid in list(SESSIONS): + close(sid) diff --git a/backend/formcite_engine.py b/backend/formcite_engine.py index 0126d2b..430cece 100755 --- a/backend/formcite_engine.py +++ b/backend/formcite_engine.py @@ -115,6 +115,7 @@ def serve() -> int: import signal def leave(_signum, _frame) -> None: + __import__("app.services.agent_programs", fromlist=["_leave"])._leave() runtime.release(data) os._exit(0) diff --git a/backend/oc_install b/backend/oc_install index aa56984..0ed91e4 100755 --- a/backend/oc_install +++ b/backend/oc_install @@ -2,7 +2,7 @@ set -e cd "$(dirname "$0")" PY="" -for c in python3.14 python3.13 python3.12 python3 python; do +for c in python3 python3.14 python3.13 python3.12 python; do if command -v "$c" >/dev/null 2>&1 && "$c" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 12) else 1)' 2>/dev/null; then PY="$c"; break; fi done [ -n "$PY" ] || { echo "[formcite] Python 3.12 or newer is required" >&2; exit 1; } diff --git a/backend/oc_install.bat b/backend/oc_install.bat index 0a3b87d..bb052c5 100644 --- a/backend/oc_install.bat +++ b/backend/oc_install.bat @@ -2,8 +2,8 @@ setlocal cd /d "%~dp0" set "PY=" -py -3 -c "import sys; raise SystemExit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul && set "PY=py -3" -if not defined PY python -c "import sys; raise SystemExit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul && set "PY=python" +python -c "import sys; raise SystemExit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul && set "PY=python" +if not defined PY py -3 -c "import sys; raise SystemExit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul && set "PY=py -3" if not defined PY ( echo [formcite] Python 3.12 or newer is required & exit /b 1 ) if not exist venv %PY% -m venv venv call venv\Scripts\activate.bat diff --git a/backend/requirements.txt b/backend/requirements.txt index 68c1bd4..660e100 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,3 +1,6 @@ fastapi==0.141.1 uvicorn[standard]==0.53.0 pypdf==7.2.0 +tzdata==2026.6 +ptyprocess==0.7.0; sys_platform != "win32" +pywinpty==3.0.5; sys_platform == "win32" diff --git a/backend/requirements_macos.txt b/backend/requirements_macos.txt index c2646db..9fbbc18 100644 --- a/backend/requirements_macos.txt +++ b/backend/requirements_macos.txt @@ -1,3 +1,5 @@ fastapi uvicorn[standard] pypdf +tzdata +ptyprocess diff --git a/demos/README.md b/demos/README.md new file mode 100644 index 0000000..bfe3f70 --- /dev/null +++ b/demos/README.md @@ -0,0 +1,52 @@ +# FormCite demos + +Three complete sample libraries. Each one has references, collections, tags and notes. + +| Folder | Library | References | Collections | Tags | Notes | +| --- | --- | ---: | ---: | ---: | ---: | +| `urban-heat/` | Cooling the city: a thesis on urban heat | 260 | 9 | 14 | 30 | +| `history-reading/` | Writing the past: a history reading list | 215 | 10 | 11 | 30 | +| `lab-methods/` | Bench to paper: a cell biology lab's methods library | 240 | 9 | 12 | 30 | + +Each folder holds: + +- `library/library.sqlite`: the whole library, ready to open. +- `references.bib`: the same references as BibTeX, with their keywords. You can import this file into any library; it brings the references and their tags but not the collections or notes. +- `about.json`: id, name, description, licence and credit. + +The references are invented. They have no DOI, so none of them points at a real work it does not describe. The history list also cites fifteen classic histories that are in the public domain (Herodotus, Bede, Gibbon, Burckhardt and others). They are cited by their first editions. + +## Open a demo + +1. Stop FormCite. +2. Copy the demo's `library` folder into your data folder (`~/FormCite` unless `FORMCITE_DATA_DIR` says otherwise) and give the copy a name, for example `~/FormCite/Demo - Urban heat thesis`. +3. Register that folder as a library under the same name: + + ``` + ./formcite cli library new "Demo - Urban heat thesis" + ``` + + A library named this way lives in the data folder under its own name, so FormCite finds the copied `library.sqlite` and opens it as it is. +4. Start FormCite, open Preferences, then Libraries, and press Switch beside the demo. Items shows its references, and the side panel shows its collections and tags. + +Always work on a copy. The folder in this repository stays unchanged. + +## Import only the references + +In the window, choose Add, then Import, then the demo's `references.bib`, and turn on "Turn keywords into tags". From the command line: + +``` +./formcite cli import demos/urban-heat/references.bib --keywords-as-tags +``` + +## Rebuilding + +`make_demos.py` writes every demo, and the library starters in `templates/starters/`, from fixed random seeds. It uses the engine's own import, collection, tag and note code. Run it from the repository root with the backend environment: + +``` +backend/venv/bin/python demos/make_demos.py +``` + +## Licence + +The demos are part of FormCite and use its licence (GPL-3.0-only). Credit: written for FormCite by nodemode.ai. diff --git a/demos/history-reading/about.json b/demos/history-reading/about.json new file mode 100644 index 0000000..d9f5f6c --- /dev/null +++ b/demos/history-reading/about.json @@ -0,0 +1,16 @@ +{ + "id": "history-reading", + "name": "Writing the past: a history reading list", + "description": "A seminar reading list on how history has been written: classic public-domain histories and 200 invented modern studies, by week and theme, with tags and notes.", + "kind": "demo", + "library_name": "Demo - History reading list", + "references": 215, + "collections": 10, + "notes": 30, + "licence": "GPL-3.0-only", + "credit": "Invented references written for FormCite by nodemode.ai; the classic histories are public-domain works, cited by their first editions. No DOI is given, so no reference points at a real work it does not describe.", + "files": { + "import": "references.bib", + "library": "library/library.sqlite" + } +} diff --git a/demos/history-reading/library/library.sqlite b/demos/history-reading/library/library.sqlite new file mode 100644 index 0000000..8b24563 Binary files /dev/null and b/demos/history-reading/library/library.sqlite differ diff --git a/demos/history-reading/references.bib b/demos/history-reading/references.bib new file mode 100644 index 0000000..e1919af --- /dev/null +++ b/demos/history-reading/references.bib @@ -0,0 +1,2185 @@ +@book{classic1, + author = {Gibbon, Edward}, + title = {The History of the Decline and Fall of the Roman Empire}, + year = {1776}, + address = {London}, + publisher = {Strahan and Cadell}, + keywords = {primary source, historiography} +} + +@book{classic2, + author = {Macaulay, Thomas Babington}, + title = {The History of England from the Accession of James the Second}, + year = {1848}, + address = {London}, + publisher = {Longman, Brown, Green, and Longmans}, + keywords = {historiography} +} + +@book{classic3, + author = {Burckhardt, Jacob}, + title = {The Civilization of the Renaissance in Italy}, + year = {1878}, + address = {London}, + publisher = {C. Kegan Paul}, + keywords = {renaissance, translation} +} + +@book{classic4, + author = {Carlyle, Thomas}, + title = {The French Revolution: A History}, + year = {1837}, + address = {London}, + publisher = {James Fraser}, + keywords = {revolution, primary source} +} + +@book{classic5, + author = {Tocqueville, Alexis de}, + title = {The Old Regime and the Revolution}, + year = {1856}, + address = {London}, + publisher = {John Murray}, + keywords = {revolution, translation} +} + +@book{classic6, + author = {Prescott, William H.}, + title = {History of the Conquest of Mexico}, + year = {1843}, + address = {New York}, + publisher = {Harper and Brothers}, + keywords = {empire} +} + +@book{classic7, + author = {Motley, John Lothrop}, + title = {The Rise of the Dutch Republic}, + year = {1856}, + address = {New York}, + publisher = {Harper and Brothers}, + keywords = {historiography} +} + +@book{classic8, + author = {{Bede}}, + title = {Ecclesiastical History of the English People}, + year = {731}, + keywords = {primary source, archive} +} + +@book{classic9, + author = {{Herodotus}}, + title = {The Histories}, + year = {-430}, + keywords = {primary source, translation} +} + +@book{classic10, + author = {{Thucydides}}, + title = {History of the Peloponnesian War}, + year = {-400}, + keywords = {primary source, translation} +} + +@book{classic11, + author = {{Tacitus}}, + title = {The Annals}, + year = {116}, + keywords = {primary source, translation} +} + +@book{classic12, + author = {Froissart, Jean}, + title = {Chronicles}, + year = {1400}, + keywords = {primary source, archive} +} + +@book{classic13, + author = {Machiavelli, Niccolo}, + title = {The Prince}, + year = {1532}, + keywords = {renaissance, primary source} +} + +@book{classic14, + author = {Parkman, Francis}, + title = {Montcalm and Wolfe}, + year = {1884}, + address = {Boston}, + publisher = {Little, Brown, and Company}, + keywords = {empire} +} + +@book{classic15, + author = {Seeley, John Robert}, + title = {The Expansion of England}, + year = {1883}, + address = {London}, + publisher = {Macmillan}, + keywords = {empire, historiography} +} + +@misc{history16, + author = {Ivesdale, Yara and Marrowfield, Rosa and Dunmore, Ada and Oakhurst, Otto}, + title = {Reading oral testimony in the Atlantic world}, + year = {2013}, + keywords = {empire, renaissance}, + howpublished = {Dataset}, + publisher = {Ostrava Vale Open Data} +} + +@article{history17, + author = {Whitlock, Cosmo and Delacourt, Nils and Calloway, Marisol and Yardley, Saoirse and Lindqvist, Otto}, + title = {Ordering Enlightenment historiography in the Atlantic world}, + year = {2020}, + keywords = {renaissance}, + journal = {Journal of Archival Practice}, + volume = {48}, + number = {6}, + pages = {580--597} +} + +@incollection{history18, + author = {Tremaine, Rafael and Kettering, Luca and Lindqvist, Juno and Underhill, Tobias and Ishikawa-Reed, Mina and Montaigne-Blake, Hugo}, + title = {Rethinking oral testimony in Renaissance Italy}, + year = {2024}, + keywords = {revolution}, + booktitle = {Handbook Of Enlightenment Historiography}, + editor = {Cardenas-Holt, Celia and Larkspur, Rosa}, + publisher = {Saltford House}, + address = {Westmarch}, + pages = {303--325} +} + +@article{history19, + author = {Okonkwo-Hart, Hugo and Varga, Farid}, + title = {Questioning the Renaissance city in the Low Countries}, + year = {2023}, + keywords = {method, archive, translation}, + journal = {Journal of Archival Practice}, + volume = {22}, + number = {9}, + pages = {146--170} +} + +@article{history20, + author = {Abernathy, Bram and Kettering, Orla and Tremaine, Ada and Oakhurst, Aurelio and Delacourt, Juno}, + title = {Ordering revolutionary memory in the Mediterranean}, + year = {1996}, + keywords = {essay question}, + journal = {Studies in Early Modern Memory}, + volume = {48}, + number = {2}, + pages = {355--361} +} + +@article{history21, + author = {Zabala, Desmond and Stavely, Nils and Fenwright, Greta}, + title = {Reading imperial record keeping in nineteenth-century Britain}, + year = {1998}, + keywords = {revolution, renaissance}, + journal = {Chronicle and Method}, + volume = {34}, + number = {11}, + pages = {174--202} +} + +@incollection{history22, + author = {Zabala, Viktor and Sandoval, Amara and Kettering, Otto and Ulvaeus, Amara and Ellery, Vesna and Pemberton, Aurelio}, + title = {Questioning microhistory in nineteenth-century Britain}, + year = {2000}, + keywords = {translation, primary source}, + booktitle = {Handbook Of Microhistory}, + editor = {Stavely, Bastian and Bellweather, Tala}, + publisher = {Saltford House}, + address = {Harrowgate}, + pages = {146--161} +} + +@article{history23, + author = {Vantongeren, Kenji and Ulvaeus, Juno}, + title = {Tracing maps and borders in the Mediterranean}, + year = {2021}, + keywords = {translation}, + journal = {Historiography Review}, + volume = {16}, + number = {9}, + pages = {483--503} +} + +@techreport{history24, + author = {Northcote, Tobias and Brightwater, Luca and Ravensworth, Chiara and Yilmaz-Grant, Bastian and Fenwright, Amara}, + title = {Tracing oral testimony in early modern Europe}, + year = {2018}, + keywords = {translation}, + institution = {Westmarch Data Office}, + number = {TR-2018-77} +} + +@techreport{history25, + author = {Gilchrist, Yusuf}, + title = {Questioning microhistory in the Mediterranean}, + year = {2010}, + keywords = {method}, + institution = {Harrowgate Data Office}, + number = {TR-2010-78} +} + +@article{history26, + author = {Zeller, Celia and Bellweather, Saoirse}, + title = {Remembering oral testimony in Renaissance Italy}, + year = {2016}, + keywords = {archive, memory}, + journal = {Studies in Early Modern Memory}, + volume = {36}, + number = {5}, + pages = {552--566} +} + +@techreport{history27, + author = {Harwood, Otto and Esterhazy-Lowe, Hugo and Rowntree, Leonie and Achterberg, Chiara}, + title = {Narrating Enlightenment historiography in colonial port towns}, + year = {2010}, + keywords = {renaissance}, + institution = {Harrowgate City Council}, + number = {TR-2010-34} +} + +@article{history28, + author = {Yardley, Leonie and Jessamy, Otto and Achterberg, Femi}, + title = {Reading national histories in the Baltic}, + year = {2020}, + keywords = {archive}, + journal = {Journal of Archival Practice}, + volume = {48}, + number = {9}, + pages = {406--431} +} + +@inproceedings{history29, + author = {Brightwater, Ines and Okonkwo-Hart, Tobias}, + title = {Rethinking the Renaissance city in the Low Countries}, + year = {2004}, + keywords = {historiography}, + booktitle = {Proceedings of the 7th Meeting on Local History Societies}, + pages = {151--158} +} + +@techreport{history30, + author = {Fenwright, Kaia and Northcote, Nils and Cardenas-Holt, Uma and Zabala, Otto}, + title = {Reading oral testimony in early modern Europe}, + year = {2000}, + keywords = {primary source, translation}, + institution = {Brindlemoor Data Office}, + number = {TR-2000-85} +} + +@article{history31, + author = {Gilchrist, Zora}, + title = {Questioning microhistory in nineteenth-century Britain: lessons from a decade}, + year = {2002}, + keywords = {empire, archive}, + journal = {Past and Narrative}, + volume = {47}, + number = {4}, + pages = {777--803} +} + +@incollection{history32, + author = {Yilmaz-Grant, Bastian and Fairbairn, Kaia and Montaigne-Blake, Amara and Yardley, Pavel}, + title = {Tracing the archive in nineteenth-century Britain}, + year = {2020}, + keywords = {primary source, essay question}, + booktitle = {Perspectives On The Medieval Chronicle}, + editor = {Sandoval, Soren and Dunmore, Luca}, + publisher = {Westmarch Scholarly}, + address = {Lowen}, + pages = {295--322} +} + +@article{history33, + author = {Ellery, Desmond and Ashgrove, Zora and Pemberton, Yusuf and Quarrington, Dario and Yilmaz-Grant, Celia}, + title = {Recovering microhistory in colonial port towns}, + year = {2022}, + keywords = {essay question}, + journal = {Studies in Early Modern Memory}, + volume = {25}, + number = {6}, + pages = {759--786} +} + +@techreport{history34, + author = {Juniper, Beatrix and Harwood, Edda and Cardenas-Holt, Elif and Tremaine, Jonas and Ravensworth, Tala and Harwood, Otto}, + title = {Recovering maps and borders in the Low Countries}, + year = {2003}, + keywords = {historiography, seminar, renaissance}, + institution = {Harrowgate Research Institute}, + number = {TR-2003-69} +} + +@inproceedings{history35, + author = {Vantongeren, Aurelio and Brightwater, Orla and Sandoval, Leonie}, + title = {Questioning national histories in Renaissance Italy}, + year = {2011}, + keywords = {archive, empire, revolution}, + booktitle = {Proceedings of the 28th Meeting on Local History Societies}, + pages = {288--293} +} + +@article{history36, + author = {Fenwright, Celia and Wexford, Elif}, + title = {Rethinking the printing press in the Mediterranean}, + year = {2013}, + keywords = {historiography, seminar}, + journal = {Historiography Review}, + volume = {33}, + number = {5}, + pages = {279--302} +} + +@incollection{history37, + author = {Delacourt, Aurelio and Sandoval, Jonas and Quarrington, Ada and Nakashima, Yusuf and Zabala, Celia and Larkspur, Beatrix}, + title = {Narrating revolutionary memory in early modern Europe}, + year = {1998}, + keywords = {translation, essay question, method}, + booktitle = {New Directions In Revolutionary Memory}, + editor = {Calloway, Priya and Brightwater, Ines}, + publisher = {Calder Bay Academic}, + address = {Harrowgate}, + pages = {182--212} +} + +@book{history38, + author = {Stavely, Saoirse and Varga, Otto and Calloway, Kaia and Northcote, Tala}, + title = {Reading microhistory in colonial port towns}, + year = {2025}, + keywords = {revolution}, + publisher = {Brindlemoor University Press}, + address = {Calder Bay} +} + +@article{history39, + author = {Ellery, Rosa and Sandoval, Noor and Galloway, Marisol}, + title = {Remembering the archive in the Atlantic world}, + year = {2026}, + keywords = {translation}, + journal = {Journal of Archival Practice}, + volume = {8}, + number = {9}, + pages = {441--458} +} + +@article{history40, + author = {Esterhazy-Lowe, Nils and Kettering, Kenji and Kowalczyk, Pavel and Vantongeren, Celia and Larkspur, Marisol}, + title = {Tracing national histories in colonial port towns}, + year = {2000}, + keywords = {method, translation, memory}, + journal = {Historiography Review}, + volume = {9}, + number = {12}, + pages = {885--895} +} + +@article{history41, + author = {Whitlock, Aurelio and Northcote, Desmond and Varga, Cosmo}, + title = {Reading microhistory in Renaissance Italy}, + year = {1996}, + keywords = {primary source, translation}, + journal = {Past and Narrative}, + volume = {20}, + number = {2}, + pages = {822--841} +} + +@book{history42, + author = {Larkspur, Rafael and Ellery, Bram}, + title = {Remembering monastic libraries in the Atlantic world}, + year = {2018}, + keywords = {essay question, primary source}, + publisher = {Brindlemoor University Press}, + address = {Lowen} +} + +@techreport{history43, + author = {Ishikawa-Reed, Rosa and Ishikawa-Reed, Juno}, + title = {Tracing the archive in the Atlantic world}, + year = {2019}, + keywords = {translation, empire, archive}, + institution = {Saltford Research Institute}, + number = {TR-2019-77} +} + +@article{history44, + author = {Gilchrist, Elif and Whitlock, Wilhelmina}, + title = {Recovering revolutionary memory in Renaissance Italy}, + year = {1994}, + keywords = {archive, renaissance}, + journal = {Historiography Review}, + volume = {27}, + number = {11}, + pages = {776--784} +} + +@article{history45, + author = {Pemberton, Ikaika and Ulvaeus, Quinn}, + title = {Reading the archive in the Atlantic world}, + year = {2008}, + keywords = {empire, method}, + journal = {Past and Narrative}, + volume = {13}, + number = {4}, + pages = {704--715} +} + +@incollection{history46, + author = {Montaigne-Blake, Bastian and Yilmaz-Grant, Dario and Yilmaz-Grant, Yusuf}, + title = {Tracing the archive in the Baltic}, + year = {2020}, + keywords = {memory, renaissance}, + booktitle = {Perspectives On The History Of Reading}, + editor = {Yilmaz-Grant, Hugo and Ellery, Dario}, + publisher = {Calder Bay Academic}, + address = {Port Ellery}, + pages = {95--110} +} + +@book{history47, + author = {Vantongeren, Soren and Larkspur, Aurelio and Esterhazy-Lowe, Yara and Okonkwo-Hart, Nils}, + title = {Tracing oral testimony in the Mediterranean}, + year = {2004}, + keywords = {essay question}, + publisher = {Saltford House}, + address = {Saltford} +} + +@incollection{history48, + author = {Pemberton, Rafael and Calloway, Ines and Fairbairn, Ada and Wexford, Ximena and Pemberton, Chiara}, + title = {Reading the printing press in the Low Countries}, + year = {2004}, + keywords = {essay question, primary source, revolution}, + booktitle = {Handbook Of Microhistory}, + editor = {Jessamy, Saoirse and Varga, Mina}, + publisher = {Lantern Field Books}, + address = {Harrowgate}, + pages = {144--174} +} + +@article{history49, + author = {Lindqvist, Otto and Cardenas-Holt, Amara and Marrowfield, Hugo and Varga, Nils and Zeller, Ada and Bellweather, Hugo}, + title = {Ordering Enlightenment historiography in the Low Countries}, + year = {1994}, + keywords = {archive, revolution}, + journal = {Past and Narrative}, + volume = {12}, + number = {5}, + pages = {852--865} +} + +@article{history50, + author = {Lindqvist, Amara and Marrowfield, Mina}, + title = {Questioning national histories in early modern Europe}, + year = {2026}, + keywords = {empire}, + journal = {Historiography Review}, + volume = {35}, + number = {4}, + pages = {73--79} +} + +@article{history51, + author = {Oakhurst, Rosa and Delacourt, Cosmo}, + title = {Reading the archive in Renaissance Italy}, + year = {1995}, + keywords = {empire, memory, revolution}, + journal = {Journal of Archival Practice}, + volume = {1}, + number = {2}, + pages = {62--74} +} + +@article{history52, + author = {Gilchrist, Hanne and Varga, Celia and Calloway, Kenji and Sandoval, Kaia and Ashgrove, Uma and Halloran, Otto}, + title = {Recovering Enlightenment historiography in nineteenth-century Britain}, + year = {1999}, + keywords = {revolution, renaissance, archive}, + journal = {Studies in Early Modern Memory}, + volume = {1}, + number = {10}, + pages = {412--425} +} + +@article{history53, + author = {Fenwright, Nils and Stavely, Vesna and Underhill, Priya and Sandoval, Otto}, + title = {Tracing the history of reading in early modern Europe}, + year = {2026}, + keywords = {revolution}, + journal = {Past and Narrative}, + volume = {19}, + number = {4}, + pages = {431--444} +} + +@inproceedings{history54, + author = {Ulvaeus, Amara and Oakhurst, Marisol and Fenwright, Hanne and Kettering, Orla and Marrowfield, Bastian}, + title = {Reading local history societies in early modern Europe}, + year = {1998}, + keywords = {empire, seminar}, + booktitle = {Proceedings of the 25th Meeting on Enlightenment Historiography}, + pages = {278--282} +} + +@book{history55, + author = {Ishikawa-Reed, Orla and Calloway, Viktor}, + title = {Ordering the history of reading in early modern Europe}, + year = {2011}, + keywords = {empire}, + publisher = {Calder Bay Academic}, + address = {Saltford} +} + +@article{history56, + author = {Yardley, Aurelio and Varga, Elif}, + title = {Recovering the printing press in the Low Countries}, + year = {2007}, + keywords = {translation, essay question}, + journal = {Journal of Archival Practice}, + volume = {47}, + number = {7}, + pages = {26--33} +} + +@article{history57, + author = {Montaigne-Blake, Kenji}, + title = {Narrating local history societies in colonial port towns}, + year = {2007}, + keywords = {translation, revolution}, + journal = {Chronicle and Method}, + volume = {47}, + number = {8}, + pages = {193--206} +} + +@misc{history58, + author = {Ravensworth, Kenji and Bellweather, Viktor and Fenwright, Beatrix and Oakhurst, Uma}, + title = {Ordering microhistory in the Baltic}, + year = {1998}, + keywords = {revolution}, + howpublished = {Dataset}, + publisher = {Calder Bay Open Data} +} + +@techreport{history59, + author = {Okonkwo-Hart, Pavel and Marrowfield, Femi and Kettering, Noor}, + title = {Narrating oral testimony in Renaissance Italy}, + year = {1995}, + keywords = {seminar, revolution}, + institution = {Harrowgate City Council}, + number = {TR-1995-48} +} + +@article{history60, + author = {Oakhurst, Uma and Nakashima, Vesna and Harwood, Pavel and Yardley, Viktor}, + title = {Rethinking national histories in the Atlantic world}, + year = {2006}, + keywords = {renaissance, historiography}, + journal = {Journal of Archival Practice}, + volume = {37}, + number = {4}, + pages = {473--483} +} + +@techreport{history61, + author = {Juniper, Leonie and Rowntree, Hanne and Marrowfield, Noor and Lindqvist, Tobias and Okonkwo-Hart, Wilhelmina}, + title = {Rethinking oral testimony in the Low Countries}, + year = {2014}, + keywords = {revolution, method, translation}, + institution = {Saltford Data Office}, + number = {TR-2014-77} +} + +@phdthesis{history62, + author = {Montaigne-Blake, Vesna and Fenwright, Noor}, + title = {Recovering revolutionary memory in the Low Countries}, + year = {2019}, + keywords = {revolution}, + school = {University of Port Ellery} +} + +@article{history63, + author = {Zeller, Tala and Sandoval, Leonie and Zabala, Priya and Whitlock, Cosmo}, + title = {Reading oral testimony in the Mediterranean}, + year = {2021}, + keywords = {revolution}, + journal = {Studies in Early Modern Memory}, + volume = {17}, + number = {12}, + pages = {360--372} +} + +@techreport{history64, + author = {Varga, Aurelio and Bellweather, Jonas}, + title = {Remembering revolutionary memory in the Mediterranean}, + year = {2014}, + keywords = {method, translation}, + institution = {Lowen City Council}, + number = {TR-2014-50} +} + +@techreport{history65, + author = {Larkspur, Bram and Jessamy, Priya and Montaigne-Blake, Marisol}, + title = {Recovering revolutionary memory in the Atlantic world}, + year = {1995}, + keywords = {archive, historiography}, + institution = {Westmarch Observatory}, + number = {TR-1995-15} +} + +@phdthesis{history66, + author = {Bellweather, Farid and Esterhazy-Lowe, Aurelio and Ashgrove, Mina}, + title = {Ordering the history of reading in nineteenth-century Britain}, + year = {2011}, + keywords = {revolution}, + school = {University of Ostrava Vale} +} + +@article{history67, + author = {Kowalczyk, Celia and Zabala, Wilhelmina and Wexford, Hugo and Rowntree, Tobias}, + title = {Rethinking imperial record keeping in the Atlantic world}, + year = {2008}, + keywords = {translation, historiography}, + journal = {Historiography Review}, + volume = {33}, + number = {2}, + pages = {637--649} +} + +@incollection{history68, + author = {Montaigne-Blake, Ada and Oakhurst, Tala and Zeller, Ada and Dunmore, Wilhelmina}, + title = {Ordering the Renaissance city in nineteenth-century Britain}, + year = {2014}, + keywords = {translation, method}, + booktitle = {New Directions In National Histories}, + editor = {Kettering, Bram and Ravensworth, Hugo}, + publisher = {Saltford House}, + address = {Ostrava Vale}, + pages = {347--376} +} + +@inproceedings{history69, + author = {Vantongeren, Orla and Montaigne-Blake, Dario}, + title = {Remembering the grand narrative in the Mediterranean}, + year = {2021}, + keywords = {essay question, revolution}, + booktitle = {Proceedings of the 23th Meeting on The Medieval Chronicle}, + pages = {275--281} +} + +@article{history70, + author = {Dunmore, Greta and Stavely, Hanne}, + title = {Narrating revolutionary memory in the Baltic}, + year = {2006}, + keywords = {method}, + journal = {Past and Narrative}, + volume = {17}, + number = {8}, + pages = {782--789} +} + +@article{history71, + author = {Whitlock, Celia and Tremaine, Mina and Zabala, Kenji}, + title = {Questioning the medieval chronicle in the Baltic}, + year = {2025}, + keywords = {seminar, memory, essay question}, + journal = {Studies in Early Modern Memory}, + volume = {29}, + number = {12}, + pages = {73--79} +} + +@inproceedings{history72, + author = {Larkspur, Priya and Jessamy, Wilhelmina}, + title = {Reading revolutionary memory in colonial port towns}, + year = {1999}, + keywords = {renaissance, revolution, memory}, + booktitle = {Proceedings of the 12th Meeting on Imperial Record Keeping}, + pages = {46--50} +} + +@article{history73, + author = {Yilmaz-Grant, Desmond}, + title = {Reading the Renaissance city in the Low Countries}, + year = {2025}, + keywords = {memory, essay question}, + journal = {Historiography Review}, + volume = {19}, + number = {10}, + pages = {238--261} +} + +@article{history74, + author = {Sandoval, Juno and Quarrington, Zora and Rowntree, Vesna}, + title = {Rethinking Enlightenment historiography in early modern Europe}, + year = {2008}, + keywords = {essay question}, + journal = {Studies in Early Modern Memory}, + volume = {30}, + number = {1}, + pages = {57--70} +} + +@article{history75, + author = {Underhill, Chiara and Brightwater, Ines and Abernathy, Noor and Whitlock, Yara}, + title = {Tracing monastic libraries in the Mediterranean}, + year = {2013}, + keywords = {method, historiography}, + journal = {Chronicle and Method}, + volume = {16}, + number = {3}, + pages = {777--796} +} + +@article{history76, + author = {Cardenas-Holt, Hanne and Rowntree, Rafael and Okonkwo-Hart, Beatrix}, + title = {Recovering the archive in the Atlantic world}, + year = {2020}, + keywords = {archive}, + journal = {Historiography Review}, + volume = {22}, + number = {6}, + pages = {544--563} +} + +@article{history77, + author = {Gilchrist, Beatrix and Kettering, Celia and Halloran, Noor}, + title = {Reading national histories in the Low Countries}, + year = {2007}, + keywords = {primary source, renaissance}, + journal = {Studies in Early Modern Memory}, + volume = {8}, + number = {3}, + pages = {709--720} +} + +@article{history78, + author = {Bellweather, Marisol and Zabala, Yusuf and Gilchrist, Uma and Thornbury, Wren and Kowalczyk, Zora and Ellery, Dario}, + title = {Remembering national histories in the Low Countries}, + year = {2022}, + keywords = {renaissance, seminar}, + journal = {Past and Narrative}, + volume = {8}, + number = {6}, + pages = {288--305} +} + +@inproceedings{history79, + author = {Rowntree, Ikaika and Thornbury, Noor and Ravensworth, Kenji and Kettering, Vesna}, + title = {Recovering the medieval chronicle in Renaissance Italy}, + year = {2024}, + keywords = {seminar, archive}, + booktitle = {Proceedings of the 5th Meeting on Monastic Libraries}, + pages = {220--225} +} + +@article{history80, + author = {Nakashima, Hanne and Halloran, Priya and Cardenas-Holt, Zora and Wexford, Aurelio}, + title = {Ordering monastic libraries in the Low Countries}, + year = {2003}, + keywords = {memory}, + journal = {Journal of Archival Practice}, + volume = {35}, + number = {6}, + pages = {879--902} +} + +@book{history81, + author = {Northcote, Kaia and Dunmore, Desmond and Dunmore, Ada and Ishikawa-Reed, Zora and Ravensworth, Luca and Tremaine, Juno}, + title = {Recovering the archive in early modern Europe}, + year = {2000}, + keywords = {archive}, + publisher = {Brindlemoor University Press}, + address = {Calder Bay} +} + +@article{history82, + author = {Nakashima, Aurelio and Achterberg, Rosa}, + title = {Tracing the grand narrative in the Atlantic world}, + year = {2000}, + keywords = {primary source, essay question}, + journal = {Chronicle and Method}, + volume = {18}, + number = {1}, + pages = {295--316} +} + +@book{history83, + author = {Northcote, Cosmo and Montaigne-Blake, Kaia and Halloran, Uma}, + title = {Rethinking maps and borders in the Atlantic world}, + year = {2002}, + keywords = {essay question}, + publisher = {Saltford House}, + address = {Lowen} +} + +@incollection{history84, + author = {Okonkwo-Hart, Ines and Quarrington, Priya and Fairbairn, Bram}, + title = {Rethinking local history societies in the Low Countries}, + year = {2017}, + keywords = {translation}, + booktitle = {Perspectives On National Histories}, + editor = {Harwood, Viktor and Fairbairn, Aurelio}, + publisher = {Westmarch Scholarly}, + address = {Lowen}, + pages = {318--339} +} + +@article{history85, + author = {Juniper, Cosmo and Marrowfield, Wren and Fenwright, Bastian}, + title = {Tracing the grand narrative in Renaissance Italy}, + year = {2010}, + keywords = {method, translation, renaissance}, + journal = {Historiography Review}, + volume = {14}, + number = {4}, + pages = {101--111} +} + +@book{history86, + author = {Underhill, Tala and Tremaine, Femi}, + title = {Remembering the history of reading in nineteenth-century Britain}, + year = {2016}, + keywords = {historiography}, + publisher = {Lantern Field Books}, + address = {Lowen} +} + +@article{history87, + author = {Ashgrove, Juno and Lindqvist, Saoirse and Lindqvist, Bastian and Tremaine, Otto and Kettering, Elif}, + title = {Tracing the medieval chronicle in colonial port towns}, + year = {2018}, + keywords = {renaissance, primary source, translation}, + journal = {Journal of Archival Practice}, + volume = {30}, + number = {1}, + pages = {79--105} +} + +@book{history88, + author = {Thornbury, Soren and Fenwright, Otto and Varga, Hugo and Galloway, Ada}, + title = {Ordering oral testimony in the Mediterranean}, + year = {2021}, + keywords = {method, empire}, + publisher = {Lantern Field Books}, + address = {Saltford} +} + +@misc{history89, + author = {Pellham, Celia and Pellham, Wilhelmina and Varga, Yara and Ishikawa-Reed, Femi}, + title = {Ordering the archive in the Mediterranean}, + year = {2014}, + keywords = {memory, seminar}, + howpublished = {Dataset}, + publisher = {Port Ellery Open Data} +} + +@incollection{history90, + author = {Jessamy, Rafael and Achterberg, Luca}, + title = {Recovering the grand narrative in early modern Europe}, + year = {2012}, + keywords = {renaissance, seminar, revolution}, + booktitle = {Handbook Of Enlightenment Historiography}, + editor = {Esterhazy-Lowe, Vesna and Ellery, Cosmo}, + publisher = {Brindlemoor University Press}, + address = {Harrowgate}, + pages = {18--36} +} + +@article{history91, + author = {Varga, Yusuf and Lindqvist, Cosmo}, + title = {Reading maps and borders in early modern Europe}, + year = {2002}, + keywords = {memory}, + journal = {Chronicle and Method}, + volume = {42}, + number = {11}, + pages = {814--829} +} + +@article{history92, + author = {Juniper, Elif and Cardenas-Holt, Bram and Vantongeren, Nils and Larkspur, Marisol and Wexford, Farid and Fairbairn, Hanne}, + title = {Recovering national histories in early modern Europe}, + year = {2004}, + keywords = {memory, renaissance, archive}, + journal = {Chronicle and Method}, + volume = {32}, + number = {5}, + pages = {152--173} +} + +@article{history93, + author = {Stavely, Beatrix and Abernathy, Bastian and Bellweather, Pavel and Quarrington, Bram and Esterhazy-Lowe, Ada}, + title = {Recovering the history of reading in Renaissance Italy}, + year = {2014}, + keywords = {seminar, archive, primary source}, + journal = {Historiography Review}, + volume = {4}, + number = {12}, + pages = {27--33} +} + +@inproceedings{history94, + author = {Juniper, Hugo and Ulvaeus, Quinn and Gilchrist, Bram and Ashgrove, Ikaika}, + title = {Ordering the printing press in the Atlantic world}, + year = {2017}, + keywords = {revolution}, + booktitle = {Proceedings of the 20th Meeting on Local History Societies}, + pages = {276--281} +} + +@article{history95, + author = {Dunmore, Bram and Montaigne-Blake, Hanne and Fairbairn, Uma}, + title = {Reading national histories in the Atlantic world}, + year = {2009}, + keywords = {primary source}, + journal = {Historiography Review}, + volume = {34}, + number = {5}, + pages = {173--191} +} + +@incollection{history96, + author = {Abernathy, Noor and Yardley, Cosmo}, + title = {Rethinking oral testimony in the Atlantic world}, + year = {2001}, + keywords = {historiography}, + booktitle = {Perspectives On The Grand Narrative}, + editor = {Fairbairn, Leonie and Kowalczyk, Otto}, + publisher = {Westmarch Scholarly}, + address = {Ostrava Vale}, + pages = {322--345} +} + +@article{history97, + author = {Ivesdale, Yara and Marrowfield, Femi}, + title = {Narrating oral testimony in the Mediterranean}, + year = {2025}, + keywords = {revolution, renaissance, primary source}, + journal = {Journal of Archival Practice}, + volume = {44}, + number = {3}, + pages = {411--421} +} + +@article{history98, + author = {Varga, Juno and Gilchrist, Vesna and Delacourt, Wren}, + title = {Questioning microhistory in the Baltic}, + year = {2023}, + keywords = {renaissance, empire, method}, + journal = {Past and Narrative}, + volume = {25}, + number = {4}, + pages = {890--903} +} + +@article{history99, + author = {Ulvaeus, Priya and Bellweather, Hanne and Halloran, Cosmo and Ashgrove, Marisol and Gilchrist, Yara}, + title = {Remembering the Renaissance city in Renaissance Italy}, + year = {1995}, + keywords = {revolution, essay question, memory}, + journal = {Past and Narrative}, + volume = {38}, + number = {7}, + pages = {439--459} +} + +@incollection{history100, + author = {Zeller, Desmond and Underhill, Soren and Ellery, Elif and Ellery, Chiara and Jessamy, Priya and Fenwright, Jonas}, + title = {Ordering the history of reading in colonial port towns}, + year = {2017}, + keywords = {revolution, essay question, renaissance}, + booktitle = {Perspectives On The Printing Press}, + editor = {Jessamy, Zora and Ellery, Vesna}, + publisher = {Westmarch Scholarly}, + address = {Calder Bay}, + pages = {41--71} +} + +@article{history101, + author = {Gilchrist, Marisol and Brightwater, Vesna and Fenwright, Bastian and Galloway, Ada}, + title = {Questioning maps and borders in Renaissance Italy}, + year = {2002}, + keywords = {renaissance}, + journal = {Historiography Review}, + volume = {25}, + number = {4}, + pages = {864--879} +} + +@incollection{history102, + author = {Northcote, Mina and Yardley, Yusuf and Fairbairn, Kenji}, + title = {Ordering the grand narrative in the Low Countries}, + year = {1999}, + keywords = {renaissance, revolution}, + booktitle = {Handbook Of The Archive}, + editor = {Larkspur, Greta and Ellery, Dario}, + publisher = {Saltford House}, + address = {Westmarch}, + pages = {31--53} +} + +@article{history103, + author = {Ishikawa-Reed, Cosmo and Juniper, Aurelio and Stavely, Ada and Achterberg, Vesna}, + title = {Questioning oral testimony in the Baltic}, + year = {2008}, + keywords = {empire}, + journal = {Studies in Early Modern Memory}, + volume = {47}, + number = {7}, + pages = {882--901} +} + +@article{history104, + author = {Cardenas-Holt, Farid}, + title = {Tracing the medieval chronicle in nineteenth-century Britain}, + year = {2014}, + keywords = {archive}, + journal = {Chronicle and Method}, + volume = {20}, + number = {4}, + pages = {308--314} +} + +@article{history105, + author = {Thornbury, Noor and Tremaine, Luca and Kowalczyk, Celia}, + title = {Remembering local history societies in the Mediterranean}, + year = {1999}, + keywords = {historiography, seminar, renaissance}, + journal = {Historiography Review}, + volume = {37}, + number = {5}, + pages = {233--248} +} + +@article{history106, + author = {Abernathy, Viktor and Underhill, Yusuf and Halloran, Ada}, + title = {Tracing the medieval chronicle in the Mediterranean}, + year = {2005}, + keywords = {method, revolution}, + journal = {Studies in Early Modern Memory}, + volume = {10}, + number = {11}, + pages = {634--659} +} + +@article{history107, + author = {Halloran, Viktor and Galloway, Jonas and Dunmore, Rosa}, + title = {Remembering the Renaissance city in Renaissance Italy: a field study}, + year = {2023}, + keywords = {translation}, + journal = {Studies in Early Modern Memory}, + volume = {43}, + number = {5}, + pages = {114--141} +} + +@article{history108, + author = {Jessamy, Beatrix and Montaigne-Blake, Wilhelmina and Gilchrist, Amara and Lindqvist, Edda}, + title = {Narrating the printing press in the Atlantic world}, + year = {2005}, + keywords = {archive, seminar}, + journal = {Historiography Review}, + volume = {17}, + number = {3}, + pages = {871--880} +} + +@article{history109, + author = {Ellery, Hugo and Gilchrist, Wren and Tremaine, Pavel and Halloran, Vesna and Tremaine, Greta}, + title = {Narrating the grand narrative in the Atlantic world}, + year = {1994}, + keywords = {translation, primary source}, + journal = {Studies in Early Modern Memory}, + volume = {27}, + number = {11}, + pages = {36--48} +} + +@article{history110, + author = {Stavely, Orla and Zeller, Hanne and Zeller, Beatrix and Underhill, Cosmo and Okonkwo-Hart, Viktor}, + title = {Tracing the history of reading in colonial port towns}, + year = {1999}, + keywords = {archive, method, translation}, + journal = {Chronicle and Method}, + volume = {48}, + number = {6}, + pages = {806--827} +} + +@book{history111, + author = {Bellweather, Kaia and Yardley, Femi and Stavely, Saoirse}, + title = {Ordering monastic libraries in early modern Europe}, + year = {2023}, + keywords = {seminar}, + publisher = {Lantern Field Books}, + address = {Port Ellery} +} + +@article{history112, + author = {Sandoval, Tobias and Zeller, Hugo and Sandoval, Ikaika and Esterhazy-Lowe, Chiara}, + title = {Tracing microhistory in Renaissance Italy}, + year = {2017}, + keywords = {empire}, + journal = {Journal of Archival Practice}, + volume = {41}, + number = {12}, + pages = {65--77} +} + +@phdthesis{history113, + author = {Quarrington, Viktor and Ishikawa-Reed, Dario and Ivesdale, Edda}, + title = {Rethinking microhistory in the Low Countries}, + year = {2004}, + keywords = {primary source, archive, memory}, + school = {University of Calder Bay} +} + +@inproceedings{history114, + author = {Thornbury, Noor and Esterhazy-Lowe, Bram}, + title = {Tracing the medieval chronicle in the Baltic}, + year = {1998}, + keywords = {primary source, archive}, + booktitle = {Proceedings of the 8th Meeting on National Histories}, + pages = {80--88} +} + +@incollection{history115, + author = {Dunmore, Quinn and Lindqvist, Kaia}, + title = {Tracing the medieval chronicle in Renaissance Italy}, + year = {2001}, + keywords = {renaissance, memory, essay question}, + booktitle = {New Directions In The Archive}, + editor = {Jessamy, Aurelio and Tremaine, Tala}, + publisher = {Brindlemoor University Press}, + address = {Brindlemoor}, + pages = {1--28} +} + +@article{history116, + author = {Thornbury, Jonas and Thornbury, Zora and Stavely, Bastian and Rowntree, Bastian}, + title = {Ordering oral testimony in colonial port towns}, + year = {2026}, + keywords = {memory, primary source}, + journal = {Past and Narrative}, + volume = {34}, + number = {3}, + pages = {573--596} +} + +@inproceedings{history117, + author = {Halloran, Beatrix and Montaigne-Blake, Yusuf and Kettering, Ximena and Pellham, Ada and Juniper, Rafael}, + title = {Ordering the medieval chronicle in the Low Countries}, + year = {1994}, + keywords = {method, revolution, translation}, + booktitle = {Proceedings of the 25th Meeting on Imperial Record Keeping}, + pages = {136--145} +} + +@book{history118, + author = {Lindqvist, Kaia and Nakashima, Celia and Kettering, Chiara and Jessamy, Zora and Rowntree, Pavel}, + title = {Remembering the medieval chronicle in nineteenth-century Britain}, + year = {2017}, + keywords = {memory, method, essay question}, + publisher = {Saltford House}, + address = {Saltford} +} + +@book{history119, + author = {Larkspur, Marisol and Jessamy, Luca and Dunmore, Greta and Harwood, Yusuf and Nakashima, Nils}, + title = {Rethinking the Renaissance city in early modern Europe}, + year = {2009}, + keywords = {essay question, translation, empire}, + publisher = {Westmarch Scholarly}, + address = {Ostrava Vale} +} + +@inproceedings{history120, + author = {Pellham, Wren and Delacourt, Edda}, + title = {Recovering the archive in Renaissance Italy}, + year = {2007}, + keywords = {renaissance, translation, primary source}, + booktitle = {Proceedings of the 17th Meeting on Microhistory}, + pages = {275--284} +} + +@article{history121, + author = {Cardenas-Holt, Tobias and Esterhazy-Lowe, Greta and Gilchrist, Yusuf}, + title = {Ordering the history of reading in the Baltic}, + year = {2009}, + keywords = {method, primary source}, + journal = {Studies in Early Modern Memory}, + volume = {40}, + number = {12}, + pages = {36--57} +} + +@article{history122, + author = {Bellweather, Chiara and Yardley, Viktor and Lindqvist, Beatrix and Dunmore, Luca}, + title = {Remembering the Renaissance city in the Baltic}, + year = {1995}, + keywords = {primary source, essay question, renaissance}, + journal = {Past and Narrative}, + volume = {38}, + number = {6}, + pages = {746--762} +} + +@book{history123, + author = {Brightwater, Pavel}, + title = {Rethinking Enlightenment historiography in the Mediterranean}, + year = {2007}, + keywords = {method, revolution}, + publisher = {Lantern Field Books}, + address = {Port Ellery} +} + +@incollection{history124, + author = {Ellery, Rafael and Ravensworth, Amara and Ashgrove, Desmond and Vantongeren, Zora and Juniper, Luca}, + title = {Narrating the printing press in the Baltic}, + year = {2005}, + keywords = {seminar, archive}, + booktitle = {New Directions In The Printing Press}, + editor = {Zabala, Orla and Harwood, Elif}, + publisher = {Lantern Field Books}, + address = {Port Ellery}, + pages = {145--165} +} + +@incollection{history125, + author = {Cardenas-Holt, Rafael and Ulvaeus, Beatrix and Ellery, Celia and Cardenas-Holt, Mina and Wexford, Rosa}, + title = {Tracing monastic libraries in the Mediterranean: a comparison}, + year = {2021}, + keywords = {primary source}, + booktitle = {Perspectives On The History Of Reading}, + editor = {Larkspur, Edda and Vantongeren, Ines}, + publisher = {Saltford House}, + address = {Harrowgate}, + pages = {87--111} +} + +@misc{history126, + author = {Delacourt, Amara and Larkspur, Rosa and Underhill, Hugo and Gilchrist, Uma and Underhill, Juno and Kettering, Bastian}, + title = {Rethinking maps and borders in Renaissance Italy}, + year = {2022}, + keywords = {seminar}, + howpublished = {Dataset}, + publisher = {Port Ellery Open Data} +} + +@article{history127, + author = {Nakashima, Marisol and Yardley, Marisol and Bellweather, Soren and Montaigne-Blake, Ximena and Ashgrove, Zora}, + title = {Narrating the Renaissance city in the Mediterranean}, + year = {2011}, + keywords = {translation, memory, seminar}, + journal = {Journal of Archival Practice}, + volume = {35}, + number = {4}, + pages = {866--889} +} + +@techreport{history128, + author = {Zabala, Quinn and Abernathy, Desmond and Yilmaz-Grant, Chiara}, + title = {Remembering maps and borders in Renaissance Italy}, + year = {2010}, + keywords = {memory, seminar}, + institution = {Ostrava Vale Research Institute}, + number = {TR-2010-91} +} + +@inproceedings{history129, + author = {Kettering, Jonas}, + title = {Rethinking maps and borders in the Mediterranean}, + year = {2020}, + keywords = {primary source}, + booktitle = {Proceedings of the 25th Meeting on The Grand Narrative}, + pages = {67--72} +} + +@techreport{history130, + author = {Rowntree, Quinn and Kowalczyk, Yusuf and Fenwright, Celia and Whitlock, Kaia}, + title = {Tracing oral testimony in Renaissance Italy}, + year = {2015}, + keywords = {renaissance, memory, seminar}, + institution = {Lowen Data Office}, + number = {TR-2015-80} +} + +@article{history131, + author = {Oakhurst, Ines}, + title = {Reading the archive in the Atlantic world: a field study}, + year = {2001}, + keywords = {archive, memory, renaissance}, + journal = {Past and Narrative}, + volume = {14}, + number = {3}, + pages = {271--290} +} + +@article{history132, + author = {Whitlock, Kaia}, + title = {Tracing the grand narrative in the Baltic}, + year = {1997}, + keywords = {revolution}, + journal = {Studies in Early Modern Memory}, + volume = {17}, + number = {1}, + pages = {886--896} +} + +@article{history133, + author = {Stavely, Kenji and Wexford, Vesna and Thornbury, Kenji}, + title = {Tracing Enlightenment historiography in the Low Countries}, + year = {2003}, + keywords = {essay question}, + journal = {Journal of Archival Practice}, + volume = {10}, + number = {3}, + pages = {558--570} +} + +@article{history134, + author = {Ivesdale, Rafael and Larkspur, Chiara and Ishikawa-Reed, Ximena and Gilchrist, Orla and Ulvaeus, Uma}, + title = {Rethinking the Renaissance city in the Atlantic world}, + year = {2004}, + keywords = {archive}, + journal = {Past and Narrative}, + volume = {40}, + number = {8}, + pages = {344--353} +} + +@article{history135, + author = {Pemberton, Tobias and Varga, Priya}, + title = {Rethinking maps and borders in early modern Europe}, + year = {2022}, + keywords = {memory, method}, + journal = {Chronicle and Method}, + volume = {5}, + number = {7}, + pages = {403--425} +} + +@book{history136, + author = {Pellham, Hanne}, + title = {Tracing the medieval chronicle in colonial port towns: lessons from a decade}, + year = {1999}, + keywords = {renaissance, essay question}, + publisher = {Harrowgate & Lowe}, + address = {Harrowgate} +} + +@book{history137, + author = {Wexford, Kaia and Jessamy, Zora and Calloway, Bastian}, + title = {Ordering the Renaissance city in early modern Europe}, + year = {2020}, + keywords = {essay question, renaissance, memory}, + publisher = {Brindlemoor University Press}, + address = {Brindlemoor} +} + +@article{history138, + author = {Gilchrist, Bram and Ellery, Noor}, + title = {Questioning local history societies in Renaissance Italy}, + year = {2015}, + keywords = {essay question, translation, empire}, + journal = {Studies in Early Modern Memory}, + volume = {44}, + number = {1}, + pages = {3--29} +} + +@inproceedings{history139, + author = {Vantongeren, Vesna and Bellweather, Tala and Larkspur, Marisol}, + title = {Rethinking revolutionary memory in the Baltic}, + year = {1998}, + keywords = {essay question}, + booktitle = {Proceedings of the 17th Meeting on The Renaissance City}, + pages = {94--101} +} + +@misc{history140, + author = {Kowalczyk, Jonas and Lindqvist, Juno and Underhill, Hugo and Achterberg, Ikaika and Harwood, Uma and Harwood, Tala}, + title = {Reading imperial record keeping in the Atlantic world}, + year = {1997}, + keywords = {translation}, + howpublished = {Dataset}, + publisher = {Westmarch Open Data} +} + +@techreport{history141, + author = {Rowntree, Aurelio and Vantongeren, Femi and Esterhazy-Lowe, Aurelio and Ravensworth, Desmond and Bellweather, Mina and Jessamy, Zora}, + title = {Ordering microhistory in Renaissance Italy}, + year = {2024}, + keywords = {memory, historiography}, + institution = {Ostrava Vale Data Office}, + number = {TR-2024-07} +} + +@inproceedings{history142, + author = {Quarrington, Noor and Dunmore, Yara and Ashgrove, Otto}, + title = {Questioning revolutionary memory in the Baltic}, + year = {2022}, + keywords = {revolution, translation}, + booktitle = {Proceedings of the 6th Meeting on Enlightenment Historiography}, + pages = {179--183} +} + +@article{history143, + author = {Larkspur, Nils and Fairbairn, Wren}, + title = {Recovering the printing press in colonial port towns}, + year = {2000}, + keywords = {translation, method}, + journal = {Journal of Archival Practice}, + volume = {38}, + number = {5}, + pages = {119--131} +} + +@phdthesis{history144, + author = {Esterhazy-Lowe, Celia}, + title = {Narrating imperial record keeping in Renaissance Italy}, + year = {2004}, + keywords = {memory}, + school = {University of Port Ellery} +} + +@article{history145, + author = {Ravensworth, Tobias and Zeller, Hugo}, + title = {Tracing oral testimony in colonial port towns}, + year = {2001}, + keywords = {archive}, + journal = {Historiography Review}, + volume = {32}, + number = {11}, + pages = {101--111} +} + +@inproceedings{history146, + author = {Galloway, Rafael and Bellweather, Greta and Pemberton, Ikaika and Pellham, Ximena}, + title = {Recovering the history of reading in colonial port towns}, + year = {2014}, + keywords = {method, historiography, primary source}, + booktitle = {Proceedings of the 11th Meeting on Enlightenment Historiography}, + pages = {16--20} +} + +@techreport{history147, + author = {Harwood, Noor and Ishikawa-Reed, Bram and Bellweather, Ines and Okonkwo-Hart, Leonie}, + title = {Reading maps and borders in the Atlantic world}, + year = {2022}, + keywords = {seminar, historiography, primary source}, + institution = {Saltford Research Institute}, + number = {TR-2022-64} +} + +@book{history148, + author = {Ashgrove, Nils}, + title = {Recovering national histories in Renaissance Italy}, + year = {2026}, + keywords = {method}, + publisher = {Lantern Field Books}, + address = {Calder Bay} +} + +@article{history149, + author = {Rowntree, Jonas and Stavely, Quinn and Yilmaz-Grant, Hugo and Jessamy, Ikaika and Bellweather, Hugo}, + title = {Remembering oral testimony in early modern Europe}, + year = {2022}, + keywords = {historiography, method}, + journal = {Historiography Review}, + volume = {12}, + number = {12}, + pages = {822--833} +} + +@book{history150, + author = {Yilmaz-Grant, Leonie and Cardenas-Holt, Tobias and Delacourt, Beatrix and Nakashima, Rafael and Delacourt, Tala and Vantongeren, Zora}, + title = {Reading monastic libraries in early modern Europe}, + year = {2013}, + keywords = {revolution}, + publisher = {Saltford House}, + address = {Brindlemoor} +} + +@book{history151, + author = {Quarrington, Tobias and Harwood, Tobias}, + title = {Ordering the medieval chronicle in early modern Europe}, + year = {2009}, + keywords = {seminar}, + publisher = {Calder Bay Academic}, + address = {Saltford} +} + +@article{history152, + author = {Stavely, Otto and Larkspur, Ada and Achterberg, Wilhelmina and Harwood, Bastian and Ellery, Ada}, + title = {Recovering monastic libraries in nineteenth-century Britain}, + year = {1997}, + keywords = {memory, primary source, renaissance}, + journal = {Historiography Review}, + volume = {41}, + number = {9}, + pages = {754--768} +} + +@techreport{history153, + author = {Fenwright, Greta}, + title = {Ordering revolutionary memory in colonial port towns}, + year = {2024}, + keywords = {historiography}, + institution = {Calder Bay Data Office}, + number = {TR-2024-96} +} + +@article{history154, + author = {Whitlock, Kaia and Stavely, Celia}, + title = {Rethinking local history societies in nineteenth-century Britain}, + year = {2013}, + keywords = {method, revolution}, + journal = {Chronicle and Method}, + volume = {2}, + number = {4}, + pages = {696--723} +} + +@article{history155, + author = {Ellery, Marisol and Pemberton, Celia}, + title = {Remembering Enlightenment historiography in Renaissance Italy}, + year = {2009}, + keywords = {translation}, + journal = {Past and Narrative}, + volume = {33}, + number = {2}, + pages = {578--604} +} + +@article{history156, + author = {Nakashima, Luca and Kowalczyk, Kaia and Ellery, Soren and Delacourt, Bram and Underhill, Cosmo}, + title = {Recovering the archive in the Atlantic world: a field study}, + year = {1997}, + keywords = {revolution}, + journal = {Chronicle and Method}, + volume = {48}, + number = {9}, + pages = {726--737} +} + +@incollection{history157, + author = {Gilchrist, Juno}, + title = {Rethinking revolutionary memory in the Baltic: a field study}, + year = {2023}, + keywords = {memory, revolution}, + booktitle = {Perspectives On Maps And Borders}, + editor = {Abernathy, Celia and Sandoval, Jonas}, + publisher = {Westmarch Scholarly}, + address = {Calder Bay}, + pages = {362--375} +} + +@article{history158, + author = {Ivesdale, Femi}, + title = {Remembering the medieval chronicle in the Atlantic world}, + year = {2008}, + keywords = {archive, method}, + journal = {Historiography Review}, + volume = {15}, + number = {1}, + pages = {821--842} +} + +@article{history159, + author = {Calloway, Marisol and Yardley, Elif and Calloway, Tobias}, + title = {Narrating imperial record keeping in the Mediterranean}, + year = {2010}, + keywords = {revolution}, + journal = {Journal of Archival Practice}, + volume = {23}, + number = {12}, + pages = {318--327} +} + +@book{history160, + author = {Wexford, Nils and Dunmore, Elif and Zeller, Amara}, + title = {Tracing imperial record keeping in the Low Countries}, + year = {2021}, + keywords = {translation}, + publisher = {Lantern Field Books}, + address = {Saltford} +} + +@book{history161, + author = {Sandoval, Tala and Fenwright, Bram}, + title = {Ordering national histories in the Atlantic world}, + year = {1999}, + keywords = {empire, seminar}, + publisher = {Lantern Field Books}, + address = {Brindlemoor} +} + +@techreport{history162, + author = {Dunmore, Leonie and Thornbury, Juno and Ellery, Hanne}, + title = {Questioning the grand narrative in Renaissance Italy}, + year = {2014}, + keywords = {historiography, essay question}, + institution = {Harrowgate Observatory}, + number = {TR-2014-11} +} + +@article{history163, + author = {Lindqvist, Dario and Pellham, Beatrix and Gilchrist, Viktor and Cardenas-Holt, Leonie and Zabala, Ximena}, + title = {Ordering national histories in the Mediterranean}, + year = {2007}, + keywords = {archive, translation, revolution}, + journal = {Journal of Archival Practice}, + volume = {41}, + number = {6}, + pages = {658--667} +} + +@incollection{history164, + author = {Ravensworth, Nils and Dunmore, Farid and Ishikawa-Reed, Priya}, + title = {Remembering oral testimony in nineteenth-century Britain}, + year = {2024}, + keywords = {renaissance, historiography}, + booktitle = {Perspectives On Revolutionary Memory}, + editor = {Zeller, Uma and Yilmaz-Grant, Rafael}, + publisher = {Harrowgate & Lowe}, + address = {Lowen}, + pages = {83--99} +} + +@book{history165, + author = {Oakhurst, Ikaika and Galloway, Otto and Nakashima, Ximena}, + title = {Remembering the archive in early modern Europe}, + year = {2023}, + keywords = {seminar, primary source, memory}, + publisher = {Harrowgate & Lowe}, + address = {Westmarch} +} + +@phdthesis{history166, + author = {Fairbairn, Orla and Okonkwo-Hart, Mina and Vantongeren, Desmond and Esterhazy-Lowe, Edda}, + title = {Tracing the grand narrative in the Low Countries}, + year = {2007}, + keywords = {method}, + school = {University of Brindlemoor} +} + +@inproceedings{history167, + author = {Jessamy, Beatrix and Halloran, Pavel}, + title = {Questioning the history of reading in the Baltic}, + year = {2023}, + keywords = {seminar, historiography, translation}, + booktitle = {Proceedings of the 27th Meeting on Microhistory}, + pages = {24--29} +} + +@article{history168, + author = {Northcote, Saoirse and Cardenas-Holt, Bastian and Esterhazy-Lowe, Mina}, + title = {Tracing Enlightenment historiography in the Low Countries: lessons from a decade}, + year = {2013}, + keywords = {memory}, + journal = {Historiography Review}, + volume = {10}, + number = {10}, + pages = {81--102} +} + +@article{history169, + author = {Bellweather, Rafael and Yilmaz-Grant, Elif and Galloway, Vesna and Fenwright, Ikaika and Ashgrove, Elif and Achterberg, Juno}, + title = {Narrating monastic libraries in early modern Europe}, + year = {2026}, + keywords = {primary source, method}, + journal = {Chronicle and Method}, + volume = {39}, + number = {11}, + pages = {299--317} +} + +@article{history170, + author = {Zeller, Priya and Harwood, Mina and Fairbairn, Noor and Stavely, Tala}, + title = {Remembering maps and borders in the Low Countries}, + year = {1999}, + keywords = {translation, memory}, + journal = {Journal of Archival Practice}, + volume = {27}, + number = {1}, + pages = {237--265} +} + +@book{history171, + author = {Bellweather, Cosmo}, + title = {Recovering local history societies in nineteenth-century Britain}, + year = {2011}, + keywords = {method, historiography, archive}, + publisher = {Harrowgate & Lowe}, + address = {Westmarch} +} + +@incollection{history172, + author = {Yardley, Ikaika and Montaigne-Blake, Beatrix}, + title = {Reading monastic libraries in the Atlantic world}, + year = {2000}, + keywords = {empire, revolution, archive}, + booktitle = {New Directions In The Renaissance City}, + editor = {Delacourt, Otto and Pellham, Pavel}, + publisher = {Calder Bay Academic}, + address = {Ostrava Vale}, + pages = {83--111} +} + +@book{history173, + author = {Esterhazy-Lowe, Quinn and Cardenas-Holt, Dario and Halloran, Desmond and Marrowfield, Tobias and Galloway, Ines}, + title = {Rethinking oral testimony in the Atlantic world: lessons from a decade}, + year = {2017}, + keywords = {archive, renaissance, empire}, + publisher = {Harrowgate & Lowe}, + address = {Calder Bay} +} + +@article{history174, + author = {Pellham, Otto}, + title = {Reading Enlightenment historiography in nineteenth-century Britain}, + year = {2008}, + keywords = {primary source}, + journal = {Past and Narrative}, + volume = {14}, + number = {10}, + pages = {216--231} +} + +@misc{history175, + author = {Kettering, Desmond and Ellery, Desmond and Fairbairn, Celia and Fairbairn, Juno and Marrowfield, Tala}, + title = {Remembering revolutionary memory in the Mediterranean: a second look}, + year = {1994}, + keywords = {translation, archive, seminar}, + howpublished = {Dataset}, + publisher = {Port Ellery Open Data} +} + +@techreport{history176, + author = {Galloway, Pavel}, + title = {Remembering imperial record keeping in the Atlantic world}, + year = {1996}, + keywords = {method}, + institution = {Brindlemoor Research Institute}, + number = {TR-1996-13} +} + +@phdthesis{history177, + author = {Yilmaz-Grant, Kaia and Ivesdale, Yusuf and Zabala, Marisol and Marrowfield, Viktor and Montaigne-Blake, Cosmo and Ravensworth, Farid}, + title = {Questioning microhistory in colonial port towns}, + year = {2006}, + keywords = {historiography}, + school = {University of Harrowgate} +} + +@article{history178, + author = {Abernathy, Ikaika}, + title = {Reading imperial record keeping in the Low Countries}, + year = {2020}, + keywords = {archive}, + journal = {Studies in Early Modern Memory}, + volume = {5}, + number = {2}, + pages = {88--112} +} + +@article{history179, + author = {Rowntree, Uma and Oakhurst, Saoirse}, + title = {Reading maps and borders in Renaissance Italy}, + year = {2017}, + keywords = {revolution, historiography}, + journal = {Chronicle and Method}, + volume = {33}, + number = {5}, + pages = {808--816} +} + +@techreport{history180, + author = {Pemberton, Wren and Tremaine, Quinn}, + title = {Ordering the Renaissance city in nineteenth-century Britain: lessons from a decade}, + year = {2002}, + keywords = {revolution, method, archive}, + institution = {Port Ellery Data Office}, + number = {TR-2002-27} +} + +@book{history181, + author = {Jessamy, Edda and Ellery, Ximena and Northcote, Kaia and Cardenas-Holt, Amara and Rowntree, Otto}, + title = {Narrating the printing press in the Baltic: new evidence}, + year = {2026}, + keywords = {method, memory, renaissance}, + publisher = {Lantern Field Books}, + address = {Harrowgate} +} + +@techreport{history182, + author = {Calloway, Mina and Fenwright, Vesna and Calloway, Celia and Northcote, Pavel and Yilmaz-Grant, Farid}, + title = {Tracing oral testimony in the Baltic}, + year = {2014}, + keywords = {essay question, revolution}, + institution = {Calder Bay Research Institute}, + number = {TR-2014-05} +} + +@incollection{history183, + author = {Kowalczyk, Aurelio and Pemberton, Yara}, + title = {Ordering oral testimony in the Atlantic world}, + year = {2016}, + keywords = {memory}, + booktitle = {Handbook Of Oral Testimony}, + editor = {Lindqvist, Soren and Kettering, Femi}, + publisher = {Calder Bay Academic}, + address = {Saltford}, + pages = {37--66} +} + +@incollection{history184, + author = {Ravensworth, Soren and Esterhazy-Lowe, Wren and Ravensworth, Juno and Sandoval, Nils}, + title = {Reading national histories in Renaissance Italy}, + year = {2003}, + keywords = {translation}, + booktitle = {Handbook Of The Grand Narrative}, + editor = {Cardenas-Holt, Otto and Ivesdale, Wren}, + publisher = {Calder Bay Academic}, + address = {Port Ellery}, + pages = {120--147} +} + +@book{history185, + author = {Ishikawa-Reed, Noor and Gilchrist, Tala}, + title = {Reading the history of reading in nineteenth-century Britain}, + year = {2017}, + keywords = {seminar, renaissance}, + publisher = {Brindlemoor University Press}, + address = {Saltford} +} + +@article{history186, + author = {Larkspur, Femi and Wexford, Edda}, + title = {Narrating maps and borders in early modern Europe}, + year = {2022}, + keywords = {renaissance, essay question}, + journal = {Journal of Archival Practice}, + volume = {18}, + number = {6}, + pages = {163--187} +} + +@article{history187, + author = {Underhill, Farid}, + title = {Reading the history of reading in the Baltic}, + year = {2009}, + keywords = {seminar}, + journal = {Journal of Archival Practice}, + volume = {28}, + number = {6}, + pages = {81--96} +} + +@article{history188, + author = {Pemberton, Viktor and Marrowfield, Amara}, + title = {Remembering oral testimony in nineteenth-century Britain: a second look}, + year = {2020}, + keywords = {translation}, + journal = {Past and Narrative}, + volume = {19}, + number = {2}, + pages = {14--22} +} + +@article{history189, + author = {Quarrington, Wilhelmina and Cardenas-Holt, Luca and Ishikawa-Reed, Kenji and Oakhurst, Ikaika and Juniper, Zora and Ellery, Kenji}, + title = {Questioning the archive in the Atlantic world}, + year = {2002}, + keywords = {revolution}, + journal = {Studies in Early Modern Memory}, + volume = {36}, + number = {2}, + pages = {846--863} +} + +@article{history190, + author = {Ashgrove, Dario and Delacourt, Viktor}, + title = {Reading revolutionary memory in colonial port towns: a field study}, + year = {2020}, + keywords = {primary source}, + journal = {Journal of Archival Practice}, + volume = {20}, + number = {11}, + pages = {890--915} +} + +@article{history191, + author = {Calloway, Mina and Marrowfield, Aurelio and Northcote, Orla}, + title = {Recovering maps and borders in the Low Countries: a comparison}, + year = {1994}, + keywords = {renaissance, historiography, seminar}, + journal = {Studies in Early Modern Memory}, + volume = {6}, + number = {9}, + pages = {864--892} +} + +@article{history192, + author = {Northcote, Beatrix and Stavely, Noor and Juniper, Noor and Okonkwo-Hart, Desmond and Delacourt, Jonas and Nakashima, Greta}, + title = {Narrating microhistory in early modern Europe}, + year = {2025}, + keywords = {memory, empire}, + journal = {Studies in Early Modern Memory}, + volume = {24}, + number = {7}, + pages = {832--857} +} + +@book{history193, + author = {Okonkwo-Hart, Viktor and Brightwater, Ada and Galloway, Elif and Sandoval, Quinn and Stavely, Beatrix and Harwood, Elif}, + title = {Reading Enlightenment historiography in colonial port towns}, + year = {1997}, + keywords = {revolution, historiography}, + publisher = {Lantern Field Books}, + address = {Brindlemoor} +} + +@article{history194, + author = {Tremaine, Ikaika and Fairbairn, Pavel}, + title = {Remembering the grand narrative in Renaissance Italy}, + year = {1998}, + keywords = {essay question}, + journal = {Studies in Early Modern Memory}, + volume = {33}, + number = {9}, + pages = {585--612} +} + +@article{history195, + author = {Zeller, Noor}, + title = {Recovering the medieval chronicle in the Mediterranean}, + year = {2015}, + keywords = {renaissance}, + journal = {Journal of Archival Practice}, + volume = {28}, + number = {12}, + pages = {758--773} +} + +@misc{history196, + author = {Kettering, Hanne and Jessamy, Otto}, + title = {Tracing revolutionary memory in early modern Europe}, + year = {2003}, + keywords = {revolution, empire}, + howpublished = {Dataset}, + publisher = {Lowen Open Data} +} + +@techreport{history197, + author = {Tremaine, Desmond and Fenwright, Mina and Cardenas-Holt, Tala and Kowalczyk, Chiara}, + title = {Recovering the grand narrative in the Atlantic world}, + year = {2020}, + keywords = {revolution, primary source, archive}, + institution = {Calder Bay City Council}, + number = {TR-2020-39} +} + +@article{history198, + author = {Bellweather, Hugo and Rowntree, Wren and Galloway, Pavel and Thornbury, Kaia and Vantongeren, Amara}, + title = {Ordering maps and borders in early modern Europe}, + year = {2024}, + keywords = {empire, primary source, seminar}, + journal = {Past and Narrative}, + volume = {40}, + number = {5}, + pages = {869--896} +} + +@article{history199, + author = {Montaigne-Blake, Wren and Abernathy, Ada}, + title = {Tracing maps and borders in Renaissance Italy}, + year = {2018}, + keywords = {memory}, + journal = {Studies in Early Modern Memory}, + volume = {17}, + number = {2}, + pages = {267--294} +} + +@article{history200, + author = {Ulvaeus, Amara and Juniper, Femi and Halloran, Bastian}, + title = {Questioning the medieval chronicle in the Baltic: a comparison}, + year = {2017}, + keywords = {memory, renaissance}, + journal = {Journal of Archival Practice}, + volume = {35}, + number = {5}, + pages = {104--124} +} + +@article{history201, + author = {Okonkwo-Hart, Rosa and Quarrington, Cosmo and Quarrington, Femi}, + title = {Questioning national histories in the Baltic}, + year = {2006}, + keywords = {translation, essay question, historiography}, + journal = {Journal of Archival Practice}, + volume = {46}, + number = {9}, + pages = {719--730} +} + +@article{history202, + author = {Stavely, Hanne and Delacourt, Mina and Stavely, Priya}, + title = {Tracing national histories in Renaissance Italy}, + year = {2007}, + keywords = {historiography, essay question}, + journal = {Journal of Archival Practice}, + volume = {43}, + number = {3}, + pages = {733--756} +} + +@article{history203, + author = {Dunmore, Orla and Zeller, Kenji}, + title = {Narrating the archive in colonial port towns}, + year = {2015}, + keywords = {method, primary source, memory}, + journal = {Studies in Early Modern Memory}, + volume = {26}, + number = {7}, + pages = {47--70} +} + +@techreport{history204, + author = {Pellham, Pavel and Oakhurst, Bastian and Zabala, Wren and Quarrington, Luca and Wexford, Aurelio}, + title = {Reading local history societies in the Baltic}, + year = {2024}, + keywords = {method, memory}, + institution = {Westmarch Data Office}, + number = {TR-2024-35} +} + +@article{history205, + author = {Vantongeren, Celia and Sandoval, Edda and Fairbairn, Hanne and Bellweather, Vesna}, + title = {Remembering microhistory in Renaissance Italy}, + year = {2001}, + keywords = {empire, method, renaissance}, + journal = {Chronicle and Method}, + volume = {25}, + number = {10}, + pages = {188--200} +} + +@article{history206, + author = {Okonkwo-Hart, Dario and Thornbury, Marisol and Underhill, Edda}, + title = {Ordering oral testimony in early modern Europe}, + year = {2025}, + keywords = {empire, historiography, translation}, + journal = {Historiography Review}, + volume = {2}, + number = {1}, + pages = {768--777} +} + +@incollection{history207, + author = {Sandoval, Wren and Rowntree, Edda and Ulvaeus, Hanne and Kowalczyk, Hanne and Ellery, Ikaika}, + title = {Tracing the Renaissance city in the Atlantic world}, + year = {2007}, + keywords = {method}, + booktitle = {Perspectives On Maps And Borders}, + editor = {Jessamy, Chiara and Pellham, Quinn}, + publisher = {Saltford House}, + address = {Ostrava Vale}, + pages = {396--416} +} + +@article{history208, + author = {Ulvaeus, Pavel and Lindqvist, Nils and Bellweather, Ximena and Abernathy, Ikaika}, + title = {Ordering the history of reading in the Low Countries}, + year = {1998}, + keywords = {method, translation}, + journal = {Journal of Archival Practice}, + volume = {25}, + number = {8}, + pages = {189--200} +} + +@techreport{history209, + author = {Kettering, Ines}, + title = {Questioning national histories in the Atlantic world}, + year = {2010}, + keywords = {method, archive, historiography}, + institution = {Port Ellery Research Institute}, + number = {TR-2010-78} +} + +@article{history210, + author = {Quarrington, Aurelio and Bellweather, Hanne}, + title = {Questioning monastic libraries in the Low Countries}, + year = {2002}, + keywords = {essay question}, + journal = {Past and Narrative}, + volume = {14}, + number = {2}, + pages = {703--721} +} + +@article{history211, + author = {Calloway, Ximena and Kettering, Orla and Yardley, Kaia and Okonkwo-Hart, Celia and Ravensworth, Ada}, + title = {Rethinking monastic libraries in nineteenth-century Britain}, + year = {2019}, + keywords = {essay question, method, empire}, + journal = {Studies in Early Modern Memory}, + volume = {43}, + number = {5}, + pages = {62--71} +} + +@article{history212, + author = {Whitlock, Beatrix and Rowntree, Dario}, + title = {Reading Enlightenment historiography in the Atlantic world}, + year = {1996}, + keywords = {translation}, + journal = {Studies in Early Modern Memory}, + volume = {3}, + number = {4}, + pages = {869--896} +} + +@article{history213, + author = {Northcote, Otto and Oakhurst, Kaia and Kowalczyk, Greta and Brightwater, Zora}, + title = {Rethinking maps and borders in the Atlantic world: an open dataset}, + year = {2023}, + keywords = {seminar, translation}, + journal = {Historiography Review}, + volume = {13}, + number = {7}, + pages = {292--299} +} + +@book{history214, + author = {Kettering, Rafael and Dunmore, Beatrix and Ivesdale, Dario}, + title = {Recovering imperial record keeping in the Baltic}, + year = {2012}, + keywords = {translation, memory, essay question}, + publisher = {Harrowgate & Lowe}, + address = {Calder Bay} +} + +@article{history215, + author = {Juniper, Hugo}, + title = {Reading microhistory in the Mediterranean}, + year = {2017}, + keywords = {seminar, revolution}, + journal = {Chronicle and Method}, + volume = {43}, + number = {8}, + pages = {242--263} +} diff --git a/demos/lab-methods/about.json b/demos/lab-methods/about.json new file mode 100644 index 0000000..37bc1ed --- /dev/null +++ b/demos/lab-methods/about.json @@ -0,0 +1,16 @@ +{ + "id": "lab-methods", + "name": "Bench to paper: a cell biology lab's methods library", + "description": "A shared library for a cell biology lab: 240 methods papers, protocols and datasets by technique, with a journal club shelf, tags and notes.", + "kind": "demo", + "library_name": "Demo - Lab methods", + "references": 240, + "collections": 9, + "notes": 30, + "licence": "GPL-3.0-only", + "credit": "Invented references written for FormCite by nodemode.ai. No DOI is given, so no reference points at a real work it does not describe.", + "files": { + "import": "references.bib", + "library": "library/library.sqlite" + } +} diff --git a/demos/lab-methods/library/library.sqlite b/demos/lab-methods/library/library.sqlite new file mode 100644 index 0000000..3264756 Binary files /dev/null and b/demos/lab-methods/library/library.sqlite differ diff --git a/demos/lab-methods/references.bib b/demos/lab-methods/references.bib new file mode 100644 index 0000000..8cf5faa --- /dev/null +++ b/demos/lab-methods/references.bib @@ -0,0 +1,2522 @@ +@techreport{lab1, + author = {Nakashima, Soren and Zeller, Aurelio and Cardenas-Holt, Chiara and Jessamy, Dario and Fenwright, Amara and Ellery, Juno}, + title = {Improving image segmentation in intestinal organoids}, + year = {2017}, + keywords = {organoids, crispr}, + institution = {Westmarch Observatory}, + number = {TR-2017-83} +} + +@techreport{lab2, + author = {Ravensworth, Hanne}, + title = {Improving confocal deconvolution in yeast}, + year = {2007}, + keywords = {software, crispr, microscopy}, + institution = {Lowen City Council}, + number = {TR-2007-91} +} + +@incollection{lab3, + author = {Yilmaz-Grant, Yara and Thornbury, Vesna and Oakhurst, Hanne}, + title = {Quantifying organoid culture in human fibroblasts}, + year = {2016}, + keywords = {flow cytometry, microscopy, journal club}, + booktitle = {New Directions In Phototoxicity}, + editor = {Thornbury, Otto and Calloway, Soren}, + publisher = {Harrowgate & Lowe}, + address = {Brindlemoor}, + pages = {247--263} +} + +@article{lab4, + author = {Rowntree, Rafael}, + title = {Scaling single-cell sequencing in human fibroblasts}, + year = {2022}, + keywords = {organoids}, + journal = {Quantitative Cell Imaging}, + volume = {6}, + number = {8}, + pages = {666--676} +} + +@article{lab5, + author = {Pemberton, Hanne and Sandoval, Pavel}, + title = {Benchmarking western blot quantification in human fibroblasts}, + year = {2003}, + keywords = {sequencing}, + journal = {Genome Editing Practice}, + volume = {19}, + number = {8}, + pages = {27--51} +} + +@article{lab6, + author = {Cardenas-Holt, Marisol and Ishikawa-Reed, Juno}, + title = {Optimising mitochondrial staining in primary neurons}, + year = {2007}, + keywords = {reagent}, + journal = {Statistics for the Life Sciences}, + volume = {1}, + number = {6}, + pages = {284--292} +} + +@incollection{lab7, + author = {Marrowfield, Femi and Thornbury, Celia}, + title = {Validating spheroid invasion assays in human fibroblasts}, + year = {2004}, + keywords = {antibodies, dataset}, + booktitle = {Handbook Of Spheroid Invasion Assays}, + editor = {Pellham, Wilhelmina and Dunmore, Leonie}, + publisher = {Lantern Field Books}, + address = {Ostrava Vale}, + pages = {178--207} +} + +@article{lab8, + author = {Quarrington, Marisol}, + title = {Validating phototoxicity in human fibroblasts}, + year = {2013}, + keywords = {microscopy, protocol, sequencing}, + journal = {Cytometry and Sorting}, + volume = {15}, + number = {6}, + pages = {774--799} +} + +@article{lab9, + author = {Ravensworth, Leonie and Varga, Femi}, + title = {Benchmarking organoid culture in yeast}, + year = {2017}, + keywords = {crispr, antibodies}, + journal = {Bench Protocols Letters}, + volume = {42}, + number = {6}, + pages = {38--59} +} + +@article{lab10, + author = {Jessamy, Wilhelmina and Yardley, Tobias}, + title = {Quantifying phototoxicity in human fibroblasts}, + year = {2023}, + keywords = {sequencing, crispr, antibodies}, + journal = {Quantitative Cell Imaging}, + volume = {11}, + number = {3}, + pages = {239--255} +} + +@article{lab11, + author = {Harwood, Ximena}, + title = {Automating flow cytometry panels in intestinal organoids}, + year = {2024}, + keywords = {crispr}, + journal = {Genome Editing Practice}, + volume = {1}, + number = {12}, + pages = {161--177} +} + +@inproceedings{lab12, + author = {Montaigne-Blake, Tobias and Larkspur, Dario and Bellweather, Farid}, + title = {Benchmarking fluorescent reporters in intestinal organoids}, + year = {2012}, + keywords = {software}, + booktitle = {Proceedings of the 28th Meeting on Single-Cell Sequencing}, + pages = {85--95} +} + +@incollection{lab13, + author = {Gilchrist, Desmond and Dunmore, Ximena and Pellham, Kaia}, + title = {Scaling image segmentation in human fibroblasts}, + year = {2007}, + keywords = {flow cytometry}, + booktitle = {Handbook Of Lentiviral Transduction}, + editor = {Jessamy, Marisol and Ulvaeus, Ada}, + publisher = {Harrowgate & Lowe}, + address = {Ostrava Vale}, + pages = {172--189} +} + +@phdthesis{lab14, + author = {Calloway, Ikaika and Pemberton, Pavel}, + title = {Scaling flow cytometry panels in zebrafish embryos}, + year = {1996}, + keywords = {microscopy}, + school = {University of Westmarch} +} + +@techreport{lab15, + author = {Gilchrist, Noor and Gilchrist, Rafael and Abernathy, Noor and Halloran, Marisol and Halloran, Edda}, + title = {Validating phototoxicity in primary neurons}, + year = {2008}, + keywords = {protocol, dataset}, + institution = {Brindlemoor Observatory}, + number = {TR-2008-64} +} + +@article{lab16, + author = {Ravensworth, Zora and Yardley, Soren and Jessamy, Desmond and Pellham, Vesna and Oakhurst, Bastian}, + title = {Standardising replicate design in intestinal organoids}, + year = {1998}, + keywords = {antibodies}, + journal = {Statistics for the Life Sciences}, + volume = {29}, + number = {12}, + pages = {766--776} +} + +@article{lab17, + author = {Ravensworth, Dario and Calloway, Marisol and Rowntree, Pavel}, + title = {Improving CRISPR knock-in efficiency in mouse embryonic stem cells}, + year = {2008}, + keywords = {crispr}, + journal = {Journal of Cell Methods}, + volume = {39}, + number = {8}, + pages = {861--875} +} + +@article{lab18, + author = {Marrowfield, Wren and Esterhazy-Lowe, Wren and Okonkwo-Hart, Yara and Ishikawa-Reed, Cosmo and Ravensworth, Quinn and Zabala, Saoirse}, + title = {Optimising western blot quantification in human fibroblasts}, + year = {1999}, + keywords = {flow cytometry, dataset}, + journal = {Quantitative Cell Imaging}, + volume = {35}, + number = {8}, + pages = {432--449} +} + +@phdthesis{lab19, + author = {Zabala, Wilhelmina and Ishikawa-Reed, Hugo and Kettering, Marisol and Ravensworth, Ada and Lindqvist, Hanne and Wexford, Luca}, + title = {Benchmarking phototoxicity in yeast}, + year = {2003}, + keywords = {organoids, reagent}, + school = {University of Harrowgate} +} + +@article{lab20, + author = {Lindqvist, Ada and Ravensworth, Kaia and Esterhazy-Lowe, Saoirse and Ishikawa-Reed, Uma and Dunmore, Tala and Kettering, Hugo}, + title = {Benchmarking organoid culture in patient-derived cells}, + year = {2012}, + keywords = {antibodies}, + journal = {Statistics for the Life Sciences}, + volume = {39}, + number = {9}, + pages = {132--155} +} + +@article{lab21, + author = {Pellham, Dario and Wexford, Edda and Thornbury, Wilhelmina}, + title = {Standardising fluorescent reporters in zebrafish embryos}, + year = {2018}, + keywords = {crispr}, + journal = {Bench Protocols Letters}, + volume = {37}, + number = {2}, + pages = {809--822} +} + +@article{lab22, + author = {Esterhazy-Lowe, Femi and Ellery, Pavel}, + title = {Quantifying single-cell sequencing in HeLa cells}, + year = {2015}, + keywords = {antibodies, dataset, flow cytometry}, + journal = {Statistics for the Life Sciences}, + volume = {4}, + number = {2}, + pages = {439--454} +} + +@article{lab23, + author = {Bellweather, Ikaika and Yilmaz-Grant, Viktor and Ishikawa-Reed, Wren}, + title = {Quantifying mitochondrial staining in human fibroblasts}, + year = {2012}, + keywords = {sequencing, journal club, antibodies}, + journal = {Statistics for the Life Sciences}, + volume = {48}, + number = {8}, + pages = {485--499} +} + +@article{lab24, + author = {Esterhazy-Lowe, Soren and Lindqvist, Elif and Harwood, Ada and Montaigne-Blake, Hanne}, + title = {Scaling confocal deconvolution in intestinal organoids}, + year = {2004}, + keywords = {statistics, antibodies, journal club}, + journal = {Bench Protocols Letters}, + volume = {44}, + number = {1}, + pages = {328--344} +} + +@misc{lab25, + author = {Stavely, Dario and Dunmore, Priya and Okonkwo-Hart, Amara and Oakhurst, Tobias and Ishikawa-Reed, Kenji}, + title = {Standardising confocal deconvolution in yeast}, + year = {1994}, + keywords = {sequencing}, + howpublished = {Dataset}, + publisher = {Saltford Open Data} +} + +@article{lab26, + author = {Stavely, Viktor and Larkspur, Beatrix and Underhill, Amara}, + title = {Improving CRISPR knock-in efficiency in mouse embryonic stem cells: a comparison}, + year = {2003}, + keywords = {protocol, statistics}, + journal = {Statistics for the Life Sciences}, + volume = {37}, + number = {8}, + pages = {45--55} +} + +@article{lab27, + author = {Pellham, Yusuf and Abernathy, Cosmo}, + title = {Scaling fluorescent reporters in HeLa cells}, + year = {2007}, + keywords = {journal club}, + journal = {Genome Editing Practice}, + volume = {41}, + number = {11}, + pages = {348--360} +} + +@article{lab28, + author = {Kowalczyk, Otto and Ravensworth, Rafael}, + title = {Optimising image segmentation in yeast}, + year = {2025}, + keywords = {dataset, statistics}, + journal = {Bench Protocols Letters}, + volume = {14}, + number = {6}, + pages = {136--150} +} + +@techreport{lab29, + author = {Dunmore, Vesna and Cardenas-Holt, Priya}, + title = {Standardising organoid culture in yeast}, + year = {2010}, + keywords = {protocol, journal club}, + institution = {Brindlemoor Data Office}, + number = {TR-2010-42} +} + +@inproceedings{lab30, + author = {Varga, Soren and Jessamy, Wilhelmina}, + title = {Standardising live-cell imaging in yeast}, + year = {2007}, + keywords = {reagent, sequencing}, + booktitle = {Proceedings of the 27th Meeting on Western Blot Quantification}, + pages = {26--30} +} + +@book{lab31, + author = {Harwood, Rosa and Yardley, Quinn}, + title = {Quantifying mitochondrial staining in HeLa cells}, + year = {2005}, + keywords = {software, journal club, statistics}, + publisher = {Saltford House}, + address = {Ostrava Vale} +} + +@article{lab32, + author = {Whitlock, Saoirse and Quarrington, Soren and Nakashima, Femi and Yardley, Celia and Kowalczyk, Hanne}, + title = {Improving antibody validation in human fibroblasts}, + year = {2015}, + keywords = {crispr, software}, + journal = {Statistics for the Life Sciences}, + volume = {23}, + number = {9}, + pages = {41--65} +} + +@incollection{lab33, + author = {Abernathy, Ikaika and Nakashima, Vesna and Bellweather, Viktor and Cardenas-Holt, Viktor and Zeller, Hanne}, + title = {Quantifying organoid culture in mouse embryonic stem cells}, + year = {2002}, + keywords = {journal club, antibodies}, + booktitle = {Perspectives On Image Segmentation}, + editor = {Yardley, Cosmo and Galloway, Bram}, + publisher = {Harrowgate & Lowe}, + address = {Lowen}, + pages = {337--360} +} + +@inproceedings{lab34, + author = {Thornbury, Chiara and Delacourt, Marisol and Fenwright, Pavel and Ellery, Nils}, + title = {Improving antibody validation in intestinal organoids}, + year = {2000}, + keywords = {sequencing}, + booktitle = {Proceedings of the 6th Meeting on Western Blot Quantification}, + pages = {211--219} +} + +@article{lab35, + author = {Ravensworth, Rosa and Ulvaeus, Amara and Halloran, Greta}, + title = {Standardising flow cytometry panels in mouse embryonic stem cells}, + year = {2024}, + keywords = {dataset}, + journal = {Cytometry and Sorting}, + volume = {44}, + number = {3}, + pages = {284--293} +} + +@article{lab36, + author = {Ravensworth, Uma}, + title = {Optimising organoid culture in patient-derived cells}, + year = {2009}, + keywords = {organoids}, + journal = {Cytometry and Sorting}, + volume = {6}, + number = {11}, + pages = {191--203} +} + +@misc{lab37, + author = {Northcote, Ikaika and Brightwater, Vesna and Northcote, Orla and Whitlock, Jonas and Tremaine, Bastian and Fairbairn, Amara}, + title = {Scaling flow cytometry panels in mouse embryonic stem cells}, + year = {2002}, + keywords = {crispr, statistics}, + howpublished = {Dataset}, + publisher = {Westmarch Open Data} +} + +@book{lab38, + author = {Whitlock, Elif and Oakhurst, Greta}, + title = {Quantifying CRISPR knock-in efficiency in mouse embryonic stem cells}, + year = {2005}, + keywords = {reagent}, + publisher = {Westmarch Scholarly}, + address = {Ostrava Vale} +} + +@article{lab39, + author = {Juniper, Ximena and Vantongeren, Ikaika}, + title = {Optimising replicate design in primary neurons}, + year = {2003}, + keywords = {sequencing, microscopy}, + journal = {Cytometry and Sorting}, + volume = {3}, + number = {3}, + pages = {864--877} +} + +@article{lab40, + author = {Yardley, Marisol and Ashgrove, Dario}, + title = {Automating flow cytometry panels in intestinal organoids: an open dataset}, + year = {2005}, + keywords = {crispr, sequencing}, + journal = {Quantitative Cell Imaging}, + volume = {14}, + number = {12}, + pages = {443--467} +} + +@incollection{lab41, + author = {Gilchrist, Quinn and Kowalczyk, Bastian and Calloway, Viktor and Vantongeren, Priya and Abernathy, Hugo and Northcote, Aurelio}, + title = {Benchmarking image segmentation in HeLa cells}, + year = {2001}, + keywords = {statistics, protocol}, + booktitle = {Perspectives On Antibody Validation}, + editor = {Montaigne-Blake, Luca and Bellweather, Amara}, + publisher = {Lantern Field Books}, + address = {Westmarch}, + pages = {136--163} +} + +@article{lab42, + author = {Lindqvist, Tala and Sandoval, Femi and Vantongeren, Pavel and Yilmaz-Grant, Zora and Delacourt, Elif and Ashgrove, Nils}, + title = {Improving spheroid invasion assays in primary neurons}, + year = {2013}, + keywords = {dataset, software, reagent}, + journal = {Journal of Cell Methods}, + volume = {34}, + number = {12}, + pages = {862--869} +} + +@article{lab43, + author = {Galloway, Marisol and Bellweather, Dario and Zabala, Kaia}, + title = {Benchmarking single-cell sequencing in mouse embryonic stem cells}, + year = {2022}, + keywords = {dataset, microscopy}, + journal = {Bench Protocols Letters}, + volume = {9}, + number = {7}, + pages = {414--439} +} + +@inproceedings{lab44, + author = {Ellery, Tala and Whitlock, Priya and Ashgrove, Tala and Zabala, Celia and Marrowfield, Marisol}, + title = {Scaling spheroid invasion assays in yeast}, + year = {2014}, + keywords = {crispr, dataset}, + booktitle = {Proceedings of the 16th Meeting on Spheroid Invasion Assays}, + pages = {250--258} +} + +@article{lab45, + author = {Abernathy, Pavel and Larkspur, Soren}, + title = {Optimising mitochondrial staining in patient-derived cells}, + year = {2021}, + keywords = {reagent}, + journal = {Quantitative Cell Imaging}, + volume = {20}, + number = {5}, + pages = {627--649} +} + +@inproceedings{lab46, + author = {Galloway, Jonas and Pemberton, Orla and Harwood, Hugo and Jessamy, Yara and Vantongeren, Kaia and Rowntree, Marisol}, + title = {Automating western blot quantification in primary neurons}, + year = {2017}, + keywords = {organoids, antibodies}, + booktitle = {Proceedings of the 29th Meeting on Crispr Knock-In Efficiency}, + pages = {290--296} +} + +@article{lab47, + author = {Sandoval, Soren and Stavely, Quinn and Underhill, Tobias and Northcote, Soren and Achterberg, Femi and Fenwright, Vesna}, + title = {Automating western blot quantification in primary neurons: a second look}, + year = {2023}, + keywords = {crispr, antibodies}, + journal = {Quantitative Cell Imaging}, + volume = {4}, + number = {9}, + pages = {869--890} +} + +@article{lab48, + author = {Kettering, Tala and Kettering, Amara}, + title = {Automating spheroid invasion assays in primary neurons}, + year = {2011}, + keywords = {microscopy, antibodies}, + journal = {Journal of Cell Methods}, + volume = {21}, + number = {4}, + pages = {106--121} +} + +@book{lab49, + author = {Cardenas-Holt, Rosa and Marrowfield, Zora}, + title = {Optimising flow cytometry panels in HeLa cells}, + year = {2004}, + keywords = {antibodies, crispr}, + publisher = {Harrowgate & Lowe}, + address = {Westmarch} +} + +@article{lab50, + author = {Harwood, Ada and Marrowfield, Vesna and Juniper, Noor and Calloway, Otto}, + title = {Validating flow cytometry panels in HeLa cells}, + year = {2003}, + keywords = {statistics}, + journal = {Journal of Cell Methods}, + volume = {13}, + number = {10}, + pages = {874--897} +} + +@article{lab51, + author = {Yilmaz-Grant, Zora and Sandoval, Ada}, + title = {Standardising flow cytometry panels in human fibroblasts}, + year = {2022}, + keywords = {microscopy, journal club, reagent}, + journal = {Quantitative Cell Imaging}, + volume = {38}, + number = {6}, + pages = {803--813} +} + +@inproceedings{lab52, + author = {Juniper, Soren and Halloran, Beatrix and Tremaine, Aurelio}, + title = {Benchmarking phototoxicity in primary neurons}, + year = {2017}, + keywords = {crispr}, + booktitle = {Proceedings of the 30th Meeting on Phototoxicity}, + pages = {10--17} +} + +@incollection{lab53, + author = {Yilmaz-Grant, Zora and Gilchrist, Uma and Galloway, Aurelio}, + title = {Standardising phototoxicity in human fibroblasts}, + year = {2005}, + keywords = {sequencing, organoids, dataset}, + booktitle = {Handbook Of Replicate Design}, + editor = {Northcote, Wilhelmina and Whitlock, Amara}, + publisher = {Harrowgate & Lowe}, + address = {Port Ellery}, + pages = {133--162} +} + +@article{lab54, + author = {Tremaine, Kaia and Abernathy, Marisol}, + title = {Improving organoid culture in HeLa cells}, + year = {2004}, + keywords = {protocol, sequencing}, + journal = {Genome Editing Practice}, + volume = {31}, + number = {3}, + pages = {590--607} +} + +@article{lab55, + author = {Montaigne-Blake, Nils and Northcote, Tala and Fairbairn, Kaia}, + title = {Quantifying CRISPR knock-in efficiency in patient-derived cells}, + year = {2015}, + keywords = {flow cytometry, reagent}, + journal = {Journal of Cell Methods}, + volume = {14}, + number = {7}, + pages = {632--658} +} + +@phdthesis{lab56, + author = {Kowalczyk, Elif and Kowalczyk, Marisol and Yilmaz-Grant, Luca}, + title = {Improving flow cytometry panels in yeast}, + year = {2000}, + keywords = {antibodies, crispr}, + school = {University of Calder Bay} +} + +@article{lab57, + author = {Ishikawa-Reed, Bastian and Calloway, Luca}, + title = {Improving organoid culture in patient-derived cells}, + year = {2025}, + keywords = {statistics, dataset}, + journal = {Cytometry and Sorting}, + volume = {39}, + number = {7}, + pages = {656--674} +} + +@article{lab58, + author = {Rowntree, Ines and Nakashima, Hanne and Oakhurst, Rafael and Ashgrove, Soren and Stavely, Kaia and Harwood, Orla}, + title = {Quantifying single-cell sequencing in primary neurons}, + year = {2011}, + keywords = {organoids, crispr}, + journal = {Statistics for the Life Sciences}, + volume = {46}, + number = {11}, + pages = {636--659} +} + +@article{lab59, + author = {Esterhazy-Lowe, Ikaika and Sandoval, Wren and Kowalczyk, Yara}, + title = {Validating live-cell imaging in primary neurons}, + year = {2018}, + keywords = {microscopy}, + journal = {Bench Protocols Letters}, + volume = {20}, + number = {2}, + pages = {443--453} +} + +@techreport{lab60, + author = {Cardenas-Holt, Chiara and Rowntree, Chiara and Stavely, Tala}, + title = {Standardising antibody validation in mouse embryonic stem cells}, + year = {2015}, + keywords = {antibodies, microscopy}, + institution = {Lowen Data Office}, + number = {TR-2015-78} +} + +@article{lab61, + author = {Ravensworth, Pavel and Brightwater, Rafael}, + title = {Validating spheroid invasion assays in primary neurons}, + year = {2002}, + keywords = {flow cytometry, protocol}, + journal = {Cytometry and Sorting}, + volume = {33}, + number = {11}, + pages = {574--580} +} + +@incollection{lab62, + author = {Galloway, Rafael and Juniper, Yara}, + title = {Validating antibody validation in human fibroblasts}, + year = {2005}, + keywords = {protocol}, + booktitle = {New Directions In Replicate Design}, + editor = {Northcote, Juno and Juniper, Quinn}, + publisher = {Westmarch Scholarly}, + address = {Port Ellery}, + pages = {80--97} +} + +@article{lab63, + author = {Galloway, Amara and Underhill, Kenji}, + title = {Benchmarking image segmentation in mouse embryonic stem cells}, + year = {1999}, + keywords = {crispr, reagent}, + journal = {Quantitative Cell Imaging}, + volume = {21}, + number = {6}, + pages = {533--555} +} + +@article{lab64, + author = {Northcote, Wren and Yilmaz-Grant, Tobias and Ashgrove, Edda}, + title = {Improving phototoxicity in intestinal organoids}, + year = {2020}, + keywords = {antibodies}, + journal = {Statistics for the Life Sciences}, + volume = {48}, + number = {7}, + pages = {208--236} +} + +@inproceedings{lab65, + author = {Kowalczyk, Bram and Kowalczyk, Quinn and Jessamy, Uma and Ulvaeus, Quinn and Bellweather, Beatrix}, + title = {Automating lentiviral transduction in yeast}, + year = {2023}, + keywords = {microscopy, dataset}, + booktitle = {Proceedings of the 12th Meeting on Lentiviral Transduction}, + pages = {80--85} +} + +@phdthesis{lab66, + author = {Nakashima, Desmond and Okonkwo-Hart, Otto and Kettering, Rafael and Ashgrove, Bastian and Quarrington, Edda and Ashgrove, Celia}, + title = {Scaling phototoxicity in mouse embryonic stem cells}, + year = {1998}, + keywords = {flow cytometry, reagent}, + school = {University of Lowen} +} + +@phdthesis{lab67, + author = {Abernathy, Juno and Nakashima, Beatrix and Achterberg, Zora and Harwood, Celia}, + title = {Benchmarking flow cytometry panels in zebrafish embryos}, + year = {1998}, + keywords = {organoids}, + school = {University of Westmarch} +} + +@incollection{lab68, + author = {Oakhurst, Orla and Jessamy, Otto and Juniper, Kenji and Kowalczyk, Rafael and Ashgrove, Femi and Ravensworth, Wren}, + title = {Standardising live-cell imaging in yeast: a second look}, + year = {1995}, + keywords = {protocol, crispr, flow cytometry}, + booktitle = {Perspectives On Flow Cytometry Panels}, + editor = {Rowntree, Viktor and Ravensworth, Uma}, + publisher = {Lantern Field Books}, + address = {Brindlemoor}, + pages = {234--250} +} + +@article{lab69, + author = {Rowntree, Zora and Brightwater, Hugo and Calloway, Cosmo and Sandoval, Tobias and Thornbury, Kenji and Okonkwo-Hart, Ximena}, + title = {Standardising fluorescent reporters in mouse embryonic stem cells}, + year = {2002}, + keywords = {software, statistics, protocol}, + journal = {Quantitative Cell Imaging}, + volume = {11}, + number = {8}, + pages = {102--127} +} + +@inproceedings{lab70, + author = {Whitlock, Otto and Ishikawa-Reed, Soren and Ivesdale, Yusuf}, + title = {Validating organoid culture in yeast}, + year = {1999}, + keywords = {reagent, journal club, software}, + booktitle = {Proceedings of the 21th Meeting on Organoid Culture}, + pages = {194--199} +} + +@incollection{lab71, + author = {Lindqvist, Tala and Achterberg, Orla and Ulvaeus, Celia}, + title = {Validating fluorescent reporters in primary neurons}, + year = {1994}, + keywords = {organoids, dataset}, + booktitle = {New Directions In Phototoxicity}, + editor = {Dunmore, Ximena and Tremaine, Chiara}, + publisher = {Lantern Field Books}, + address = {Harrowgate}, + pages = {137--153} +} + +@article{lab72, + author = {Bellweather, Tala and Calloway, Wren and Juniper, Uma and Ivesdale, Mina}, + title = {Quantifying single-cell sequencing in mouse embryonic stem cells}, + year = {2018}, + keywords = {software, journal club}, + journal = {Statistics for the Life Sciences}, + volume = {3}, + number = {10}, + pages = {419--430} +} + +@article{lab73, + author = {Harwood, Leonie and Quarrington, Ines and Zabala, Wilhelmina}, + title = {Automating lentiviral transduction in patient-derived cells}, + year = {2004}, + keywords = {journal club, microscopy, statistics}, + journal = {Statistics for the Life Sciences}, + volume = {35}, + number = {6}, + pages = {205--220} +} + +@phdthesis{lab74, + author = {Ulvaeus, Bastian and Rowntree, Yara and Gilchrist, Yara and Underhill, Mina and Zeller, Kaia}, + title = {Quantifying lentiviral transduction in human fibroblasts}, + year = {2006}, + keywords = {sequencing, reagent}, + school = {University of Westmarch} +} + +@article{lab75, + author = {Zabala, Nils and Sandoval, Rosa and Pellham, Marisol}, + title = {Optimising CRISPR knock-in efficiency in human fibroblasts}, + year = {1999}, + keywords = {flow cytometry, statistics, crispr}, + journal = {Quantitative Cell Imaging}, + volume = {3}, + number = {4}, + pages = {29--57} +} + +@article{lab76, + author = {Cardenas-Holt, Marisol and Fenwright, Saoirse}, + title = {Standardising antibody validation in mouse embryonic stem cells: a comparison}, + year = {2021}, + keywords = {journal club}, + journal = {Genome Editing Practice}, + volume = {21}, + number = {11}, + pages = {186--195} +} + +@phdthesis{lab77, + author = {Marrowfield, Ada and Bellweather, Juno and Delacourt, Femi}, + title = {Improving antibody validation in HeLa cells}, + year = {2002}, + keywords = {statistics}, + school = {University of Port Ellery} +} + +@article{lab78, + author = {Zeller, Quinn and Thornbury, Rafael}, + title = {Quantifying antibody validation in zebrafish embryos}, + year = {2017}, + keywords = {reagent}, + journal = {Journal of Cell Methods}, + volume = {3}, + number = {1}, + pages = {3--13} +} + +@article{lab79, + author = {Marrowfield, Elif and Jessamy, Bastian and Wexford, Priya}, + title = {Automating live-cell imaging in patient-derived cells}, + year = {2016}, + keywords = {dataset, protocol}, + journal = {Quantitative Cell Imaging}, + volume = {3}, + number = {7}, + pages = {483--496} +} + +@article{lab80, + author = {Rowntree, Luca and Brightwater, Yara and Sandoval, Yusuf}, + title = {Optimising fluorescent reporters in zebrafish embryos}, + year = {1994}, + keywords = {flow cytometry, microscopy, software}, + journal = {Genome Editing Practice}, + volume = {29}, + number = {3}, + pages = {717--736} +} + +@article{lab81, + author = {Larkspur, Noor and Varga, Farid}, + title = {Validating antibody validation in patient-derived cells}, + year = {2007}, + keywords = {protocol}, + journal = {Cytometry and Sorting}, + volume = {18}, + number = {2}, + pages = {837--861} +} + +@article{lab82, + author = {Halloran, Elif and Ulvaeus, Celia}, + title = {Validating flow cytometry panels in HeLa cells: new evidence}, + year = {1997}, + keywords = {crispr, protocol}, + journal = {Journal of Cell Methods}, + volume = {15}, + number = {5}, + pages = {144--154} +} + +@article{lab83, + author = {Ivesdale, Femi}, + title = {Validating live-cell imaging in intestinal organoids}, + year = {2003}, + keywords = {journal club}, + journal = {Genome Editing Practice}, + volume = {9}, + number = {3}, + pages = {272--300} +} + +@article{lab84, + author = {Whitlock, Saoirse and Oakhurst, Kaia}, + title = {Quantifying fluorescent reporters in intestinal organoids}, + year = {1998}, + keywords = {protocol, software, sequencing}, + journal = {Cytometry and Sorting}, + volume = {1}, + number = {2}, + pages = {89--103} +} + +@book{lab85, + author = {Montaigne-Blake, Hugo}, + title = {Optimising flow cytometry panels in primary neurons}, + year = {1994}, + keywords = {microscopy}, + publisher = {Lantern Field Books}, + address = {Port Ellery} +} + +@article{lab86, + author = {Varga, Kenji}, + title = {Improving CRISPR knock-in efficiency in mouse embryonic stem cells: lessons from a decade}, + year = {2003}, + keywords = {flow cytometry, reagent, journal club}, + journal = {Bench Protocols Letters}, + volume = {12}, + number = {4}, + pages = {129--142} +} + +@article{lab87, + author = {Wexford, Farid and Pellham, Tala and Gilchrist, Desmond and Cardenas-Holt, Elif}, + title = {Scaling live-cell imaging in intestinal organoids}, + year = {2018}, + keywords = {sequencing, journal club, organoids}, + journal = {Bench Protocols Letters}, + volume = {45}, + number = {8}, + pages = {728--752} +} + +@article{lab88, + author = {Gilchrist, Bastian}, + title = {Benchmarking flow cytometry panels in zebrafish embryos: a second look}, + year = {2017}, + keywords = {software, flow cytometry}, + journal = {Journal of Cell Methods}, + volume = {1}, + number = {8}, + pages = {884--905} +} + +@article{lab89, + author = {Esterhazy-Lowe, Aurelio and Ulvaeus, Farid}, + title = {Optimising antibody validation in HeLa cells}, + year = {2016}, + keywords = {crispr}, + journal = {Journal of Cell Methods}, + volume = {25}, + number = {8}, + pages = {53--80} +} + +@article{lab90, + author = {Northcote, Ximena and Juniper, Luca and Ulvaeus, Ximena and Underhill, Mina and Kowalczyk, Soren and Galloway, Yusuf}, + title = {Improving CRISPR knock-in efficiency in zebrafish embryos}, + year = {2013}, + keywords = {microscopy, journal club, flow cytometry}, + journal = {Quantitative Cell Imaging}, + volume = {33}, + number = {5}, + pages = {739--765} +} + +@incollection{lab91, + author = {Marrowfield, Saoirse and Varga, Tala}, + title = {Optimising spheroid invasion assays in primary neurons}, + year = {2006}, + keywords = {flow cytometry, sequencing}, + booktitle = {Perspectives On Organoid Culture}, + editor = {Zeller, Vesna and Yilmaz-Grant, Orla}, + publisher = {Brindlemoor University Press}, + address = {Port Ellery}, + pages = {216--245} +} + +@article{lab92, + author = {Whitlock, Dario and Okonkwo-Hart, Wren and Ravensworth, Rosa and Harwood, Pavel and Oakhurst, Celia}, + title = {Optimising confocal deconvolution in patient-derived cells}, + year = {2016}, + keywords = {reagent, organoids}, + journal = {Genome Editing Practice}, + volume = {19}, + number = {9}, + pages = {443--462} +} + +@incollection{lab93, + author = {Lindqvist, Rosa and Jessamy, Soren and Kowalczyk, Otto}, + title = {Scaling confocal deconvolution in human fibroblasts}, + year = {2010}, + keywords = {antibodies, microscopy}, + booktitle = {Handbook Of Organoid Culture}, + editor = {Ivesdale, Orla and Ellery, Ximena}, + publisher = {Brindlemoor University Press}, + address = {Lowen}, + pages = {103--119} +} + +@article{lab94, + author = {Harwood, Tala}, + title = {Standardising phototoxicity in yeast}, + year = {2000}, + keywords = {journal club, statistics}, + journal = {Quantitative Cell Imaging}, + volume = {44}, + number = {11}, + pages = {833--850} +} + +@incollection{lab95, + author = {Jessamy, Wren and Harwood, Celia}, + title = {Benchmarking mitochondrial staining in zebrafish embryos}, + year = {2026}, + keywords = {statistics, journal club}, + booktitle = {Perspectives On Fluorescent Reporters}, + editor = {Juniper, Ada and Yilmaz-Grant, Jonas}, + publisher = {Harrowgate & Lowe}, + address = {Port Ellery}, + pages = {368--381} +} + +@inproceedings{lab96, + author = {Larkspur, Bram and Ishikawa-Reed, Cosmo and Bellweather, Juno}, + title = {Automating lentiviral transduction in intestinal organoids}, + year = {1999}, + keywords = {protocol, crispr, journal club}, + booktitle = {Proceedings of the 20th Meeting on Spheroid Invasion Assays}, + pages = {160--165} +} + +@inproceedings{lab97, + author = {Bellweather, Rafael}, + title = {Standardising fluorescent reporters in intestinal organoids}, + year = {1995}, + keywords = {reagent, software}, + booktitle = {Proceedings of the 20th Meeting on Confocal Deconvolution}, + pages = {204--212} +} + +@article{lab98, + author = {Ellery, Chiara and Pellham, Ximena and Zeller, Celia and Pemberton, Orla and Okonkwo-Hart, Elif and Halloran, Uma}, + title = {Validating CRISPR knock-in efficiency in intestinal organoids}, + year = {2009}, + keywords = {antibodies, protocol, sequencing}, + journal = {Genome Editing Practice}, + volume = {15}, + number = {10}, + pages = {146--158} +} + +@book{lab99, + author = {Lindqvist, Otto and Varga, Elif and Quarrington, Hanne}, + title = {Standardising single-cell sequencing in primary neurons}, + year = {1995}, + keywords = {dataset, crispr, reagent}, + publisher = {Harrowgate & Lowe}, + address = {Brindlemoor} +} + +@article{lab100, + author = {Calloway, Yusuf and Halloran, Rosa}, + title = {Benchmarking lentiviral transduction in mouse embryonic stem cells}, + year = {2001}, + keywords = {journal club, flow cytometry}, + journal = {Quantitative Cell Imaging}, + volume = {30}, + number = {12}, + pages = {780--796} +} + +@phdthesis{lab101, + author = {Calloway, Zora and Gilchrist, Viktor}, + title = {Benchmarking confocal deconvolution in intestinal organoids}, + year = {2000}, + keywords = {microscopy, sequencing}, + school = {University of Calder Bay} +} + +@inproceedings{lab102, + author = {Marrowfield, Aurelio}, + title = {Scaling phototoxicity in yeast}, + year = {1997}, + keywords = {protocol}, + booktitle = {Proceedings of the 15th Meeting on Organoid Culture}, + pages = {134--144} +} + +@incollection{lab103, + author = {Jessamy, Rosa and Yardley, Beatrix and Quarrington, Quinn and Stavely, Saoirse}, + title = {Scaling mitochondrial staining in yeast}, + year = {2014}, + keywords = {journal club, crispr}, + booktitle = {Perspectives On Replicate Design}, + editor = {Underhill, Yara and Fenwright, Bram}, + publisher = {Saltford House}, + address = {Brindlemoor}, + pages = {135--159} +} + +@article{lab104, + author = {Ishikawa-Reed, Farid and Whitlock, Zora and Varga, Tala and Sandoval, Tobias and Halloran, Soren and Delacourt, Soren}, + title = {Improving single-cell sequencing in HeLa cells}, + year = {1999}, + keywords = {crispr}, + journal = {Cytometry and Sorting}, + volume = {26}, + number = {8}, + pages = {357--363} +} + +@article{lab105, + author = {Montaigne-Blake, Juno and Pellham, Marisol}, + title = {Scaling lentiviral transduction in primary neurons}, + year = {2021}, + keywords = {dataset}, + journal = {Genome Editing Practice}, + volume = {2}, + number = {3}, + pages = {696--721} +} + +@article{lab106, + author = {Marrowfield, Kenji}, + title = {Benchmarking antibody validation in mouse embryonic stem cells}, + year = {2013}, + keywords = {statistics, dataset}, + journal = {Journal of Cell Methods}, + volume = {24}, + number = {10}, + pages = {270--277} +} + +@techreport{lab107, + author = {Sandoval, Amara}, + title = {Validating live-cell imaging in human fibroblasts}, + year = {2023}, + keywords = {statistics, organoids}, + institution = {Lowen City Council}, + number = {TR-2023-66} +} + +@book{lab108, + author = {Esterhazy-Lowe, Ines and Nakashima, Viktor and Achterberg, Bram}, + title = {Automating single-cell sequencing in primary neurons}, + year = {2016}, + keywords = {flow cytometry}, + publisher = {Harrowgate & Lowe}, + address = {Port Ellery} +} + +@incollection{lab109, + author = {Underhill, Desmond and Ivesdale, Ikaika and Ellery, Saoirse and Whitlock, Edda and Fenwright, Vesna and Harwood, Saoirse}, + title = {Standardising lentiviral transduction in HeLa cells}, + year = {2000}, + keywords = {crispr}, + booktitle = {Handbook Of Confocal Deconvolution}, + editor = {Pellham, Rosa and Yilmaz-Grant, Ximena}, + publisher = {Calder Bay Academic}, + address = {Saltford}, + pages = {370--392} +} + +@article{lab110, + author = {Nakashima, Jonas and Whitlock, Beatrix and Abernathy, Ikaika}, + title = {Benchmarking single-cell sequencing in zebrafish embryos}, + year = {2022}, + keywords = {antibodies, sequencing, reagent}, + journal = {Cytometry and Sorting}, + volume = {48}, + number = {4}, + pages = {723--745} +} + +@article{lab111, + author = {Stavely, Ikaika and Abernathy, Hugo and Thornbury, Leonie}, + title = {Optimising organoid culture in primary neurons}, + year = {1998}, + keywords = {protocol, dataset}, + journal = {Bench Protocols Letters}, + volume = {16}, + number = {5}, + pages = {84--108} +} + +@incollection{lab112, + author = {Ishikawa-Reed, Bastian and Juniper, Yusuf and Kettering, Vesna and Pemberton, Ines and Sandoval, Vesna}, + title = {Optimising confocal deconvolution in human fibroblasts}, + year = {2008}, + keywords = {dataset}, + booktitle = {Handbook Of Image Segmentation}, + editor = {Ashgrove, Kenji and Varga, Uma}, + publisher = {Saltford House}, + address = {Calder Bay}, + pages = {166--183} +} + +@article{lab113, + author = {Harwood, Elif and Yardley, Tobias and Quarrington, Tobias and Pemberton, Edda}, + title = {Quantifying live-cell imaging in HeLa cells}, + year = {2026}, + keywords = {antibodies}, + journal = {Quantitative Cell Imaging}, + volume = {37}, + number = {2}, + pages = {679--693} +} + +@techreport{lab114, + author = {Ravensworth, Dario}, + title = {Optimising organoid culture in zebrafish embryos}, + year = {2005}, + keywords = {protocol, journal club, organoids}, + institution = {Brindlemoor Data Office}, + number = {TR-2005-89} +} + +@article{lab115, + author = {Ashgrove, Femi and Abernathy, Kaia and Nakashima, Viktor and Kettering, Otto and Marrowfield, Mina and Pellham, Priya}, + title = {Standardising fluorescent reporters in primary neurons}, + year = {2020}, + keywords = {statistics, antibodies}, + journal = {Journal of Cell Methods}, + volume = {40}, + number = {12}, + pages = {87--112} +} + +@article{lab116, + author = {Varga, Juno and Ellery, Beatrix and Vantongeren, Tala}, + title = {Improving live-cell imaging in yeast}, + year = {2012}, + keywords = {software, microscopy}, + journal = {Journal of Cell Methods}, + volume = {29}, + number = {5}, + pages = {332--359} +} + +@incollection{lab117, + author = {Ivesdale, Orla}, + title = {Scaling flow cytometry panels in HeLa cells}, + year = {1999}, + keywords = {sequencing, microscopy, protocol}, + booktitle = {New Directions In Mitochondrial Staining}, + editor = {Montaigne-Blake, Hanne and Galloway, Noor}, + publisher = {Lantern Field Books}, + address = {Harrowgate}, + pages = {23--44} +} + +@incollection{lab118, + author = {Bellweather, Mina and Abernathy, Viktor and Northcote, Orla}, + title = {Validating single-cell sequencing in zebrafish embryos}, + year = {2003}, + keywords = {journal club, dataset}, + booktitle = {New Directions In Single-Cell Sequencing}, + editor = {Vantongeren, Vesna and Galloway, Jonas}, + publisher = {Saltford House}, + address = {Port Ellery}, + pages = {329--350} +} + +@article{lab119, + author = {Marrowfield, Hugo and Bellweather, Marisol and Larkspur, Hugo and Pellham, Ximena}, + title = {Validating phototoxicity in primary neurons: a comparison}, + year = {1996}, + keywords = {software}, + journal = {Statistics for the Life Sciences}, + volume = {6}, + number = {6}, + pages = {246--265} +} + +@article{lab120, + author = {Fairbairn, Vesna and Fairbairn, Bastian and Stavely, Zora}, + title = {Automating replicate design in zebrafish embryos}, + year = {1995}, + keywords = {organoids, software}, + journal = {Quantitative Cell Imaging}, + volume = {4}, + number = {12}, + pages = {534--557} +} + +@article{lab121, + author = {Sandoval, Viktor and Ravensworth, Uma and Oakhurst, Beatrix}, + title = {Scaling confocal deconvolution in intestinal organoids: new evidence}, + year = {2017}, + keywords = {reagent, organoids, sequencing}, + journal = {Journal of Cell Methods}, + volume = {46}, + number = {5}, + pages = {83--98} +} + +@techreport{lab122, + author = {Rowntree, Celia and Ulvaeus, Beatrix}, + title = {Improving replicate design in primary neurons}, + year = {2009}, + keywords = {dataset, sequencing}, + institution = {Westmarch Research Institute}, + number = {TR-2009-11} +} + +@phdthesis{lab123, + author = {Gilchrist, Tala and Gilchrist, Uma and Ishikawa-Reed, Viktor and Nakashima, Juno}, + title = {Optimising CRISPR knock-in efficiency in mouse embryonic stem cells}, + year = {2000}, + keywords = {software, flow cytometry, organoids}, + school = {University of Calder Bay} +} + +@book{lab124, + author = {Underhill, Yusuf and Quarrington, Yusuf}, + title = {Standardising antibody validation in human fibroblasts}, + year = {1998}, + keywords = {reagent}, + publisher = {Lantern Field Books}, + address = {Westmarch} +} + +@book{lab125, + author = {Stavely, Kenji and Fairbairn, Tala and Kettering, Juno}, + title = {Standardising mitochondrial staining in zebrafish embryos}, + year = {2025}, + keywords = {dataset, microscopy}, + publisher = {Saltford House}, + address = {Harrowgate} +} + +@article{lab126, + author = {Lindqvist, Rafael and Thornbury, Kenji and Northcote, Luca}, + title = {Optimising phototoxicity in patient-derived cells}, + year = {2005}, + keywords = {crispr}, + journal = {Journal of Cell Methods}, + volume = {10}, + number = {9}, + pages = {660--681} +} + +@article{lab127, + author = {Harwood, Edda and Bellweather, Saoirse and Harwood, Cosmo and Larkspur, Hanne}, + title = {Automating confocal deconvolution in HeLa cells}, + year = {2016}, + keywords = {reagent, dataset}, + journal = {Journal of Cell Methods}, + volume = {26}, + number = {7}, + pages = {678--695} +} + +@article{lab128, + author = {Jessamy, Pavel and Kettering, Greta}, + title = {Standardising confocal deconvolution in primary neurons}, + year = {2016}, + keywords = {flow cytometry, crispr, microscopy}, + journal = {Cytometry and Sorting}, + volume = {9}, + number = {3}, + pages = {420--435} +} + +@techreport{lab129, + author = {Cardenas-Holt, Farid and Rowntree, Yara}, + title = {Automating confocal deconvolution in intestinal organoids}, + year = {2003}, + keywords = {organoids, antibodies}, + institution = {Brindlemoor Research Institute}, + number = {TR-2003-85} +} + +@book{lab130, + author = {Achterberg, Yusuf and Abernathy, Quinn and Esterhazy-Lowe, Orla and Stavely, Elif and Tremaine, Wilhelmina}, + title = {Scaling replicate design in mouse embryonic stem cells}, + year = {1997}, + keywords = {reagent, statistics}, + publisher = {Harrowgate & Lowe}, + address = {Port Ellery} +} + +@article{lab131, + author = {Lindqvist, Edda and Achterberg, Priya and Marrowfield, Yusuf and Marrowfield, Celia and Bellweather, Desmond}, + title = {Validating CRISPR knock-in efficiency in intestinal organoids: a second look}, + year = {2015}, + keywords = {sequencing, flow cytometry}, + journal = {Genome Editing Practice}, + volume = {21}, + number = {1}, + pages = {708--732} +} + +@article{lab132, + author = {Fairbairn, Noor and Northcote, Marisol}, + title = {Benchmarking phototoxicity in patient-derived cells}, + year = {2017}, + keywords = {dataset, sequencing}, + journal = {Bench Protocols Letters}, + volume = {21}, + number = {2}, + pages = {340--346} +} + +@article{lab133, + author = {Marrowfield, Viktor and Wexford, Kaia}, + title = {Optimising image segmentation in yeast: lessons from a decade}, + year = {1996}, + keywords = {reagent, journal club, statistics}, + journal = {Bench Protocols Letters}, + volume = {24}, + number = {1}, + pages = {276--297} +} + +@book{lab134, + author = {Ashgrove, Farid and Fenwright, Juno and Lindqvist, Ada}, + title = {Scaling western blot quantification in yeast}, + year = {2016}, + keywords = {sequencing, antibodies, statistics}, + publisher = {Harrowgate & Lowe}, + address = {Brindlemoor} +} + +@article{lab135, + author = {Quarrington, Cosmo and Ellery, Jonas}, + title = {Optimising organoid culture in intestinal organoids}, + year = {2009}, + keywords = {journal club}, + journal = {Bench Protocols Letters}, + volume = {20}, + number = {5}, + pages = {851--872} +} + +@incollection{lab136, + author = {Esterhazy-Lowe, Cosmo and Jessamy, Ximena}, + title = {Scaling confocal deconvolution in HeLa cells}, + year = {2021}, + keywords = {crispr}, + booktitle = {Handbook Of Image Segmentation}, + editor = {Halloran, Ines and Ravensworth, Rosa}, + publisher = {Saltford House}, + address = {Westmarch}, + pages = {84--114} +} + +@article{lab137, + author = {Calloway, Wren and Stavely, Wilhelmina and Galloway, Luca and Bellweather, Priya and Ulvaeus, Leonie}, + title = {Benchmarking antibody validation in mouse embryonic stem cells: lessons from a decade}, + year = {2001}, + keywords = {dataset, flow cytometry, software}, + journal = {Journal of Cell Methods}, + volume = {40}, + number = {1}, + pages = {172--179} +} + +@incollection{lab138, + author = {Rowntree, Wilhelmina and Jessamy, Ines and Ivesdale, Aurelio}, + title = {Quantifying live-cell imaging in primary neurons}, + year = {2018}, + keywords = {sequencing}, + booktitle = {Handbook Of Live-Cell Imaging}, + editor = {Oakhurst, Jonas and Larkspur, Rafael}, + publisher = {Calder Bay Academic}, + address = {Harrowgate}, + pages = {11--38} +} + +@article{lab139, + author = {Tremaine, Edda and Dunmore, Farid and Esterhazy-Lowe, Yusuf}, + title = {Automating fluorescent reporters in yeast}, + year = {2022}, + keywords = {microscopy}, + journal = {Quantitative Cell Imaging}, + volume = {35}, + number = {9}, + pages = {200--216} +} + +@article{lab140, + author = {Varga, Beatrix and Ishikawa-Reed, Nils}, + title = {Validating live-cell imaging in primary neurons: an open dataset}, + year = {2018}, + keywords = {dataset, sequencing}, + journal = {Journal of Cell Methods}, + volume = {6}, + number = {5}, + pages = {619--627} +} + +@book{lab141, + author = {Yardley, Soren}, + title = {Improving organoid culture in yeast}, + year = {2017}, + keywords = {journal club}, + publisher = {Saltford House}, + address = {Lowen} +} + +@book{lab142, + author = {Underhill, Noor and Wexford, Elif and Quarrington, Desmond and Halloran, Ada}, + title = {Validating live-cell imaging in mouse embryonic stem cells}, + year = {2013}, + keywords = {flow cytometry, dataset, organoids}, + publisher = {Harrowgate & Lowe}, + address = {Saltford} +} + +@article{lab143, + author = {Vantongeren, Dario and Pellham, Femi and Zeller, Soren}, + title = {Validating phototoxicity in patient-derived cells}, + year = {1994}, + keywords = {microscopy, statistics, sequencing}, + journal = {Statistics for the Life Sciences}, + volume = {43}, + number = {12}, + pages = {433--447} +} + +@article{lab144, + author = {Ravensworth, Cosmo and Fenwright, Quinn and Fenwright, Dario and Nakashima, Desmond}, + title = {Optimising fluorescent reporters in HeLa cells}, + year = {1996}, + keywords = {sequencing, flow cytometry, organoids}, + journal = {Journal of Cell Methods}, + volume = {41}, + number = {10}, + pages = {468--492} +} + +@article{lab145, + author = {Ulvaeus, Mina}, + title = {Quantifying single-cell sequencing in HeLa cells: new evidence}, + year = {2025}, + keywords = {software, antibodies}, + journal = {Statistics for the Life Sciences}, + volume = {35}, + number = {2}, + pages = {258--272} +} + +@misc{lab146, + author = {Larkspur, Jonas and Harwood, Jonas}, + title = {Scaling image segmentation in patient-derived cells}, + year = {2011}, + keywords = {flow cytometry}, + howpublished = {Dataset}, + publisher = {Lowen Open Data} +} + +@inproceedings{lab147, + author = {Okonkwo-Hart, Bram and Dunmore, Luca and Ashgrove, Juno}, + title = {Scaling organoid culture in patient-derived cells}, + year = {2009}, + keywords = {flow cytometry, reagent, crispr}, + booktitle = {Proceedings of the 20th Meeting on Western Blot Quantification}, + pages = {254--263} +} + +@article{lab148, + author = {Quarrington, Leonie and Quarrington, Wren and Underhill, Leonie}, + title = {Quantifying confocal deconvolution in human fibroblasts}, + year = {1998}, + keywords = {microscopy, flow cytometry, dataset}, + journal = {Journal of Cell Methods}, + volume = {15}, + number = {1}, + pages = {754--768} +} + +@article{lab149, + author = {Whitlock, Amara and Larkspur, Yara and Kettering, Orla}, + title = {Benchmarking western blot quantification in HeLa cells}, + year = {2022}, + keywords = {microscopy, sequencing}, + journal = {Genome Editing Practice}, + volume = {18}, + number = {10}, + pages = {83--93} +} + +@incollection{lab150, + author = {Whitlock, Kaia}, + title = {Benchmarking organoid culture in mouse embryonic stem cells}, + year = {2003}, + keywords = {antibodies}, + booktitle = {Handbook Of Antibody Validation}, + editor = {Montaigne-Blake, Aurelio and Larkspur, Orla}, + publisher = {Calder Bay Academic}, + address = {Port Ellery}, + pages = {348--370} +} + +@article{lab151, + author = {Larkspur, Wren and Rowntree, Vesna and Okonkwo-Hart, Desmond and Ashgrove, Hugo and Stavely, Bram}, + title = {Benchmarking image segmentation in zebrafish embryos}, + year = {2021}, + keywords = {dataset, protocol}, + journal = {Genome Editing Practice}, + volume = {24}, + number = {5}, + pages = {811--839} +} + +@article{lab152, + author = {Ravensworth, Ines}, + title = {Improving image segmentation in human fibroblasts}, + year = {2001}, + keywords = {journal club, software, microscopy}, + journal = {Bench Protocols Letters}, + volume = {31}, + number = {1}, + pages = {375--397} +} + +@article{lab153, + author = {Ivesdale, Ikaika and Rowntree, Nils and Zabala, Rosa}, + title = {Automating lentiviral transduction in patient-derived cells: a second look}, + year = {2010}, + keywords = {software}, + journal = {Genome Editing Practice}, + volume = {9}, + number = {7}, + pages = {2--15} +} + +@article{lab154, + author = {Fairbairn, Farid and Brightwater, Yusuf and Calloway, Tala and Kowalczyk, Hugo and Pemberton, Juno and Pellham, Uma}, + title = {Benchmarking spheroid invasion assays in HeLa cells}, + year = {2019}, + keywords = {reagent, protocol, statistics}, + journal = {Journal of Cell Methods}, + volume = {23}, + number = {7}, + pages = {649--675} +} + +@article{lab155, + author = {Pemberton, Desmond and Montaigne-Blake, Elif and Yilmaz-Grant, Chiara}, + title = {Validating organoid culture in mouse embryonic stem cells}, + year = {2013}, + keywords = {flow cytometry}, + journal = {Journal of Cell Methods}, + volume = {47}, + number = {3}, + pages = {592--611} +} + +@article{lab156, + author = {Zabala, Leonie and Stavely, Elif and Marrowfield, Ximena}, + title = {Optimising western blot quantification in patient-derived cells}, + year = {1994}, + keywords = {sequencing, antibodies, statistics}, + journal = {Journal of Cell Methods}, + volume = {29}, + number = {3}, + pages = {89--114} +} + +@book{lab157, + author = {Delacourt, Ximena and Ellery, Tobias and Galloway, Rafael and Pellham, Uma and Esterhazy-Lowe, Noor and Achterberg, Nils}, + title = {Improving lentiviral transduction in patient-derived cells}, + year = {2003}, + keywords = {reagent, sequencing}, + publisher = {Brindlemoor University Press}, + address = {Saltford} +} + +@article{lab158, + author = {Gilchrist, Farid and Varga, Celia and Zeller, Beatrix and Okonkwo-Hart, Edda and Galloway, Dario and Abernathy, Rafael}, + title = {Quantifying live-cell imaging in yeast}, + year = {2014}, + keywords = {dataset}, + journal = {Statistics for the Life Sciences}, + volume = {24}, + number = {6}, + pages = {330--345} +} + +@article{lab159, + author = {Stavely, Otto and Okonkwo-Hart, Kaia}, + title = {Validating replicate design in HeLa cells}, + year = {1998}, + keywords = {journal club, protocol}, + journal = {Cytometry and Sorting}, + volume = {35}, + number = {2}, + pages = {266--288} +} + +@article{lab160, + author = {Ivesdale, Mina and Juniper, Uma and Montaigne-Blake, Cosmo}, + title = {Scaling phototoxicity in patient-derived cells}, + year = {2007}, + keywords = {dataset, microscopy, protocol}, + journal = {Quantitative Cell Imaging}, + volume = {44}, + number = {7}, + pages = {256--282} +} + +@book{lab161, + author = {Northcote, Farid and Calloway, Mina and Halloran, Leonie and Gilchrist, Mina}, + title = {Quantifying mitochondrial staining in mouse embryonic stem cells}, + year = {2017}, + keywords = {protocol, crispr, statistics}, + publisher = {Saltford House}, + address = {Harrowgate} +} + +@article{lab162, + author = {Wexford, Ximena and Larkspur, Tala}, + title = {Benchmarking live-cell imaging in zebrafish embryos}, + year = {2003}, + keywords = {statistics, protocol, sequencing}, + journal = {Cytometry and Sorting}, + volume = {23}, + number = {6}, + pages = {434--453} +} + +@techreport{lab163, + author = {Bellweather, Otto and Zabala, Cosmo and Okonkwo-Hart, Tobias and Varga, Otto and Varga, Tobias}, + title = {Improving spheroid invasion assays in primary neurons: a second look}, + year = {1997}, + keywords = {sequencing}, + institution = {Calder Bay Observatory}, + number = {TR-1997-98} +} + +@article{lab164, + author = {Whitlock, Vesna and Juniper, Femi and Ellery, Ikaika and Calloway, Zora and Pellham, Wilhelmina and Harwood, Soren}, + title = {Benchmarking live-cell imaging in mouse embryonic stem cells}, + year = {2013}, + keywords = {organoids, sequencing, crispr}, + journal = {Bench Protocols Letters}, + volume = {25}, + number = {9}, + pages = {336--358} +} + +@article{lab165, + author = {Ivesdale, Jonas}, + title = {Quantifying antibody validation in yeast}, + year = {2024}, + keywords = {microscopy}, + journal = {Cytometry and Sorting}, + volume = {5}, + number = {12}, + pages = {462--484} +} + +@article{lab166, + author = {Quarrington, Rafael and Cardenas-Holt, Zora and Juniper, Priya}, + title = {Optimising spheroid invasion assays in patient-derived cells}, + year = {2023}, + keywords = {dataset, journal club}, + journal = {Genome Editing Practice}, + volume = {20}, + number = {11}, + pages = {710--734} +} + +@article{lab167, + author = {Ivesdale, Ikaika and Dunmore, Orla and Yardley, Leonie}, + title = {Benchmarking live-cell imaging in primary neurons}, + year = {2022}, + keywords = {journal club, statistics, sequencing}, + journal = {Bench Protocols Letters}, + volume = {34}, + number = {12}, + pages = {249--277} +} + +@article{lab168, + author = {Ishikawa-Reed, Viktor and Pellham, Dario and Montaigne-Blake, Femi and Quarrington, Elif}, + title = {Optimising organoid culture in yeast}, + year = {2024}, + keywords = {crispr}, + journal = {Statistics for the Life Sciences}, + volume = {26}, + number = {2}, + pages = {87--98} +} + +@incollection{lab169, + author = {Gilchrist, Ikaika and Okonkwo-Hart, Femi and Ishikawa-Reed, Farid and Vantongeren, Orla}, + title = {Quantifying CRISPR knock-in efficiency in primary neurons}, + year = {2014}, + keywords = {sequencing, dataset, statistics}, + booktitle = {Perspectives On Organoid Culture}, + editor = {Ulvaeus, Rafael and Lindqvist, Nils}, + publisher = {Saltford House}, + address = {Port Ellery}, + pages = {181--206} +} + +@incollection{lab170, + author = {Fenwright, Wren and Ashgrove, Mina and Cardenas-Holt, Femi}, + title = {Scaling replicate design in human fibroblasts}, + year = {2012}, + keywords = {crispr, sequencing}, + booktitle = {Handbook Of Phototoxicity}, + editor = {Ellery, Juno and Northcote, Otto}, + publisher = {Saltford House}, + address = {Brindlemoor}, + pages = {387--411} +} + +@article{lab171, + author = {Kowalczyk, Wilhelmina and Ulvaeus, Quinn and Wexford, Priya and Pellham, Quinn and Stavely, Yara}, + title = {Optimising organoid culture in mouse embryonic stem cells}, + year = {2018}, + keywords = {statistics, sequencing}, + journal = {Bench Protocols Letters}, + volume = {28}, + number = {6}, + pages = {457--465} +} + +@article{lab172, + author = {Gilchrist, Uma and Ivesdale, Kenji}, + title = {Improving western blot quantification in zebrafish embryos}, + year = {2024}, + keywords = {statistics, sequencing}, + journal = {Cytometry and Sorting}, + volume = {35}, + number = {9}, + pages = {748--770} +} + +@article{lab173, + author = {Cardenas-Holt, Jonas and Ashgrove, Aurelio and Marrowfield, Aurelio and Zabala, Farid and Ravensworth, Priya and Okonkwo-Hart, Yara}, + title = {Automating live-cell imaging in HeLa cells}, + year = {2024}, + keywords = {organoids, protocol}, + journal = {Bench Protocols Letters}, + volume = {11}, + number = {8}, + pages = {703--712} +} + +@article{lab174, + author = {Lindqvist, Wilhelmina}, + title = {Improving phototoxicity in patient-derived cells}, + year = {2008}, + keywords = {antibodies}, + journal = {Quantitative Cell Imaging}, + volume = {8}, + number = {4}, + pages = {185--191} +} + +@incollection{lab175, + author = {Brightwater, Celia and Ellery, Hanne and Kowalczyk, Kaia and Varga, Ines and Whitlock, Noor}, + title = {Standardising single-cell sequencing in patient-derived cells}, + year = {2000}, + keywords = {microscopy, antibodies}, + booktitle = {New Directions In Phototoxicity}, + editor = {Northcote, Vesna and Abernathy, Kaia}, + publisher = {Lantern Field Books}, + address = {Calder Bay}, + pages = {398--426} +} + +@inproceedings{lab176, + author = {Ellery, Quinn and Gilchrist, Otto}, + title = {Validating single-cell sequencing in intestinal organoids}, + year = {2014}, + keywords = {crispr, flow cytometry, journal club}, + booktitle = {Proceedings of the 7th Meeting on Confocal Deconvolution}, + pages = {204--209} +} + +@article{lab177, + author = {Pemberton, Wilhelmina and Marrowfield, Kaia}, + title = {Validating confocal deconvolution in human fibroblasts}, + year = {2018}, + keywords = {sequencing, antibodies}, + journal = {Bench Protocols Letters}, + volume = {32}, + number = {10}, + pages = {127--139} +} + +@inproceedings{lab178, + author = {Ravensworth, Soren}, + title = {Improving replicate design in intestinal organoids}, + year = {1998}, + keywords = {organoids, flow cytometry}, + booktitle = {Proceedings of the 13th Meeting on Single-Cell Sequencing}, + pages = {215--225} +} + +@article{lab179, + author = {Quarrington, Ines and Varga, Hanne}, + title = {Validating flow cytometry panels in primary neurons}, + year = {1996}, + keywords = {software}, + journal = {Bench Protocols Letters}, + volume = {45}, + number = {3}, + pages = {4--18} +} + +@book{lab180, + author = {Zeller, Ada and Galloway, Chiara}, + title = {Benchmarking lentiviral transduction in intestinal organoids}, + year = {2008}, + keywords = {sequencing}, + publisher = {Calder Bay Academic}, + address = {Westmarch} +} + +@article{lab181, + author = {Ishikawa-Reed, Pavel and Ashgrove, Hanne and Abernathy, Tobias and Pellham, Juno and Fenwright, Ada and Wexford, Bram}, + title = {Validating antibody validation in mouse embryonic stem cells}, + year = {2019}, + keywords = {microscopy, reagent, antibodies}, + journal = {Statistics for the Life Sciences}, + volume = {26}, + number = {7}, + pages = {571--590} +} + +@article{lab182, + author = {Nakashima, Wilhelmina and Ashgrove, Ines and Juniper, Zora}, + title = {Improving CRISPR knock-in efficiency in mouse embryonic stem cells: an open dataset}, + year = {2009}, + keywords = {protocol}, + journal = {Journal of Cell Methods}, + volume = {8}, + number = {11}, + pages = {119--146} +} + +@book{lab183, + author = {Ivesdale, Mina and Achterberg, Priya and Ishikawa-Reed, Ada and Sandoval, Vesna and Tremaine, Rosa and Achterberg, Pavel}, + title = {Automating spheroid invasion assays in mouse embryonic stem cells}, + year = {2008}, + keywords = {journal club}, + publisher = {Harrowgate & Lowe}, + address = {Brindlemoor} +} + +@article{lab184, + author = {Fairbairn, Elif and Stavely, Elif}, + title = {Scaling fluorescent reporters in mouse embryonic stem cells}, + year = {2009}, + keywords = {dataset}, + journal = {Cytometry and Sorting}, + volume = {11}, + number = {12}, + pages = {119--143} +} + +@article{lab185, + author = {Pemberton, Tobias and Zabala, Yusuf and Esterhazy-Lowe, Jonas}, + title = {Optimising antibody validation in primary neurons}, + year = {1994}, + keywords = {organoids}, + journal = {Cytometry and Sorting}, + volume = {4}, + number = {4}, + pages = {708--726} +} + +@article{lab186, + author = {Stavely, Otto and Ishikawa-Reed, Wilhelmina and Ivesdale, Hugo and Ishikawa-Reed, Rafael and Esterhazy-Lowe, Desmond}, + title = {Standardising replicate design in yeast}, + year = {2003}, + keywords = {sequencing, journal club}, + journal = {Bench Protocols Letters}, + volume = {44}, + number = {5}, + pages = {552--575} +} + +@article{lab187, + author = {Dunmore, Wren and Okonkwo-Hart, Rosa}, + title = {Standardising image segmentation in zebrafish embryos}, + year = {1998}, + keywords = {sequencing}, + journal = {Bench Protocols Letters}, + volume = {8}, + number = {8}, + pages = {263--275} +} + +@inproceedings{lab188, + author = {Bellweather, Bastian and Tremaine, Tobias and Kowalczyk, Kaia and Halloran, Viktor}, + title = {Standardising flow cytometry panels in human fibroblasts: lessons from a decade}, + year = {2013}, + keywords = {journal club}, + booktitle = {Proceedings of the 17th Meeting on Antibody Validation}, + pages = {38--48} +} + +@book{lab189, + author = {Northcote, Vesna and Kettering, Soren and Nakashima, Ximena and Sandoval, Mina and Juniper, Femi and Northcote, Greta}, + title = {Benchmarking phototoxicity in primary neurons: a second look}, + year = {2001}, + keywords = {microscopy, reagent, software}, + publisher = {Brindlemoor University Press}, + address = {Westmarch} +} + +@article{lab190, + author = {Underhill, Celia and Brightwater, Vesna and Vantongeren, Luca and Pellham, Farid and Juniper, Pavel and Gilchrist, Rosa}, + title = {Standardising spheroid invasion assays in primary neurons}, + year = {2016}, + keywords = {statistics}, + journal = {Statistics for the Life Sciences}, + volume = {13}, + number = {4}, + pages = {243--267} +} + +@article{lab191, + author = {Whitlock, Tala and Nakashima, Edda and Kowalczyk, Leonie and Fairbairn, Pavel and Ashgrove, Chiara and Harwood, Jonas}, + title = {Validating fluorescent reporters in human fibroblasts}, + year = {2008}, + keywords = {statistics}, + journal = {Cytometry and Sorting}, + volume = {34}, + number = {12}, + pages = {833--841} +} + +@incollection{lab192, + author = {Abernathy, Edda and Montaigne-Blake, Quinn and Ashgrove, Hugo and Marrowfield, Tala and Sandoval, Otto}, + title = {Optimising fluorescent reporters in yeast}, + year = {2006}, + keywords = {statistics, organoids}, + booktitle = {Handbook Of Crispr Knock-In Efficiency}, + editor = {Ellery, Elif and Marrowfield, Rafael}, + publisher = {Calder Bay Academic}, + address = {Lowen}, + pages = {203--228} +} + +@incollection{lab193, + author = {Ashgrove, Ines and Okonkwo-Hart, Elif and Brightwater, Juno and Brightwater, Bastian and Sandoval, Kaia}, + title = {Quantifying phototoxicity in yeast}, + year = {2011}, + keywords = {crispr, flow cytometry}, + booktitle = {Handbook Of Flow Cytometry Panels}, + editor = {Dunmore, Pavel and Montaigne-Blake, Uma}, + publisher = {Harrowgate & Lowe}, + address = {Calder Bay}, + pages = {111--127} +} + +@misc{lab194, + author = {Ellery, Cosmo and Delacourt, Yusuf and Gilchrist, Hanne and Fenwright, Rafael and Larkspur, Celia}, + title = {Validating live-cell imaging in primary neurons: a comparison}, + year = {2022}, + keywords = {crispr, dataset}, + howpublished = {Dataset}, + publisher = {Ostrava Vale Open Data} +} + +@article{lab195, + author = {Tremaine, Jonas and Halloran, Edda}, + title = {Scaling live-cell imaging in patient-derived cells}, + year = {2017}, + keywords = {journal club}, + journal = {Journal of Cell Methods}, + volume = {2}, + number = {8}, + pages = {209--216} +} + +@article{lab196, + author = {Ishikawa-Reed, Bram and Varga, Hanne and Rowntree, Wilhelmina and Okonkwo-Hart, Orla and Rowntree, Femi and Achterberg, Desmond}, + title = {Improving image segmentation in intestinal organoids: an open dataset}, + year = {2012}, + keywords = {software, microscopy, journal club}, + journal = {Cytometry and Sorting}, + volume = {46}, + number = {10}, + pages = {334--350} +} + +@inproceedings{lab197, + author = {Wexford, Dario and Ulvaeus, Uma and Ravensworth, Wren}, + title = {Scaling organoid culture in primary neurons}, + year = {2002}, + keywords = {crispr, statistics, antibodies}, + booktitle = {Proceedings of the 22th Meeting on Single-Cell Sequencing}, + pages = {90--100} +} + +@techreport{lab198, + author = {Gilchrist, Kenji and Cardenas-Holt, Uma}, + title = {Standardising spheroid invasion assays in human fibroblasts}, + year = {2015}, + keywords = {crispr}, + institution = {Brindlemoor Data Office}, + number = {TR-2015-78} +} + +@incollection{lab199, + author = {Ulvaeus, Elif and Kowalczyk, Marisol and Zabala, Uma}, + title = {Quantifying image segmentation in HeLa cells}, + year = {1994}, + keywords = {microscopy, sequencing, organoids}, + booktitle = {Handbook Of Lentiviral Transduction}, + editor = {Larkspur, Quinn and Whitlock, Kaia}, + publisher = {Calder Bay Academic}, + address = {Lowen}, + pages = {356--368} +} + +@incollection{lab200, + author = {Fairbairn, Juno and Halloran, Noor and Ravensworth, Beatrix}, + title = {Benchmarking fluorescent reporters in yeast}, + year = {2014}, + keywords = {organoids, software}, + booktitle = {Handbook Of Single-Cell Sequencing}, + editor = {Underhill, Orla and Marrowfield, Zora}, + publisher = {Harrowgate & Lowe}, + address = {Port Ellery}, + pages = {365--388} +} + +@article{lab201, + author = {Larkspur, Ines and Oakhurst, Dario and Whitlock, Farid and Kowalczyk, Marisol and Bellweather, Tobias and Lindqvist, Jonas}, + title = {Standardising mitochondrial staining in mouse embryonic stem cells}, + year = {2014}, + keywords = {microscopy}, + journal = {Bench Protocols Letters}, + volume = {24}, + number = {6}, + pages = {864--891} +} + +@article{lab202, + author = {Pemberton, Tala and Ashgrove, Jonas and Gilchrist, Tobias}, + title = {Automating image segmentation in human fibroblasts}, + year = {2002}, + keywords = {software}, + journal = {Genome Editing Practice}, + volume = {41}, + number = {8}, + pages = {498--508} +} + +@techreport{lab203, + author = {Delacourt, Yusuf and Varga, Jonas and Brightwater, Viktor and Juniper, Celia and Abernathy, Tobias}, + title = {Validating organoid culture in intestinal organoids}, + year = {2009}, + keywords = {crispr, organoids}, + institution = {Brindlemoor City Council}, + number = {TR-2009-53} +} + +@article{lab204, + author = {Pemberton, Femi and Cardenas-Holt, Kenji and Achterberg, Viktor and Delacourt, Ximena}, + title = {Optimising mitochondrial staining in intestinal organoids}, + year = {2007}, + keywords = {organoids}, + journal = {Statistics for the Life Sciences}, + volume = {36}, + number = {7}, + pages = {6--31} +} + +@article{lab205, + author = {Fenwright, Tobias and Harwood, Yara and Achterberg, Hugo}, + title = {Validating antibody validation in yeast}, + year = {2025}, + keywords = {reagent}, + journal = {Journal of Cell Methods}, + volume = {27}, + number = {6}, + pages = {629--648} +} + +@article{lab206, + author = {Achterberg, Quinn and Delacourt, Ikaika and Bellweather, Soren}, + title = {Scaling mitochondrial staining in primary neurons}, + year = {2003}, + keywords = {crispr, sequencing}, + journal = {Journal of Cell Methods}, + volume = {41}, + number = {12}, + pages = {812--818} +} + +@article{lab207, + author = {Gilchrist, Amara and Underhill, Juno}, + title = {Automating lentiviral transduction in yeast: lessons from a decade}, + year = {2019}, + keywords = {sequencing, protocol, antibodies}, + journal = {Bench Protocols Letters}, + volume = {30}, + number = {1}, + pages = {204--217} +} + +@book{lab208, + author = {Underhill, Bram and Ishikawa-Reed, Soren}, + title = {Quantifying single-cell sequencing in zebrafish embryos}, + year = {2015}, + keywords = {flow cytometry, sequencing}, + publisher = {Brindlemoor University Press}, + address = {Ostrava Vale} +} + +@article{lab209, + author = {Underhill, Kenji and Ivesdale, Rafael}, + title = {Standardising organoid culture in mouse embryonic stem cells}, + year = {1998}, + keywords = {organoids, journal club}, + journal = {Quantitative Cell Imaging}, + volume = {45}, + number = {10}, + pages = {172--195} +} + +@article{lab210, + author = {Achterberg, Bastian and Lindqvist, Ximena and Wexford, Luca and Nakashima, Wilhelmina}, + title = {Standardising fluorescent reporters in zebrafish embryos: new evidence}, + year = {2019}, + keywords = {flow cytometry, organoids}, + journal = {Statistics for the Life Sciences}, + volume = {12}, + number = {6}, + pages = {673--679} +} + +@article{lab211, + author = {Abernathy, Wilhelmina and Bellweather, Otto and Halloran, Viktor and Varga, Kaia}, + title = {Standardising spheroid invasion assays in primary neurons: an open dataset}, + year = {2001}, + keywords = {crispr, journal club}, + journal = {Cytometry and Sorting}, + volume = {29}, + number = {3}, + pages = {50--73} +} + +@article{lab212, + author = {Nakashima, Vesna and Dunmore, Edda and Zabala, Femi}, + title = {Quantifying phototoxicity in mouse embryonic stem cells}, + year = {2020}, + keywords = {antibodies, software, flow cytometry}, + journal = {Quantitative Cell Imaging}, + volume = {31}, + number = {9}, + pages = {797--820} +} + +@incollection{lab213, + author = {Tremaine, Greta and Abernathy, Rafael}, + title = {Quantifying lentiviral transduction in yeast}, + year = {1996}, + keywords = {organoids}, + booktitle = {New Directions In Spheroid Invasion Assays}, + editor = {Dunmore, Ines and Dunmore, Priya}, + publisher = {Harrowgate & Lowe}, + address = {Calder Bay}, + pages = {240--264} +} + +@article{lab214, + author = {Northcote, Ines}, + title = {Improving lentiviral transduction in human fibroblasts}, + year = {2005}, + keywords = {protocol, microscopy}, + journal = {Genome Editing Practice}, + volume = {4}, + number = {1}, + pages = {465--483} +} + +@article{lab215, + author = {Bellweather, Chiara and Rowntree, Farid}, + title = {Automating live-cell imaging in intestinal organoids}, + year = {2021}, + keywords = {software, dataset}, + journal = {Quantitative Cell Imaging}, + volume = {18}, + number = {5}, + pages = {717--729} +} + +@article{lab216, + author = {Kettering, Ines and Whitlock, Hanne and Fenwright, Yusuf}, + title = {Benchmarking western blot quantification in primary neurons}, + year = {1996}, + keywords = {statistics, microscopy, protocol}, + journal = {Quantitative Cell Imaging}, + volume = {4}, + number = {4}, + pages = {297--310} +} + +@article{lab217, + author = {Montaigne-Blake, Chiara and Zeller, Priya and Vantongeren, Juno}, + title = {Validating phototoxicity in human fibroblasts: a field study}, + year = {2020}, + keywords = {organoids, reagent, flow cytometry}, + journal = {Quantitative Cell Imaging}, + volume = {37}, + number = {2}, + pages = {200--211} +} + +@book{lab218, + author = {Ivesdale, Priya}, + title = {Validating antibody validation in human fibroblasts: a comparison}, + year = {2000}, + keywords = {reagent, antibodies, journal club}, + publisher = {Saltford House}, + address = {Saltford} +} + +@incollection{lab219, + author = {Yardley, Rafael and Fairbairn, Yusuf}, + title = {Quantifying phototoxicity in zebrafish embryos}, + year = {2012}, + keywords = {microscopy}, + booktitle = {Handbook Of Replicate Design}, + editor = {Juniper, Cosmo and Bellweather, Luca}, + publisher = {Calder Bay Academic}, + address = {Westmarch}, + pages = {127--152} +} + +@article{lab220, + author = {Larkspur, Pavel}, + title = {Automating CRISPR knock-in efficiency in mouse embryonic stem cells}, + year = {2014}, + keywords = {microscopy}, + journal = {Journal of Cell Methods}, + volume = {43}, + number = {12}, + pages = {490--497} +} + +@article{lab221, + author = {Cardenas-Holt, Juno and Jessamy, Amara and Bellweather, Beatrix and Underhill, Quinn}, + title = {Improving CRISPR knock-in efficiency in human fibroblasts}, + year = {2025}, + keywords = {crispr, organoids, reagent}, + journal = {Journal of Cell Methods}, + volume = {1}, + number = {8}, + pages = {691--705} +} + +@book{lab222, + author = {Ravensworth, Orla and Zabala, Wren and Ellery, Bastian and Oakhurst, Cosmo}, + title = {Optimising antibody validation in human fibroblasts}, + year = {2021}, + keywords = {reagent}, + publisher = {Westmarch Scholarly}, + address = {Saltford} +} + +@phdthesis{lab223, + author = {Ulvaeus, Desmond and Gilchrist, Elif and Harwood, Luca and Rowntree, Viktor and Juniper, Hugo}, + title = {Benchmarking live-cell imaging in intestinal organoids}, + year = {1996}, + keywords = {journal club, statistics, dataset}, + school = {University of Calder Bay} +} + +@article{lab224, + author = {Brightwater, Viktor and Achterberg, Greta and Montaigne-Blake, Zora}, + title = {Improving single-cell sequencing in yeast}, + year = {2003}, + keywords = {flow cytometry, reagent}, + journal = {Bench Protocols Letters}, + volume = {35}, + number = {8}, + pages = {772--788} +} + +@article{lab225, + author = {Ishikawa-Reed, Yusuf and Fairbairn, Pavel and Tremaine, Vesna and Quarrington, Chiara and Pellham, Ikaika and Kettering, Ada}, + title = {Improving organoid culture in HeLa cells: a second look}, + year = {2023}, + keywords = {reagent, sequencing}, + journal = {Quantitative Cell Imaging}, + volume = {38}, + number = {7}, + pages = {243--251} +} + +@article{lab226, + author = {Ashgrove, Bram and Underhill, Desmond}, + title = {Validating flow cytometry panels in primary neurons: new evidence}, + year = {2008}, + keywords = {dataset, antibodies}, + journal = {Statistics for the Life Sciences}, + volume = {7}, + number = {8}, + pages = {633--644} +} + +@techreport{lab227, + author = {Ishikawa-Reed, Pavel and Jessamy, Priya and Sandoval, Tala and Northcote, Tobias}, + title = {Quantifying fluorescent reporters in yeast}, + year = {2007}, + keywords = {flow cytometry, crispr}, + institution = {Ostrava Vale Observatory}, + number = {TR-2007-98} +} + +@article{lab228, + author = {Calloway, Femi and Ravensworth, Elif and Ishikawa-Reed, Tobias and Delacourt, Ximena and Oakhurst, Edda and Whitlock, Pavel}, + title = {Scaling mitochondrial staining in mouse embryonic stem cells}, + year = {2001}, + keywords = {reagent}, + journal = {Cytometry and Sorting}, + volume = {15}, + number = {7}, + pages = {115--131} +} + +@book{lab229, + author = {Marrowfield, Soren and Delacourt, Rafael and Oakhurst, Rosa and Fenwright, Ikaika and Brightwater, Farid}, + title = {Benchmarking live-cell imaging in mouse embryonic stem cells: a field study}, + year = {2016}, + keywords = {software, sequencing, reagent}, + publisher = {Saltford House}, + address = {Calder Bay} +} + +@article{lab230, + author = {Abernathy, Rafael and Calloway, Beatrix and Halloran, Kenji}, + title = {Automating lentiviral transduction in intestinal organoids: a field study}, + year = {2010}, + keywords = {statistics, dataset}, + journal = {Quantitative Cell Imaging}, + volume = {37}, + number = {4}, + pages = {507--532} +} + +@article{lab231, + author = {Delacourt, Priya and Wexford, Leonie and Vantongeren, Ada and Varga, Farid}, + title = {Optimising confocal deconvolution in zebrafish embryos}, + year = {2006}, + keywords = {microscopy}, + journal = {Genome Editing Practice}, + volume = {39}, + number = {4}, + pages = {832--856} +} + +@article{lab232, + author = {Montaigne-Blake, Tobias and Vantongeren, Yara and Kettering, Wren}, + title = {Scaling live-cell imaging in human fibroblasts}, + year = {2024}, + keywords = {software, sequencing}, + journal = {Genome Editing Practice}, + volume = {35}, + number = {11}, + pages = {271--296} +} + +@article{lab233, + author = {Marrowfield, Yusuf and Juniper, Ada and Yilmaz-Grant, Chiara and Cardenas-Holt, Cosmo and Nakashima, Hugo and Ishikawa-Reed, Viktor}, + title = {Improving single-cell sequencing in HeLa cells: new evidence}, + year = {2014}, + keywords = {sequencing, flow cytometry, statistics}, + journal = {Statistics for the Life Sciences}, + volume = {19}, + number = {2}, + pages = {625--646} +} + +@inproceedings{lab234, + author = {Dunmore, Rafael and Nakashima, Rafael and Galloway, Saoirse and Varga, Ikaika and Zabala, Aurelio}, + title = {Validating western blot quantification in zebrafish embryos}, + year = {2000}, + keywords = {protocol, microscopy}, + booktitle = {Proceedings of the 6th Meeting on Organoid Culture}, + pages = {243--250} +} + +@inproceedings{lab235, + author = {Harwood, Noor and Wexford, Cosmo and Juniper, Otto and Kowalczyk, Bram and Pellham, Cosmo and Rowntree, Ximena}, + title = {Standardising lentiviral transduction in yeast}, + year = {2009}, + keywords = {sequencing}, + booktitle = {Proceedings of the 22th Meeting on Mitochondrial Staining}, + pages = {282--291} +} + +@article{lab236, + author = {Abernathy, Celia and Cardenas-Holt, Kenji}, + title = {Optimising replicate design in primary neurons: new evidence}, + year = {2016}, + keywords = {statistics}, + journal = {Cytometry and Sorting}, + volume = {19}, + number = {12}, + pages = {772--791} +} + +@article{lab237, + author = {Yilmaz-Grant, Leonie and Gilchrist, Elif}, + title = {Validating CRISPR knock-in efficiency in intestinal organoids: new evidence}, + year = {2004}, + keywords = {journal club, reagent, protocol}, + journal = {Quantitative Cell Imaging}, + volume = {4}, + number = {6}, + pages = {232--242} +} + +@article{lab238, + author = {Abernathy, Beatrix and Ellery, Mina and Kettering, Wren and Abernathy, Zora and Sandoval, Juno and Esterhazy-Lowe, Rafael}, + title = {Standardising replicate design in patient-derived cells}, + year = {2025}, + keywords = {microscopy, sequencing, antibodies}, + journal = {Cytometry and Sorting}, + volume = {3}, + number = {12}, + pages = {671--690} +} + +@inproceedings{lab239, + author = {Okonkwo-Hart, Quinn and Oakhurst, Kaia and Pellham, Juno}, + title = {Improving spheroid invasion assays in patient-derived cells}, + year = {1998}, + keywords = {protocol, software, microscopy}, + booktitle = {Proceedings of the 30th Meeting on Phototoxicity}, + pages = {123--132} +} + +@inproceedings{lab240, + author = {Northcote, Aurelio and Varga, Bram}, + title = {Quantifying spheroid invasion assays in intestinal organoids}, + year = {2003}, + keywords = {reagent}, + booktitle = {Proceedings of the 25th Meeting on Live-Cell Imaging}, + pages = {191--200} +} diff --git a/demos/make_demos.py b/demos/make_demos.py new file mode 100644 index 0000000..fec3a7a --- /dev/null +++ b/demos/make_demos.py @@ -0,0 +1,375 @@ +import json +import os +import random +import shutil +import sqlite3 +import sys +import tempfile +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +DEMOS = ROOT / "demos" +STARTERS = ROOT / "templates" / "starters" + +GIVEN = ["Ada", "Bram", "Celia", "Dario", "Edda", "Femi", "Greta", "Hugo", "Ines", "Jonas", "Kaia", "Luca", "Mina", "Nils", + "Orla", "Pavel", "Quinn", "Rosa", "Soren", "Tala", "Uma", "Viktor", "Wren", "Ximena", "Yusuf", "Zora", "Amara", + "Bastian", "Chiara", "Desmond", "Elif", "Farid", "Hanne", "Ikaika", "Juno", "Kenji", "Leonie", "Marisol", "Noor", + "Otto", "Priya", "Rafael", "Saoirse", "Tobias", "Vesna", "Wilhelmina", "Yara", "Aurelio", "Beatrix", "Cosmo"] +FAMILY = ["Ashgrove", "Brightwater", "Calloway", "Delacourt", "Ellery", "Fenwright", "Galloway", "Harwood", "Ivesdale", + "Jessamy", "Kettering", "Lindqvist", "Marrowfield", "Northcote", "Oakhurst", "Pellham", "Quarrington", "Rowntree", + "Stavely", "Thornbury", "Underhill", "Vantongeren", "Whitlock", "Yardley", "Zeller", "Abernathy", "Bellweather", + "Cardenas-Holt", "Dunmore", "Esterhazy-Lowe", "Fairbairn", "Gilchrist", "Halloran", "Ishikawa-Reed", "Juniper", + "Kowalczyk", "Larkspur", "Montaigne-Blake", "Nakashima", "Okonkwo-Hart", "Pemberton", "Ravensworth", "Sandoval", + "Tremaine", "Ulvaeus", "Varga", "Wexford", "Yilmaz-Grant", "Zabala", "Achterberg"] +PLACES = ["Harrowgate", "Port Ellery", "Calder Bay", "Brindlemoor", "Westmarch", "Lowen", "Saltford", "Ostrava Vale"] +PRESSES = ["Brindlemoor University Press", "Calder Bay Academic", "Harrowgate & Lowe", "Westmarch Scholarly", + "Saltford House", "Lantern Field Books"] + +URBAN = { + "id": "urban-heat", + "name": "Cooling the city: a thesis on urban heat", + "library": "Demo - Urban heat thesis", + "description": "A doctoral thesis library on urban heat islands: 260 references in collections by chapter, with tags, notes and a methods shelf.", + "count": 260, + "seed": 11, + "journals": ["Journal of Urban Thermal Studies", "Cities and Climate Review", "Applied Urban Meteorology", + "Heat and Health Quarterly", "Landscape and Microclimate", "Remote Sensing of Built Environments"], + "subjects": ["the surface urban heat island", "tree canopy cover", "cool roofs", "street canyon geometry", + "nocturnal heat retention", "heatwave mortality", "green roofs", "pavement albedo", "blue spaces", + "outdoor thermal comfort", "land surface temperature", "air temperature networks", "shade equity", + "anthropogenic heat", "heat action plans"], + "places": ["a mid-latitude port city", "three coastal cities", "a dense inner suburb", "twelve European capitals", + "a semi-arid metropolis", "informal settlements", "a river delta city", "a northern industrial town"], + "verbs": ["Mapping", "Measuring", "Modelling", "Reducing", "Explaining", "Comparing", "Forecasting", "Monitoring"], + "tags": ["remote sensing", "field campaign", "tree canopy", "cool roofs", "heatwave", "mortality", "albedo", + "modelling", "policy", "equity", "green infrastructure", "air temperature", "review", "dataset"], + "collections": [ + ("Thesis", None, []), + ("1 Introduction", "Thesis", ["review", "policy"]), + ("2 Measuring heat", "Thesis", ["remote sensing", "air temperature", "field campaign"]), + ("3 Green and blue infrastructure", "Thesis", ["tree canopy", "green infrastructure"]), + ("4 Materials and roofs", "Thesis", ["cool roofs", "albedo"]), + ("5 Heat and health", "Thesis", ["heatwave", "mortality"]), + ("6 Policy and equity", "Thesis", ["policy", "equity"]), + ("Methods shelf", None, ["modelling", "dataset"]), + ("To read", None, []), + ], + "notes": ["Key source for the chapter's framing; quote the definition on the first page.", + "Their sensor siting differs from mine: check the height above ground before comparing.", + "Good figure of the diurnal cycle; ask for permission before reusing it.", + "Sample is small. Use as supporting evidence only.", + "Supervisor recommended this one at the March meeting.", + "Compare their albedo values with the ones in the materials chapter.", + "Method could be repeated with my own temperature network.", + "Cited in the review, but the conclusion is stronger than the data allow."], +} + +HISTORY = { + "id": "history-reading", + "name": "Writing the past: a history reading list", + "library": "Demo - History reading list", + "description": "A seminar reading list on how history has been written: classic public-domain histories and 200 invented modern studies, by week and theme, with tags and notes.", + "count": 200, + "seed": 23, + "journals": ["Historiography Review", "Journal of Archival Practice", "Past and Narrative", + "Studies in Early Modern Memory", "Chronicle and Method"], + "subjects": ["the medieval chronicle", "Enlightenment historiography", "the archive", "national histories", + "oral testimony", "the Renaissance city", "revolutionary memory", "imperial record keeping", + "microhistory", "the history of reading", "maps and borders", "the printing press", + "monastic libraries", "the grand narrative", "local history societies"], + "places": ["early modern Europe", "the Atlantic world", "the Mediterranean", "nineteenth-century Britain", + "the Low Countries", "Renaissance Italy", "colonial port towns", "the Baltic"], + "verbs": ["Reading", "Rethinking", "Recovering", "Narrating", "Questioning", "Tracing", "Remembering", "Ordering"], + "tags": ["primary source", "historiography", "translation", "method", "archive", "memory", "empire", + "revolution", "renaissance", "seminar", "essay question"], + "collections": [ + ("Seminar weeks", None, []), + ("Week 1 Ancient historians", "Seminar weeks", ["translation"]), + ("Week 2 Chronicles and monks", "Seminar weeks", ["archive"]), + ("Week 3 Renaissance and humanism", "Seminar weeks", ["renaissance"]), + ("Week 4 Enlightenment histories", "Seminar weeks", ["historiography"]), + ("Week 5 Revolutions", "Seminar weeks", ["revolution"]), + ("Week 6 Empire and record", "Seminar weeks", ["empire"]), + ("Week 7 Memory and testimony", "Seminar weeks", ["memory"]), + ("Method and theory", None, ["method"]), + ("Essay sources", None, ["essay question"]), + ], + "classics": [ + ("book", "The History of the Decline and Fall of the Roman Empire", [("Gibbon", "Edward")], "1776", "London", "Strahan and Cadell", ["primary source", "historiography"], "Week 4 Enlightenment histories"), + ("book", "The History of England from the Accession of James the Second", [("Macaulay", "Thomas Babington")], "1848", "London", "Longman, Brown, Green, and Longmans", ["historiography"], "Week 4 Enlightenment histories"), + ("book", "The Civilization of the Renaissance in Italy", [("Burckhardt", "Jacob")], "1878", "London", "C. Kegan Paul", ["renaissance", "translation"], "Week 3 Renaissance and humanism"), + ("book", "The French Revolution: A History", [("Carlyle", "Thomas")], "1837", "London", "James Fraser", ["revolution", "primary source"], "Week 5 Revolutions"), + ("book", "The Old Regime and the Revolution", [("Tocqueville", "Alexis de")], "1856", "London", "John Murray", ["revolution", "translation"], "Week 5 Revolutions"), + ("book", "History of the Conquest of Mexico", [("Prescott", "William H.")], "1843", "New York", "Harper and Brothers", ["empire"], "Week 6 Empire and record"), + ("book", "The Rise of the Dutch Republic", [("Motley", "John Lothrop")], "1856", "New York", "Harper and Brothers", ["historiography"], "Week 6 Empire and record"), + ("book", "Ecclesiastical History of the English People", [("Bede", "")], "731", "", "", ["primary source", "archive"], "Week 2 Chronicles and monks"), + ("book", "The Histories", [("Herodotus", "")], "-430", "", "", ["primary source", "translation"], "Week 1 Ancient historians"), + ("book", "History of the Peloponnesian War", [("Thucydides", "")], "-400", "", "", ["primary source", "translation"], "Week 1 Ancient historians"), + ("book", "The Annals", [("Tacitus", "")], "116", "", "", ["primary source", "translation"], "Week 1 Ancient historians"), + ("book", "Chronicles", [("Froissart", "Jean")], "1400", "", "", ["primary source", "archive"], "Week 2 Chronicles and monks"), + ("book", "The Prince", [("Machiavelli", "Niccolo")], "1532", "", "", ["renaissance", "primary source"], "Week 3 Renaissance and humanism"), + ("book", "Montcalm and Wolfe", [("Parkman", "Francis")], "1884", "Boston", "Little, Brown, and Company", ["empire"], "Week 6 Empire and record"), + ("book", "The Expansion of England", [("Seeley", "John Robert")], "1883", "London", "Macmillan", ["empire", "historiography"], "Week 6 Empire and record"), + ], + "notes": ["Read the preface first: it states the author's method in two pages.", + "Set text for the essay on narrative and evidence.", + "Compare the translation's wording with the older one in the library.", + "Seminar question: whose voices are missing from this archive?", + "Strong on sources, weak on context. Good for the method week.", + "Bring a passage to week 5 for close reading.", + "The appendix lists the manuscripts used; useful for the essay.", + "Disagrees with the classic account; pair the two in discussion."], +} + +LAB = { + "id": "lab-methods", + "name": "Bench to paper: a cell biology lab's methods library", + "library": "Demo - Lab methods", + "description": "A shared library for a cell biology lab: 240 methods papers, protocols and datasets by technique, with a journal club shelf, tags and notes.", + "count": 240, + "seed": 37, + "journals": ["Journal of Cell Methods", "Quantitative Cell Imaging", "Bench Protocols Letters", + "Cytometry and Sorting", "Genome Editing Practice", "Statistics for the Life Sciences"], + "subjects": ["live-cell imaging", "CRISPR knock-in efficiency", "flow cytometry panels", "organoid culture", + "single-cell sequencing", "western blot quantification", "confocal deconvolution", + "fluorescent reporters", "mitochondrial staining", "image segmentation", "replicate design", + "antibody validation", "lentiviral transduction", "spheroid invasion assays", "phototoxicity"], + "places": ["human fibroblasts", "intestinal organoids", "zebrafish embryos", "HeLa cells", "primary neurons", + "yeast", "mouse embryonic stem cells", "patient-derived cells"], + "verbs": ["Improving", "Benchmarking", "Optimising", "Validating", "Automating", "Quantifying", "Standardising", "Scaling"], + "tags": ["microscopy", "crispr", "flow cytometry", "statistics", "protocol", "dataset", "software", + "antibodies", "organoids", "sequencing", "journal club", "reagent"], + "collections": [ + ("Techniques", None, []), + ("Microscopy", "Techniques", ["microscopy"]), + ("Genome editing", "Techniques", ["crispr"]), + ("Flow cytometry", "Techniques", ["flow cytometry"]), + ("Culture and organoids", "Techniques", ["organoids"]), + ("Sequencing", "Techniques", ["sequencing"]), + ("Statistics and analysis", None, ["statistics", "software"]), + ("Lab protocols", None, ["protocol", "reagent"]), + ("Journal club 2026", None, ["journal club"]), + ], + "notes": ["We use the modified version of step 4 (30 min instead of 15). See the lab protocol folder.", + "Antibody lot matters: order the same catalogue number as in the methods.", + "Presented at journal club; slides in the shared drive.", + "Power analysis in the supplement is worth copying for our grant.", + "Their segmentation code is open; try it on the March images.", + "Phototoxicity controls missing. Do not cite as a reference method.", + "Check the replicate numbers before quoting the effect size.", + "Good starting point for the new student."], +} + +STARTER_SETS = [ + ("thesis", "Thesis or dissertation", "Collections for a thesis by chapter, with front matter, methods, data and a to-read shelf.", + [("Thesis", None), ("Introduction", "Thesis"), ("Literature review", "Thesis"), ("Methods", "Thesis"), ("Results", "Thesis"), ("Discussion", "Thesis"), ("Conclusion", "Thesis"), ("Data and software", None), ("To read", None), ("Cited", None)], + ["to read", "read", "cited", "key source", "method", "dataset", "quote"]), + ("grant", "Grant proposal", "Collections for a research grant: case for support, prior work, methods, impact and the team's own papers.", + [("Proposal", None), ("Case for support", "Proposal"), ("State of the art", "Proposal"), ("Methods and work plan", "Proposal"), ("Impact", "Proposal"), ("Team publications", None), ("Funder guidance", None)], + ["background", "preliminary data", "competitor", "impact", "own work", "must cite"]), + ("course", "Course reading list", "Collections for a twelve-week course, a core shelf and further reading.", + [("Course", None)] + [(f"Week {n}", "Course") for n in range(1, 13)] + [("Core texts", None), ("Further reading", None)], + ["required", "recommended", "seminar", "assessment", "library copy"]), + ("systematic-review", "Systematic review", "Collections that follow a review from search results through screening to the included studies.", + [("Review", None), ("Search results", "Review"), ("Title and abstract screening", "Review"), ("Full text screening", "Review"), ("Included", "Review"), ("Excluded", "Review"), ("Protocol and guidance", None)], + ["include", "exclude", "maybe", "duplicate", "no full text", "wrong population", "wrong outcome", "risk of bias"]), + ("journal-article", "Journal article", "Collections for one paper: introduction, methods, results, discussion and the target journal's guidance.", + [("Paper", None), ("Introduction", "Paper"), ("Methods", "Paper"), ("Results", "Paper"), ("Discussion", "Paper"), ("Reviewer requests", None), ("Journal guidance", None)], + ["cited", "to cite", "reviewer 1", "reviewer 2", "figure"]), + ("book-project", "Book project", "Collections for a book by part and chapter, with permissions and archive material.", + [("Book", None), ("Part I", "Book"), ("Part II", "Book"), ("Part III", "Book"), ("Archive material", None), ("Permissions", None), ("Epigraphs and quotations", None)], + ["chapter draft", "quotation", "image", "permission asked", "permission granted"]), + ("lab-group", "Lab group library", "Collections for a research group: techniques, protocols, the group's papers and a journal club shelf.", + [("Techniques", None), ("Imaging", "Techniques"), ("Molecular", "Techniques"), ("Analysis", "Techniques"), ("Group papers", None), ("Protocols", None), ("Journal club", None)], + ["protocol", "reagent", "software", "journal club", "group paper"]), + ("conference-talk", "Conference talk or poster", "Collections for a talk or poster: the slides' sources, the abstract and the venue's earlier work.", + [("Talk", None), ("Abstract", "Talk"), ("Slides", "Talk"), ("Venue's earlier work", None), ("Follow-up", None)], + ["on a slide", "background", "question from audience"]), + ("teaching-portfolio", "Teaching portfolio", "Collections for teaching practice: pedagogy, assessment, course design and evidence.", + [("Pedagogy", None), ("Assessment", None), ("Course design", None), ("Evidence and feedback", None)], + ["active learning", "assessment", "inclusion", "feedback"]), + ("policy-brief", "Policy brief", "Collections for a policy brief: evidence base, official documents, case studies and press.", + [("Brief", None), ("Evidence base", "Brief"), ("Official documents", "Brief"), ("Case studies", "Brief"), ("Press and commentary", None)], + ["evidence", "official", "case study", "press", "contested"]), +] + +TYPES = [("article", 55), ("book", 12), ("incollection", 10), ("inproceedings", 10), ("techreport", 6), ("phdthesis", 4), ("misc", 3)] + + +def pick_type(rng): + n = rng.randint(1, sum(w for _, w in TYPES)) + for t, w in TYPES: + n -= w + if n <= 0: + return t + return "article" + + +def people(rng, n): + seen, out = set(), [] + while len(out) < n: + p = (rng.choice(FAMILY), rng.choice(GIVEN)) + if p not in seen: + seen.add(p) + out.append(p) + return out + + +def tex(s): + return s.replace("&", "\\&").replace("%", "\\%").replace("#", "\\#") + + +def names(ps): + return " and ".join(f"{f}, {g}" if g else "{" + f + "}" for f, g in ps) + + +def entry(kind, key, fields): + body = ",\n".join(f" {k} = {{{v}}}" for k, v in fields.items() if v) + return f"@{kind}{{{key},\n{body}\n}}\n" + + +def make_records(spec): + rng = random.Random(spec["seed"]) + recs, titles = [], set() + for c in spec.get("classics", []): + kind, title, authors, year, place, press, tags, coll = c + recs.append({"key": f"classic{len(recs) + 1}", "kind": kind, "tags": tags, "home": coll, + "fields": {"author": names(authors), "title": tex(title), "year": year, "address": place, "publisher": press, + "keywords": ", ".join(tags)}}) + titles.add(title) + while len(recs) < spec["count"] + len(spec.get("classics", [])): + kind = pick_type(rng) + subj, place = rng.choice(spec["subjects"]), rng.choice(spec["places"]) + title = f"{rng.choice(spec['verbs'])} {subj} in {place}" + if title in titles: + title = f"{title}: {rng.choice(['a comparison', 'new evidence', 'a field study', 'lessons from a decade', 'an open dataset', 'a second look'])}" + if title in titles: + continue + titles.add(title) + title = title[0].upper() + title[1:] + year = str(rng.randint(1994, 2026)) + tags = rng.sample(spec["tags"], rng.randint(1, 3)) + authors = people(rng, rng.choice([1, 2, 2, 3, 3, 4, 5, 6])) + f = {"author": names(authors), "title": tex(title), "year": year, "keywords": ", ".join(tags)} + if kind == "article": + f.update({"journal": rng.choice(spec["journals"]), "volume": str(rng.randint(1, 48)), "number": str(rng.randint(1, 12)), + "pages": (lambda a: f"{a}--{a + rng.randint(6, 28)}")(rng.randint(1, 900))}) + elif kind == "book": + f.update({"publisher": rng.choice(PRESSES), "address": rng.choice(PLACES)}) + elif kind == "incollection": + f.update({"booktitle": tex(f"{rng.choice(['Handbook of', 'Perspectives on', 'New Directions in'])} {rng.choice(spec['subjects'])}".title()), + "editor": names(people(rng, 2)), "publisher": rng.choice(PRESSES), "address": rng.choice(PLACES), + "pages": (lambda a: f"{a}--{a + rng.randint(12, 30)}")(rng.randint(1, 400))}) + elif kind == "inproceedings": + f.update({"booktitle": f"Proceedings of the {rng.randint(3, 31)}th Meeting on {rng.choice(spec['subjects']).title()}", + "pages": (lambda a: f"{a}--{a + rng.randint(4, 10)}")(rng.randint(1, 300))}) + elif kind == "techreport": + f.update({"institution": f"{rng.choice(PLACES)} {rng.choice(['City Council', 'Research Institute', 'Observatory', 'Data Office'])}", + "number": f"TR-{year}-{rng.randint(1, 99):02d}"}) + elif kind == "phdthesis": + f.update({"school": f"University of {rng.choice(PLACES)}"}) + else: + f.update({"howpublished": "Dataset", "publisher": f"{rng.choice(PLACES)} Open Data"}) + recs.append({"key": f"{spec['id'].split('-')[0]}{len(recs) + 1}", "kind": kind, "tags": tags, "fields": f}) + return recs, rng + + +def bibtex(recs): + return "\n".join(entry(r["kind"], r["key"], r["fields"]) for r in recs) + + +def settle(conn): + conn.execute("PRAGMA wal_checkpoint(TRUNCATE)") + + +def build_library(work, build): + os.environ["FORMCITE_DATA_DIR"] = str(work) + for name in list(sys.modules): + if name == "app" or name.startswith("app."): + del sys.modules[name] + sys.path.insert(0, str(ROOT / "backend")) + from app.services import library + from app.store import collections, notes, tags + with library._session() as (_, conn): + build(conn, collections, notes, tags) + library.close_all() + db = work / "Library" / "library.sqlite" + c = sqlite3.connect(db) + c.execute("PRAGMA wal_checkpoint(TRUNCATE)") + c.execute("PRAGMA journal_mode=DELETE") + c.execute("VACUUM") + c.close() + return db + + +def make_collections(conn, collections, rows): + ids = {} + for name, parent, *_ in rows: + ids[name] = collections.create(conn, name, parent_id=ids[parent] if parent else None)["id"] + return ids + + +def build_demo(spec): + recs, rng = make_records(spec) + out = DEMOS / spec["id"] + out.mkdir(parents=True, exist_ok=True) + (out / "references.bib").write_text(bibtex(recs), encoding="utf-8") + with tempfile.TemporaryDirectory() as tmp: + work = Path(tmp) + + def build(conn, collections, notes, tags): + from app.services.transfer import import_file + res = import_file(conn, str(out / "references.bib"), "bibtex", keywords_as_tags=True) + if len(res["added"]) != len(recs): + raise SystemExit(f"{spec['id']}: imported {len(res['added'])} of {len(recs)}") + ids = make_collections(conn, collections, spec["collections"]) + for r, item in zip(recs, res["added"]): + homes = [n for n, _, want in spec["collections"] if want and set(want) & set(r["tags"])] + if r.get("home"): + homes.append(r["home"]) + if not homes: + homes = ["To read"] if "To read" in ids else [] + for h in homes[:2]: + collections.add_items(conn, ids[h], [item]) + for item in rng.sample(res["added"], 30): + notes.create(conn, item, rng.choice(spec["notes"])) + + db = build_library(work, build) + target = out / "library" + if target.exists(): + shutil.rmtree(target) + target.mkdir() + shutil.copy2(db, target / "library.sqlite") + about = {"id": spec["id"], "name": spec["name"], "description": spec["description"], "kind": "demo", + "library_name": spec["library"], "references": len(recs), "collections": len(spec["collections"]), + "notes": 30, "licence": "GPL-3.0-only", + "credit": "Invented references written for FormCite by nodemode.ai" + ("; the classic histories are public-domain works, cited by their first editions" if spec.get("classics") else "") + ". No DOI is given, so no reference points at a real work it does not describe.", + "files": {"import": "references.bib", "library": "library/library.sqlite"}} + (out / "about.json").write_text(json.dumps(about, indent=2) + "\n", encoding="utf-8") + + +def build_starter(sid, name, desc, rows, tagnames): + out = STARTERS / sid + out.mkdir(parents=True, exist_ok=True) + with tempfile.TemporaryDirectory() as tmp: + work = Path(tmp) + + def build(conn, collections, notes, tags): + make_collections(conn, collections, rows) + for t in tagnames: + tags.ensure(conn, t) + conn.commit() + + db = build_library(work, build) + shutil.copy2(db, out / "library.sqlite") + meta = {"id": sid, "name": name, "description": desc, "kind": "starter", "collections": [n for n, _ in rows], + "tags": tagnames, "licence": "GPL-3.0-only", "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite"} + (out / "about.json").write_text(json.dumps(meta, indent=2) + "\n", encoding="utf-8") + + +if __name__ == "__main__": + for spec in (URBAN, HISTORY, LAB): + build_demo(spec) + for s in STARTER_SETS: + build_starter(*s) diff --git a/demos/urban-heat/about.json b/demos/urban-heat/about.json new file mode 100644 index 0000000..3eff7ac --- /dev/null +++ b/demos/urban-heat/about.json @@ -0,0 +1,16 @@ +{ + "id": "urban-heat", + "name": "Cooling the city: a thesis on urban heat", + "description": "A doctoral thesis library on urban heat islands: 260 references in collections by chapter, with tags, notes and a methods shelf.", + "kind": "demo", + "library_name": "Demo - Urban heat thesis", + "references": 260, + "collections": 9, + "notes": 30, + "licence": "GPL-3.0-only", + "credit": "Invented references written for FormCite by nodemode.ai. No DOI is given, so no reference points at a real work it does not describe.", + "files": { + "import": "references.bib", + "library": "library/library.sqlite" + } +} diff --git a/demos/urban-heat/library/library.sqlite b/demos/urban-heat/library/library.sqlite new file mode 100644 index 0000000..d5baafa Binary files /dev/null and b/demos/urban-heat/library/library.sqlite differ diff --git a/demos/urban-heat/references.bib b/demos/urban-heat/references.bib new file mode 100644 index 0000000..fc1f6dc --- /dev/null +++ b/demos/urban-heat/references.bib @@ -0,0 +1,2694 @@ +@book{urban1, + author = {Pemberton, Otto and Lindqvist, Greta and Dunmore, Tala and Jessamy, Femi and Juniper, Vesna and Pemberton, Celia}, + title = {Monitoring anthropogenic heat in a northern industrial town}, + year = {2026}, + keywords = {cool roofs, tree canopy, policy}, + publisher = {Saltford House}, + address = {Saltford} +} + +@book{urban2, + author = {Pellham, Noor and Brightwater, Cosmo and Esterhazy-Lowe, Uma}, + title = {Mapping land surface temperature in a dense inner suburb}, + year = {1998}, + keywords = {remote sensing}, + publisher = {Westmarch Scholarly}, + address = {Brindlemoor} +} + +@book{urban3, + author = {Bellweather, Kenji and Fenwright, Wilhelmina and Quarrington, Uma}, + title = {Monitoring street canyon geometry in a semi-arid metropolis}, + year = {1994}, + keywords = {field campaign, modelling, green infrastructure}, + publisher = {Calder Bay Academic}, + address = {Westmarch} +} + +@article{urban4, + author = {Tremaine, Ada}, + title = {Forecasting tree canopy cover in three coastal cities}, + year = {2000}, + keywords = {albedo, field campaign}, + journal = {Cities and Climate Review}, + volume = {14}, + number = {1}, + pages = {482--500} +} + +@techreport{urban5, + author = {Vantongeren, Ada and Bellweather, Beatrix and Harwood, Ines}, + title = {Measuring green roofs in a river delta city}, + year = {2006}, + keywords = {heatwave, mortality, field campaign}, + institution = {Brindlemoor City Council}, + number = {TR-2006-02} +} + +@article{urban6, + author = {Bellweather, Rafael and Zeller, Hugo}, + title = {Modelling pavement albedo in a northern industrial town}, + year = {2006}, + keywords = {policy, cool roofs}, + journal = {Heat and Health Quarterly}, + volume = {27}, + number = {4}, + pages = {1--15} +} + +@incollection{urban7, + author = {Calloway, Jonas and Northcote, Chiara}, + title = {Reducing nocturnal heat retention in a mid-latitude port city}, + year = {2005}, + keywords = {dataset, equity}, + booktitle = {Perspectives On The Surface Urban Heat Island}, + editor = {Achterberg, Otto and Vantongeren, Soren}, + publisher = {Westmarch Scholarly}, + address = {Port Ellery}, + pages = {39--53} +} + +@article{urban8, + author = {Montaigne-Blake, Elif and Larkspur, Ines}, + title = {Mapping outdoor thermal comfort in twelve European capitals}, + year = {2017}, + keywords = {equity, modelling}, + journal = {Heat and Health Quarterly}, + volume = {12}, + number = {11}, + pages = {158--173} +} + +@article{urban9, + author = {Fairbairn, Noor and Fenwright, Amara and Delacourt, Greta and Galloway, Celia and Halloran, Quinn}, + title = {Reducing anthropogenic heat in twelve European capitals}, + year = {2004}, + keywords = {green infrastructure, policy, cool roofs}, + journal = {Cities and Climate Review}, + volume = {48}, + number = {12}, + pages = {402--416} +} + +@article{urban10, + author = {Kowalczyk, Rafael and Okonkwo-Hart, Otto and Ellery, Rosa and Northcote, Nils and Yilmaz-Grant, Bram and Bellweather, Chiara}, + title = {Explaining anthropogenic heat in a northern industrial town}, + year = {2005}, + keywords = {field campaign, tree canopy, cool roofs}, + journal = {Cities and Climate Review}, + volume = {4}, + number = {1}, + pages = {181--196} +} + +@article{urban11, + author = {Sandoval, Yara and Ulvaeus, Ikaika and Montaigne-Blake, Ines and Montaigne-Blake, Celia}, + title = {Measuring blue spaces in a dense inner suburb}, + year = {2017}, + keywords = {modelling}, + journal = {Journal of Urban Thermal Studies}, + volume = {31}, + number = {6}, + pages = {718--733} +} + +@article{urban12, + author = {Ellery, Chiara and Juniper, Ximena}, + title = {Monitoring the surface urban heat island in three coastal cities}, + year = {1998}, + keywords = {heatwave, mortality, tree canopy}, + journal = {Remote Sensing of Built Environments}, + volume = {3}, + number = {12}, + pages = {755--783} +} + +@article{urban13, + author = {Gilchrist, Leonie}, + title = {Comparing shade equity in informal settlements}, + year = {1999}, + keywords = {modelling, field campaign, albedo}, + journal = {Journal of Urban Thermal Studies}, + volume = {40}, + number = {11}, + pages = {392--410} +} + +@incollection{urban14, + author = {Zeller, Aurelio and Ulvaeus, Marisol and Esterhazy-Lowe, Chiara and Esterhazy-Lowe, Juno}, + title = {Measuring the surface urban heat island in three coastal cities}, + year = {1999}, + keywords = {field campaign, heatwave, albedo}, + booktitle = {Handbook Of Blue Spaces}, + editor = {Zabala, Hanne and Brightwater, Tala}, + publisher = {Saltford House}, + address = {Port Ellery}, + pages = {247--259} +} + +@article{urban15, + author = {Jessamy, Tobias and Okonkwo-Hart, Mina and Ishikawa-Reed, Kaia}, + title = {Monitoring air temperature networks in three coastal cities}, + year = {2025}, + keywords = {remote sensing, mortality}, + journal = {Applied Urban Meteorology}, + volume = {43}, + number = {8}, + pages = {511--524} +} + +@article{urban16, + author = {Oakhurst, Marisol and Underhill, Nils and Ivesdale, Ines and Gilchrist, Wren and Calloway, Wilhelmina}, + title = {Reducing green roofs in a semi-arid metropolis}, + year = {2021}, + keywords = {cool roofs}, + journal = {Journal of Urban Thermal Studies}, + volume = {18}, + number = {3}, + pages = {116--136} +} + +@book{urban17, + author = {Varga, Otto and Dunmore, Uma and Ellery, Celia and Rowntree, Noor}, + title = {Forecasting nocturnal heat retention in twelve European capitals}, + year = {2018}, + keywords = {policy, modelling, green infrastructure}, + publisher = {Brindlemoor University Press}, + address = {Westmarch} +} + +@incollection{urban18, + author = {Achterberg, Rosa}, + title = {Mapping heatwave mortality in a semi-arid metropolis}, + year = {2002}, + keywords = {modelling, cool roofs}, + booktitle = {Handbook Of Shade Equity}, + editor = {Jessamy, Dario and Pemberton, Hugo}, + publisher = {Westmarch Scholarly}, + address = {Port Ellery}, + pages = {323--352} +} + +@inproceedings{urban19, + author = {Quarrington, Luca and Varga, Ada and Zabala, Elif and Juniper, Wilhelmina and Calloway, Luca and Oakhurst, Rosa}, + title = {Measuring land surface temperature in informal settlements}, + year = {2006}, + keywords = {dataset}, + booktitle = {Proceedings of the 27th Meeting on Heatwave Mortality}, + pages = {277--286} +} + +@book{urban20, + author = {Ivesdale, Chiara and Esterhazy-Lowe, Mina and Pemberton, Ada and Zeller, Kenji and Larkspur, Rafael}, + title = {Forecasting blue spaces in a dense inner suburb}, + year = {2008}, + keywords = {albedo}, + publisher = {Saltford House}, + address = {Lowen} +} + +@book{urban21, + author = {Fenwright, Tala and Juniper, Uma and Quarrington, Wilhelmina and Brightwater, Wren and Halloran, Femi}, + title = {Measuring heatwave mortality in twelve European capitals}, + year = {2001}, + keywords = {cool roofs}, + publisher = {Brindlemoor University Press}, + address = {Ostrava Vale} +} + +@article{urban22, + author = {Cardenas-Holt, Celia and Lindqvist, Juno}, + title = {Explaining blue spaces in a river delta city}, + year = {2025}, + keywords = {cool roofs}, + journal = {Applied Urban Meteorology}, + volume = {44}, + number = {3}, + pages = {482--492} +} + +@book{urban23, + author = {Wexford, Kenji and Pemberton, Kaia and Ishikawa-Reed, Hanne}, + title = {Monitoring heat action plans in a northern industrial town}, + year = {1999}, + keywords = {modelling}, + publisher = {Saltford House}, + address = {Westmarch} +} + +@article{urban24, + author = {Larkspur, Farid and Marrowfield, Amara and Juniper, Hugo}, + title = {Reducing land surface temperature in a river delta city}, + year = {2013}, + keywords = {policy}, + journal = {Landscape and Microclimate}, + volume = {1}, + number = {10}, + pages = {387--393} +} + +@incollection{urban25, + author = {Ellery, Juno and Esterhazy-Lowe, Amara}, + title = {Measuring the surface urban heat island in a river delta city}, + year = {2025}, + keywords = {air temperature}, + booktitle = {Perspectives On Nocturnal Heat Retention}, + editor = {Pellham, Elif and Gilchrist, Ines}, + publisher = {Harrowgate & Lowe}, + address = {Saltford}, + pages = {244--272} +} + +@article{urban26, + author = {Calloway, Mina}, + title = {Forecasting tree canopy cover in twelve European capitals}, + year = {1995}, + keywords = {tree canopy, air temperature}, + journal = {Cities and Climate Review}, + volume = {15}, + number = {1}, + pages = {704--719} +} + +@article{urban27, + author = {Halloran, Otto and Quarrington, Wilhelmina}, + title = {Reducing air temperature networks in informal settlements}, + year = {2025}, + keywords = {modelling}, + journal = {Cities and Climate Review}, + volume = {45}, + number = {9}, + pages = {900--919} +} + +@article{urban28, + author = {Juniper, Otto and Montaigne-Blake, Ines and Oakhurst, Aurelio}, + title = {Modelling green roofs in a river delta city}, + year = {2007}, + keywords = {policy, green infrastructure, cool roofs}, + journal = {Remote Sensing of Built Environments}, + volume = {23}, + number = {3}, + pages = {324--349} +} + +@article{urban29, + author = {Ivesdale, Yara and Fenwright, Quinn and Zeller, Greta}, + title = {Reducing heat action plans in twelve European capitals}, + year = {2006}, + keywords = {tree canopy}, + journal = {Heat and Health Quarterly}, + volume = {27}, + number = {9}, + pages = {809--837} +} + +@article{urban30, + author = {Yardley, Hugo and Varga, Hanne and Pemberton, Beatrix and Vantongeren, Hanne}, + title = {Mapping street canyon geometry in a river delta city}, + year = {2000}, + keywords = {equity}, + journal = {Remote Sensing of Built Environments}, + volume = {13}, + number = {2}, + pages = {494--503} +} + +@article{urban31, + author = {Lindqvist, Kaia and Stavely, Tobias and Galloway, Marisol}, + title = {Modelling the surface urban heat island in a northern industrial town}, + year = {2006}, + keywords = {field campaign}, + journal = {Journal of Urban Thermal Studies}, + volume = {9}, + number = {11}, + pages = {474--482} +} + +@misc{urban32, + author = {Northcote, Noor and Yardley, Ada and Pemberton, Vesna and Calloway, Mina and Lindqvist, Amara}, + title = {Forecasting tree canopy cover in informal settlements}, + year = {2023}, + keywords = {policy, mortality}, + howpublished = {Dataset}, + publisher = {Ostrava Vale Open Data} +} + +@article{urban33, + author = {Underhill, Femi}, + title = {Forecasting air temperature networks in informal settlements}, + year = {2006}, + keywords = {tree canopy, field campaign, policy}, + journal = {Remote Sensing of Built Environments}, + volume = {41}, + number = {7}, + pages = {584--609} +} + +@article{urban34, + author = {Abernathy, Ines and Vantongeren, Juno}, + title = {Explaining blue spaces in informal settlements}, + year = {2011}, + keywords = {air temperature}, + journal = {Remote Sensing of Built Environments}, + volume = {24}, + number = {7}, + pages = {784--795} +} + +@article{urban35, + author = {Whitlock, Priya}, + title = {Measuring street canyon geometry in a dense inner suburb}, + year = {2015}, + keywords = {modelling, field campaign}, + journal = {Landscape and Microclimate}, + volume = {4}, + number = {4}, + pages = {280--307} +} + +@article{urban36, + author = {Ravensworth, Nils and Ulvaeus, Hugo and Zabala, Zora and Larkspur, Bram and Harwood, Otto and Galloway, Aurelio}, + title = {Forecasting heatwave mortality in twelve European capitals}, + year = {2005}, + keywords = {field campaign, albedo, policy}, + journal = {Cities and Climate Review}, + volume = {17}, + number = {8}, + pages = {412--434} +} + +@article{urban37, + author = {Rowntree, Viktor and Kowalczyk, Juno and Halloran, Amara}, + title = {Forecasting shade equity in twelve European capitals}, + year = {1994}, + keywords = {heatwave}, + journal = {Landscape and Microclimate}, + volume = {37}, + number = {2}, + pages = {654--674} +} + +@inproceedings{urban38, + author = {Juniper, Otto and Nakashima, Dario and Cardenas-Holt, Farid and Bellweather, Soren and Ishikawa-Reed, Zora and Nakashima, Tala}, + title = {Forecasting tree canopy cover in a mid-latitude port city}, + year = {2004}, + keywords = {modelling, tree canopy}, + booktitle = {Proceedings of the 14th Meeting on Blue Spaces}, + pages = {147--154} +} + +@inproceedings{urban39, + author = {Montaigne-Blake, Celia and Pemberton, Kaia and Bellweather, Beatrix}, + title = {Explaining nocturnal heat retention in a semi-arid metropolis}, + year = {1995}, + keywords = {review}, + booktitle = {Proceedings of the 24th Meeting on Green Roofs}, + pages = {28--34} +} + +@phdthesis{urban40, + author = {Quarrington, Beatrix and Pellham, Celia and Ishikawa-Reed, Greta and Wexford, Desmond and Jessamy, Pavel and Nakashima, Wilhelmina}, + title = {Comparing green roofs in a mid-latitude port city}, + year = {1998}, + keywords = {albedo}, + school = {University of Port Ellery} +} + +@article{urban41, + author = {Whitlock, Ikaika}, + title = {Monitoring outdoor thermal comfort in a river delta city}, + year = {2001}, + keywords = {dataset}, + journal = {Cities and Climate Review}, + volume = {8}, + number = {6}, + pages = {454--464} +} + +@inproceedings{urban42, + author = {Stavely, Yara and Ivesdale, Pavel}, + title = {Explaining green roofs in a northern industrial town}, + year = {2020}, + keywords = {review, air temperature}, + booktitle = {Proceedings of the 18th Meeting on Tree Canopy Cover}, + pages = {258--264} +} + +@book{urban43, + author = {Pemberton, Rosa and Zabala, Pavel and Marrowfield, Pavel}, + title = {Explaining outdoor thermal comfort in informal settlements}, + year = {2011}, + keywords = {green infrastructure, air temperature, equity}, + publisher = {Saltford House}, + address = {Brindlemoor} +} + +@techreport{urban44, + author = {Galloway, Orla}, + title = {Mapping the surface urban heat island in a mid-latitude port city}, + year = {2011}, + keywords = {albedo, remote sensing}, + institution = {Westmarch City Council}, + number = {TR-2011-97} +} + +@article{urban45, + author = {Vantongeren, Viktor and Gilchrist, Aurelio and Ivesdale, Edda}, + title = {Reducing heat action plans in a dense inner suburb}, + year = {2017}, + keywords = {modelling, mortality}, + journal = {Journal of Urban Thermal Studies}, + volume = {29}, + number = {10}, + pages = {859--871} +} + +@book{urban46, + author = {Stavely, Kenji and Zabala, Aurelio and Lindqvist, Bastian and Ravensworth, Ximena}, + title = {Forecasting green roofs in a semi-arid metropolis}, + year = {2003}, + keywords = {tree canopy, green infrastructure}, + publisher = {Saltford House}, + address = {Port Ellery} +} + +@book{urban47, + author = {Tremaine, Desmond and Thornbury, Cosmo and Ashgrove, Edda and Thornbury, Nils and Sandoval, Noor and Fenwright, Vesna}, + title = {Measuring heat action plans in informal settlements}, + year = {1999}, + keywords = {equity, dataset}, + publisher = {Harrowgate & Lowe}, + address = {Ostrava Vale} +} + +@techreport{urban48, + author = {Yardley, Hugo and Underhill, Wilhelmina and Dunmore, Leonie and Nakashima, Tobias}, + title = {Explaining shade equity in informal settlements}, + year = {2003}, + keywords = {mortality}, + institution = {Westmarch Data Office}, + number = {TR-2003-68} +} + +@article{urban49, + author = {Yardley, Bram and Yardley, Tobias and Abernathy, Marisol and Zeller, Mina}, + title = {Reducing pavement albedo in informal settlements}, + year = {2019}, + keywords = {policy, cool roofs, field campaign}, + journal = {Remote Sensing of Built Environments}, + volume = {37}, + number = {6}, + pages = {817--835} +} + +@incollection{urban50, + author = {Oakhurst, Ikaika}, + title = {Modelling cool roofs in a dense inner suburb}, + year = {1999}, + keywords = {dataset, heatwave}, + booktitle = {Handbook Of Blue Spaces}, + editor = {Kettering, Leonie and Stavely, Bram}, + publisher = {Lantern Field Books}, + address = {Saltford}, + pages = {33--63} +} + +@incollection{urban51, + author = {Fenwright, Bram and Pemberton, Rafael and Jessamy, Greta and Yilmaz-Grant, Rafael}, + title = {Comparing nocturnal heat retention in three coastal cities}, + year = {1999}, + keywords = {air temperature, field campaign}, + booktitle = {Perspectives On Street Canyon Geometry}, + editor = {Varga, Orla and Gilchrist, Beatrix}, + publisher = {Saltford House}, + address = {Lowen}, + pages = {392--418} +} + +@article{urban52, + author = {Varga, Otto and Calloway, Amara}, + title = {Comparing heatwave mortality in informal settlements}, + year = {2002}, + keywords = {modelling, policy}, + journal = {Remote Sensing of Built Environments}, + volume = {23}, + number = {1}, + pages = {826--844} +} + +@article{urban53, + author = {Bellweather, Jonas and Pellham, Aurelio and Kettering, Priya and Zeller, Tobias and Kettering, Uma}, + title = {Mapping heat action plans in a northern industrial town}, + year = {2017}, + keywords = {remote sensing, review, field campaign}, + journal = {Cities and Climate Review}, + volume = {25}, + number = {7}, + pages = {542--557} +} + +@article{urban54, + author = {Achterberg, Luca and Delacourt, Beatrix}, + title = {Monitoring heat action plans in a mid-latitude port city}, + year = {2013}, + keywords = {field campaign, heatwave, green infrastructure}, + journal = {Heat and Health Quarterly}, + volume = {2}, + number = {10}, + pages = {493--500} +} + +@article{urban55, + author = {Nakashima, Wilhelmina and Fairbairn, Noor and Halloran, Orla}, + title = {Modelling tree canopy cover in twelve European capitals}, + year = {2016}, + keywords = {equity}, + journal = {Heat and Health Quarterly}, + volume = {12}, + number = {5}, + pages = {413--424} +} + +@phdthesis{urban56, + author = {Fairbairn, Orla and Abernathy, Dario}, + title = {Monitoring heat action plans in a semi-arid metropolis}, + year = {2010}, + keywords = {albedo, mortality}, + school = {University of Brindlemoor} +} + +@article{urban57, + author = {Dunmore, Pavel and Varga, Amara and Nakashima, Kaia and Bellweather, Kaia}, + title = {Explaining shade equity in a river delta city}, + year = {1997}, + keywords = {cool roofs, remote sensing, modelling}, + journal = {Applied Urban Meteorology}, + volume = {10}, + number = {5}, + pages = {891--913} +} + +@article{urban58, + author = {Jessamy, Ines and Fenwright, Wren and Rowntree, Otto}, + title = {Mapping land surface temperature in a semi-arid metropolis}, + year = {2003}, + keywords = {review, tree canopy, remote sensing}, + journal = {Remote Sensing of Built Environments}, + volume = {34}, + number = {2}, + pages = {492--520} +} + +@book{urban59, + author = {Dunmore, Nils and Calloway, Juno}, + title = {Mapping tree canopy cover in a semi-arid metropolis}, + year = {2006}, + keywords = {cool roofs, green infrastructure}, + publisher = {Westmarch Scholarly}, + address = {Ostrava Vale} +} + +@article{urban60, + author = {Esterhazy-Lowe, Saoirse and Varga, Edda and Yardley, Edda}, + title = {Comparing anthropogenic heat in a semi-arid metropolis}, + year = {2013}, + keywords = {field campaign, policy}, + journal = {Remote Sensing of Built Environments}, + volume = {9}, + number = {2}, + pages = {684--702} +} + +@inproceedings{urban61, + author = {Pellham, Soren and Larkspur, Hugo and Esterhazy-Lowe, Cosmo and Ashgrove, Yara and Northcote, Otto and Jessamy, Soren}, + title = {Monitoring pavement albedo in three coastal cities}, + year = {1994}, + keywords = {air temperature, dataset}, + booktitle = {Proceedings of the 23th Meeting on Green Roofs}, + pages = {277--286} +} + +@article{urban62, + author = {Wexford, Hugo and Vantongeren, Tala and Rowntree, Leonie and Fairbairn, Yara and Pemberton, Viktor}, + title = {Measuring heatwave mortality in a river delta city}, + year = {2010}, + keywords = {cool roofs}, + journal = {Heat and Health Quarterly}, + volume = {25}, + number = {2}, + pages = {105--115} +} + +@inproceedings{urban63, + author = {Esterhazy-Lowe, Marisol}, + title = {Modelling tree canopy cover in a dense inner suburb}, + year = {2005}, + keywords = {albedo}, + booktitle = {Proceedings of the 25th Meeting on Tree Canopy Cover}, + pages = {52--57} +} + +@article{urban64, + author = {Halloran, Ines and Ravensworth, Nils and Achterberg, Jonas and Ulvaeus, Yusuf and Fairbairn, Viktor}, + title = {Forecasting cool roofs in three coastal cities}, + year = {2020}, + keywords = {mortality}, + journal = {Heat and Health Quarterly}, + volume = {40}, + number = {1}, + pages = {745--763} +} + +@inproceedings{urban65, + author = {Thornbury, Rafael and Dunmore, Greta and Kowalczyk, Yusuf and Northcote, Hanne}, + title = {Reducing air temperature networks in informal settlements: a second look}, + year = {1995}, + keywords = {mortality, cool roofs}, + booktitle = {Proceedings of the 13th Meeting on Shade Equity}, + pages = {151--161} +} + +@article{urban66, + author = {Larkspur, Wilhelmina and Marrowfield, Ikaika}, + title = {Explaining outdoor thermal comfort in a dense inner suburb}, + year = {2013}, + keywords = {cool roofs, mortality, equity}, + journal = {Remote Sensing of Built Environments}, + volume = {46}, + number = {4}, + pages = {581--587} +} + +@inproceedings{urban67, + author = {Ulvaeus, Viktor and Vantongeren, Femi and Yardley, Rosa and Esterhazy-Lowe, Hugo and Dunmore, Yara}, + title = {Measuring land surface temperature in twelve European capitals}, + year = {2002}, + keywords = {modelling}, + booktitle = {Proceedings of the 7th Meeting on Street Canyon Geometry}, + pages = {292--300} +} + +@incollection{urban68, + author = {Harwood, Ada and Stavely, Tobias}, + title = {Explaining blue spaces in three coastal cities}, + year = {2004}, + keywords = {dataset, mortality, equity}, + booktitle = {Perspectives On Street Canyon Geometry}, + editor = {Zabala, Leonie and Yardley, Kaia}, + publisher = {Calder Bay Academic}, + address = {Port Ellery}, + pages = {233--246} +} + +@article{urban69, + author = {Marrowfield, Amara and Esterhazy-Lowe, Celia}, + title = {Explaining cool roofs in a dense inner suburb}, + year = {2018}, + keywords = {equity, green infrastructure, remote sensing}, + journal = {Cities and Climate Review}, + volume = {34}, + number = {7}, + pages = {122--146} +} + +@article{urban70, + author = {Delacourt, Rafael and Calloway, Yara and Sandoval, Jonas and Abernathy, Farid}, + title = {Modelling cool roofs in informal settlements}, + year = {2010}, + keywords = {equity}, + journal = {Landscape and Microclimate}, + volume = {7}, + number = {8}, + pages = {354--373} +} + +@inproceedings{urban71, + author = {Cardenas-Holt, Hugo and Larkspur, Hugo and Ishikawa-Reed, Viktor and Ishikawa-Reed, Ikaika and Cardenas-Holt, Amara}, + title = {Explaining heat action plans in a river delta city}, + year = {2025}, + keywords = {dataset, air temperature}, + booktitle = {Proceedings of the 31th Meeting on The Surface Urban Heat Island}, + pages = {165--169} +} + +@article{urban72, + author = {Harwood, Chiara and Pellham, Hanne and Abernathy, Dario}, + title = {Forecasting air temperature networks in a river delta city}, + year = {2014}, + keywords = {equity, field campaign}, + journal = {Heat and Health Quarterly}, + volume = {45}, + number = {2}, + pages = {539--552} +} + +@incollection{urban73, + author = {Larkspur, Kaia and Oakhurst, Rafael and Yilmaz-Grant, Amara and Larkspur, Hugo and Ellery, Greta}, + title = {Reducing nocturnal heat retention in a river delta city}, + year = {1998}, + keywords = {dataset, green infrastructure, mortality}, + booktitle = {New Directions In Shade Equity}, + editor = {Ivesdale, Hugo and Juniper, Leonie}, + publisher = {Westmarch Scholarly}, + address = {Harrowgate}, + pages = {152--171} +} + +@phdthesis{urban74, + author = {Ishikawa-Reed, Zora and Jessamy, Wren and Ulvaeus, Marisol and Oakhurst, Celia and Thornbury, Bram and Esterhazy-Lowe, Uma}, + title = {Comparing nocturnal heat retention in a mid-latitude port city}, + year = {2005}, + keywords = {modelling}, + school = {University of Westmarch} +} + +@article{urban75, + author = {Marrowfield, Uma}, + title = {Monitoring pavement albedo in a dense inner suburb}, + year = {2007}, + keywords = {heatwave}, + journal = {Applied Urban Meteorology}, + volume = {31}, + number = {1}, + pages = {177--203} +} + +@techreport{urban76, + author = {Thornbury, Yara and Underhill, Rosa}, + title = {Reducing blue spaces in twelve European capitals}, + year = {2006}, + keywords = {green infrastructure}, + institution = {Saltford Research Institute}, + number = {TR-2006-43} +} + +@techreport{urban77, + author = {Harwood, Wilhelmina and Ulvaeus, Mina and Rowntree, Luca}, + title = {Forecasting shade equity in a northern industrial town}, + year = {1999}, + keywords = {cool roofs}, + institution = {Brindlemoor Observatory}, + number = {TR-1999-35} +} + +@article{urban78, + author = {Rowntree, Ines and Pemberton, Saoirse and Fenwright, Desmond}, + title = {Reducing shade equity in three coastal cities}, + year = {2013}, + keywords = {green infrastructure}, + journal = {Journal of Urban Thermal Studies}, + volume = {29}, + number = {9}, + pages = {76--98} +} + +@article{urban79, + author = {Pellham, Luca and Rowntree, Yara and Kowalczyk, Bram}, + title = {Explaining the surface urban heat island in a semi-arid metropolis}, + year = {2021}, + keywords = {field campaign, tree canopy, heatwave}, + journal = {Cities and Climate Review}, + volume = {10}, + number = {1}, + pages = {637--657} +} + +@phdthesis{urban80, + author = {Kowalczyk, Cosmo and Ravensworth, Ximena}, + title = {Mapping outdoor thermal comfort in a river delta city}, + year = {2025}, + keywords = {tree canopy}, + school = {University of Lowen} +} + +@inproceedings{urban81, + author = {Nakashima, Cosmo and Achterberg, Kaia}, + title = {Explaining pavement albedo in a mid-latitude port city}, + year = {2026}, + keywords = {green infrastructure, policy, air temperature}, + booktitle = {Proceedings of the 6th Meeting on Outdoor Thermal Comfort}, + pages = {224--229} +} + +@inproceedings{urban82, + author = {Quarrington, Celia and Marrowfield, Noor and Varga, Dario and Larkspur, Chiara and Lindqvist, Uma and Jessamy, Noor}, + title = {Reducing pavement albedo in a semi-arid metropolis}, + year = {2010}, + keywords = {policy, cool roofs}, + booktitle = {Proceedings of the 3th Meeting on Outdoor Thermal Comfort}, + pages = {255--265} +} + +@book{urban83, + author = {Larkspur, Priya and Juniper, Marisol}, + title = {Explaining blue spaces in a northern industrial town}, + year = {1995}, + keywords = {field campaign}, + publisher = {Lantern Field Books}, + address = {Brindlemoor} +} + +@inproceedings{urban84, + author = {Okonkwo-Hart, Aurelio and Ishikawa-Reed, Cosmo and Quarrington, Beatrix and Montaigne-Blake, Farid}, + title = {Explaining cool roofs in a mid-latitude port city}, + year = {2021}, + keywords = {air temperature}, + booktitle = {Proceedings of the 5th Meeting on Land Surface Temperature}, + pages = {262--267} +} + +@article{urban85, + author = {Underhill, Amara}, + title = {Modelling nocturnal heat retention in twelve European capitals}, + year = {2025}, + keywords = {green infrastructure, equity, modelling}, + journal = {Heat and Health Quarterly}, + volume = {24}, + number = {12}, + pages = {222--250} +} + +@article{urban86, + author = {Ashgrove, Pavel}, + title = {Modelling cool roofs in a northern industrial town}, + year = {2003}, + keywords = {modelling, policy, air temperature}, + journal = {Heat and Health Quarterly}, + volume = {34}, + number = {3}, + pages = {94--112} +} + +@incollection{urban87, + author = {Stavely, Quinn and Harwood, Kenji and Pellham, Amara}, + title = {Forecasting nocturnal heat retention in a northern industrial town}, + year = {1998}, + keywords = {green infrastructure}, + booktitle = {Perspectives On Tree Canopy Cover}, + editor = {Oakhurst, Ximena and Thornbury, Viktor}, + publisher = {Saltford House}, + address = {Brindlemoor}, + pages = {21--38} +} + +@article{urban88, + author = {Zeller, Yusuf and Delacourt, Nils and Bellweather, Wren}, + title = {Comparing outdoor thermal comfort in a mid-latitude port city}, + year = {2005}, + keywords = {dataset, albedo}, + journal = {Cities and Climate Review}, + volume = {12}, + number = {9}, + pages = {824--835} +} + +@book{urban89, + author = {Pemberton, Tobias and Lindqvist, Farid and Northcote, Juno and Zeller, Amara and Ellery, Dario and Ulvaeus, Rosa}, + title = {Reducing street canyon geometry in a river delta city}, + year = {2023}, + keywords = {modelling, dataset}, + publisher = {Harrowgate & Lowe}, + address = {Westmarch} +} + +@inproceedings{urban90, + author = {Rowntree, Greta and Yardley, Dario and Jessamy, Yara}, + title = {Explaining the surface urban heat island in a dense inner suburb}, + year = {2026}, + keywords = {equity, green infrastructure}, + booktitle = {Proceedings of the 27th Meeting on Heatwave Mortality}, + pages = {71--81} +} + +@article{urban91, + author = {Underhill, Quinn and Achterberg, Ikaika and Sandoval, Dario and Thornbury, Zora and Nakashima, Pavel}, + title = {Mapping air temperature networks in three coastal cities}, + year = {2014}, + keywords = {modelling, field campaign}, + journal = {Heat and Health Quarterly}, + volume = {3}, + number = {4}, + pages = {155--177} +} + +@incollection{urban92, + author = {Ishikawa-Reed, Wilhelmina and Kowalczyk, Quinn}, + title = {Reducing cool roofs in a mid-latitude port city}, + year = {2013}, + keywords = {albedo, modelling}, + booktitle = {Perspectives On Air Temperature Networks}, + editor = {Dunmore, Saoirse and Zeller, Jonas}, + publisher = {Calder Bay Academic}, + address = {Westmarch}, + pages = {274--300} +} + +@article{urban93, + author = {Whitlock, Otto and Northcote, Ines and Calloway, Bram and Yilmaz-Grant, Priya}, + title = {Comparing cool roofs in a river delta city}, + year = {2008}, + keywords = {heatwave}, + journal = {Heat and Health Quarterly}, + volume = {37}, + number = {1}, + pages = {829--844} +} + +@inproceedings{urban94, + author = {Pemberton, Quinn and Fenwright, Bastian and Harwood, Zora}, + title = {Reducing land surface temperature in three coastal cities}, + year = {2016}, + keywords = {field campaign, review, mortality}, + booktitle = {Proceedings of the 18th Meeting on The Surface Urban Heat Island}, + pages = {251--258} +} + +@article{urban95, + author = {Fairbairn, Cosmo and Kettering, Wren and Sandoval, Wilhelmina}, + title = {Explaining nocturnal heat retention in a northern industrial town}, + year = {2008}, + keywords = {albedo}, + journal = {Cities and Climate Review}, + volume = {34}, + number = {2}, + pages = {761--777} +} + +@article{urban96, + author = {Abernathy, Hugo}, + title = {Monitoring shade equity in a dense inner suburb}, + year = {2010}, + keywords = {dataset, policy, heatwave}, + journal = {Applied Urban Meteorology}, + volume = {5}, + number = {7}, + pages = {279--286} +} + +@article{urban97, + author = {Whitlock, Uma}, + title = {Monitoring pavement albedo in a semi-arid metropolis}, + year = {2014}, + keywords = {field campaign, remote sensing}, + journal = {Applied Urban Meteorology}, + volume = {37}, + number = {5}, + pages = {269--296} +} + +@article{urban98, + author = {Achterberg, Edda and Pemberton, Dario and Okonkwo-Hart, Juno}, + title = {Forecasting land surface temperature in a northern industrial town}, + year = {2015}, + keywords = {remote sensing, equity}, + journal = {Heat and Health Quarterly}, + volume = {40}, + number = {7}, + pages = {66--80} +} + +@article{urban99, + author = {Tremaine, Hanne and Rowntree, Tala}, + title = {Monitoring anthropogenic heat in a northern industrial town: lessons from a decade}, + year = {2018}, + keywords = {review}, + journal = {Heat and Health Quarterly}, + volume = {24}, + number = {8}, + pages = {22--32} +} + +@inproceedings{urban100, + author = {Juniper, Zora}, + title = {Reducing street canyon geometry in a semi-arid metropolis}, + year = {2010}, + keywords = {cool roofs, dataset, policy}, + booktitle = {Proceedings of the 3th Meeting on Street Canyon Geometry}, + pages = {281--288} +} + +@inproceedings{urban101, + author = {Varga, Nils and Ulvaeus, Zora and Tremaine, Kaia and Marrowfield, Kaia}, + title = {Comparing shade equity in three coastal cities}, + year = {2010}, + keywords = {field campaign, remote sensing}, + booktitle = {Proceedings of the 8th Meeting on Heatwave Mortality}, + pages = {252--262} +} + +@incollection{urban102, + author = {Pellham, Rafael and Pellham, Ximena and Underhill, Wilhelmina and Lindqvist, Hanne and Yilmaz-Grant, Ines and Ellery, Edda}, + title = {Forecasting nocturnal heat retention in informal settlements}, + year = {2012}, + keywords = {air temperature, green infrastructure}, + booktitle = {Handbook Of Heat Action Plans}, + editor = {Varga, Tala and Harwood, Chiara}, + publisher = {Saltford House}, + address = {Ostrava Vale}, + pages = {21--38} +} + +@inproceedings{urban103, + author = {Quarrington, Wilhelmina and Pemberton, Quinn and Yardley, Wilhelmina and Tremaine, Uma and Lindqvist, Viktor}, + title = {Monitoring anthropogenic heat in a river delta city}, + year = {1997}, + keywords = {heatwave, albedo}, + booktitle = {Proceedings of the 30th Meeting on Shade Equity}, + pages = {105--115} +} + +@incollection{urban104, + author = {Marrowfield, Yusuf and Okonkwo-Hart, Saoirse}, + title = {Forecasting anthropogenic heat in a dense inner suburb}, + year = {2002}, + keywords = {air temperature, heatwave, tree canopy}, + booktitle = {Perspectives On Street Canyon Geometry}, + editor = {Ravensworth, Luca and Ashgrove, Elif}, + publisher = {Saltford House}, + address = {Calder Bay}, + pages = {138--158} +} + +@article{urban105, + author = {Calloway, Mina and Stavely, Wren}, + title = {Forecasting nocturnal heat retention in a river delta city}, + year = {2002}, + keywords = {tree canopy}, + journal = {Remote Sensing of Built Environments}, + volume = {35}, + number = {2}, + pages = {415--431} +} + +@article{urban106, + author = {Ravensworth, Soren and Oakhurst, Zora and Wexford, Otto and Bellweather, Beatrix and Jessamy, Leonie and Zeller, Tobias}, + title = {Modelling anthropogenic heat in a northern industrial town}, + year = {2017}, + keywords = {heatwave}, + journal = {Remote Sensing of Built Environments}, + volume = {14}, + number = {9}, + pages = {290--300} +} + +@book{urban107, + author = {Brightwater, Rosa and Larkspur, Leonie and Jessamy, Rosa and Pemberton, Zora}, + title = {Explaining cool roofs in three coastal cities}, + year = {2025}, + keywords = {field campaign, tree canopy}, + publisher = {Harrowgate & Lowe}, + address = {Lowen} +} + +@article{urban108, + author = {Ellery, Ada and Zabala, Tala}, + title = {Reducing tree canopy cover in a northern industrial town}, + year = {2017}, + keywords = {heatwave, policy, remote sensing}, + journal = {Remote Sensing of Built Environments}, + volume = {6}, + number = {1}, + pages = {187--203} +} + +@book{urban109, + author = {Kowalczyk, Zora and Kowalczyk, Dario and Northcote, Kenji and Okonkwo-Hart, Saoirse}, + title = {Forecasting cool roofs in twelve European capitals}, + year = {2024}, + keywords = {albedo}, + publisher = {Saltford House}, + address = {Westmarch} +} + +@article{urban110, + author = {Kettering, Juno}, + title = {Reducing street canyon geometry in a semi-arid metropolis: lessons from a decade}, + year = {1997}, + keywords = {dataset}, + journal = {Journal of Urban Thermal Studies}, + volume = {44}, + number = {2}, + pages = {278--295} +} + +@article{urban111, + author = {Yardley, Ada and Achterberg, Ikaika}, + title = {Measuring shade equity in a semi-arid metropolis}, + year = {2026}, + keywords = {remote sensing, cool roofs}, + journal = {Applied Urban Meteorology}, + volume = {16}, + number = {12}, + pages = {507--525} +} + +@article{urban112, + author = {Ashgrove, Leonie}, + title = {Monitoring shade equity in three coastal cities}, + year = {2019}, + keywords = {albedo, heatwave, equity}, + journal = {Cities and Climate Review}, + volume = {15}, + number = {6}, + pages = {398--415} +} + +@book{urban113, + author = {Ravensworth, Uma and Nakashima, Greta}, + title = {Comparing land surface temperature in a semi-arid metropolis}, + year = {2022}, + keywords = {heatwave, dataset}, + publisher = {Harrowgate & Lowe}, + address = {Lowen} +} + +@article{urban114, + author = {Lindqvist, Wren and Galloway, Jonas and Jessamy, Ximena}, + title = {Reducing air temperature networks in a dense inner suburb}, + year = {1997}, + keywords = {tree canopy, policy, heatwave}, + journal = {Applied Urban Meteorology}, + volume = {12}, + number = {7}, + pages = {23--29} +} + +@article{urban115, + author = {Brightwater, Luca and Underhill, Edda and Zabala, Marisol}, + title = {Forecasting blue spaces in a mid-latitude port city}, + year = {2000}, + keywords = {policy, review}, + journal = {Journal of Urban Thermal Studies}, + volume = {38}, + number = {6}, + pages = {441--462} +} + +@article{urban116, + author = {Underhill, Luca and Achterberg, Wren and Ishikawa-Reed, Ada and Jessamy, Yara and Pemberton, Saoirse}, + title = {Modelling pavement albedo in a river delta city}, + year = {2011}, + keywords = {green infrastructure}, + journal = {Heat and Health Quarterly}, + volume = {42}, + number = {1}, + pages = {218--243} +} + +@inproceedings{urban117, + author = {Cardenas-Holt, Saoirse and Esterhazy-Lowe, Amara and Zeller, Hanne and Oakhurst, Yusuf and Nakashima, Juno and Larkspur, Celia}, + title = {Forecasting heatwave mortality in a northern industrial town}, + year = {2026}, + keywords = {field campaign, dataset, air temperature}, + booktitle = {Proceedings of the 19th Meeting on Heat Action Plans}, + pages = {17--25} +} + +@inproceedings{urban118, + author = {Vantongeren, Quinn and Yilmaz-Grant, Otto and Underhill, Mina and Yilmaz-Grant, Elif and Kowalczyk, Zora and Delacourt, Ines}, + title = {Explaining pavement albedo in a northern industrial town}, + year = {1996}, + keywords = {remote sensing, mortality, tree canopy}, + booktitle = {Proceedings of the 27th Meeting on Heat Action Plans}, + pages = {252--256} +} + +@article{urban119, + author = {Calloway, Wilhelmina and Vantongeren, Quinn}, + title = {Measuring cool roofs in a dense inner suburb}, + year = {2000}, + keywords = {heatwave, dataset, field campaign}, + journal = {Landscape and Microclimate}, + volume = {23}, + number = {8}, + pages = {213--236} +} + +@article{urban120, + author = {Galloway, Kenji and Dunmore, Beatrix}, + title = {Reducing anthropogenic heat in a river delta city}, + year = {2025}, + keywords = {green infrastructure, cool roofs}, + journal = {Heat and Health Quarterly}, + volume = {16}, + number = {2}, + pages = {820--841} +} + +@article{urban121, + author = {Calloway, Wren and Oakhurst, Soren and Harwood, Amara and Lindqvist, Otto}, + title = {Modelling shade equity in three coastal cities}, + year = {2017}, + keywords = {field campaign}, + journal = {Heat and Health Quarterly}, + volume = {2}, + number = {11}, + pages = {632--652} +} + +@book{urban122, + author = {Zeller, Ada and Vantongeren, Vesna and Underhill, Priya and Rowntree, Saoirse and Nakashima, Nils}, + title = {Reducing tree canopy cover in three coastal cities}, + year = {2014}, + keywords = {cool roofs, policy, green infrastructure}, + publisher = {Lantern Field Books}, + address = {Brindlemoor} +} + +@article{urban123, + author = {Harwood, Quinn and Whitlock, Otto and Okonkwo-Hart, Wren}, + title = {Modelling shade equity in a dense inner suburb}, + year = {2023}, + keywords = {tree canopy}, + journal = {Applied Urban Meteorology}, + volume = {13}, + number = {1}, + pages = {71--99} +} + +@article{urban124, + author = {Pemberton, Rosa and Cardenas-Holt, Ximena}, + title = {Explaining air temperature networks in informal settlements}, + year = {2020}, + keywords = {tree canopy}, + journal = {Landscape and Microclimate}, + volume = {27}, + number = {5}, + pages = {468--478} +} + +@book{urban125, + author = {Stavely, Hugo and Stavely, Femi}, + title = {Comparing tree canopy cover in three coastal cities}, + year = {2026}, + keywords = {albedo, cool roofs, modelling}, + publisher = {Lantern Field Books}, + address = {Ostrava Vale} +} + +@article{urban126, + author = {Pemberton, Edda and Yardley, Amara and Vantongeren, Soren and Montaigne-Blake, Chiara and Sandoval, Rosa and Stavely, Saoirse}, + title = {Forecasting heat action plans in a northern industrial town}, + year = {2006}, + keywords = {albedo, equity, cool roofs}, + journal = {Remote Sensing of Built Environments}, + volume = {1}, + number = {11}, + pages = {626--639} +} + +@article{urban127, + author = {Galloway, Cosmo and Montaigne-Blake, Greta and Juniper, Saoirse and Galloway, Desmond}, + title = {Modelling green roofs in informal settlements}, + year = {2010}, + keywords = {albedo, heatwave}, + journal = {Cities and Climate Review}, + volume = {6}, + number = {6}, + pages = {17--34} +} + +@article{urban128, + author = {Esterhazy-Lowe, Hanne and Underhill, Elif}, + title = {Mapping air temperature networks in informal settlements}, + year = {2003}, + keywords = {field campaign, mortality}, + journal = {Remote Sensing of Built Environments}, + volume = {42}, + number = {10}, + pages = {63--76} +} + +@article{urban129, + author = {Ellery, Desmond}, + title = {Forecasting shade equity in a river delta city}, + year = {2008}, + keywords = {policy, air temperature, field campaign}, + journal = {Remote Sensing of Built Environments}, + volume = {26}, + number = {11}, + pages = {224--246} +} + +@incollection{urban130, + author = {Ashgrove, Kaia and Ravensworth, Vesna}, + title = {Comparing street canyon geometry in a northern industrial town}, + year = {2003}, + keywords = {albedo, field campaign, air temperature}, + booktitle = {New Directions In Shade Equity}, + editor = {Yilmaz-Grant, Quinn and Sandoval, Yara}, + publisher = {Westmarch Scholarly}, + address = {Port Ellery}, + pages = {222--248} +} + +@article{urban131, + author = {Juniper, Kenji and Juniper, Hugo and Achterberg, Greta and Thornbury, Hanne and Larkspur, Hugo}, + title = {Comparing the surface urban heat island in informal settlements}, + year = {1995}, + keywords = {mortality}, + journal = {Journal of Urban Thermal Studies}, + volume = {37}, + number = {4}, + pages = {133--160} +} + +@article{urban132, + author = {Esterhazy-Lowe, Dario and Northcote, Marisol and Dunmore, Kaia and Kowalczyk, Greta and Esterhazy-Lowe, Ines}, + title = {Explaining blue spaces in a semi-arid metropolis}, + year = {2016}, + keywords = {cool roofs}, + journal = {Journal of Urban Thermal Studies}, + volume = {33}, + number = {3}, + pages = {148--172} +} + +@incollection{urban133, + author = {Harwood, Aurelio and Yilmaz-Grant, Wilhelmina}, + title = {Measuring cool roofs in a river delta city}, + year = {2020}, + keywords = {cool roofs}, + booktitle = {Perspectives On Cool Roofs}, + editor = {Stavely, Ikaika and Okonkwo-Hart, Bram}, + publisher = {Westmarch Scholarly}, + address = {Port Ellery}, + pages = {253--274} +} + +@incollection{urban134, + author = {Juniper, Hugo and Sandoval, Amara and Vantongeren, Farid}, + title = {Forecasting land surface temperature in a mid-latitude port city}, + year = {2020}, + keywords = {field campaign, cool roofs}, + booktitle = {Handbook Of Land Surface Temperature}, + editor = {Kowalczyk, Ines and Larkspur, Hanne}, + publisher = {Brindlemoor University Press}, + address = {Saltford}, + pages = {321--342} +} + +@article{urban135, + author = {Zeller, Wren and Ravensworth, Bastian and Vantongeren, Chiara and Harwood, Dario and Thornbury, Ikaika and Delacourt, Kaia}, + title = {Reducing air temperature networks in a semi-arid metropolis}, + year = {2017}, + keywords = {albedo}, + journal = {Landscape and Microclimate}, + volume = {25}, + number = {9}, + pages = {331--349} +} + +@article{urban136, + author = {Ishikawa-Reed, Aurelio and Ishikawa-Reed, Farid and Wexford, Ada}, + title = {Comparing land surface temperature in three coastal cities}, + year = {1996}, + keywords = {mortality, modelling}, + journal = {Applied Urban Meteorology}, + volume = {27}, + number = {10}, + pages = {108--114} +} + +@techreport{urban137, + author = {Nakashima, Beatrix and Montaigne-Blake, Dario and Underhill, Luca}, + title = {Reducing outdoor thermal comfort in informal settlements}, + year = {2017}, + keywords = {air temperature, mortality, heatwave}, + institution = {Ostrava Vale City Council}, + number = {TR-2017-67} +} + +@misc{urban138, + author = {Cardenas-Holt, Rafael and Yardley, Zora and Fenwright, Soren}, + title = {Mapping shade equity in informal settlements}, + year = {1999}, + keywords = {heatwave}, + howpublished = {Dataset}, + publisher = {Port Ellery Open Data} +} + +@article{urban139, + author = {Jessamy, Soren and Ravensworth, Soren}, + title = {Explaining green roofs in twelve European capitals}, + year = {2015}, + keywords = {mortality}, + journal = {Journal of Urban Thermal Studies}, + volume = {32}, + number = {1}, + pages = {405--430} +} + +@article{urban140, + author = {Yilmaz-Grant, Elif}, + title = {Comparing blue spaces in a dense inner suburb}, + year = {1995}, + keywords = {green infrastructure, review, cool roofs}, + journal = {Heat and Health Quarterly}, + volume = {22}, + number = {11}, + pages = {641--649} +} + +@article{urban141, + author = {Harwood, Chiara and Underhill, Aurelio and Wexford, Edda and Harwood, Wren and Sandoval, Kenji}, + title = {Monitoring shade equity in three coastal cities: a second look}, + year = {2002}, + keywords = {review, modelling}, + journal = {Remote Sensing of Built Environments}, + volume = {8}, + number = {12}, + pages = {122--140} +} + +@article{urban142, + author = {Harwood, Jonas and Rowntree, Elif}, + title = {Reducing air temperature networks in three coastal cities}, + year = {2000}, + keywords = {mortality, policy}, + journal = {Heat and Health Quarterly}, + volume = {3}, + number = {7}, + pages = {387--399} +} + +@inproceedings{urban143, + author = {Galloway, Kenji and Yilmaz-Grant, Kaia and Achterberg, Marisol and Underhill, Mina and Ashgrove, Wren and Kettering, Rafael}, + title = {Monitoring air temperature networks in a northern industrial town}, + year = {2021}, + keywords = {review, albedo, policy}, + booktitle = {Proceedings of the 14th Meeting on Green Roofs}, + pages = {267--276} +} + +@article{urban144, + author = {Fenwright, Vesna and Gilchrist, Orla and Pemberton, Quinn and Whitlock, Yara}, + title = {Comparing pavement albedo in a northern industrial town}, + year = {2003}, + keywords = {air temperature, albedo}, + journal = {Heat and Health Quarterly}, + volume = {37}, + number = {1}, + pages = {264--272} +} + +@article{urban145, + author = {Ishikawa-Reed, Desmond and Zeller, Farid and Harwood, Orla and Lindqvist, Beatrix and Okonkwo-Hart, Greta}, + title = {Reducing green roofs in twelve European capitals}, + year = {2021}, + keywords = {field campaign, policy, tree canopy}, + journal = {Remote Sensing of Built Environments}, + volume = {20}, + number = {9}, + pages = {868--878} +} + +@article{urban146, + author = {Zabala, Wren and Thornbury, Greta and Pellham, Jonas and Northcote, Mina and Juniper, Aurelio and Okonkwo-Hart, Wren}, + title = {Modelling air temperature networks in informal settlements}, + year = {2025}, + keywords = {modelling, tree canopy}, + journal = {Journal of Urban Thermal Studies}, + volume = {11}, + number = {4}, + pages = {597--608} +} + +@article{urban147, + author = {Harwood, Pavel and Whitlock, Bram and Lindqvist, Juno}, + title = {Comparing air temperature networks in informal settlements}, + year = {2000}, + keywords = {review, heatwave, equity}, + journal = {Applied Urban Meteorology}, + volume = {43}, + number = {5}, + pages = {294--308} +} + +@incollection{urban148, + author = {Halloran, Jonas and Zeller, Kaia and Juniper, Ines}, + title = {Monitoring cool roofs in a semi-arid metropolis}, + year = {1998}, + keywords = {remote sensing, heatwave}, + booktitle = {New Directions In Tree Canopy Cover}, + editor = {Juniper, Yara and Kettering, Juno}, + publisher = {Lantern Field Books}, + address = {Westmarch}, + pages = {157--170} +} + +@article{urban149, + author = {Wexford, Nils and Pemberton, Hanne and Rowntree, Leonie and Wexford, Wren}, + title = {Reducing heat action plans in informal settlements}, + year = {2024}, + keywords = {green infrastructure, mortality}, + journal = {Cities and Climate Review}, + volume = {5}, + number = {9}, + pages = {113--137} +} + +@inproceedings{urban150, + author = {Marrowfield, Ximena and Thornbury, Wren}, + title = {Explaining air temperature networks in three coastal cities}, + year = {1994}, + keywords = {equity}, + booktitle = {Proceedings of the 30th Meeting on Cool Roofs}, + pages = {32--41} +} + +@inproceedings{urban151, + author = {Cardenas-Holt, Ikaika and Tremaine, Luca}, + title = {Mapping tree canopy cover in a dense inner suburb}, + year = {2020}, + keywords = {tree canopy, green infrastructure, policy}, + booktitle = {Proceedings of the 5th Meeting on Blue Spaces}, + pages = {182--190} +} + +@book{urban152, + author = {Fenwright, Vesna and Gilchrist, Bram and Kowalczyk, Kenji}, + title = {Measuring heat action plans in twelve European capitals}, + year = {2020}, + keywords = {modelling}, + publisher = {Brindlemoor University Press}, + address = {Calder Bay} +} + +@article{urban153, + author = {Cardenas-Holt, Bram and Nakashima, Farid}, + title = {Reducing nocturnal heat retention in informal settlements}, + year = {2011}, + keywords = {policy}, + journal = {Landscape and Microclimate}, + volume = {44}, + number = {10}, + pages = {628--653} +} + +@article{urban154, + author = {Thornbury, Tala and Brightwater, Amara}, + title = {Measuring heat action plans in a dense inner suburb}, + year = {2004}, + keywords = {field campaign}, + journal = {Journal of Urban Thermal Studies}, + volume = {10}, + number = {3}, + pages = {705--730} +} + +@book{urban155, + author = {Abernathy, Orla and Bellweather, Wren and Vantongeren, Orla}, + title = {Mapping anthropogenic heat in three coastal cities}, + year = {2017}, + keywords = {review}, + publisher = {Harrowgate & Lowe}, + address = {Saltford} +} + +@article{urban156, + author = {Ishikawa-Reed, Tobias and Whitlock, Desmond and Ravensworth, Pavel and Bellweather, Luca}, + title = {Explaining heat action plans in twelve European capitals}, + year = {1997}, + keywords = {mortality, policy, air temperature}, + journal = {Cities and Climate Review}, + volume = {10}, + number = {4}, + pages = {260--280} +} + +@book{urban157, + author = {Larkspur, Bram and Lindqvist, Tala and Oakhurst, Edda}, + title = {Modelling street canyon geometry in informal settlements}, + year = {2009}, + keywords = {green infrastructure, equity, heatwave}, + publisher = {Harrowgate & Lowe}, + address = {Lowen} +} + +@phdthesis{urban158, + author = {Dunmore, Nils and Calloway, Amara and Kowalczyk, Ines}, + title = {Mapping air temperature networks in twelve European capitals}, + year = {2009}, + keywords = {field campaign, dataset, green infrastructure}, + school = {University of Lowen} +} + +@inproceedings{urban159, + author = {Vantongeren, Nils and Zeller, Soren and Kowalczyk, Marisol}, + title = {Measuring heatwave mortality in three coastal cities}, + year = {2018}, + keywords = {albedo}, + booktitle = {Proceedings of the 26th Meeting on Tree Canopy Cover}, + pages = {244--254} +} + +@article{urban160, + author = {Jessamy, Edda and Northcote, Kaia}, + title = {Mapping the surface urban heat island in a northern industrial town}, + year = {2018}, + keywords = {albedo}, + journal = {Heat and Health Quarterly}, + volume = {15}, + number = {6}, + pages = {351--361} +} + +@article{urban161, + author = {Wexford, Saoirse and Esterhazy-Lowe, Ximena and Yardley, Yara}, + title = {Mapping cool roofs in informal settlements}, + year = {2006}, + keywords = {tree canopy}, + journal = {Journal of Urban Thermal Studies}, + volume = {18}, + number = {3}, + pages = {892--900} +} + +@article{urban162, + author = {Rowntree, Ikaika and Ishikawa-Reed, Juno}, + title = {Mapping air temperature networks in informal settlements: a comparison}, + year = {2013}, + keywords = {tree canopy, equity}, + journal = {Landscape and Microclimate}, + volume = {29}, + number = {9}, + pages = {269--277} +} + +@article{urban163, + author = {Kettering, Viktor and Pemberton, Leonie}, + title = {Mapping land surface temperature in twelve European capitals}, + year = {1998}, + keywords = {review, green infrastructure}, + journal = {Journal of Urban Thermal Studies}, + volume = {19}, + number = {8}, + pages = {812--837} +} + +@book{urban164, + author = {Tremaine, Bram and Dunmore, Beatrix and Montaigne-Blake, Zora and Juniper, Dario and Stavely, Kaia and Calloway, Luca}, + title = {Monitoring heatwave mortality in a northern industrial town}, + year = {1996}, + keywords = {tree canopy}, + publisher = {Westmarch Scholarly}, + address = {Brindlemoor} +} + +@article{urban165, + author = {Lindqvist, Viktor}, + title = {Forecasting the surface urban heat island in twelve European capitals}, + year = {2025}, + keywords = {green infrastructure, field campaign, modelling}, + journal = {Journal of Urban Thermal Studies}, + volume = {11}, + number = {5}, + pages = {43--59} +} + +@article{urban166, + author = {Jessamy, Marisol and Montaigne-Blake, Otto and Bellweather, Bastian and Juniper, Marisol}, + title = {Monitoring anthropogenic heat in informal settlements}, + year = {2010}, + keywords = {air temperature, mortality, tree canopy}, + journal = {Heat and Health Quarterly}, + volume = {17}, + number = {6}, + pages = {504--517} +} + +@inproceedings{urban167, + author = {Pellham, Kenji and Montaigne-Blake, Zora and Kettering, Vesna and Vantongeren, Soren}, + title = {Monitoring heat action plans in a dense inner suburb}, + year = {2026}, + keywords = {heatwave, review, tree canopy}, + booktitle = {Proceedings of the 23th Meeting on Tree Canopy Cover}, + pages = {2--8} +} + +@book{urban168, + author = {Abernathy, Rosa and Gilchrist, Leonie and Pemberton, Leonie and Esterhazy-Lowe, Dario and Fenwright, Uma and Gilchrist, Priya}, + title = {Monitoring blue spaces in three coastal cities}, + year = {2026}, + keywords = {albedo, green infrastructure, remote sensing}, + publisher = {Westmarch Scholarly}, + address = {Harrowgate} +} + +@inproceedings{urban169, + author = {Delacourt, Pavel and Montaigne-Blake, Zora and Calloway, Quinn}, + title = {Explaining cool roofs in a mid-latitude port city: an open dataset}, + year = {2022}, + keywords = {field campaign}, + booktitle = {Proceedings of the 9th Meeting on Heat Action Plans}, + pages = {259--263} +} + +@article{urban170, + author = {Sandoval, Hanne and Halloran, Viktor and Marrowfield, Rafael and Northcote, Vesna}, + title = {Measuring heatwave mortality in a mid-latitude port city}, + year = {2025}, + keywords = {tree canopy, heatwave}, + journal = {Heat and Health Quarterly}, + volume = {20}, + number = {11}, + pages = {132--159} +} + +@article{urban171, + author = {Thornbury, Wilhelmina and Pellham, Celia and Brightwater, Hanne and Sandoval, Viktor and Fairbairn, Rafael and Okonkwo-Hart, Tobias}, + title = {Explaining shade equity in a semi-arid metropolis}, + year = {2005}, + keywords = {dataset}, + journal = {Heat and Health Quarterly}, + volume = {42}, + number = {2}, + pages = {684--695} +} + +@article{urban172, + author = {Varga, Otto and Ravensworth, Ines and Yilmaz-Grant, Yara}, + title = {Forecasting nocturnal heat retention in a semi-arid metropolis}, + year = {2013}, + keywords = {tree canopy, equity}, + journal = {Remote Sensing of Built Environments}, + volume = {4}, + number = {7}, + pages = {889--908} +} + +@misc{urban173, + author = {Calloway, Bram and Kettering, Farid and Oakhurst, Orla and Ravensworth, Otto}, + title = {Explaining green roofs in a mid-latitude port city}, + year = {2025}, + keywords = {modelling, cool roofs, albedo}, + howpublished = {Dataset}, + publisher = {Port Ellery Open Data} +} + +@techreport{urban174, + author = {Tremaine, Cosmo and Galloway, Viktor and Vantongeren, Dario}, + title = {Comparing cool roofs in a river delta city: lessons from a decade}, + year = {2011}, + keywords = {tree canopy, remote sensing, green infrastructure}, + institution = {Harrowgate Observatory}, + number = {TR-2011-69} +} + +@incollection{urban175, + author = {Ishikawa-Reed, Farid and Ellery, Celia and Galloway, Wilhelmina}, + title = {Monitoring outdoor thermal comfort in a semi-arid metropolis}, + year = {1997}, + keywords = {field campaign, heatwave}, + booktitle = {New Directions In The Surface Urban Heat Island}, + editor = {Fairbairn, Beatrix and Yilmaz-Grant, Ikaika}, + publisher = {Calder Bay Academic}, + address = {Westmarch}, + pages = {103--133} +} + +@article{urban176, + author = {Whitlock, Soren}, + title = {Comparing street canyon geometry in a river delta city}, + year = {2019}, + keywords = {mortality}, + journal = {Landscape and Microclimate}, + volume = {41}, + number = {9}, + pages = {425--437} +} + +@article{urban177, + author = {Fairbairn, Tobias and Bellweather, Beatrix and Pemberton, Kenji and Ravensworth, Hanne and Quarrington, Marisol}, + title = {Monitoring heat action plans in twelve European capitals}, + year = {1999}, + keywords = {albedo}, + journal = {Landscape and Microclimate}, + volume = {27}, + number = {1}, + pages = {541--549} +} + +@article{urban178, + author = {Rowntree, Cosmo and Ravensworth, Celia and Varga, Dario and Esterhazy-Lowe, Dario}, + title = {Modelling cool roofs in a mid-latitude port city}, + year = {2005}, + keywords = {heatwave, review, air temperature}, + journal = {Heat and Health Quarterly}, + volume = {7}, + number = {8}, + pages = {199--213} +} + +@article{urban179, + author = {Ivesdale, Bastian and Gilchrist, Leonie and Yilmaz-Grant, Pavel and Abernathy, Rafael and Pellham, Tobias and Okonkwo-Hart, Amara}, + title = {Mapping blue spaces in three coastal cities}, + year = {2011}, + keywords = {air temperature, equity}, + journal = {Journal of Urban Thermal Studies}, + volume = {6}, + number = {12}, + pages = {578--588} +} + +@article{urban180, + author = {Wexford, Desmond and Okonkwo-Hart, Greta and Northcote, Pavel and Yilmaz-Grant, Farid and Montaigne-Blake, Uma}, + title = {Forecasting the surface urban heat island in a northern industrial town}, + year = {1995}, + keywords = {field campaign, air temperature}, + journal = {Remote Sensing of Built Environments}, + volume = {8}, + number = {6}, + pages = {312--318} +} + +@article{urban181, + author = {Varga, Rosa and Dunmore, Nils}, + title = {Forecasting anthropogenic heat in a river delta city}, + year = {2006}, + keywords = {remote sensing, review}, + journal = {Applied Urban Meteorology}, + volume = {43}, + number = {7}, + pages = {210--230} +} + +@book{urban182, + author = {Esterhazy-Lowe, Aurelio and Fairbairn, Priya}, + title = {Mapping heatwave mortality in twelve European capitals}, + year = {2020}, + keywords = {equity, review}, + publisher = {Saltford House}, + address = {Ostrava Vale} +} + +@inproceedings{urban183, + author = {Cardenas-Holt, Nils and Ravensworth, Tala and Oakhurst, Noor and Achterberg, Femi and Juniper, Marisol and Wexford, Viktor}, + title = {Measuring green roofs in a river delta city: a second look}, + year = {2008}, + keywords = {cool roofs, air temperature}, + booktitle = {Proceedings of the 21th Meeting on Air Temperature Networks}, + pages = {201--205} +} + +@article{urban184, + author = {Marrowfield, Aurelio and Cardenas-Holt, Dario and Gilchrist, Marisol}, + title = {Explaining heatwave mortality in a river delta city}, + year = {1999}, + keywords = {albedo, cool roofs, dataset}, + journal = {Journal of Urban Thermal Studies}, + volume = {14}, + number = {11}, + pages = {401--409} +} + +@incollection{urban185, + author = {Juniper, Kaia and Brightwater, Ines and Zabala, Cosmo and Montaigne-Blake, Uma and Wexford, Hanne}, + title = {Comparing air temperature networks in informal settlements: an open dataset}, + year = {2024}, + keywords = {heatwave, air temperature}, + booktitle = {Handbook Of Nocturnal Heat Retention}, + editor = {Zabala, Leonie and Vantongeren, Ikaika}, + publisher = {Westmarch Scholarly}, + address = {Lowen}, + pages = {86--113} +} + +@inproceedings{urban186, + author = {Esterhazy-Lowe, Desmond}, + title = {Forecasting pavement albedo in a semi-arid metropolis}, + year = {2003}, + keywords = {equity}, + booktitle = {Proceedings of the 19th Meeting on Blue Spaces}, + pages = {226--234} +} + +@article{urban187, + author = {Ulvaeus, Ximena and Northcote, Yusuf}, + title = {Forecasting nocturnal heat retention in informal settlements: a comparison}, + year = {1998}, + keywords = {heatwave}, + journal = {Remote Sensing of Built Environments}, + volume = {18}, + number = {3}, + pages = {368--392} +} + +@incollection{urban188, + author = {Northcote, Luca and Brightwater, Hugo and Fenwright, Priya}, + title = {Comparing blue spaces in a mid-latitude port city}, + year = {2019}, + keywords = {albedo, tree canopy, heatwave}, + booktitle = {Handbook Of Air Temperature Networks}, + editor = {Marrowfield, Quinn and Brightwater, Farid}, + publisher = {Brindlemoor University Press}, + address = {Harrowgate}, + pages = {341--362} +} + +@article{urban189, + author = {Ulvaeus, Uma and Brightwater, Chiara and Larkspur, Soren and Nakashima, Hanne and Whitlock, Orla and Kowalczyk, Orla}, + title = {Comparing street canyon geometry in informal settlements}, + year = {2015}, + keywords = {dataset}, + journal = {Landscape and Microclimate}, + volume = {40}, + number = {6}, + pages = {154--180} +} + +@article{urban190, + author = {Whitlock, Noor and Varga, Wren and Northcote, Cosmo and Underhill, Orla and Fairbairn, Ximena and Delacourt, Orla}, + title = {Forecasting shade equity in a northern industrial town: new evidence}, + year = {2005}, + keywords = {green infrastructure, review, tree canopy}, + journal = {Heat and Health Quarterly}, + volume = {46}, + number = {11}, + pages = {49--77} +} + +@phdthesis{urban191, + author = {Zabala, Farid and Nakashima, Juno and Zeller, Edda and Galloway, Amara}, + title = {Measuring tree canopy cover in a mid-latitude port city}, + year = {2014}, + keywords = {equity}, + school = {University of Harrowgate} +} + +@techreport{urban192, + author = {Achterberg, Soren and Oakhurst, Kenji and Brightwater, Wren and Pellham, Ximena and Ashgrove, Pavel and Stavely, Tala}, + title = {Explaining outdoor thermal comfort in a dense inner suburb: a comparison}, + year = {2003}, + keywords = {green infrastructure, mortality, remote sensing}, + institution = {Westmarch City Council}, + number = {TR-2003-03} +} + +@article{urban193, + author = {Galloway, Elif and Tremaine, Hanne}, + title = {Modelling nocturnal heat retention in a river delta city}, + year = {2011}, + keywords = {field campaign}, + journal = {Cities and Climate Review}, + volume = {20}, + number = {9}, + pages = {773--798} +} + +@inproceedings{urban194, + author = {Dunmore, Ikaika and Larkspur, Juno and Oakhurst, Soren and Brightwater, Soren and Thornbury, Zora and Calloway, Rafael}, + title = {Forecasting pavement albedo in twelve European capitals}, + year = {2018}, + keywords = {policy, heatwave}, + booktitle = {Proceedings of the 28th Meeting on The Surface Urban Heat Island}, + pages = {234--240} +} + +@book{urban195, + author = {Montaigne-Blake, Rafael and Marrowfield, Edda and Harwood, Pavel}, + title = {Monitoring street canyon geometry in informal settlements}, + year = {2017}, + keywords = {modelling, field campaign, albedo}, + publisher = {Saltford House}, + address = {Lowen} +} + +@incollection{urban196, + author = {Ashgrove, Jonas and Zeller, Wilhelmina}, + title = {Mapping green roofs in a semi-arid metropolis}, + year = {2012}, + keywords = {mortality, field campaign, policy}, + booktitle = {New Directions In Shade Equity}, + editor = {Harwood, Chiara and Kowalczyk, Bastian}, + publisher = {Saltford House}, + address = {Harrowgate}, + pages = {299--316} +} + +@article{urban197, + author = {Larkspur, Priya and Okonkwo-Hart, Bram and Ashgrove, Orla and Wexford, Saoirse}, + title = {Monitoring pavement albedo in twelve European capitals}, + year = {2007}, + keywords = {green infrastructure, policy}, + journal = {Cities and Climate Review}, + volume = {39}, + number = {2}, + pages = {249--264} +} + +@article{urban198, + author = {Zabala, Kaia and Delacourt, Wren and Calloway, Yara}, + title = {Modelling cool roofs in three coastal cities}, + year = {2010}, + keywords = {dataset}, + journal = {Remote Sensing of Built Environments}, + volume = {9}, + number = {4}, + pages = {650--656} +} + +@phdthesis{urban199, + author = {Okonkwo-Hart, Ada and Tremaine, Celia}, + title = {Comparing cool roofs in a northern industrial town}, + year = {2010}, + keywords = {tree canopy, mortality, green infrastructure}, + school = {University of Westmarch} +} + +@article{urban200, + author = {Pellham, Marisol}, + title = {Forecasting heat action plans in a semi-arid metropolis}, + year = {2005}, + keywords = {modelling, green infrastructure}, + journal = {Applied Urban Meteorology}, + volume = {18}, + number = {4}, + pages = {691--699} +} + +@article{urban201, + author = {Pemberton, Saoirse and Ravensworth, Priya}, + title = {Reducing nocturnal heat retention in a dense inner suburb}, + year = {2018}, + keywords = {dataset, green infrastructure}, + journal = {Remote Sensing of Built Environments}, + volume = {25}, + number = {12}, + pages = {328--349} +} + +@article{urban202, + author = {Delacourt, Hugo and Brightwater, Ximena and Nakashima, Ximena}, + title = {Monitoring the surface urban heat island in a river delta city}, + year = {2018}, + keywords = {policy}, + journal = {Landscape and Microclimate}, + volume = {22}, + number = {7}, + pages = {152--176} +} + +@inproceedings{urban203, + author = {Dunmore, Mina and Gilchrist, Yara and Calloway, Edda}, + title = {Reducing heat action plans in a dense inner suburb: an open dataset}, + year = {1994}, + keywords = {green infrastructure, review}, + booktitle = {Proceedings of the 20th Meeting on Anthropogenic Heat}, + pages = {18--23} +} + +@article{urban204, + author = {Wexford, Dario and Whitlock, Edda and Jessamy, Rosa and Kettering, Otto}, + title = {Reducing green roofs in a northern industrial town}, + year = {2021}, + keywords = {albedo, air temperature, tree canopy}, + journal = {Journal of Urban Thermal Studies}, + volume = {2}, + number = {4}, + pages = {898--924} +} + +@article{urban205, + author = {Montaigne-Blake, Hugo}, + title = {Mapping cool roofs in three coastal cities}, + year = {2002}, + keywords = {equity, review}, + journal = {Cities and Climate Review}, + volume = {19}, + number = {3}, + pages = {196--216} +} + +@article{urban206, + author = {Bellweather, Jonas and Zeller, Leonie and Yilmaz-Grant, Hanne and Galloway, Yusuf and Ashgrove, Elif}, + title = {Measuring green roofs in twelve European capitals}, + year = {2004}, + keywords = {tree canopy}, + journal = {Applied Urban Meteorology}, + volume = {3}, + number = {10}, + pages = {29--41} +} + +@article{urban207, + author = {Kettering, Yusuf and Varga, Ximena}, + title = {Forecasting heat action plans in a mid-latitude port city}, + year = {2019}, + keywords = {policy, heatwave}, + journal = {Remote Sensing of Built Environments}, + volume = {7}, + number = {11}, + pages = {42--56} +} + +@article{urban208, + author = {Vantongeren, Beatrix and Quarrington, Hugo and Kowalczyk, Hugo and Yilmaz-Grant, Amara and Tremaine, Ximena}, + title = {Reducing nocturnal heat retention in a semi-arid metropolis}, + year = {2000}, + keywords = {air temperature, green infrastructure, tree canopy}, + journal = {Landscape and Microclimate}, + volume = {39}, + number = {11}, + pages = {591--615} +} + +@article{urban209, + author = {Ivesdale, Cosmo and Achterberg, Rafael}, + title = {Explaining street canyon geometry in a northern industrial town}, + year = {2003}, + keywords = {albedo, modelling}, + journal = {Journal of Urban Thermal Studies}, + volume = {28}, + number = {11}, + pages = {593--607} +} + +@article{urban210, + author = {Lindqvist, Ximena and Halloran, Vesna and Nakashima, Mina}, + title = {Reducing heatwave mortality in a river delta city}, + year = {2011}, + keywords = {green infrastructure, remote sensing}, + journal = {Landscape and Microclimate}, + volume = {17}, + number = {4}, + pages = {390--413} +} + +@inproceedings{urban211, + author = {Halloran, Priya and Brightwater, Edda and Cardenas-Holt, Wilhelmina and Oakhurst, Elif and Lindqvist, Yara and Esterhazy-Lowe, Elif}, + title = {Measuring heatwave mortality in a mid-latitude port city: a comparison}, + year = {1994}, + keywords = {mortality, green infrastructure, heatwave}, + booktitle = {Proceedings of the 24th Meeting on Green Roofs}, + pages = {138--144} +} + +@incollection{urban212, + author = {Ivesdale, Otto and Nakashima, Kaia and Tremaine, Celia}, + title = {Comparing green roofs in twelve European capitals}, + year = {2023}, + keywords = {green infrastructure, equity, tree canopy}, + booktitle = {Perspectives On Green Roofs}, + editor = {Lindqvist, Juno and Wexford, Mina}, + publisher = {Saltford House}, + address = {Lowen}, + pages = {331--344} +} + +@article{urban213, + author = {Kowalczyk, Desmond and Yardley, Hugo and Delacourt, Rafael}, + title = {Modelling tree canopy cover in a mid-latitude port city}, + year = {2023}, + keywords = {dataset, heatwave, green infrastructure}, + journal = {Remote Sensing of Built Environments}, + volume = {2}, + number = {8}, + pages = {235--244} +} + +@article{urban214, + author = {Harwood, Ximena and Sandoval, Rafael and Wexford, Ximena and Cardenas-Holt, Kenji}, + title = {Measuring outdoor thermal comfort in a dense inner suburb}, + year = {2004}, + keywords = {mortality, tree canopy, field campaign}, + journal = {Remote Sensing of Built Environments}, + volume = {38}, + number = {4}, + pages = {884--891} +} + +@inproceedings{urban215, + author = {Dunmore, Elif}, + title = {Explaining blue spaces in informal settlements: lessons from a decade}, + year = {2012}, + keywords = {albedo, modelling, cool roofs}, + booktitle = {Proceedings of the 30th Meeting on Nocturnal Heat Retention}, + pages = {247--255} +} + +@book{urban216, + author = {Wexford, Soren and Ellery, Desmond}, + title = {Mapping cool roofs in a semi-arid metropolis}, + year = {2002}, + keywords = {equity, mortality}, + publisher = {Saltford House}, + address = {Saltford} +} + +@article{urban217, + author = {Ulvaeus, Zora}, + title = {Forecasting green roofs in a northern industrial town}, + year = {2024}, + keywords = {field campaign, dataset}, + journal = {Landscape and Microclimate}, + volume = {6}, + number = {11}, + pages = {155--175} +} + +@article{urban218, + author = {Thornbury, Ximena and Zeller, Nils and Wexford, Ada}, + title = {Measuring outdoor thermal comfort in a river delta city}, + year = {2008}, + keywords = {modelling}, + journal = {Journal of Urban Thermal Studies}, + volume = {11}, + number = {8}, + pages = {146--156} +} + +@article{urban219, + author = {Lindqvist, Noor and Delacourt, Soren and Delacourt, Viktor and Varga, Jonas and Cardenas-Holt, Cosmo and Ellery, Greta}, + title = {Measuring cool roofs in three coastal cities}, + year = {2003}, + keywords = {mortality}, + journal = {Landscape and Microclimate}, + volume = {3}, + number = {11}, + pages = {341--362} +} + +@article{urban220, + author = {Bellweather, Nils and Achterberg, Rafael and Ellery, Amara}, + title = {Mapping heat action plans in twelve European capitals}, + year = {2005}, + keywords = {modelling, heatwave}, + journal = {Cities and Climate Review}, + volume = {30}, + number = {10}, + pages = {185--201} +} + +@article{urban221, + author = {Pellham, Kaia and Kowalczyk, Ikaika and Underhill, Kaia}, + title = {Mapping air temperature networks in a river delta city}, + year = {2026}, + keywords = {tree canopy}, + journal = {Landscape and Microclimate}, + volume = {48}, + number = {5}, + pages = {778--791} +} + +@article{urban222, + author = {Oakhurst, Kaia and Pellham, Amara}, + title = {Reducing land surface temperature in a river delta city: lessons from a decade}, + year = {1998}, + keywords = {policy}, + journal = {Heat and Health Quarterly}, + volume = {42}, + number = {8}, + pages = {374--386} +} + +@article{urban223, + author = {Bellweather, Pavel and Ravensworth, Ximena and Bellweather, Ximena and Harwood, Rafael and Quarrington, Wren}, + title = {Reducing tree canopy cover in a dense inner suburb}, + year = {2009}, + keywords = {field campaign}, + journal = {Heat and Health Quarterly}, + volume = {23}, + number = {9}, + pages = {868--882} +} + +@techreport{urban224, + author = {Underhill, Leonie and Galloway, Luca and Thornbury, Marisol and Zeller, Priya and Harwood, Vesna}, + title = {Explaining land surface temperature in a dense inner suburb}, + year = {2018}, + keywords = {green infrastructure, remote sensing, heatwave}, + institution = {Calder Bay City Council}, + number = {TR-2018-69} +} + +@article{urban225, + author = {Marrowfield, Soren and Cardenas-Holt, Rosa and Thornbury, Yara and Fairbairn, Bram and Northcote, Priya and Larkspur, Cosmo}, + title = {Reducing shade equity in a northern industrial town}, + year = {2000}, + keywords = {mortality}, + journal = {Applied Urban Meteorology}, + volume = {32}, + number = {4}, + pages = {13--22} +} + +@article{urban226, + author = {Underhill, Uma and Calloway, Ikaika and Bellweather, Chiara and Whitlock, Quinn and Ivesdale, Ximena and Okonkwo-Hart, Beatrix}, + title = {Mapping tree canopy cover in three coastal cities}, + year = {2009}, + keywords = {modelling, equity}, + journal = {Remote Sensing of Built Environments}, + volume = {37}, + number = {2}, + pages = {129--145} +} + +@inproceedings{urban227, + author = {Okonkwo-Hart, Kaia and Thornbury, Uma and Larkspur, Soren and Stavely, Femi and Zabala, Desmond}, + title = {Measuring tree canopy cover in a dense inner suburb}, + year = {2026}, + keywords = {tree canopy}, + booktitle = {Proceedings of the 23th Meeting on The Surface Urban Heat Island}, + pages = {243--248} +} + +@misc{urban228, + author = {Fenwright, Jonas and Yilmaz-Grant, Dario and Kettering, Cosmo and Thornbury, Hugo and Dunmore, Ines and Esterhazy-Lowe, Kaia}, + title = {Modelling heatwave mortality in three coastal cities}, + year = {2020}, + keywords = {air temperature, dataset, review}, + howpublished = {Dataset}, + publisher = {Westmarch Open Data} +} + +@inproceedings{urban229, + author = {Fenwright, Nils and Ellery, Wren and Rowntree, Rafael and Achterberg, Saoirse and Montaigne-Blake, Beatrix}, + title = {Measuring shade equity in informal settlements}, + year = {2015}, + keywords = {remote sensing, modelling}, + booktitle = {Proceedings of the 24th Meeting on Cool Roofs}, + pages = {212--218} +} + +@book{urban230, + author = {Tremaine, Desmond}, + title = {Forecasting land surface temperature in twelve European capitals}, + year = {2023}, + keywords = {heatwave}, + publisher = {Brindlemoor University Press}, + address = {Calder Bay} +} + +@incollection{urban231, + author = {Sandoval, Chiara and Lindqvist, Vesna and Zabala, Farid and Montaigne-Blake, Nils and Ravensworth, Hugo and Yardley, Kaia}, + title = {Mapping street canyon geometry in a northern industrial town}, + year = {2007}, + keywords = {albedo, green infrastructure, tree canopy}, + booktitle = {Perspectives On Street Canyon Geometry}, + editor = {Fenwright, Ada and Fairbairn, Ines}, + publisher = {Harrowgate & Lowe}, + address = {Port Ellery}, + pages = {124--145} +} + +@inproceedings{urban232, + author = {Esterhazy-Lowe, Hanne and Tremaine, Wilhelmina and Underhill, Leonie and Ulvaeus, Jonas}, + title = {Forecasting anthropogenic heat in informal settlements}, + year = {2023}, + keywords = {modelling}, + booktitle = {Proceedings of the 7th Meeting on The Surface Urban Heat Island}, + pages = {270--277} +} + +@incollection{urban233, + author = {Oakhurst, Ximena and Harwood, Tala and Ivesdale, Dario and Montaigne-Blake, Tobias}, + title = {Measuring heatwave mortality in a mid-latitude port city: lessons from a decade}, + year = {2008}, + keywords = {remote sensing, field campaign}, + booktitle = {New Directions In Green Roofs}, + editor = {Vantongeren, Luca and Lindqvist, Greta}, + publisher = {Harrowgate & Lowe}, + address = {Harrowgate}, + pages = {228--247} +} + +@article{urban234, + author = {Yilmaz-Grant, Tala and Calloway, Chiara}, + title = {Reducing air temperature networks in three coastal cities: new evidence}, + year = {2018}, + keywords = {modelling, review}, + journal = {Heat and Health Quarterly}, + volume = {23}, + number = {2}, + pages = {484--493} +} + +@article{urban235, + author = {Oakhurst, Hugo and Esterhazy-Lowe, Tala and Dunmore, Edda}, + title = {Explaining heat action plans in three coastal cities}, + year = {2015}, + keywords = {field campaign, tree canopy, mortality}, + journal = {Landscape and Microclimate}, + volume = {44}, + number = {6}, + pages = {209--217} +} + +@article{urban236, + author = {Abernathy, Edda and Nakashima, Amara and Ellery, Amara and Pellham, Zora and Wexford, Noor}, + title = {Mapping anthropogenic heat in a mid-latitude port city}, + year = {2012}, + keywords = {heatwave, review}, + journal = {Applied Urban Meteorology}, + volume = {29}, + number = {4}, + pages = {512--520} +} + +@misc{urban237, + author = {Yardley, Bram and Esterhazy-Lowe, Tobias and Calloway, Viktor}, + title = {Forecasting the surface urban heat island in a semi-arid metropolis}, + year = {2011}, + keywords = {heatwave, albedo, equity}, + howpublished = {Dataset}, + publisher = {Ostrava Vale Open Data} +} + +@article{urban238, + author = {Brightwater, Elif and Nakashima, Bram and Wexford, Bram}, + title = {Mapping tree canopy cover in a semi-arid metropolis: a comparison}, + year = {2012}, + keywords = {tree canopy, field campaign}, + journal = {Applied Urban Meteorology}, + volume = {1}, + number = {8}, + pages = {549--571} +} + +@article{urban239, + author = {Zabala, Rosa and Halloran, Yusuf and Ulvaeus, Yara and Jessamy, Tobias and Thornbury, Desmond}, + title = {Measuring the surface urban heat island in a river delta city: lessons from a decade}, + year = {2025}, + keywords = {mortality}, + journal = {Landscape and Microclimate}, + volume = {38}, + number = {9}, + pages = {529--536} +} + +@phdthesis{urban240, + author = {Larkspur, Rosa and Jessamy, Beatrix}, + title = {Monitoring anthropogenic heat in a mid-latitude port city}, + year = {2002}, + keywords = {remote sensing, equity}, + school = {University of Ostrava Vale} +} + +@article{urban241, + author = {Ulvaeus, Cosmo and Achterberg, Rosa and Fenwright, Amara and Varga, Desmond and Wexford, Dario}, + title = {Forecasting air temperature networks in a semi-arid metropolis}, + year = {1994}, + keywords = {cool roofs, air temperature}, + journal = {Landscape and Microclimate}, + volume = {45}, + number = {9}, + pages = {79--86} +} + +@book{urban242, + author = {Esterhazy-Lowe, Hugo and Dunmore, Ines and Rowntree, Kenji and Tremaine, Hanne and Harwood, Luca}, + title = {Comparing pavement albedo in twelve European capitals}, + year = {2004}, + keywords = {equity}, + publisher = {Harrowgate & Lowe}, + address = {Saltford} +} + +@article{urban243, + author = {Varga, Pavel and Marrowfield, Desmond and Ravensworth, Elif}, + title = {Forecasting blue spaces in a northern industrial town}, + year = {2002}, + keywords = {heatwave, remote sensing, air temperature}, + journal = {Landscape and Microclimate}, + volume = {46}, + number = {6}, + pages = {673--688} +} + +@article{urban244, + author = {Sandoval, Pavel}, + title = {Modelling land surface temperature in a mid-latitude port city}, + year = {1999}, + keywords = {air temperature}, + journal = {Journal of Urban Thermal Studies}, + volume = {16}, + number = {2}, + pages = {806--814} +} + +@article{urban245, + author = {Achterberg, Hanne and Zabala, Rosa and Ishikawa-Reed, Noor and Sandoval, Vesna}, + title = {Monitoring blue spaces in three coastal cities: a field study}, + year = {2024}, + keywords = {air temperature}, + journal = {Applied Urban Meteorology}, + volume = {48}, + number = {11}, + pages = {140--150} +} + +@article{urban246, + author = {Ravensworth, Viktor and Larkspur, Tobias and Ellery, Yara and Yilmaz-Grant, Dario and Calloway, Zora}, + title = {Reducing street canyon geometry in a dense inner suburb}, + year = {2001}, + keywords = {air temperature}, + journal = {Journal of Urban Thermal Studies}, + volume = {33}, + number = {12}, + pages = {770--791} +} + +@article{urban247, + author = {Zabala, Yusuf and Wexford, Wilhelmina}, + title = {Reducing heat action plans in a northern industrial town}, + year = {2014}, + keywords = {albedo, mortality, remote sensing}, + journal = {Heat and Health Quarterly}, + volume = {30}, + number = {4}, + pages = {154--174} +} + +@book{urban248, + author = {Oakhurst, Amara and Ulvaeus, Marisol}, + title = {Modelling land surface temperature in three coastal cities}, + year = {1994}, + keywords = {cool roofs, dataset}, + publisher = {Calder Bay Academic}, + address = {Harrowgate} +} + +@inproceedings{urban249, + author = {Whitlock, Saoirse and Delacourt, Tobias}, + title = {Explaining anthropogenic heat in a dense inner suburb}, + year = {2005}, + keywords = {field campaign, mortality}, + booktitle = {Proceedings of the 20th Meeting on Heat Action Plans}, + pages = {27--36} +} + +@book{urban250, + author = {Okonkwo-Hart, Ximena and Yardley, Dario}, + title = {Measuring outdoor thermal comfort in a northern industrial town}, + year = {2023}, + keywords = {review, remote sensing}, + publisher = {Brindlemoor University Press}, + address = {Lowen} +} + +@inproceedings{urban251, + author = {Varga, Ada and Kowalczyk, Uma and Whitlock, Dario and Larkspur, Zora and Underhill, Rosa}, + title = {Reducing pavement albedo in a northern industrial town}, + year = {1996}, + keywords = {cool roofs, modelling, green infrastructure}, + booktitle = {Proceedings of the 5th Meeting on Air Temperature Networks}, + pages = {50--58} +} + +@article{urban252, + author = {Vantongeren, Otto}, + title = {Measuring air temperature networks in a river delta city}, + year = {1999}, + keywords = {policy, albedo, mortality}, + journal = {Remote Sensing of Built Environments}, + volume = {13}, + number = {10}, + pages = {544--559} +} + +@article{urban253, + author = {Ulvaeus, Juno and Whitlock, Edda and Bellweather, Wren}, + title = {Explaining heatwave mortality in a mid-latitude port city}, + year = {2020}, + keywords = {heatwave, mortality, modelling}, + journal = {Applied Urban Meteorology}, + volume = {45}, + number = {10}, + pages = {137--152} +} + +@phdthesis{urban254, + author = {Larkspur, Greta and Okonkwo-Hart, Chiara}, + title = {Comparing green roofs in a mid-latitude port city: new evidence}, + year = {2009}, + keywords = {field campaign, policy, equity}, + school = {University of Ostrava Vale} +} + +@article{urban255, + author = {Quarrington, Greta}, + title = {Explaining green roofs in informal settlements}, + year = {1997}, + keywords = {albedo, field campaign}, + journal = {Cities and Climate Review}, + volume = {11}, + number = {5}, + pages = {465--490} +} + +@article{urban256, + author = {Fairbairn, Greta and Halloran, Vesna}, + title = {Explaining heatwave mortality in twelve European capitals}, + year = {2016}, + keywords = {equity}, + journal = {Cities and Climate Review}, + volume = {15}, + number = {12}, + pages = {740--762} +} + +@incollection{urban257, + author = {Ulvaeus, Rosa and Calloway, Rafael and Ishikawa-Reed, Ada and Esterhazy-Lowe, Tobias and Harwood, Viktor and Wexford, Luca}, + title = {Mapping the surface urban heat island in a dense inner suburb}, + year = {2025}, + keywords = {modelling, remote sensing}, + booktitle = {New Directions In Green Roofs}, + editor = {Vantongeren, Yara and Achterberg, Marisol}, + publisher = {Calder Bay Academic}, + address = {Saltford}, + pages = {264--292} +} + +@article{urban258, + author = {Yardley, Nils and Marrowfield, Ada and Galloway, Femi and Zabala, Cosmo and Montaigne-Blake, Farid}, + title = {Explaining anthropogenic heat in a semi-arid metropolis}, + year = {2016}, + keywords = {review}, + journal = {Journal of Urban Thermal Studies}, + volume = {31}, + number = {3}, + pages = {51--79} +} + +@inproceedings{urban259, + author = {Jessamy, Bram}, + title = {Explaining heatwave mortality in a river delta city: a field study}, + year = {2008}, + keywords = {cool roofs}, + booktitle = {Proceedings of the 8th Meeting on Pavement Albedo}, + pages = {298--305} +} + +@article{urban260, + author = {Whitlock, Noor}, + title = {Explaining heatwave mortality in informal settlements}, + year = {2006}, + keywords = {albedo, field campaign, modelling}, + journal = {Landscape and Microclimate}, + volume = {33}, + number = {1}, + pages = {250--278} +} diff --git a/docs/STYLE_ENGINE_BUILD.md b/docs/STYLE_ENGINE_BUILD.md index 00377c4..7a887cf 100644 --- a/docs/STYLE_ENGINE_BUILD.md +++ b/docs/STYLE_ENGINE_BUILD.md @@ -4,7 +4,7 @@ FormCite formats citations with `formcite_style`, a Rust module in `native/formc ## What is prebuilt, for which platforms -The module targets pyo3's stable ABI (`abi3-py310` in `native/formcite-style/Cargo.toml`), so one wheel per platform serves every supported Python (the engine needs 3.12 or newer). A Linux x64 build here gave `formcite_style-0.10.0-cp310-abi3-manylinux_2_34_x86_64.whl`, 2,141,532 bytes; the glibc tag follows the machine that built it. +The module targets pyo3's stable ABI (`abi3-py310` in `native/formcite-style/Cargo.toml`), so one wheel per platform serves every supported Python (the engine needs 3.12 or newer). The wheel's version is the crate's, which moves with the app's version at each release: a Linux x64 build at 0.14.0 gave `formcite_style-0.14.0-cp310-abi3-manylinux_2_34_x86_64.whl` (an earlier one at 0.10.0 was 2,141,532 bytes); the glibc tag follows the machine that built it. | Platform | Runner (as formcompiler names it) | In a release | In CI | | --- | --- | --- | --- | diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index db274e7..0fe5012 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -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.14.0 +Current build version: v0.15.0 Last updated: 2026-11-26 (US Eastern) · window skeleton: shell, engine store, window key, health status --- @@ -484,3 +484,68 @@ Run in v0.14.0 work (2026-11-27), no code changed. Trash "Deleted for good." in ## src/ui/connections.ts, src/ui/toast.ts {#src-asks-toast-follows-request} New in v0.14.0 (2026-11-27). The "asks to use your library" toast (key `connections-arrived`, raised in `bindConnections`) now follows the requests. `settleToast` runs on `request:remove` and `request:update`: if the toast is on screen and no unexpired request is left it calls the dismiss function `toast()` returned, and if one or more are left it rewrites the same node's text through the existing key. It never raises a toast that is not already showing. `toast()` takes `onOpen`, kept in a WeakMap by node; the root's one click listener runs it for a click anywhere but the close button, and the node gets inline `pointer-events: auto` and `cursor: pointer` only then, since `shell.css` sets `.fc-toast` to `pointer-events: none` and that file is not this slice's. The opener clicks the Connections nav item unless the panes already show it. Checked in a private built copy, 2,000 items, CPU 4x, 400 ms, 50 kB/s, fresh engine and data folder per load: Approve and Deny each took the toast away 0.62 s after the click (the leave transition and the next refresh), layout shift 0 and 0; two requests, one Deny left the toast with the other app's name, the second Deny removed it; a click on the toast text moved the window from Items to Connections. One 0.005 shift with recent input appeared in the two-request runs when Connections opened, which is the view switch and not the toast. + +## cite-home: Home, Preferences sections, shell commands, menu bar and dock wiring (v0.15.0) {#src-home-prefs-shell} + +Agent `cite-home`, 2026-12-01 EST. Files: `src/ui/home.ts` (new), `src/styles/home.css` (new), `src/ui/app.ts`, `src/ui/preferences.ts`, `src/styles/preferences.css`, `src/engine/commands.ts`, `src/engine/preferences.ts`, `src/io/look.ts`, `src/styles/shell.css`, `index.html`; backend `app/core/look_store.py`, `app/routers/look.py`. + +- Home is a sixth `.fc-view` (`data-pane="home"`), shown by `.fc-panes[data-view="home"]` in `home.css`. Its nav item is prepended to `.fc-nav` in `mountApp` before `bindConnections`, so the existing nav click handler switches to it. With "Show Home at launch" on, `mountApp` sets the view to `home` before the first paint (no swap after reveal). Home reuses what already works: the Add dialog (clicks its tab, then `.fc-add-open`), `Adding.identify` for Choose a PDF, the window-wide drop target for a dropped PDF, `sideApi` for counts (`/library/rows?limit=1`, collections, tags) and `readCurrentLibrary`. "Recent collections" is newest `created_at` first, six at most; the collections API has no use time, so recent means recently made. Tiles and cards have fixed heights; numbers arrive by `setText`, cards by `patchList`. +- `mountApp` now follows `library` `view` events into `panes.dataset.view` and the nav `is-active`, so a side-panel pick (which only calls `setView('library')`) also leaves Home, Trash or Preferences. `'home'` is passed as `ViewId` by cast; `engine/library.ts` was left alone. +- Preferences keeps every row and id it had, regrouped into FormVis's shape: a sticky rail of section tabs (accent fill on the current one), section cards with a fold head, and groups with an uppercase accent label. Sections: General (Show Home at launch), Appearance (theme, dark and light grids, all themes, accent; Details pane group with the title field slot), Network (lookups, recent calls), Libraries, Menus (only in the macOS desktop app: Menus in Window), Agents (Show the agent dock). Removed headings, quoted: `

...Appearance

`, `...Details pane...`, `...Network...`, `...Libraries...`; their content moved into the groups unchanged. The rail scrolls the pane body; a scroll spy marks the tab, held on the clicked tab until the next wheel, pointer or key in the pane. +- The 0.13.9 rule extends to three new look fields: `home` (`launch`/`off`), `menus` (`bar`/`window`), `dock` (`shown`/`hidden`, default hidden). They ride `PUT /api/window/look`, come back as `data-fc-home`, `data-fc-menus`, `data-fc-dock` on `html`, and the boot script copies them to `formcite.homeAtLaunch`, `formcite.menusInWindow` and `formcite.dockShown` ('1'/'0') before any module reads storage. Names have no underscore because `main.py` only replaces the first `_` in an attribute name. +- Menu bar row: the boot script sets `data-fc-menubar` to `native` exactly when `wantsNativeMenus()` in `ui/native-menu.ts` would be true (Tauri, Mac, `formcite.menusInWindow` not '1'), else `window`. `shell.css` gives `.fc-app` a first row `--fc-menu-row` (0 or `--fc-titlebar-h`, 40 px) holding `.fc-menubar-host`, so the bar's height exists before first paint. Removed line, quoted: `.fc-app { display: grid; grid-template-rows: minmax(0, 1fr) var(--fc-status-h); ...`. The dock's `terminal.css` redefines the rows with this variable. +- Commands: `registerShellCommands` registers `app.home`, `app.preferences` (`keys: 'Mod+,'`), `view.dock` (the dock handle's `toggle()`), `view.menus-in-window` (macOS desktop only; next start). `app.ts` also registers the menu ids that map to existing actions: `library.add`, `library.import`, `library.export`, `collection.new`, `edit.find`, `view.items`, `view.duplicates`, `view.trash`, `view.connections`, and calls `registerItemCommands`. A window keydown runs commands that carry `keys` when nothing earlier took the key (the menus' own key binder runs first in the window; with native menus it is the only binder in the page). Cmd or Ctrl+J is the dock's own capture-phase chord and is not registered again. +- Dock: `mountDock(.fc-app)` in the same task as the first render. The `dockShown` preference is the dock's open state: at mount it opens or closes the dock to match (before reveal), a MutationObserver on `data-ft-dock` writes changes made by the chord or the dock's own hide button back, and the Agents switch opens or closes it. +- Checked (verified under throttling): production build served by the engine from source (private venv, data folder with 300 items and 7 collections), Playwright with system Chrome, CPU 4x. First paint: view `home`, Home pane `grid`, bar row 40 px; with a fake macOS Tauri, `data-fc-menubar="native"` and a 0 px row. Theme pick Ocean: 0 nodes added or removed under `.fc-panes`; mode to Light: 1 (the mode hint text node). Home, Items, Preferences, Home switches: 0 nodes added or removed. Layout shift 0 on every load and action. Ctrl+, opened Preferences; a collection card opened Items on that collection; Import a file opened the Add dialog on Import. Dock by Ctrl+J and by the Agents switch: panes 836 to 556 px and back, status bar top unchanged at 876, layout shift entries none. Persistence: Ocean, dark, Home off and dock shown set in one engine run; after an engine restart and a fresh browser profile, DOMContentLoaded had `data-dark-theme="ocean"`, ground rgb(6, 19, 28), and the first ready frame showed Items with the dock open. +- `src/ui/side.ts` (cite-home, demos task, 2026-12-01 EST): the side pane now runs `refreshAll` on `library:switched`. Before this, switching libraries in Preferences reloaded Items but left the old library's collections and tags in the side pane until a reload. Found while opening the three demo libraries one after another. Checked under throttling: the side pane showed each demo's own collections and tag count after Switch. +- Known: with the fake Tauri the native menu build fails and the menus module falls back to an in-window bar inside the 0 px row, so it overlays the panes. In the real macOS app the native build succeeds; if it ever fails, `ui/menus.ts` should set `data-fc-menubar="window"` on its fallback. + +## src/styles/tokens.css, src/styles/light-mode.css {#src-family-tokens} + +New in v0.15.0 (2026-12-01, EST). FormCite's token file already carried most of FormVis's names (`--bg-primary`, `--text-primary`, `--accent-color`, `--surface-0`, `--line-*`, `--ctl*`, `--space-*`, `--radius*`) mapped from its own `--ground`, `--sheet`, `--surface`, `--text` and `--accent`, so nothing was renamed and no existing value moved. Added to the `:root` block, each derived from those same tokens so every theme in `themes.css`, the OLED flag and the accent choice (`--accent` set inline by `engine/preferences.ts`) carry them with no per-theme edit: `--space-3h` (14px, the fallback `preferences.css` already wrote), `--space-7`, `--radius-xs`, `--radius-xl`, `--fs-9`, `--fs-10`, `--fs-16`, `--fs-18`, `--ctl-lg`, `--ctl-xl`, `--bg-input`, `--bg-scrim`, `--surface-field`, `--group-head`, `--ease-glass`, `--accent-intensity`, `--accent-tint`, `--accent-tint-strong`, `--accent-soft`, `--accent-line`, `--accent-glow`, `--accent-ink`, the glass set (`--glass-bg` is `--surface-2` at 82%, `--glass-border` and `--glass-highlight` are `--text` at 16% and 12%, `--glass-filter` `blur(40px) saturate(1.8)`, `--glass-shadow`), `--ok-soft`, `--danger-fill-hover`, `--success-fill`, `--success-fill-hover`. Layers, in the one scale already in the file: `--z-under` -1, and the two the menus and dock agents need, `--z-menu` (equal to `--z-dropdown`, 400: above the chrome at 300 and the dock, below the scrim at 500 so a dialog still covers the bar) and `--z-dock` 350, plus the family aliases `--z-modal` (`--z-overlay`, 600) and `--z-context` (`--z-popover`, 700). FormVis's own numbers (menu 200, context 2000) were not used: FormCite's components already sit on 100 to 1000 and moving them would reorder shipped layers. The dock adapter's `layers: ['--z-raised', '--z-overlay']` both exist. `light-mode.css` gains one `:root[data-theme="light"]` block: `--group-head` to `--surface-2`, `--bg-scrim` `rgba(40, 36, 28, 0.45)`, a lighter `--glass-shadow`; the one line it had, `:root[data-theme="light"] .fc-toast { box-shadow: var(--shadow-lg); }`, is kept. FormVis keys light on `body.theme-light`; FormCite keys it on `data-theme` on `html`, so the selector stays FormCite's. `scrollbars.css` already matched FormVis's `scrollbars.css` rule for rule (no bar drawn, both engines, `!important`), so it is unchanged. Raw z-index: the 7 in `src/` were all `var(--z-*)` already, 0 raw numbers in CSS, TS or `index.html`, so no occurrence was edited. Noted, not mine: `titles.css` still reads `var(--rv-line)`, which v0.12.0 removed, so `.fc-tt-row` has an invalid `grid-template-rows` (the row heights fall to auto). Checked: a private build of the work tree (`npm run build` passes `tsc --noEmit`) served by `vite preview --port 5602` with the engine on 8601 and 36 items; all 21 themes read back non-empty for 20 of the new names, with `--glass-bg` following each theme's `--surface-2`; Items and Preferences at 1440 by 900, dark and light, before and after, in `captures/formcite/aesthetic-check/` (CPU 4x on the Chromium session). These tokens add names and change no used value, so the Items and Preferences pixels differ only where other agents' work (the in-window menu bar, Home) landed in the same tree. Layout shift and flash were not measured for this slice: no node, rule or used value changed. + +## src/dock/, src/dock-adapter.ts, src/styles/dock-tokens.css, src/styles/terminal.css, package.json {#src-agent-dock} + +New in v0.15.0 (2026-12-01 13:40 EST, agent `cite-dock`). The family's agent dock, module 2.2.1. `src/dock/` is the shared module: every file written out from FormVis 2.9.0's folder and checked against its `MANIFEST.json`, 15 of 15 SHA-256 equal, the manifest itself equal to FormVis's and FormDeck's. Nothing in that folder is FormCite's; a change there is a change in FormVis first. The adapter and the two style files are FormCite's own, after FormDeck's adapter (the cleaner of the two references) and FormVis's. + +`mountDock(host)` in `dock-adapter.ts` returns `{ toggle, open, close }`. It runs `reserveDock()` first, which writes `data-ft-dock`, `data-ft-dock-side`, `data-ft-dock-h`, `data-ft-dock-w` and `--ft-dock-size`, `--ft-dock-wsize` on `html` from `formcite.dock` in storage, each only when it differs, then mounts the dock as a direct child of `host` before `.fc-status`. `host` is `.fc-app`. `reserveDock` is exported so the entry can call it before the first paint; mounting in the same task as the first render does the same. `terminal.css` reserves the dock's grid row: `.fc-app` becomes `var(--fc-menu-row, 0px) minmax(0, 1fr) var(--ft-dock-h) var(--fc-status-h)`, the panes stay in row 2, the dock takes row 3, the status bar row 4; closed, `--ft-dock-h` is 0 and the dock is `display: none`, so nothing moves while it is closed. On the right side the dock takes row 2, column 2 at `--ft-dock-w`. The toast root is lifted by the dock's height while it is open. Selectors start at `:root .fc-app` so they win over `shell.css` without depending on load order. The three stylesheets are imported by `dock-adapter.ts`, so `index.html` needs no new link; Vite puts them in the built CSS. No z-index is written here: the module uses `--z-raised` and `--z-overlay` from `tokens.css`. + +Adapter choices. Tabs: shell, Claude Code, Codex, Cursor, Antigravity; no Chat tab, because FormCite has no Claude Code chat engine, so the ask line opens Claude Code with the text as its first prompt. No `consent` and no `storedChoice`: outside agents pair under Connections (backend `app-agent-dock` says why). Chord Cmd+J on macOS, Ctrl+J elsewhere, also the backquote key. Button, input and note classes: `fc-btn`, `is-primary`, and three small classes in `terminal.css` (`fc-dock-ibtn`, `fc-dock-input`, `fc-dock-note`), since the window had no icon button or text input class. The stream opens with a one-time ticket bought with the window key. 409 maps to `notInstalled`, 403 to `refused`, 404 and 405 to `oldEngine`. Theme: the module already watches `data-theme`, `style` and `class` on `html`; the adapter adds `data-dark-theme`, `data-light-theme`, `data-theme-pref` and `data-oled`. Sentences: the module's, with four overridden so none mentions a Chat tab. + +`package.json`: `@xterm/xterm` 6.0.0 and `@xterm/addon-fit` 0.11.0, pinned, the versions FormVis and FormDeck use, MIT, in NOTICE. `src/dock/terminal.ts` loads them with a dynamic import when the first terminal opens. + +Run: `npx tsc --noEmit` clean; the dock folder and adapter also compiled with `noUnusedLocals`, `noUnusedParameters`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `verbatimModuleSyntax`, `noImplicitOverride` and `noImplicitReturns` (the contract's port check): no error in those files. The engine side was run over the WebSocket (backend `app-agent-dock`). Not verified in a browser: the dock is not yet mounted by the entry, which is the home agent's wiring. + +## src/styles/titles.css {#src-titles-line-token} + +`.fc-tt-row`'s `grid-template-rows` and `.fc-tt-known`'s `line-height` read `var(--rv-line)`, which `ef4f1fb` removed from `review.css`, so the row's grid template was invalid and the browser dropped it. `.fc-tt` now sets `--rv-line: 24px`, the value it had before that commit, scoped to the Titles view only. Before: `.fc-tt { --tt-row: 112px; --tt-strip: 28px; --tt-sug-max: 260px; }`. + +## src/ui/menu.ts, src/ui/native-menu.ts, src/ui/menus.ts, src/styles/menu.css, src/ui/itemlist.ts {#src-menus} + +New in v0.15.0 (2026-12-01 EST), agent `cite-menus`. FormCite had no menus. `menu.ts` is FormVis 2.9.0's `ui/menu.ts` ported by hand with FORM-MENU-OVERLAP-FIX 1.2.0 in it from the start: `PopupMenu` with `openUnder` (bar menus: top fixed at the button's bottom plus 4, never moved up), `openAt` (point menus: below and right of the pointer, flipped above or left when there is no room, top never above `barFloor()`, the `.fc-menubar` bottom plus 4, or 4 when no bar shows), `openBeside` (submenus: the root's floor and the same cap). `menuCap(top)` is `min(75% of innerHeight, innerHeight - top - 4)` and is set inline as `max-height` before the panel is measured, while it is `visibility: hidden`. The card does not scroll; its rows sit in `.fc-menu-list`, which scrolls and carries the mask, so the fade goes into the card's own glass. `showMore(true)` on every open sets `no-fade`, sets `has-more`, forces style, then drops `no-fade`, so a cut menu opens with the pill already at full opacity. Left out of the port: FormVis's i18n, `trimMenu` and item colours (FormCite has none of them), and its `Commands` class: rows read a `MenuSource` (has, label, keys, enabled, checked, run) because FormCite's `CommandRegistry` has only id, title and run. The panels go into `document.body` at `--z-popover`, not into `#overlay-root`, which has `pointer-events: none` and sits at `--z-overlay`, the Add dialog's layer. A standalone menu (the row menu) has its own key handling: arrows, Home, End, Enter, Space, Left and Right for submenus, Escape back to where focus was, Tab closes; it closes on an outside press, blur and resize. Bar menus close on resize too, which is how they follow the window height. + +`native-menu.ts`: `wantsNativeMenus()` is Tauri plus Mac plus not `formcite.menusInWindow` = `'1'` (the key cite-home's shell pref writes). `NativeMenus` builds the macOS menu bar through `@tauri-apps/api/menu` from the same `MenuDef` list: an app menu (About with version and GPL-3.0-only, Home, Preferences, Services, Hide, Hide Others, Show All, Quit), then File to Help. Edit's text commands and Window's are Tauri predefined items, which send the standard selectors to the first responder, so Cmd+V pastes into a focused field with no app paste competing; that is why no Rust `text_edit` call was needed (the bridge exists but nothing new uses it) and no Rust file changed. Accelerators come from the same `keys`; one Tauri cannot express is left off rather than failing the menu. Enabled and check states refresh 150 ms after pointer, key and focus events. If building fails, the in-window bar is mounted instead and `html[data-fc-menubar]` is set to `window` so the row cite-home reserves opens to 40 px. Removed before commit, in favour of cite-home's `setShellPref`: `export function setMenusInWindow(on: boolean): void { try { if (on) localStorage.setItem(MENUS_IN_WINDOW_KEY, '1'); else localStorage.removeItem(MENUS_IN_WINDOW_KEY); } catch { void 0; } }`. + +`menus.ts`: labels and keys live in `ENTRIES`; `MENUS` is File, Edit, View (with an Appearance submenu: System, Light, Dark through `chooseTheme`, so the engine's theme state stays in step), Library, Window, Help; the in-window bar adds a FormCite menu first. Built in, not in the registry: `edit.*` (the field focused last, refocused, then `execCommand`; Paste reads the clipboard and inserts text), `window.*` (Tauri window calls, shown only inside Tauri; Full Screen only in the system menu), `app.about` and `help.about` (a toast with the version), the Appearance rows. Everything else goes to the `run` the entry passes. In-window, every `Mod+` key in `ENTRIES` except the text edits is bound once on `window`; it skips while a menu or dialog is open, and skips A, C, V, X, Z, Backspace and Delete while a text field has focus. Under the system menu the accelerators do this instead, so a key never runs twice. Row menu: `ui/itemlist.ts` got one hand-made edit, a `contextmenu` listener on the list's scroller that selects the row and loads `openRowMenu` by dynamic import (no new import line at the top); the keyboard context-menu key opens it under the selected row. Rows: Open Attachment (first attachment, `POST /library/attachments/{id}/open`), Copy Citation and Copy Bibliography Entry (`POST /api/format/cite` and `/bibliography` with the first of `GET /api/format/styles` common styles, apa today, to the clipboard), Move to Trash (`POST /library/items/{id}/trash`, then `itemsRemoved`). "Show in collection" is left out: no call returns an item's collections. `registerItemCommands(engine)` registers the same four as `item.*` for the Library menu. + +`menu.css`: section 3a's CSS with `fc-` names. `--glass-bg` is the token; `--glass-border` and `--glass-filter` are not in `tokens.css` yet, so `var()` falls back to `--border-strong` and `blur(20px) saturate(1.4)`. + +Checked (throwaway page in /tmp built with this repo's Vite from these files, headless Chrome, served on 5677): bar menus at 1871x1080, 1280x720, 1000x480 and 800x320, CPU 4x: every menu top 33 under a bar bottom of 29 in each of the first frames, at most 75% tall, inside the window, End reaches the last row and it is visible. View > Appearance at all four: top 161, 98 tall, under the bar. Row menu at 1280x800, 1871x1080, 1000x480, CPU 4x, right-clicks high, low and low right: each opens with a corner on the pointer (flipped above or left at the bottom and right), top at least 70, never over the bar; at 1000x200 it is capped to 150, top 33, with the hint. Hint at 1000x260, CPU not slowed: Edit and View open with the pill at opacity 1 in the first frame; scrolled to the end 0.41 at 68 ms, 0.29 at 85 ms, 0 by 351 ms; scrolled up 120 px 0.62 at 229 ms, 1 by 730 ms; End hides it, Home brings it back; Help (fits) shows none; arrowing down View, the focused row never sits inside the fade while the hint shows. At 1000x130 the cut submenu shows the hint. Not run: the real window with an engine and items (the row menu was opened on stand-in rows through `openRowMenu`), the macOS system menu (no Mac here). + +## src/io/window-key.ts {#src-window-key-once} + +Since 0.15.0 four callers ask for the window key as the window starts (`ui/app.ts` start, `ui/home.ts`, `ui/preferences.ts`, `ui/status.ts`). In launch mode the first caller took the launch code and set `launched`; a second caller arriving before the first answer got `false`, so start showed the lasting toast "The engine did not accept this window" although the key was granted. Without a launch code the later calls posted again, got 409, and `key = await exchange()` wrote `''` over the good key, so every write and the dock terminal were refused. Now one claim runs at a time: every caller gets the same pending promise until it settles, and a failed exchange never clears a key already held. Before: `if (key) return true; const code = takeLaunchCode(); if (code) { launched = true; key = await exchange({ code }); return key !== ''; } if (launched) return false; key = await exchange(); return key !== '';`. + +## src/engine/itemlist.ts · stale rows after a search {#src-itemlist-stale-search} + +Fixed in v0.15.0 (2026-12-01 EST, agent `cite-home`). Report: after searching, the Items list could show rows past the engine's count. The code is the same as 0.14.0 (engine and io identical to the untouched copy; ui only gained the row menu), so any fault predates 0.15.0. + +Cause, in `ItemListModel`: `reload()` started the fresh first page but kept `ready` true and the old query's rows in the cache until that page landed. Any `paint()` in that window (a scroll, a row answer) called `ensure()`, which asked for pages of the new query, sized by the old total, at offsets the cache did not hold. If one of those answers came back before the fresh page, `res.total !== this.total` made it set the new total and `reset()`. That painted the old query's cached rows under the new count until the fresh page replaced them. Rows past a shrinking total also stayed in the cache. They were hidden by `paint()` but kept in `index`, so keys and selection could still find them. + +Fix: a `settled` flag, cleared by `reload()` and set only when the generation's fresh page lands. `ensure()` asks for nothing until then, so no page of a new query can land on the old cache. While the list is not settled, inserts and removals reload instead of committing over old rows, because `commit` also aborted the fresh page. Each load records the query it asked (`where()` as JSON). An answer is applied only when its generation, the generation's fresh query (`asked`) and the current query all match, so an older search can never write over a newer one. `trim()` drops cache entries and their `index` entries at or past the total after every new total (fresh, changed total, and `commit`), and rows an answer gives past its own total are not stored. Nothing in the DOM is rebuilt: `paint()` still hides pool rows past the total and recycles the rest in place. Removed lines, quoted: `if (!this.ready) return;` (first line of `ensure`, now `if (!this.ready || !this.settled) return;`), `const res = await fetchRows({ scope: this.lib.scope, q: this.lib.query, sort: this.lib.sort, offset, limit }, ctl.signal);`, `if (gen !== this.generation) return;`, `res.rows.forEach((r, k) => { this.cache.set(res.offset + k, r); this.index.set(r.id, res.offset + k); });`. + +Checked (verified under throttling): the urban-heat demo (260 items), built window, CPU 4x, through the engine from source. A script typed 14 steps per round as fast as 5 to 10 ms per key: narrow to 5 or 6 results, clear, narrow again, backspace, retype. It scrolled to the bottom after every step, with network latency 0 and 250 ms, for 3 and 4 rounds. At every step no row was shown at an index at or past the status count. After each round settled, the count equalled the engine's total for the search box text and every shown row was in the engine's answer. The old build passed these runs too: the race needs a page of the new query to come back before the fresh page, which these runs did not hit, so the fault was not reproduced as a settled state here. With no search, a deep scroll still loaded rows 200 to 259; with `heat`, 140 rows to index 139, none pending; layout shift none. + +## src/ui/menu.ts · bar menus open under the bar's row {#src-menu-under-row} + +The independent check measured the bar menus' top at 36 while the menu bar row ends at 40: `MenuBar.open` opened each menu at its 24 px button's bottom plus 4, and the button is centred in the 40 px row, so the menu started inside the row (FORM-MENU-OVERLAP-FIX rule 1 and section 5). Right-click menus already used `barFloor()` (the row's bottom plus 4, 44). The bar now opens at the larger of the two, so both kinds share the same floor. Before: `b.menu.openUnder(r.left, r.bottom + 4);`. diff --git a/frontend/index.html b/frontend/index.html index 0f82bc2..e455f11 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -50,6 +50,9 @@ kd = kd && typeof kd === 'object' && !Array.isArray(kd) ? kd : {}; kt.theme = mode; kt.accentColor = accent; kd.titleField = ft === 'grow' ? 'grow' : 'fixed'; + localStorage.setItem('formcite.homeAtLaunch', d.getAttribute('data-fc-home') === 'off' ? '0' : '1'); + localStorage.setItem('formcite.menusInWindow', d.getAttribute('data-fc-menus') === 'window' ? '1' : '0'); + localStorage.setItem('formcite.dockShown', d.getAttribute('data-fc-dock') === 'shown' ? '1' : '0'); localStorage.setItem('formcite.theme', JSON.stringify(kt)); localStorage.setItem('formcite.look', JSON.stringify(look)); localStorage.setItem('formcite.detail', JSON.stringify(kd)); @@ -62,6 +65,9 @@ d.setAttribute('data-light-theme', look.light); if (look.dark === 'amoled') d.setAttribute('data-oled', ''); if (accent) d.style.setProperty('--accent', accent); + var inWindow = true; + try { inWindow = !('__TAURI_INTERNALS__' in window && /Mac/.test(navigator.platform)) || localStorage.getItem('formcite.menusInWindow') === '1'; } catch (e) { inWindow = true; } + d.setAttribute('data-fc-menubar', inWindow ? 'window' : 'native'); })(); @@ -75,6 +81,7 @@ + diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2b4a7b3..9e69f1d 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,14 +1,20 @@ { "name": "formcite", - "version": "0.14.0", + "version": "0.15.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "formcite", - "version": "0.14.0", + "version": "0.15.0", "license": "GPL-3.0-only", + "dependencies": { + "@tauri-apps/api": "2.12.5", + "@xterm/addon-fit": "0.11.0", + "@xterm/xterm": "6.0.0" + }, "devDependencies": { + "@tauri-apps/cli": "2.12.5", "typescript": "7.0.2", "vite": "8.3.5" }, @@ -363,6 +369,233 @@ "dev": true, "license": "MIT" }, + "node_modules/@tauri-apps/api": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.12.5.tgz", + "integrity": "sha512-G9QIMt5fzED+aS4QhVK3w1HWLKpLIwH/MnpCr9z1ugGEHnS2ORmqrLkc0uALOjRK4qXJy+4Yiw8LDl/KicC1Hg==", + "license": "Apache-2.0 OR MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + } + }, + "node_modules/@tauri-apps/cli": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.12.5.tgz", + "integrity": "sha512-Dm8s/4aiE52HsBh+Gz3uSrh+fEykRICA1VoAnQA80IqHoTRncPg+q4rGvuhmyNsHUPg3QrPjUrTUSfWmXLVVEw==", + "dev": true, + "license": "Apache-2.0 OR MIT", + "bin": { + "tauri": "tauri.js" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + }, + "optionalDependencies": { + "@tauri-apps/cli-darwin-arm64": "2.12.5", + "@tauri-apps/cli-darwin-x64": "2.12.5", + "@tauri-apps/cli-linux-arm-gnueabihf": "2.12.5", + "@tauri-apps/cli-linux-arm64-gnu": "2.12.5", + "@tauri-apps/cli-linux-arm64-musl": "2.12.5", + "@tauri-apps/cli-linux-riscv64-gnu": "2.12.5", + "@tauri-apps/cli-linux-x64-gnu": "2.12.5", + "@tauri-apps/cli-linux-x64-musl": "2.12.5", + "@tauri-apps/cli-win32-arm64-msvc": "2.12.5", + "@tauri-apps/cli-win32-ia32-msvc": "2.12.5", + "@tauri-apps/cli-win32-x64-msvc": "2.12.5" + } + }, + "node_modules/@tauri-apps/cli-darwin-arm64": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.12.5.tgz", + "integrity": "sha512-VVvBRBdTFF7BP7RqGeItp9yDiyXj0DI1laRCEN2q6GLrNkw4wrHeWAxHp23PwtQtn/XET+yTN1jOKrq+Yor5PQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-darwin-x64": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.12.5.tgz", + "integrity": "sha512-A84QYNj93kaG06N2mIFBRZM/X3lf9TyAVQeQwOmP2AJZ2wCt1WLDJgHRCvjeJmwJjJ5Ud0jUbIKbXg8NEGvsVQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.12.5.tgz", + "integrity": "sha512-tb/5xG5HV6CJR9AZBmTyI2GCi05vcH8XUjUIjBquAx7x+AE4f1vMWngvq7JW2AqYK8nNl79LJH1GR9Hf5QQc5g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-gnu": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.12.5.tgz", + "integrity": "sha512-Vb7SlbIWlmIqekfsGYT64wH1cQNg5MET8XFyT6pUlVJ7Y/z6LsOIh4MUal0Z5FCPL83GMuEUNxpYUHpt36teHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-musl": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.12.5.tgz", + "integrity": "sha512-b/YfVGueoTOtENQHY1STBF9XlU4uZDtOiMUErp2Nao/YrDWCKggjxxBZU3ycbeDWUYxl8U8M9seE4HYag1xjiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-riscv64-gnu": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.12.5.tgz", + "integrity": "sha512-/EXbTfE9FM9GKSSRL9YTRHcMglTVNzbcwegXM0MBR3ozVgoE+pFq46Ej/InJBs1l+sjSpu6jyi38MZ+xyU/3NQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-gnu": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.12.5.tgz", + "integrity": "sha512-OIun574QsULxaZ5SmPDX4D8bO95RBmYJshu8yGFy0RSyCMKEs/y+o3BThot4fbCv4ttC1Tq6Hzt0QRHXCIgp7w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-musl": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.12.5.tgz", + "integrity": "sha512-GDzWcb/6OzJrHnVGQ/n3XndLan67bZ7cu4zJN9+zFmV10nBgKz5jDDm8sRQO4sGb7bu6Ztiy+Al2XY2ptRY0RQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-arm64-msvc": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.12.5.tgz", + "integrity": "sha512-61KCX5vo0vex7P/P7sbXdfFhHqs+rFaG+UXK/UBwz/VlLveDx6vgpHkF+rfUIfCqj0VvLArpxR3+rQIzRwxKgw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-ia32-msvc": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.12.5.tgz", + "integrity": "sha512-mGujjR/MlXwJiQcue4wlXrBYlIEdDCoap0g+GNPlLCb75ilSbWMC8qTsXVuGcLIMumIJvc2v+veDnCHnels/Zg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-x64-msvc": { + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.12.5.tgz", + "integrity": "sha512-o1+EOjvi/nFwKx5XamCXSr+GUr2ko8TH7+0wnWuZjE+lZwE+/VWCbE49HPHa3/V59M3bJ0dlK1yhogGQ15OVPg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@tybys/wasm-util": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz", @@ -714,6 +947,21 @@ "node": ">=16.20.0" } }, + "node_modules/@xterm/addon-fit": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz", + "integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==", + "license": "MIT" + }, + "node_modules/@xterm/xterm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", + "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==", + "license": "MIT", + "workspaces": [ + "addons/*" + ] + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", diff --git a/frontend/package.json b/frontend/package.json index 40caf1a..0081fc6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "formcite", "private": true, - "version": "0.14.0", + "version": "0.15.0", "description": "FormCite: a local-first personal research library from the Form family", "license": "GPL-3.0-only", "type": "module", @@ -14,7 +14,13 @@ "preview": "vite preview", "check": "tsc --noEmit" }, + "dependencies": { + "@tauri-apps/api": "2.12.5", + "@xterm/addon-fit": "0.11.0", + "@xterm/xterm": "6.0.0" + }, "devDependencies": { + "@tauri-apps/cli": "2.12.5", "typescript": "7.0.2", "vite": "8.3.5" } diff --git a/frontend/src/dock-adapter.ts b/frontend/src/dock-adapter.ts new file mode 100644 index 0000000..872c6eb --- /dev/null +++ b/frontend/src/dock-adapter.ts @@ -0,0 +1,152 @@ +import type { DockAdapter, DockAgentStatus, DockChannel, DockProgram, DockState, DockTerminal, PtyKind } from './dock/adapter'; +import { Dock } from './dock/dock'; +import { EngineError } from './io/api'; +import { keyHeaders } from './io/window-key'; +import { isMac } from './ui/dom'; +import './styles/dock-tokens.css'; +import './dock/dock.css'; +import './styles/terminal.css'; + +export const DOCK_KEY = 'formcite.dock'; +export const DOCK_SIZES = { minHeight: 140, maxHeightShare: 0.7, defaultHeight: 280, minWidth: 380, maxWidthShare: 0.6, defaultWidth: 460, keepWidth: 520 }; +const RIGHT_FROM = 980; +export type OwnKind = 'antigravity'; +const KINDS: Array = ['shell', 'claude', 'codex', 'cursor', 'antigravity']; +const PROGRAMS: Array = ['claude', 'codex', 'cursor', 'antigravity']; + +export interface DockHandle { toggle(): void; open(): void; close(): void } + +async function call(path: string, method = 'GET', body?: unknown): Promise { + const headers: Record = body === undefined ? keyHeaders() : { 'content-type': 'application/json', ...keyHeaders() }; + const r = await fetch(`/api${path}`, body === undefined ? { method, headers } : { method, headers, body: JSON.stringify(body) }); + if (!r.ok) { + const said = (await r.json().catch(() => ({}))) as { detail?: unknown }; + throw new EngineError(typeof said.detail === 'string' ? said.detail : r.statusText, r.status); + } + return r.json() as Promise; +} + +export function reserveDock(): void { + const html = document.documentElement; + let s: Partial = {}; + try { + const raw = localStorage.getItem(DOCK_KEY); + const own: unknown = raw ? JSON.parse(raw) : null; + s = own && typeof own === 'object' ? own as Partial : {}; + } catch { s = {}; } + const z = DOCK_SIZES; + const maxW = Math.min(window.innerWidth * z.maxWidthShare, window.innerWidth - z.keepWidth); + const h = Math.round(Math.max(z.minHeight, Math.min(window.innerHeight * z.maxHeightShare, typeof s.h === 'number' ? s.h : z.defaultHeight))); + const w = Math.round(Math.max(z.minWidth, Math.min(maxW, typeof s.w === 'number' ? s.w : z.defaultWidth))); + const right = s.side === 'right' && window.innerWidth >= RIGHT_FROM && maxW >= z.minWidth; + const want: Array<[string, string]> = [['data-ft-dock', s.open === true ? 'open' : 'closed'], ['data-ft-dock-side', right ? 'right' : 'bottom'], ['data-ft-dock-h', String(h)], ['data-ft-dock-w', String(w)]]; + for (const [name, value] of want) if (html.getAttribute(name) !== value) html.setAttribute(name, value); + const sizes: Array<[string, string]> = [['--ft-dock-size', `${h}px`], ['--ft-dock-wsize', `${w}px`]]; + for (const [name, value] of sizes) if (html.style.getPropertyValue(name) !== value) html.style.setProperty(name, value); +} + +function socketChannel(socket: WebSocket): DockChannel { + let data = (_chunk: string | Uint8Array): void => undefined; + let exit = (): void => undefined; + let closed = (): void => undefined; + socket.binaryType = 'arraybuffer'; + socket.addEventListener('message', (msg) => { + if (typeof msg.data === 'string') { data(msg.data); return; } + try { if ((JSON.parse(new TextDecoder().decode(msg.data as ArrayBuffer)) as { type?: string }).type === 'exit') exit(); } catch { return; } + }); + socket.addEventListener('close', () => closed()); + const send = (frame: string): void => { + if (socket.readyState === WebSocket.OPEN) socket.send(frame); + else if (socket.readyState === WebSocket.CONNECTING) socket.addEventListener('open', () => socket.send(frame), { once: true }); + }; + return { + send: (chunk) => send(JSON.stringify({ type: 'input', data: chunk })), + resize: (cols, rows) => send(JSON.stringify({ type: 'resize', cols, rows })), + onData: (handler) => { data = handler; }, + onExit: (handler) => { exit = handler; }, + onClose: (handler) => { closed = handler; }, + close: () => socket.close(), + }; +} + +interface EngineTerminal { id: string; title: string; kind?: string; alive?: boolean; tip?: string } +type Said = Partial>; +const text = (v: unknown): string => (typeof v === 'string' ? v : ''); +const record = (x: EngineTerminal): DockTerminal => ({ id: x.id, title: x.title, alive: x.alive !== false, kind: KINDS.find((k) => k === x.kind) ?? 'shell', ...(x.tip ? { tip: x.tip } : {}) }); +const mod = (e: KeyboardEvent): boolean => (isMac ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey); + +export function formciteDock(): DockAdapter { + const words = { app: 'FormCite', noun: 'library', start: './formcite boot' }; + return { + words: { ...words, example: 'find the items with no year and fill them in', lead: 'Ask an agent to work on your library through FormCite.' }, + strings: { + askPlaceholder: 'Ask Claude Code to work on your {noun}', + empty: 'No terminal is open. Start a shell with the plus button or Claude Code with the agent button.', + tourPanelBody: 'This panel runs a terminal, or an agent such as Claude Code, beside your {noun}. It stays out of the way until you open it.', + tourChatBody: 'Type what you want in this line, for example "{example}", and press Enter. Claude Code opens in a tab and works in {app}.', + }, + placement: { + mode: 'own', + storage: { key: DOCK_KEY }, + sizes: DOCK_SIZES, + canDockRight: () => window.innerWidth >= RIGHT_FROM, + }, + isDockChord: (e) => mod(e) && !e.altKey && !e.shiftKey && (e.code === 'Backquote' || e.code === 'KeyJ'), + chordLabel: () => `${isMac ? 'Cmd' : 'Ctrl'}+J`, + tabs: () => ({ builtin: ['shell', 'claude', 'codex', 'cursor', 'antigravity'] }), + classes: { iconButton: 'fc-dock-ibtn', button: 'fc-btn', primaryButton: 'is-primary', input: 'fc-dock-input', select: 'fc-dock-input', note: 'fc-dock-note' }, + t: (_key, english) => english, + onTheme: (handler) => { + new MutationObserver(handler).observe(document.documentElement, { attributes: true, attributeFilter: ['data-dark-theme', 'data-light-theme', 'data-theme-pref', 'data-oled'] }); + }, + keyHeaders, + errors: { + message: (err) => (err instanceof EngineError ? err.message : null), + kind: (err) => { + if (err instanceof TypeError) return 'unreachable'; + if (!(err instanceof EngineError)) return null; + if (err.status === 403) return 'refused'; + if (err.status === 409) return 'notInstalled'; + if (err.status === 404 || err.status === 405) return 'oldEngine'; + return err.status === 502 || err.status === 503 || err.status === 504 ? 'unreachable' : null; + }, + }, + terminal: { + list: async () => (await call<{ terminals: EngineTerminal[] }>('/terminal')).terminals.map(record), + open: async (kind, o) => { + const size = { cols: o.cols, rows: o.rows }; + if (kind === 'shell') return record(await call('/terminal', 'POST', size)); + if (kind === 'claude') return record(await call('/terminal/claude', 'POST', { ...size, ...(o.prompt ? { prompt: o.prompt } : {}), ...(o.resume ? { resume: o.resume } : {}) })); + return record(await call('/terminal/agent', 'POST', { ...size, kind })); + }, + restart: async (id) => { await call(`/terminal/${encodeURIComponent(id)}/restart`, 'POST', {}); }, + close: async (id) => { await call<{ ok: boolean }>(`/terminal/${encodeURIComponent(id)}`, 'DELETE'); }, + channel: async (id) => { + const { ticket } = await call<{ ticket: string }>('/terminal/ticket', 'POST', {}); + const proto = location.protocol === 'https:' ? 'wss:' : 'ws:'; + return socketChannel(new WebSocket(`${proto}//${location.host}/api/terminal/${encodeURIComponent(id)}/stream?ticket=${encodeURIComponent(ticket)}`)); + }, + }, + agentStatus: async () => { + let said: Said; + try { said = await call('/agent/status'); } catch { return null; } + const out: DockAgentStatus = {}; + for (const kind of PROGRAMS) { + const s = said[kind]; + if (s) out[kind] = { installed: s.installed === true, version: text(s.version) || null, install: text(s.install), signedIn: typeof s.signedIn === 'boolean' ? s.signedIn : null, ...(text(s.note) ? { note: text(s.note) } : {}) }; + } + return out; + }, + }; +} + +export function mountDock(host: HTMLElement): DockHandle { + reserveDock(); + const dock = new Dock(formciteDock()); + dock.mount(host, host.querySelector(':scope > .fc-status')); + return { + toggle: () => dock.toggle(), + open: () => { if (!dock.isOpen()) dock.toggle(true); }, + close: () => { if (dock.isOpen()) dock.toggle(false); }, + }; +} diff --git a/frontend/src/dock/CONTRACT.md b/frontend/src/dock/CONTRACT.md new file mode 100644 index 0000000..81f3a05 --- /dev/null +++ b/frontend/src/dock/CONTRACT.md @@ -0,0 +1,77 @@ +# The dock's engine contract + +Module version 2.2.1. This file travels with the shared dock folder and is the same in every app. + +The dock's frontend never talks to an engine. It calls the functions of `DockAdapter` (adapter.ts), and each app's adapter turns them into its engine's routes, sockets or event streams. This file says what an engine has to provide so that an adapter can deliver each function, in words that do not depend on the engine's language. Paths, header names and transports are each app's own. Where a clause says "the adapter", the engine may do the work instead; where it says "the engine", the adapter cannot make it up. + +Sixteen clauses. An engine that lacks one says so in its app's port notes and the adapter leaves the matching member out; the module then hides what depends on it. + +## Who may call + +1. **The caller.** Every route and stream acts for a caller the app identifies by its own means (a window key, a session cookie). Terminal tabs and the Chat conversation belong to that caller, and a list returns only theirs. An agent's credential is never accepted for these routes: the dock is the person's. +2. **Stream authentication is the app's.** A stream may need a one-time ticket, a first message carrying a key, or a cookie. The adapter hides this: `terminal.channel(id)` and `chat.subscribe(handlers)` may take an asynchronous step before the stream opens. A ticket is bought with the caller's own credential, is spent once and expires within a minute. + +## Terminals + +3. **The record.** `{ id, title, alive, kind }` and optionally `tip`. `id` is opaque and safe in a URL path. `kind` is one of `shell`, `claude`, `codex`, `cursor`, `agent` (a read-only tab showing an agent's commands). `title` is shown as given and is not translated. `alive: false` means the program has ended and the tab is shown struck through. `tip` is the tab's tooltip (a working folder, for example). Extra fields are ignored. `terminal.list()` returns the caller's tabs, oldest first. +4. **Open.** `terminal.open(kind, { cols, rows, prompt?, resume? })` returns the record. `cols` and `rows` are integers the engine clamps without failing. `prompt` is a first message for Claude Code: the engine may type it into a Claude Code tab that is already running and return that tab, so the module accepts an id it already has. `resume` is a Claude Code session id and always makes a new tab. The prompt may be a program argument; a token never is. +5. **Restart.** `terminal.restart(id)` keeps the id, starts the program again and clears the screen. The engine either keeps the stream open across the restart or ends it; the module opens a new channel when the old one has closed. An engine with no restart leaves the function out and the button is not shown. +6. **Close.** `terminal.close(id)` kills the program, is safe to repeat, and succeeds for an id that is already gone. +7. **The channel, engine to window.** `onData` delivers the program's output as text or as bytes, undecoded by the engine; a character may be split across two deliveries when bytes are used. On every attach the engine first replays its scrollback (how much is its choice), and reports `onExit` at once if the program has already ended. `onExit` is an event and nothing is printed for it. The engine sends something on every attach (an empty replay counts if the adapter reports it), because a channel that closes before any data is how the module decides that the engine did not answer. +8. **The channel, window to engine.** `send(text)` is what the person typed, as the terminal emulator encodes it; `resize(cols, rows)` follows every change of size. How these travel (JSON frames, binary frames, separate requests) is between the adapter and the engine. The engine ignores what it does not understand. +9. **The channel, the rest.** Several attachments to one tab are allowed and each gets the replay. For a reader that cannot keep up the engine drops output or closes the stream, never blocks the program. No keep-alive is required. `onClose` after the first data means "closed", whatever the reason. `close()` ends the attachment, not the program. + +## Agent programs + +10. **Status.** `agentStatus()` answers for the programs the app offers, in one request: `{ claude?, codex?, cursor? }`, each `{ installed, version, install, signedIn }`. `version` is a string or null. `install` is a command line a person can paste, never a sentence, and may be empty. `signedIn` is true, false, or null when the engine cannot tell; the module has a wording for each. A program that is left out is one the app does not offer, and the module says nothing about it. `null` for the whole answer means the engine was not reachable. The call must be cheap enough to make whenever the dock opens (cache the program's own version call); the module never makes it while the dock is closed. +11. **Launching an agent program.** The program learns the app's MCP address and a token made for that tab from its environment or from a file only the caller's user can read (mode 0600), never from its command line. A plain shell tab gets no token. The token is good only while its tab is open. The engine sets the working folder and removes its own secrets from the child's environment. + +## Chat + +12. **Chat events.** The adapter either gives its own pane (`chat.pane(host)`) and then this clause does not apply, or it gives `status`, `send`, `subscribe` and what it has of `start`, `stop`, `answer`, `modes`, `renderText`. After `subscribe`, the adapter calls `open()`, replays the conversation from its start as events, then sends `state`. Events are those of `DockChatEvent`: `state { running, state, session, mode? }` where `state` is exactly `busy` while a turn runs and any other word otherwise, and `session` is a Claude Code session id usable with resume, or null; `user { text, note? }`; `block { id, kind }` before any `delta { id, text }` for that id; `tool { id, name, summary }` then `tool_result { id, text, error }` (text may be empty); `permission { id, tool, summary }` and `permission_done { id, allowed }` only from engines that ask, which then implement `answer`; `result { ok, text, meta? }` at the end of every turn, also after `stop`; `notice { text }`; `reset` when the conversation was cleared or replaced; `meter { text, high? }` for a usage line. Ids are unique within a conversation. `send` while busy is refused with a message. `start(mode, fresh)` with `fresh` clears the conversation and the session; an engine without modes gets `null` and has no `modes`. `status()` answers `{ installed, version, signedIn, install, running, state, session }`, optionally `mode`, `lead` (a sentence to show in the empty Chat in place of the app's) and `refused` (see clause 13); null means not reachable. + +## Refusals and availability + +13. **A refusal is not an outage.** The adapter tells the module which it is, through `errors.kind(error)`: `refused` (the engine answered and said no to this caller: the message is shown as it is, and nothing suggests restarting anything), `unreachable` (no answer), `notInstalled` (the program is missing: the install line is shown), `oldEngine` (the route does not exist in this engine), `busy`. Engines use fixed codes for these rather than English text the adapter has to read. `chat.status()` may carry `refused` with the sentence to show. +14. **Availability.** The app can answer cheaply which tabs this caller may use here (`tabs()` is read at mount and on `dock.refresh()`), so a server that allows the dock only to its owner, or an operating system without a PTY, offers fewer tabs or none. `firstRun()` returning false means "not now" for the first-run guide. + +## Outside agents + +15. **Consent is optional and has two kinds.** An app that gates outside agents by a credential given on its own sign-in page provides neither `consent` nor `storedChoice`, and the module shows no dialog and no Outside agents entry. An app that asks in the window provides `consent`: each request is `{ id, agent, what, offers, always, expires?, escape?, notes? }`. `id` names one waiting call. `agent` is the program's name as the engine knows it, or empty. `what` completes "It asked to ...". `offers` lists the answers the engine can honour, from `deny`, `once`, `always`; the module shows no other. `always` says what a standing yes would cover: `agent` (this program only) or `all` (every outside agent). `expires` is when the engine stops waiting (milliseconds since the epoch). `escape: 'deny'` makes Escape a refusal; otherwise Escape leaves the request unanswered. An answer is for the request with that id and for no other. The engine must be able to say that a request is gone (its caller hung up, its time ran out, another window answered), and the adapter then calls `withdraw(id)`; after a reload of the window the adapter asks the engine which requests are still waiting and shows them again. Only the window can answer. `storedChoice` is the standing setting `ask`, `allowed` or `blocked`, kept by the engine and sealed against changes made outside the app (`changedOutside` reports a broken seal). `blocked` refuses every agent at once, with or without a window, the app's own Chat and agent tabs included. + +## Versions + +16. **A number, not a missing route.** The engine reports the contract version it implements (this file's module version) where its adapter can read it, so "this engine is too old" is decided by comparing numbers. An adapter maps an older engine onto `oldEngine` errors and onto a smaller `tabs()` set. + +## Module 2.1.0: what an adapter may now say + +Nothing an engine provides changed in 2.1.0: the sixteen clauses read as they did, and an engine that meets them for 2.0 meets them for 2.1. An adapter written for 2.0.1 compiles and behaves as before; every item here is used only by an adapter that asks for it. The one type that widened is `dock.sendChat(text)`, which now resolves to a boolean (false when nothing was sent). + +- **The app's own Chat pane is told what happens to it.** `pane(host)` is still called once, and the object it returns may have `shown()` (the dock is open and Chat is the tab in front), `hidden(why)` with `'tab'` (another tab was chosen or the Chat tab was closed) or `'dock'` (the dock was closed or its host hid it), `closed()` (the Chat tab's cross; the host element is kept and the next show is `shown()` again), `busy()` and `askTarget` (the element the guide's "how to ask" step points at). `send(text)` may answer `false`, or a promise of it, when the text was not taken. The host is `.ft-chat.is-own`, an absolutely placed box that fills the stage with `overflow: auto`; a pane that scrolls by itself fills it (`position: absolute; inset: 0` or `height: 100%`) and manages its own overflow. +- **The ask line beside an own pane**, `chat.ask`. Absent or `'none'`: no ask line on any tab. `'line'`: the module's line on every tab; on Chat the text goes to the pane's `send`, elsewhere it opens Claude Code with the text as `prompt` (clause 4). `{ send(text, tab) }`: the module's line on every tab and every submit goes to that function with the kind of the tab in front. `{ element }`: the app's own element is placed in the slot. The slot is `form.ft-dock-ask`, the same box on every tab; the root has `has-ask-line` while it shows. A busy pane or an answer of `false` leaves the text in the line. +- **First run.** The guide counts the steps it can show. A legacy reader (`placement.storage.legacy.read`) may return `seen: true` with the layout it moves, and `jsonLegacy(keys, true)` from state.ts says it for old keys that hold JSON; without that a moved layout is not taken as seen. +- **Focus at load.** When the dock is restored open before the app has revealed its window, the dock focuses once at the first `class`, `style` or `hidden` change on one of its ancestors that leaves it shown. An app that reveals itself another way (removing a cover, swapping a stylesheet) calls `dock.focus()` after its reveal. +- **Keys in capture-phase listeners.** The module stops keys at its roots in the bubble phase. An app listener in the capture phase starts with `if (dock.keeps(event)) return;`. +- **Notes of a question** (`ConsentRequest.notes`, clause 15) are shown one element each, so each is one whole sentence, already in the person's language or matchable by the app's page translator. +- **Names.** The classes, attributes and tokens an app may rely on are `DOCK_PUBLIC` in adapter.ts and nowhere else; 2.1.0 added the classes `has-ask-line`, `ft-dock-ask`, `ft-dock-ask-own`, `ft-dock-head`, `ft-dock-tab`, `ft-dock-stage`, `ft-icon`, `is-on`, `is-own` and the tokens `--dock-stage-pad`, `--dock-ask-ctl-h`, `--dock-tab-accent`, each token defaulting to the value 2.0 had written. +- **Type check.** Before a module version is cut, and as a step of every port, the folder is compiled with `noUnusedLocals`, `noUnusedParameters`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `verbatimModuleSyntax`, `noImplicitOverride` and `noImplicitReturns` on. + +## Module 2.2.0: the agent kinds are a list, and Antigravity is the fourth + +An adapter written for 2.1.0 compiles and behaves as before: copying the 2.2.0 folder into an app changes nothing there until its adapter names a further kind. Every type an adapter uses is the 2.1.0 type unless the adapter gives the type argument described below. `keyHeaders` became optional. + +- **The list.** `agents.ts` holds the kinds the module knows: `claude` (Claude Code), `codex` (Codex), `cursor` (Cursor) and `antigravity` (Antigravity, Google's `agy` program), each with its label, its picture and its two sentences. Claude Code keeps its own button, the ask line and the guide. Every other kind gets a head button and a row in the More agents menu. +- **Offering a kind.** A kind is shown when the adapter lists its id in `tabs().builtin` and `agentStatus()` reports it; both. So clause 10's answer may hold further keys, `{ claude?, codex?, cursor?, antigravity?, ... }`, and a key the adapter does not also list is ignored. The module then calls `terminal.open('antigravity', { cols, rows })`, and clause 3's `kind` may be that id. An adapter that adds kinds is typed `DockAdapter<'antigravity'>` (a union for several); `Dock`, `DockTabs`, `DockTerminal` and `DockAgentStatus` follow from it. +- **What the engine needs for a further kind.** Clause 10 for it (found, version, install line, `signedIn` null when it cannot tell, which is always so for Antigravity: it has no status command), clause 4 for its tab, and clause 11: Antigravity reads its MCP servers from a file, so the tab's entry (named `[app]_tab`, with the tab's token) goes into `.agents/mcp_config.json` of the tab's working folder, mode 0600, every other entry kept, and is taken out when the tab closes. +- **A kind that is not in the list** needs no change in this folder: the adapter lists its id, and its status carries `label`. It is drawn with the terminal picture and the sentences of the other programs. +- **`DockProgramStatus.note`** is a whole sentence shown in the kind's menu row in place of the module's (where the engine looked for the program, why it does not start, a step that is not a command). The install line still shows under it. +- **Part names.** Every control of the module carries `data-dock-part`; the attribute and the names are `DOCK_PUBLIC.partAttribute`, `parts` and `partsByKind` (`launch.[kind]`, `menu.launch.[kind]`, `tab.[kind]`). Automation and command layers use these and no class name. +- **A status line for a tab.** A terminal record may carry `status`, and a channel may give `onStatus(handler)` and call the handler with new text ("reconnecting", an exit code). The text of the tab in front shows in the head between the tabs and the buttons, clipped; an empty string clears it. + +## Module 2.2.1 + +The guide's two sentences for a computer that has Claude Code (`tourInstalledBody` and `tourReadyBody`) now end by naming the other three programs: "Codex, Cursor and Antigravity each get a button of their own here when they are on this computer." Nothing else in the folder changed, and an adapter written for 2.2.0 needs no change; an app that translates the module's sentences translates these two again. + +## The manifest + +`MANIFEST.json` in this folder lists the module version and the SHA-256 of every other file here, this one included. The source app (FormVis) writes it; every other app only checks it: read the file names and hashes from the manifest, hash each file's bytes, and fail naming any file that differs, is missing or is extra. The check is small enough to write in any language an app's tools use. diff --git a/frontend/src/dock/MANIFEST.json b/frontend/src/dock/MANIFEST.json new file mode 100644 index 0000000..c2ee1fa --- /dev/null +++ b/frontend/src/dock/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "module": "dock", + "version": "2.2.1", + "files": { + "CONTRACT.md": "9791fa9d5eb7ef7e09543d34c2d097cfe6559b7fa1792f251afb9abfa7ac0bd7", + "adapter.ts": "1128c16892424485fe68bb2bf92ebc7229a9c2ff749db2fcd2419662d9c3ada9", + "agents.ts": "db666d1042555f8bbda4a697dbfc475df23779d0c5a25abd532bcfa43ae81043", + "chat.ts": "994878030b9fbff729734d34e2baa5b018e7d0b8555c24bfb7c98962c50446fa", + "consent.ts": "922a2c9fb6a3d83a6b70f1bb02918646ae180f5ed1ed7325e71b2caf01358737", + "dock.css": "ffdb5be7e849c393f173fac9cd0fb0503c0ef4e53e4c1c86a8e198abfbbdb8d2", + "dock.ts": "abbb2929d52d592eb2730a8a90763e8caf333c458250fc89a08d637489ef4571", + "dom.ts": "dc2adf64e70e600f28eaa2d84eed0b4ad7deadb6e200cd489ee7abb583269e62", + "icons.ts": "2e3ec58ea5ccaae4243d72d55da10c39611bd02f486cdcd5b11b9459c6beb402", + "keys.ts": "1adfc7daefa35b0e6eb8957250dca3926ded1c59fd51db7d60da6346caf0d561", + "placement.ts": "0f7e03ef0b720af07995111f30dcb5ed124529d44cf5cb67ae4bfb1f96c7f880", + "state.ts": "bef508e8343737f67adfbd7ae8cb8efb446968dfd4e7e0aff37da11f996955d7", + "strings.ts": "3654a59c4d005125e248dd322f467d4ad3c513f4fd86f6dfe76f5565408ac50e", + "terminal.ts": "8bf886a7ad4dc69323e803acc13641a66e1d8614e9b85a6a60977fa30d8a56fc", + "tour.ts": "2f83994051f4370c5d1630a827b4539eb12fd50e7fe9531f5641a4bf75615782" + } +} diff --git a/frontend/src/dock/adapter.ts b/frontend/src/dock/adapter.ts new file mode 100644 index 0000000..6f13d08 --- /dev/null +++ b/frontend/src/dock/adapter.ts @@ -0,0 +1,162 @@ +import type { DockLegacy } from './state'; +import type { StringKey } from './strings'; + +export type { DockLegacy, DockSide, DockState, DockStore } from './state'; +export type DockKind = 'shell' | 'claude' | 'codex' | 'cursor' | 'chat'; +export type DockProgram = 'claude' | 'codex' | 'cursor'; +export type PtyKind = 'shell' | 'claude' | 'codex' | 'cursor' | 'agent'; +export type ChatMode = 'ask' | 'auto-edits' | 'plan'; + +export interface DockTerminal { id: string; title: string; alive: boolean; kind: PtyKind | K; tip?: string; status?: string } +export interface DockChannel { + send(data: string): void; + resize(cols: number, rows: number): void; + onData(handler: (data: string | Uint8Array) => void): void; + onExit(handler: () => void): void; + onClose?(handler: () => void): void; + onStatus?(handler: (text: string) => void): void; + close(): void; +} +export interface DockOpen { cols: number; rows: number; prompt?: string; resume?: string } +export interface DockProgramStatus { installed: boolean; version: string | null; install: string; signedIn: boolean | null; label?: string; note?: string } +export type DockAgentStatus = Partial>; +export interface DockChatStatus { + installed: boolean; + version: string | null; + signedIn: boolean | null; + install: string; + running: boolean; + state: string; + session: string | null; + mode?: ChatMode; + lead?: string; + refused?: string; +} +export interface DockChatHandlers { open(): void; event(event: DockChatEvent): void; close(): void } +export interface DockChatEngine { + status(): Promise; + send(text: string): Promise; + subscribe(handlers: DockChatHandlers): () => void; + start?(mode: ChatMode | null, fresh: boolean): Promise; + stop?(): Promise; + answer?(id: string, allow: boolean): Promise; + modes?: ChatMode[]; + renderText?(node: HTMLElement, text: string): void; +} +export type DockSent = boolean | void | Promise; +export type DockPaneHidden = 'tab' | 'dock'; +export interface DockOwnChat { + send?(text: string): DockSent; + focus?(): void; + shown?(): void; + hidden?(why: DockPaneHidden): void; + closed?(): void; + busy?(): boolean; + askTarget?: HTMLElement; +} +export interface DockOwnAsk { send?(text: string, tab: DockKind | K | null): DockSent; element?: HTMLElement } +export interface DockChatPane { pane(host: HTMLElement): DockOwnChat | void; ask?: 'none' | 'line' | DockOwnAsk } +export type DockChatEvent = + | { type: 'state'; running: boolean; state: string; session: string | null; mode?: ChatMode } + | { type: 'user'; text: string; note?: string } + | { type: 'reset' } + | { type: 'meter'; text: string; high?: boolean } + | { type: 'block'; id: string; kind: 'text' | 'thinking' } + | { type: 'delta'; id: string; text: string } + | { type: 'tool'; id: string; name: string; summary: string } + | { type: 'tool_result'; id: string; text: string; error: boolean } + | { type: 'permission'; id: string; tool: string; summary: string } + | { type: 'permission_done'; id: string; allowed: boolean } + | { type: 'result'; ok: boolean; text: string; meta?: string } + | { type: 'notice'; text: string }; + +export interface DockSizes { + minHeight: number; + minWidth: number; + defaultHeight: number; + defaultWidth: number; + maxHeightShare: number; + maxWidthShare: number; + keepHeight?: number; + keepWidth?: number; + maxHeight?(): number; + maxWidth?(): number; +} +export type DockErrorKind = 'refused' | 'unreachable' | 'notInstalled' | 'oldEngine' | 'busy'; +export interface DockWords { app: string; noun: string; lead: string; example: string; start?: string } +export interface DockAppTab { id: string; label: string; icon: string; mount(host: HTMLElement): void | (() => void) } +export interface DockTabs { builtin: Array; own?: DockAppTab[] } +export interface DockStorage { key: string; legacy?: DockLegacy | string[] } +export type DockPlacement = + | { mode: 'own'; storage: DockStorage; sizes: DockSizes; canDockRight?(): boolean } + | { mode: 'hosted'; request(open: boolean): void }; + +export interface DockAdapter { + words: DockWords; + strings?: Partial>; + placement: DockPlacement; + passKey?(event: KeyboardEvent): boolean; + isDockChord?(event: KeyboardEvent): boolean; + chordLabel?(): string; + tabs(): DockTabs; + classes: { iconButton: string; button: string; primaryButton: string; input: string; select: string; note: string }; + t(key: string, english: string): string; + onTheme(handler: () => void): void; + keyHeaders?(): Record; + errors: { message(err: unknown): string | null; kind?(err: unknown): DockErrorKind | null }; + firstRun?(): boolean; + terminal: { + list(): Promise[]>; + open(kind: Exclude | K, options: DockOpen): Promise>; + restart?(id: string): Promise; + close(id: string): Promise; + channel(id: string): DockChannel | Promise; + scrollback?: number; + }; + agentStatus(): Promise | null>; + chat?: DockChatEngine | DockChatPane; + consent?: { + subscribe(add: (request: ConsentRequest) => void, withdraw: (id: string) => void): void; + answer(id: string, choice: ConsentChoice): Promise; + }; + storedChoice?: { + get(): Promise; + set(value: StoredChoice): Promise; + }; + openSettings?(): void; +} + +export const DOCK_PUBLIC = { + classes: ['ft-dock', 'ft-consent', 'ft-tour', 'ft-term', 'ft-chat', 'ft-dock-pane', 'ft-notranslate', 'is-hosted', 'has-own-chat', 'has-no-ask', 'has-ask-line', 'ft-dock-ask', 'ft-dock-ask-own', 'ft-dock-head', 'ft-dock-tab', 'ft-dock-stage', 'ft-icon', 'is-on', 'is-own'], + rootAttributes: ['data-ft-dock', 'data-ft-dock-side', 'data-ft-dock-h', 'data-ft-dock-w'], + partAttribute: 'data-dock-part', + parts: ['new', 'chat', 'launch.claude', 'more', 'restart', 'side', 'hide', 'menu', 'menu.settings', 'menu.guide', 'screen', 'note.copy', 'note.dismiss', 'ask', 'send', 'tab.chat', 'tab.close', 'consent', 'consent.deny', 'consent.once', 'consent.always'], + partsByKind: ['launch.', 'menu.launch.', 'tab.'], + rootProperties: ['--ft-dock-size', '--ft-dock-wsize'], + tokens: [ + '--dock-bg', '--dock-bar-bg', '--dock-raised', '--dock-hover', '--dock-input-bg', '--dock-border', '--dock-edge', '--dock-divider', '--dock-tab-border', '--dock-outline', '--dock-scrim', + '--dock-text', '--dock-text-dim', '--dock-text-muted', '--dock-tab-text', '--dock-accent', '--dock-accent-line', '--dock-accent-ink', '--dock-danger', '--dock-danger-text', + '--dock-space-1', '--dock-space-2', '--dock-space-3', '--dock-space-4', '--dock-radius-xs', '--dock-radius-sm', '--dock-radius', '--dock-radius-md', '--dock-tab-radius', + '--dock-head-h', '--dock-tab-h', '--dock-ibtn', '--dock-ask-h', '--dock-chat-bar-h', '--dock-ctl-h', '--dock-icon', '--dock-icon-sm', '--dock-icon-xs', '--dock-icon-note', '--dock-icon-send', + '--dock-stage-pad', '--dock-ask-ctl-h', '--dock-tab-accent', + '--dock-fs-xs', '--dock-fs-sm', '--dock-fs-md', '--dock-font-mono', + '--dock-term-bg', '--dock-term-fg', '--dock-term-cursor', '--dock-term-selection', '--dock-term-font-size', '--dock-term-line-height', '--dock-term-contrast', + ], + layers: ['--z-raised', '--z-overlay'], +} as const; + +export type ConsentChoice = 'deny' | 'once' | 'always'; +export type ConsentScope = 'agent' | 'all'; +export type StoredChoice = 'ask' | 'allowed' | 'blocked'; +export interface ConsentRequest { + id: string; + agent: string; + what: string; + offers: ConsentChoice[]; + always: ConsentScope; + expires?: number; + escape?: 'deny'; + notes?: string[]; +} +export interface StoredChoiceState { value: StoredChoice; changedOutside: boolean } +export type ConsentHost = Pick; diff --git a/frontend/src/dock/agents.ts b/frontend/src/dock/agents.ts new file mode 100644 index 0000000..083297e --- /dev/null +++ b/frontend/src/dock/agents.ts @@ -0,0 +1,22 @@ +import type { StringKey } from './strings'; + +export interface DockAgentKind { id: string; label: string; name?: StringKey; icon: string; ready: StringKey; missing: StringKey } + +export const DOCK_AGENTS: readonly DockAgentKind[] = [ + { id: 'claude', label: 'Claude Code', name: 'claudeCode', icon: 'agent', ready: 'programReady', missing: 'notInstalled' }, + { id: 'codex', label: 'Codex', name: 'codex', icon: 'codex', ready: 'programReady', missing: 'programMissing' }, + { id: 'cursor', label: 'Cursor', name: 'cursor', icon: 'cursor', ready: 'programReady', missing: 'programMissing' }, + { id: 'antigravity', label: 'Antigravity', name: 'antigravity', icon: 'antigravity', ready: 'programReady', missing: 'programMissing' }, +]; + +export const DOCK_PLAIN: readonly string[] = ['shell', 'chat', 'agent']; + +export function agentKind(id: string): DockAgentKind { + return DOCK_AGENTS.find((k) => k.id === id) ?? { id, label: id, icon: id, ready: 'programReady', missing: 'programMissing' }; +} + +export function agentKinds(builtin: readonly string[]): DockAgentKind[] { + const listed = DOCK_AGENTS.filter((k) => builtin.includes(k.id)); + const more = builtin.filter((id) => !DOCK_PLAIN.includes(id) && !DOCK_AGENTS.some((k) => k.id === id)).map(agentKind); + return [...listed, ...more]; +} diff --git a/frontend/src/dock/chat.ts b/frontend/src/dock/chat.ts new file mode 100644 index 0000000..2c02755 --- /dev/null +++ b/frontend/src/dock/chat.ts @@ -0,0 +1,340 @@ +import type { ChatMode, DockAdapter, DockChatEngine, DockChatEvent, DockChatPane, DockChatStatus, DockOwnChat, DockPaneHidden } from './adapter'; +import { el, q, setClass, setDisabled, setHidden, setText } from './dom'; +import { dockIcon as icon } from './icons'; +import { lead as appLead, strings, type Say, type StringKey } from './strings'; + +const MODES: [ChatMode, StringKey][] = [['ask', 'modeAsk'], ['auto-edits', 'modeAuto'], ['plan', 'modePlan']]; + +function toolName(name: string): string { + return name.replace(/^mcp__/, '').replace(/__/g, ' '); +} + +export type ChatHost = Omit, 'chat'> & { chat: DockChatEngine }; + +export interface DockChatView { + readonly root: HTMLElement; + load(): Promise; + release(): void; + isBusy(): boolean; + send(text: string): Promise; + focus?(): void; + visible?(on: boolean, why: DockPaneHidden): void; + askTarget?(): HTMLElement | undefined; +} + +export class OwnChat implements DockChatView { + readonly root: HTMLElement; + private readonly own: DockOwnChat; + private on = false; + + constructor(pane: DockChatPane) { + this.root = el(''); + this.own = pane.pane(this.root) ?? {}; + } + + load(): Promise { return Promise.resolve(); } + release(): void { this.own.closed?.(); } + isBusy(): boolean { return this.own.busy?.() === true; } + async send(text: string): Promise { + if (!this.own.send || this.isBusy()) return false; + return (await this.own.send(text)) !== false; + } + focus(): void { this.own.focus?.(); } + askTarget(): HTMLElement | undefined { return this.own.askTarget; } + visible(on: boolean, why: DockPaneHidden): void { + if (on === this.on) return; + this.on = on; + if (on) this.own.shown?.(); else this.own.hidden?.(why); + } +} + +export class ChatPane implements DockChatView { + private readonly s: Say; + readonly root: HTMLElement; + onFail: (err: unknown) => void = () => undefined; + onHandoff: (session: string) => void = () => undefined; + onBash: () => void = () => undefined; + private readonly log: HTMLElement; + private readonly empty: HTMLElement; + private readonly emptyText: HTMLElement; + private readonly install: HTMLElement; + private readonly statusEl: HTMLElement; + private readonly mode: HTMLSelectElement; + private readonly stopBtn: HTMLButtonElement; + private readonly blocks = new Map(); + private readonly tools = new Map(); + private readonly asks = new Map(); + private live: { off(): void } | null = null; + private info: DockChatStatus | null = null; + private state = 'idle'; + private running = false; + private offline = false; + private wanted = false; + private session: string | null = null; + + constructor(private readonly a: ChatHost) { + const s = strings(a); + const c = a.classes; + this.s = s; + this.root = el(``); + this.log = q(this.root, '.ft-chat-log'); + this.empty = q(this.root, '.ft-chat-empty'); + this.emptyText = q(this.root, '.ft-chat-empty-text'); + this.install = q(this.root, '.ft-chat-install'); + this.statusEl = q(this.root, '.ft-chat-status'); + this.mode = q(this.root, '.ft-chat-mode'); + this.stopBtn = q(this.root, '.ft-chat-stop'); + const offered = a.chat.modes ?? []; + for (const [value, key] of MODES) { + if (!offered.includes(value)) continue; + const o = document.createElement('option'); + o.value = value; + o.textContent = s(key); + this.mode.append(o); + } + setHidden(this.mode, offered.length === 0); + setHidden(this.stopBtn, !a.chat.stop); + q(this.root, '.ft-chat-new').addEventListener('click', () => void this.begin(true)); + q(this.root, '.ft-chat-handoff').addEventListener('click', () => void this.handoff()); + q(this.root, '.ft-chat-copy').addEventListener('click', () => { void navigator.clipboard?.writeText(this.info?.install ?? '').catch(() => undefined); }); + this.stopBtn.addEventListener('click', () => { void a.chat.stop?.().catch(() => undefined); }); + this.mode.addEventListener('change', () => { if (this.running) void this.begin(false); }); + } + + private get meter(): HTMLElement { return q(this.root, '.ft-chat-meter'); } + + isBusy(): boolean { return this.state === 'busy'; } + + async load(): Promise { + this.wanted = true; + this.connect(); + await this.refresh(); + } + + release(): void { + this.wanted = false; + const live = this.live; + this.live = null; + live?.off(); + } + + async send(text: string): Promise { + if (!text || this.state === 'busy') return false; + if (!this.running && !(await this.begin(false))) return false; + let went = true; + try { await this.a.chat.send(text); } catch (err) { + went = false; + this.note('note', this.a.errors.message(err) ?? this.s('sendFailed')); + } + this.paint(); + return went; + } + + private async refresh(): Promise { + this.info = await this.a.chat.status(); + this.offline = this.info === null; + if (this.info) { + this.running = this.info.running; + this.state = this.info.state; + this.session = this.info.session ?? this.session; + if (this.info.mode && this.mode.value !== this.info.mode && this.info.running) this.mode.value = this.info.mode; + } + this.paint(); + this.root.classList.add('is-loaded'); + } + + private paint(): void { + const s = this.s; + const i = this.info; + let status: string; + let lead: string; + if (this.offline || !i) { + status = this.a.words.start ? s('offlineStart') : s('offline'); + lead = status; + } else if (i.refused !== undefined) { + status = i.refused || s('refused'); + lead = status; + } else if (!i.installed) { + status = s('missing'); + lead = s('notInstalled'); + } else { + const parts = [`Claude Code ${i.version ?? ''}`.trim()]; + if (i.signedIn === true) parts.push(s('signedIn')); + else if (i.signedIn === false) parts.push(s('notSignedIn')); + parts.push(this.running ? (this.state === 'busy' ? s('working') : s('ready')) : s('idle')); + status = parts.join(' · '); + lead = i.lead ?? appLead(this.a); + } + setText(this.statusEl, status); + this.statusEl.title = status; + setText(this.emptyText, lead); + const missing = !!i && !i.installed; + setHidden(this.install, !missing); + if (missing) setText(q(this.install, '.ft-chat-install-cmd'), i.install); + const usable = !!i && i.installed && !this.offline; + setDisabled(this.stopBtn, !this.running); + setDisabled(this.mode, !usable); + setClass(this.root, 'is-busy', this.state === 'busy'); + } + + private connect(): void { + if (this.live) return; + const live = { off: (): void => undefined }; + this.live = live; + live.off = this.a.chat.subscribe({ + open: () => { if (this.live === live) this.wipe(); }, + event: (ev) => { if (this.live === live) this.onEvent(ev); }, + close: () => { + if (this.live !== live) return; + this.live = null; + if (this.wanted) window.setTimeout(() => { if (this.wanted && !this.live) { this.connect(); void this.refresh(); } }, 2000); + }, + }); + } + + private wipe(): void { + this.log.replaceChildren(this.empty); + setHidden(this.empty, false); + this.blocks.clear(); + this.tools.clear(); + this.asks.clear(); + } + + private async begin(fresh: boolean): Promise { + try { + await this.a.chat.start?.(this.a.chat.modes?.length ? this.mode.value as ChatMode : null, fresh); + if (fresh) this.wipe(); + return true; + } catch (err) { + this.note('note', this.a.errors.message(err) ?? this.s('notStarted')); + return false; + } + } + + private async handoff(): Promise { + const st = await this.a.chat.status(); + const session = st?.session ?? this.session; + if (!session) { this.onFail(new Error(this.s('handoffFirst'))); return; } + if ((st?.state ?? this.state) === 'busy') { this.onFail(new Error(this.s('handoffBusy'))); return; } + this.onHandoff(session); + } + + private add(cls: string): HTMLElement { + const node = el(/is-note|is-error|ft-chat-ask/.test(cls) ? `
` : `
`); + setHidden(this.empty, true); + const stick = this.log.scrollHeight - this.log.scrollTop - this.log.clientHeight < 40; + this.log.append(node); + if (stick) this.log.scrollTop = this.log.scrollHeight; + return node; + } + + private note(kind: 'user' | 'note' | 'error', text: string): void { + setText(this.add(`ft-chat-msg is-${kind}`), text); + } + + private grow(node: HTMLElement): void { + if (this.log.scrollHeight - this.log.scrollTop - this.log.clientHeight < 80 + node.clientHeight) this.log.scrollTop = this.log.scrollHeight; + } + + private onEvent(ev: DockChatEvent): void { + switch (ev.type) { + case 'state': + this.running = ev.running; + this.state = ev.state; + this.session = ev.session ?? this.session; + if (ev.running && ev.mode && this.mode.value !== ev.mode) this.mode.value = ev.mode; + this.paint(); + break; + case 'user': { + const node = this.add('ft-chat-msg is-user'); + setText(node, ev.text); + if (ev.note) { const note = el(''); setText(note, ev.note); node.append(note); } + break; + } + case 'reset': this.wipe(); break; + case 'meter': + setText(this.meter, ev.text); + setClass(this.meter, 'is-high', ev.high === true); + break; + case 'block': + if (!this.blocks.has(ev.id)) { + const node = this.add(`ft-chat-msg is-${ev.kind === 'thinking' ? 'thinking' : 'assistant'}`); + const text = document.createTextNode(''); + node.append(text); + this.blocks.set(ev.id, { node, text, raw: '' }); + } + break; + case 'delta': { + const block = this.blocks.get(ev.id); + if (!block) break; + block.raw += ev.text; + const render = this.a.chat.renderText; + if (render && block.node.classList.contains('is-assistant')) render(block.node, block.raw); else block.text.appendData(ev.text); + this.grow(block.node); + break; + } + case 'tool': this.tool(ev.id, ev.name, ev.summary); break; + case 'tool_result': { + const card = this.tools.get(ev.id); + if (!card) break; + const chip = q(card, '.ft-chat-tool'); + const out = q(card, '.ft-chat-tool-out'); + setText(out, ev.text); + setHidden(out, ev.text === '' || !ev.error); + setClass(chip, 'is-running', false); + setClass(chip, 'is-done', !ev.error); + setClass(chip, 'is-error', ev.error); + break; + } + case 'permission': this.question(ev.id, ev.tool, ev.summary); break; + case 'permission_done': { + const card = this.asks.get(ev.id); + if (!card) break; + card.classList.add('is-done'); + setText(q(card, '.ft-chat-ask-state'), ev.allowed ? this.s('allowed') : this.s('declined')); + break; + } + case 'result': + if (!ev.ok) this.note('error', ev.text || this.s('stoppedError')); + if (ev.meta) setText(this.add('ft-chat-msg is-meta'), ev.meta); + break; + case 'notice': this.note('note', ev.text); break; + } + } + + private tool(id: string, name: string, summary: string): void { + if (this.tools.has(id)) return; + const card = this.add('ft-chat-tool-card'); + const chip = el(`
${icon('terminal', 11)}
`); + const out = el(''); + setText(q(chip, '.ft-chat-tool-name'), toolName(name)); + setText(q(chip, '.ft-chat-tool-input'), summary); + chip.title = summary; + const toggle = (): void => { if (out.textContent) setHidden(out, !out.hidden); }; + chip.addEventListener('click', toggle); + chip.addEventListener('keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggle(); } }); + card.append(chip, out); + this.tools.set(id, card); + if (name === 'Bash') this.onBash(); + } + + private question(id: string, tool: string, summary: string): void { + if (this.asks.has(id)) return; + const c = this.a.classes; + const card = this.add('ft-chat-ask'); + card.append(el('
'), el(''), + el(`
`)); + setText(q(card, '.ft-chat-ask-text'), this.s('asksToUse', { tool: toolName(tool) })); + setText(q(card, '.ft-chat-ask-sum'), summary); + q(card, '.ft-chat-allow').addEventListener('click', () => { void this.a.chat.answer?.(id, true).catch(() => undefined); }); + q(card, '.ft-chat-deny').addEventListener('click', () => { void this.a.chat.answer?.(id, false).catch(() => undefined); }); + this.asks.set(id, card); + } +} diff --git a/frontend/src/dock/consent.ts b/frontend/src/dock/consent.ts new file mode 100644 index 0000000..ec20659 --- /dev/null +++ b/frontend/src/dock/consent.ts @@ -0,0 +1,149 @@ +import type { ConsentChoice, ConsentHost, ConsentRequest } from './adapter'; +import { el, q, setClass, setHidden, setText } from './dom'; +import { fill, strings, type Say } from './strings'; + +const CHOICES: ConsentChoice[] = ['deny', 'once', 'always']; + +export class Consent { + private root: HTMLDialogElement | null = null; + private readonly s: Say; + private readonly queue: ConsentRequest[] = []; + private busy = false; + private opening = false; + private ours = false; + private timer = 0; + onChange: (open: boolean) => void = () => undefined; + private readonly onKey = (e: KeyboardEvent): void => { + const at = e.target as Node; + if (this.root && (this.root.contains(at) || at === document.body || at === document.documentElement)) e.stopPropagation(); + }; + + constructor(private readonly a: ConsentHost) { + this.s = strings(a); + a.consent?.subscribe((request) => this.add(request), (id) => this.withdraw(id)); + } + + get waiting(): number { return this.queue.length; } + + isOpen(): boolean { return this.root?.open === true; } + + private build(): HTMLDialogElement { + if (this.root) return this.root; + const s = this.s; + const c = this.a.classes; + const root = el(` + + `); + for (const b of root.querySelectorAll('.ft-consent-btn')) b.addEventListener('click', () => void this.pick(b.dataset.choice as ConsentChoice)); + root.addEventListener('cancel', (e) => { e.preventDefault(); this.escape(); }); + root.addEventListener('close', () => this.closed()); + document.body.append(root); + this.root = root; + return root; + } + + private add(request: ConsentRequest): void { + if (this.queue.some((r) => r.id === request.id)) return; + this.queue.push(request); + this.watch(); + void this.render(); + } + + withdraw(id: string): void { + const at = this.queue.findIndex((r) => r.id === id); + if (at < 0) return; + this.queue.splice(at, 1); + this.watch(); + void this.render(); + } + + private watch(): void { + window.clearTimeout(this.timer); + const now = Date.now(); + for (const r of this.queue.filter((x) => x.expires !== undefined && x.expires <= now)) this.queue.splice(this.queue.indexOf(r), 1); + const next = Math.min(...this.queue.map((r) => r.expires ?? Infinity)); + if (Number.isFinite(next)) this.timer = window.setTimeout(() => { this.watch(); void this.render(); }, Math.max(50, next - now)); + } + + private async render(): Promise { + const r = this.queue[0]; + if (!r) { this.shut(); return; } + const d = this.build(); + const s = this.s; + setText(q(d, '.ft-consent-title'), r.agent ? fill(s('consentTitle'), { agent: r.agent }) : s('consentTitleUnnamed')); + setText(q(d, '.ft-consent-what'), fill(s('consentWhat'), { what: r.what })); + const notes = q(d, '.ft-consent-notes'); + const lines = r.notes ?? []; + for (let i = 0; i < Math.max(lines.length, notes.children.length); i += 1) { + const line = (notes.children[i] as HTMLElement | undefined) ?? notes.appendChild(el('')); + setText(line, lines[i] ?? ''); + setHidden(line, i >= lines.length); + } + setHidden(notes, !lines.length); + const count = q(d, '.ft-consent-count'); + setText(count, fill(s('consentCount'), { n: 1, total: this.queue.length })); + setClass(count, 'is-one', this.queue.length < 2); + for (const choice of CHOICES) setHidden(q(d, `.ft-consent-${choice}`), !r.offers.includes(choice)); + setText(q(d, '.ft-consent-always'), r.always === 'all' ? s('consentAlwaysAll') : r.agent ? fill(s('consentAlways'), { agent: r.agent }) : s('consentAlwaysUnnamed')); + if (d.open || this.opening) return; + this.opening = true; + let changed = false; + try { changed = (await this.a.storedChoice?.get())?.changedOutside === true; } catch { changed = false; } + this.opening = false; + if (!this.queue.length || d.open) return; + setHidden(q(d, '.ft-consent-notice'), !changed); + window.addEventListener('keydown', this.onKey, true); + d.showModal(); + this.onChange(true); + } + + private shut(): void { + const d = this.root; + if (!d?.open) return; + this.ours = true; + d.close(); + } + + private closed(): void { + const ours = this.ours; + this.ours = false; + if (this.root?.open) return; + window.removeEventListener('keydown', this.onKey, true); + this.onChange(false); + if (ours || this.busy || !this.queue.length) return; + this.queue.shift(); + this.watch(); + void this.render(); + } + + private async pick(choice: ConsentChoice): Promise { + const r = this.queue[0]; + if (this.busy || !r || !r.offers.includes(choice)) return; + this.busy = true; + try { await this.a.consent?.answer(r.id, choice); } catch { this.busy = false; } finally { this.busy = false; } + const at = this.queue.indexOf(r); + if (at >= 0) this.queue.splice(at, 1); + this.watch(); + void this.render(); + } + + private escape(): void { + const r = this.queue[0]; + if (!r || this.busy) return; + if (r.escape === 'deny' && r.offers.includes('deny')) { void this.pick('deny'); return; } + this.queue.shift(); + this.watch(); + void this.render(); + } +} diff --git a/frontend/src/dock/dock.css b/frontend/src/dock/dock.css new file mode 100644 index 0000000..1d1a8a5 --- /dev/null +++ b/frontend/src/dock/dock.css @@ -0,0 +1,131 @@ +.ft-dock [hidden], .ft-consent [hidden], .ft-tour [hidden] { display: none; } +.ft-dock.has-no-ask .ft-dock-ask { display: none; } +.ft-dock-pane { position: absolute; inset: 0; overflow: auto; background: var(--dock-bg); user-select: text; -webkit-user-select: text; } +.ft-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; } +.ft-icon svg { width: 100%; height: 100%; } +.ft-icon, .ft-icon-15, .ft-icon-16 { width: var(--dock-icon, 15px); height: var(--dock-icon, 15px); } +.ft-icon-14 { width: var(--dock-icon-send, 14px); height: var(--dock-icon-send, 14px); } +.ft-icon-13, .ft-dock-tab-icon { width: var(--dock-icon-sm, 13px); height: var(--dock-icon-sm, 13px); } +.ft-icon-12 { width: var(--dock-icon-note, 12px); height: var(--dock-icon-note, 12px); } +.ft-icon-11 { width: var(--dock-icon-xs, 11px); height: var(--dock-icon-xs, 11px); } + +.ft-dock { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; min-width: 0; background: var(--dock-bg); border-top: 1px solid var(--dock-edge, var(--dock-border)); color: var(--dock-text); user-select: none; -webkit-user-select: none; } +:root:not([data-ft-dock="open"]) .ft-dock:not(.is-hosted) { visibility: hidden; border-top-width: 0; border-left-width: 0; } +.ft-dock.is-hosted { height: 100%; border-top-width: 0; } +.ft-dock.is-hosted .ft-dock-grip, .ft-dock.is-hosted .ft-dock-side, .ft-dock.is-hosted .ft-dock-hide { display: none; } +.ft-dock-grip.is-dragging { background: var(--dock-accent-line); } +:root[data-ft-dock-side="right"] .ft-dock { border-top: 0; border-left: 1px solid var(--dock-edge, var(--dock-border)); } +:root[data-ft-dock-side="right"] .ft-dock-grip { top: 0; bottom: 0; right: auto; width: 6px; height: auto; cursor: ew-resize; } +.ft-dock-side > span { display: inline-grid; place-items: center; } +:root[data-ft-dock-side="right"] .ft-dock-side-right, :root:not([data-ft-dock-side="right"]) .ft-dock-side-bottom { display: none; } +.ft-dock-grip { position: absolute; top: 0; left: 0; right: 0; height: 6px; cursor: ns-resize; z-index: var(--z-raised); touch-action: none; } +.ft-dock-grip:hover { background: var(--dock-accent-line); } +.ft-dock-head { flex: none; display: flex; align-items: center; gap: var(--dock-space-2); height: var(--dock-head-h); padding: 0 var(--dock-space-2); background: var(--dock-bar-bg); border-bottom: 1px solid var(--dock-divider, var(--dock-border)); min-width: 0; } +.ft-dock-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; } +.ft-dock-spacer { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: end; color: var(--dock-text-muted); font-size: var(--dock-fs-xs); user-select: text; -webkit-user-select: text; } +.ft-dock-tab { display: inline-flex; align-items: center; flex: none; gap: 6px; height: var(--dock-tab-h, 26px); padding: 0 6px 0 9px; border: 1px solid transparent; border-radius: var(--dock-tab-radius, 6px); background: transparent; color: var(--dock-tab-text, var(--dock-text-dim)); font: inherit; font-size: var(--dock-fs-sm); cursor: pointer; white-space: nowrap; } +.ft-dock-tab:hover { color: var(--dock-text); } +.ft-dock-tab.is-on { border-color: var(--dock-tab-border); background: var(--dock-raised); color: var(--dock-text); } +.ft-dock-tab.is-claude > .ft-icon, .ft-dock-tab.is-chat > .ft-icon, .ft-dock-tab.is-codex > .ft-icon, .ft-dock-tab.is-cursor > .ft-icon, .ft-dock-tab.is-program > .ft-icon { color: var(--dock-tab-accent, var(--dock-accent)); } +.ft-dock-head .ft-dock-ibtn[hidden] { display: none; } +.ft-dock-menu { position: absolute; top: calc(var(--dock-head-h) + var(--dock-space-1)); right: var(--dock-space-2); z-index: var(--z-raised); display: flex; flex-direction: column; gap: var(--dock-space-2); width: min(340px, calc(100% - 16px)); padding: var(--dock-space-2) var(--dock-space-3); border: 1px solid var(--dock-border); border-radius: var(--dock-radius-md); background: var(--dock-bar-bg); color: var(--dock-text); font-size: var(--dock-fs-sm); user-select: text; -webkit-user-select: text; } +.ft-dock-menu[hidden], .ft-dock-menu-go[hidden], .ft-dock-menu-cmd[hidden] { display: none; } +.ft-dock-menu-row { display: flex; flex-direction: column; align-items: flex-start; gap: var(--dock-space-1); } +.ft-dock-menu-go { display: inline-flex; align-items: center; gap: 6px; } +.ft-dock-menu-how { margin: 0; line-height: 1.4; } +.ft-dock-menu-cmd { padding: var(--dock-space-1) var(--dock-space-2); border-radius: var(--dock-radius-sm); background: var(--dock-input-bg); font-family: var(--dock-font-mono); font-size: var(--dock-fs-xs); overflow-wrap: anywhere; } +.ft-dock-tab.is-agent .ft-dock-tab-title { color: var(--dock-accent-ink); } +.ft-dock-tab.is-ended .ft-dock-tab-title { text-decoration: line-through; color: var(--dock-text-muted); } +.ft-dock-tab-x { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: var(--dock-radius-xs); color: var(--dock-text-muted); } +.ft-dock-tab-x:hover { background: var(--dock-hover); color: var(--dock-text); } +.ft-dock-head .ft-dock-ibtn { width: var(--dock-ibtn, 26px); height: var(--dock-ibtn, 26px); min-width: 0; min-height: 0; padding: 0; flex: none; } +.ft-dock-head .ft-dock-ibtn:disabled { opacity: 0.4; cursor: default; } +.ft-dock-stage { position: relative; flex: 1; min-height: 0; padding: var(--dock-stage-pad, var(--dock-space-1) var(--dock-space-2) 0); overflow: hidden; background: var(--dock-bg); } +.ft-term { height: 100%; user-select: text; -webkit-user-select: text; } +.ft-term[hidden] { display: none; } +.ft-term .xterm { height: 100%; } +.ft-term .xterm .xterm-viewport { scrollbar-width: none !important; -ms-overflow-style: none !important; background-color: transparent !important; } +.ft-term .xterm .xterm-viewport::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; } +.ft-term .xterm .scrollbar, .ft-term .xterm .xterm-scrollable-element > .scrollbar, .ft-term .xterm .xterm-scrollable-element > .shadow { display: none !important; } + +.ft-dock-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 0 var(--dock-space-4); text-align: center; } +.ft-dock-empty[hidden], .ft-dock-note[hidden], .ft-dock-note-cmd[hidden], .ft-dock-note-copy[hidden] { display: none; } +.ft-dock-note { position: absolute; left: var(--dock-space-2); right: var(--dock-space-2); bottom: var(--dock-space-2); z-index: var(--z-raised); display: flex; align-items: center; gap: var(--dock-space-2); padding: var(--dock-space-2) var(--dock-space-3); border: 1px solid var(--dock-accent-line); border-radius: var(--dock-radius-md); background: var(--dock-bar-bg); color: var(--dock-text); font-size: var(--dock-fs-sm); line-height: 1.4; user-select: text; -webkit-user-select: text; } +.ft-dock-note-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; } +.ft-dock-note-cmd { flex: 0 1 auto; max-width: 50%; padding: var(--dock-space-1) var(--dock-space-2); border-radius: var(--dock-radius-sm); background: var(--dock-input-bg); font-family: var(--dock-font-mono); font-size: var(--dock-fs-xs); overflow-wrap: anywhere; } +.ft-dock-note .ft-dock-ibtn { width: 24px; height: 24px; flex: none; } +.ft-dock-ask { flex: none; display: flex; align-items: center; gap: var(--dock-space-2); height: var(--dock-ask-h, 40px); padding: 0 var(--dock-space-2); background: var(--dock-bar-bg); border-top: 1px solid var(--dock-divider, var(--dock-border)); } +.ft-dock-ask-mark { display: inline-grid; place-items: center; color: var(--dock-accent); } +.ft-dock-ask-input { flex: 1; height: var(--dock-ask-ctl-h, 28px); user-select: text; -webkit-user-select: text; } +.ft-dock-ask .ft-dock-ibtn { width: var(--dock-ask-ctl-h, 28px); height: var(--dock-ask-ctl-h, 28px); flex: none; } + +.ft-chat { position: absolute; inset: 0; display: grid; grid-template-rows: var(--dock-chat-bar-h, 36px) minmax(0, 1fr); background: var(--dock-bg); } +.ft-chat.is-own { display: block; overflow: auto; } +.ft-chat[hidden], .ft-chat.is-own[hidden], .ft-chat-mode[hidden], .ft-chat-stop[hidden] { display: none; } +.ft-dock.has-own-chat .ft-dock-ask { display: none; } +.ft-dock.has-own-chat.has-ask-line .ft-dock-ask { display: flex; } +.ft-dock-ask.has-element > .ft-dock-ask-mark, .ft-dock-ask.has-element > .ft-dock-ask-input, .ft-dock-ask.has-element > .ft-dock-ask-send { display: none; } +.ft-dock-ask-own { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; height: 100%; } +.ft-chat-meter { margin: 0; flex: none; white-space: nowrap; } +.ft-chat-meter:empty { display: none; } +.ft-chat-meter.is-high { color: var(--dock-accent); } +.ft-chat-msg-note { display: block; margin-top: 2px; color: var(--dock-text-muted); font-size: var(--dock-fs-xs); } +.ft-chat-msg.is-meta { color: var(--dock-text-muted); font-size: var(--dock-fs-xs); } +.ft-chat-bar { display: flex; align-items: center; gap: var(--dock-space-2); padding: 0 var(--dock-space-3); border-bottom: 1px solid var(--dock-border); min-width: 0; } +.ft-chat-status { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.ft-chat-bar .ft-chat-btn, .ft-chat-bar .ft-chat-mode { flex: none; width: auto; height: var(--dock-ctl-h, 26px); min-height: var(--dock-ctl-h, 26px); padding: 0 var(--dock-space-3); font-size: var(--dock-fs-sm); white-space: nowrap; } +.ft-chat:not(.is-loaded) .ft-chat-log { visibility: hidden; } +.ft-chat-log { overflow-y: auto; display: flex; flex-direction: column; gap: var(--dock-space-2); padding: var(--dock-space-2) var(--dock-space-3) var(--dock-space-3); font-size: var(--dock-fs-sm); user-select: text; -webkit-user-select: text; } +.ft-chat-empty { margin: auto 0; max-width: 64ch; display: flex; flex-direction: column; gap: var(--dock-space-2); } +.ft-chat-empty[hidden], .ft-chat-install[hidden], .ft-chat-tool-out[hidden] { display: none; } +.ft-chat-empty p { margin: 0; line-height: 1.45; } +.ft-chat-install { display: flex; align-items: center; gap: var(--dock-space-2); } +.ft-chat-install code { flex: 1; min-width: 0; padding: var(--dock-space-1) var(--dock-space-2); border-radius: var(--dock-radius-sm); background: var(--dock-input-bg); font-family: var(--dock-font-mono); font-size: var(--dock-fs-xs); overflow-wrap: anywhere; } +.ft-chat-msg { max-width: 82ch; white-space: pre-wrap; line-height: 1.45; overflow-wrap: anywhere; } +.ft-chat-msg.is-user { align-self: flex-end; padding: 6px 10px; border-radius: 8px; background: var(--dock-raised); color: var(--dock-text); } +.ft-chat-msg.is-assistant { align-self: flex-start; color: var(--dock-text); } +.ft-chat-msg.is-thinking, .ft-chat-msg.is-note { color: var(--dock-text-muted); font-size: var(--dock-fs-xs); } +.ft-chat-msg.is-thinking { font-style: italic; } +.ft-chat-msg.is-error { color: var(--dock-danger-text); } +.ft-chat-tool-card { display: flex; flex-direction: column; gap: 4px; align-self: flex-start; max-width: 100%; } +.ft-chat-tool { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; max-width: 100%; padding: 2px 8px; border: 1px solid var(--dock-border); border-radius: 6px; color: var(--dock-text-muted); font-family: var(--dock-font-mono); font-size: var(--dock-fs-xs); cursor: pointer; } +.ft-chat-tool-mark { display: inline-grid; place-items: center; } +.ft-chat-tool-name { color: var(--dock-text); } +.ft-chat-tool-input { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } +.ft-chat-tool.is-running .ft-chat-tool-mark { color: var(--dock-accent); } +.ft-chat-tool.is-error { border-color: var(--dock-danger); } +.ft-chat-tool.is-error .ft-chat-tool-mark { color: var(--dock-danger); } +.ft-chat-tool-out { margin: 0; max-height: 120px; overflow: auto; font-family: var(--dock-font-mono); font-size: var(--dock-fs-xs); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--dock-text-muted); } +.ft-chat-ask { display: flex; flex-direction: column; gap: var(--dock-space-1); align-self: flex-start; max-width: 82ch; padding: var(--dock-space-2) var(--dock-space-3); border: 1px solid var(--dock-accent-line); border-radius: var(--dock-radius); background: var(--dock-bar-bg); } +.ft-chat-ask-sum { font-family: var(--dock-font-mono); font-size: var(--dock-fs-xs); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--dock-text-dim); } +.ft-chat-ask-row { display: flex; align-items: center; gap: var(--dock-space-2); } +.ft-chat-ask.is-done .ft-chat-allow, .ft-chat-ask.is-done .ft-chat-deny { display: none; } +.ft-chat-ask-state { color: var(--dock-text-muted); } + +.ft-consent { margin: auto; padding: 0; border: 0; max-width: none; max-height: none; overflow: visible; background: transparent; color: var(--dock-text); } +.ft-consent::backdrop { background: var(--dock-scrim, rgba(0, 0, 0, 0.5)); } +.ft-consent-count.is-one { visibility: hidden; } +.ft-consent-notes { margin: 0; color: var(--dock-text-dim); font-size: var(--dock-fs-sm); line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; } +.ft-consent-note { display: block; } +.ft-consent-notes[hidden], .ft-consent-note[hidden], .ft-consent-btn[hidden] { display: none; } +.ft-consent-box { display: flex; flex-direction: column; gap: var(--dock-space-2); width: min(440px, calc(100vw - 32px)); padding: var(--dock-space-4); border: 1px solid var(--dock-outline, var(--dock-border)); border-radius: var(--dock-radius-md); background: var(--dock-bg); color: var(--dock-text); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45); user-select: text; -webkit-user-select: text; } +.ft-consent-title { margin: 0; font-size: var(--dock-fs-md, 15px); font-weight: 600; line-height: 1.35; } +.ft-consent-count, .ft-consent-notice { margin: 0; color: var(--dock-text-dim); font-size: var(--dock-fs-sm); } +.ft-consent-notice[hidden] { display: none; } +.ft-consent-what { margin: 0; color: var(--dock-text); font-size: var(--dock-fs-sm); line-height: 1.45; overflow-wrap: anywhere; } +.ft-consent-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--dock-space-2); margin-top: var(--dock-space-2); } +.ft-consent-buttons > .ft-consent-btn { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; } + +.ft-tour { position: fixed; inset: 0; z-index: var(--z-overlay); pointer-events: none; contain: strict; } +.ft-tour[hidden] { display: none; } +.ft-tour-ring { position: fixed; left: 0; top: 0; width: 0; height: 0; border: 2px solid var(--dock-accent); border-radius: var(--dock-radius-md); box-shadow: 0 0 0 9999px var(--dock-scrim, rgba(0, 0, 0, 0.5)); pointer-events: none; } +.ft-tour-card { position: fixed; left: 0; top: 0; display: flex; flex-direction: column; gap: var(--dock-space-2); width: min(320px, calc(100vw - 16px)); padding: var(--dock-space-3) var(--dock-space-4); border: 1px solid var(--dock-outline, var(--dock-border)); border-radius: var(--dock-radius-md); background: var(--dock-bg); color: var(--dock-text); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45); pointer-events: auto; user-select: text; -webkit-user-select: text; outline: none; } +.ft-tour-count { margin: 0; color: var(--dock-text-dim); font-size: var(--dock-fs-xs); } +.ft-tour-title { margin: 0; font-size: var(--dock-fs-md, 15px); font-weight: 600; } +.ft-tour-body { margin: 0; font-size: var(--dock-fs-sm); line-height: 1.45; } +.ft-tour-cmd { display: flex; align-items: center; gap: var(--dock-space-2); } +.ft-tour-cmd[hidden] { display: none; } +.ft-tour-cmd code { flex: 1; padding: var(--dock-space-1) var(--dock-space-2); border-radius: var(--dock-radius-sm); background: var(--dock-input-bg); font-family: var(--dock-font-mono); font-size: var(--dock-fs-xs); overflow-wrap: anywhere; } +.ft-tour-nav { display: flex; align-items: center; justify-content: flex-end; gap: var(--dock-space-2); } +.ft-tour-x { margin-right: auto; } +.ft-tour-back[hidden] { visibility: hidden; display: inline-flex; } diff --git a/frontend/src/dock/dock.ts b/frontend/src/dock/dock.ts new file mode 100644 index 0000000..bcbd54b --- /dev/null +++ b/frontend/src/dock/dock.ts @@ -0,0 +1,720 @@ +import type { DockAdapter, DockAgentStatus, DockAppTab, DockChannel, DockKind, DockOwnAsk, DockPaneHidden, DockProgramStatus, DockTerminal } from './adapter'; +import { DOCK_AGENTS, agentKind, agentKinds, type DockAgentKind } from './agents'; +import { ChatPane, OwnChat, type DockChatView } from './chat'; +import { Consent } from './consent'; +import { el, q, setClass, setDisabled, setHidden, setText } from './dom'; +import { dockIcon as icon } from './icons'; +import { chordLabel, contain, isChord, keeps, leaves } from './keys'; +import { placementFor, type Placement } from './placement'; +import type { DockSide } from './state'; +import type { DockTerm } from './terminal'; +import { strings, type Say } from './strings'; +import { Tour, type TourStep } from './tour'; + +export type { DockAdapter, DockKind } from './adapter'; + +interface Tab { + id: string; + term: DockTerm | null; + host: HTMLElement; + tab: HTMLElement; + channel: DockChannel | null; + kind: string; + seen: boolean; + closed: boolean; + status: string; +} + +interface Program { kind: DockAgentKind; button: HTMLButtonElement; row: HTMLElement } + +export class Dock { + private readonly a: DockAdapter; + private readonly s: Say; + private readonly kinds = new Map(); + readonly root: HTMLElement; + private readonly tabsEl: HTMLElement; + private readonly stage: HTMLElement; + private readonly empty: HTMLElement; + private readonly note: HTMLElement; + private readonly noteText: HTMLElement; + private readonly noteCmd: HTMLElement; + private readonly noteCopy: HTMLButtonElement; + private readonly ask: HTMLInputElement; + private readonly restartBtn: HTMLButtonElement; + private readonly tabs = new Map(); + private readonly owned = new Map void) | undefined }>(); + private chat: DockChatView | null = null; + private readonly ownAsk: DockOwnAsk | null; + private chatTab: HTMLElement | null = null; + private active: string | null = null; + private started = false; + private pending: Promise | null = null; + private emulator: Promise | null = null; + private asked: Promise | null> | null = null; + private mounted = false; + private revealing = false; + private readonly place: Placement; + onTab: () => void = () => undefined; + onChange: () => void = () => undefined; + onResize: () => void = () => undefined; + readonly consent: Consent | null; + private readonly tour: Tour; + + constructor(adapter: DockAdapter, parts: { consent?: Consent } = {}) { + const a = adapter as unknown as DockAdapter; + const s = strings(a); + const c = a.classes; + const ib = `${c.iconButton} ft-dock-ibtn`; + this.a = a; + this.s = s; + this.root = el(`
+ +
+
+ + + + + + + + +
+ +
+
+
+ ${icon('agent', 15)} + + +
+
`); + this.tabsEl = q(this.root, '.ft-dock-tabs'); + this.stage = q(this.root, '.ft-dock-stage'); + this.empty = q(this.root, '.ft-dock-empty'); + this.note = q(this.root, '.ft-dock-note'); + this.noteText = q(this.root, '.ft-dock-note-text'); + this.noteCmd = q(this.root, '.ft-dock-note-cmd'); + this.noteCopy = q(this.root, '.ft-dock-note-copy'); + this.ask = q(this.root, '.ft-dock-ask-input'); + this.restartBtn = q(this.root, '.ft-dock-restart'); + this.place = placementFor(a); + q(this.root, '.ft-dock-new').addEventListener('click', () => void this.open()); + q(this.root, '.ft-dock-claude').addEventListener('click', () => void this.claude()); + q(this.root, '.ft-dock-chat').addEventListener('click', () => void this.showChat()); + q(this.root, '.ft-dock-hide').addEventListener('click', () => this.toggle(false)); + q(this.root, '.ft-dock-side').addEventListener('click', () => { this.setSide(this.side() === 'right' ? 'bottom' : 'right'); this.focus(); }); + q(this.root, '.ft-dock-more').addEventListener('click', () => { this.menu(q(this.root, '.ft-dock-menu').hidden === true); }); + q(this.root, '.ft-dock-menu-settings').addEventListener('click', () => { this.menu(false); a.openSettings?.(); }); + setHidden(q(this.root, '.ft-dock-menu-settings'), !a.openSettings); + q(this.root, '.ft-dock-menu-tour').addEventListener('click', () => { this.menu(false); void this.guide(); }); + this.consent = parts.consent ?? (a.consent ? new Consent(a) : null); + this.tour = new Tour(a); + this.restartBtn.addEventListener('click', () => void this.restart()); + q(this.root, '.ft-dock-ask').addEventListener('submit', (e) => { e.preventDefault(); void this.send(); }); + q(this.root, '.ft-dock-note-x').addEventListener('click', () => this.dismiss()); + this.noteCopy.addEventListener('click', () => { void navigator.clipboard?.writeText(this.noteCmd.textContent ?? '').catch(() => undefined); }); + contain(this.root, a); + setClass(this.root, 'has-own-chat', !!a.chat && 'pane' in a.chat); + const ask = a.chat && 'pane' in a.chat ? a.chat.ask : undefined; + this.ownAsk = !ask || ask === 'none' ? null : ask === 'line' ? {} : ask; + if (this.ownAsk?.element) { + const slot = q(this.root, '.ft-dock-ask'); + const box = el('
'); + box.appendChild(this.ownAsk.element); + slot.classList.add('has-element'); + slot.appendChild(box); + } + } + + mount(host: HTMLElement, before: Node | null = null): void { + if (this.mounted) return; + this.mounted = true; + const a = this.a; + host.insertBefore(this.root, before); + this.place.start(this.root, q(this.root, '.ft-dock-grip'), { + changed: () => { this.labelSide(); this.onChange(); this.fitActive(); }, + resizing: () => { this.onResize(); }, + settled: () => { this.keep(); window.dispatchEvent(new Event('resize')); this.focus(); }, + }); + this.labelSide(); + this.refresh(); + document.addEventListener('pointerdown', (e) => { if (!(e.target as Element).closest?.('.ft-dock-menu, .ft-dock-more')) this.menu(false); }, true); + new ResizeObserver(() => this.fitActive()).observe(this.stage); + document.addEventListener('keydown', (e) => { + if (!isChord(a, e)) return; + e.preventDefault(); + e.stopPropagation(); + if (!e.repeat) this.toggle(); + }, true); + a.onTheme(() => this.retheme()); + new MutationObserver(() => this.retheme()).observe(document.documentElement, { attributes: true, attributeFilter: ['style', 'class', 'data-theme'] }); + if (this.isOpen()) void this.ensure(); + } + + isOpen(): boolean { return this.place.isOpen(); } + + keeps(event: Event): boolean { return keeps(this.a, event); } + + shown(): void { + this.place.shown(true); + this.tell('dock'); + void this.ensure(); + this.onTab(); + } + + hidden(): void { + this.place.shown(false); + this.tell('dock'); + this.tour.end(false); + this.onTab(); + } + + private tell(why: DockPaneHidden): void { + this.chat?.visible?.(this.isOpen() && this.active === 'chat' && this.chatTab !== null, why); + } + + toggle(on = !this.isOpen(), seed: DockKind | 'none' = 'shell'): void { + const p = this.a.placement; + if (p.mode === 'hosted') { p.request(on); return; } + this.place.setOpen(on); + this.tell('dock'); + this.keep(); + this.onChange(); + window.dispatchEvent(new Event('resize')); + if (on && !this.place.seen() && !this.tour.isRunning() && this.a.firstRun?.() !== false) void this.guide(); + if (!on) this.tour.end(false); + if (on) void this.ensure(seed); + this.onTab(); + } + + async newTerminal(): Promise { + if (!this.isOpen()) this.toggle(true); + else await this.open(); + } + + activeKind(): DockKind | K | null { + if (this.active === 'chat') return 'chat'; + const kind = this.active ? this.tabs.get(this.active)?.kind : undefined; + return kind && kind !== 'agent' ? kind as DockKind | K : null; + } + + isShowing(kind: DockKind | K): boolean { return this.isOpen() && this.activeKind() === kind; } + + async show(kind: DockKind | K): Promise { + if (!this.isOpen()) this.toggle(true, 'none'); + await this.ensure('none'); + if (kind === 'chat') { await this.showChat(); return; } + const own = [...this.tabs.values()].find((x) => x.kind === kind); + if (own) this.select(own.id); + else if (kind === 'claude') await this.claude(); + else if (kind !== 'shell') await this.program(kind); + else await this.open(); + } + + private label(kind: DockAgentKind, status?: DockProgramStatus): string { + return kind.name ? this.s(kind.name) : this.a.t(kind.id, status?.label ?? kind.label); + } + + private listPrograms(): void { + const order = agentKinds(this.a.tabs().builtin).filter((kind) => kind.id !== 'claude'); + const c = this.a.classes; + for (const [at, kind] of order.entries()) { + if (this.kinds.has(kind.id)) continue; + const name = this.label(kind); + const button = el(``); + const row = el(`

`); + button.title = name; + button.setAttribute('aria-label', name); + row.dataset.kind = kind.id; + button.dataset.dockPart = `launch.${kind.id}`; + q(row, '.ft-dock-menu-go').dataset.dockPart = `menu.launch.${kind.id}`; + setText(q(row, '.ft-dock-menu-go > span:last-child'), name); + button.addEventListener('click', () => void this.program(kind.id)); + q(row, '.ft-dock-menu-go').addEventListener('click', () => { this.menu(false); void this.program(kind.id); }); + const next = order.slice(at + 1).map((later) => this.kinds.get(later.id)).find((later) => later !== undefined); + q(this.root, '.ft-dock-head').insertBefore(button, next?.button ?? q(this.root, '.ft-dock-new')); + q(this.root, '.ft-dock-menu').insertBefore(row, next?.row ?? q(this.root, '.ft-dock-menu-links')); + this.kinds.set(kind.id, { kind, button, row }); + } + } + + private async programs(): Promise { + const status = await this.agents(); + for (const { kind, button, row } of this.kinds.values()) { + const st = status?.[kind.id]; + const offered = this.offers(kind.id); + const found = offered && !!st?.installed; + setHidden(row, !offered || !st); + setHidden(button, !found); + setHidden(q(row, '.ft-dock-menu-go'), !found); + const name = this.label(kind, st); + setText(q(row, '.ft-dock-menu-how'), st?.note || this.s(found ? kind.ready : kind.missing, { program: name })); + setText(q(row, '.ft-dock-menu-cmd'), found ? '' : st?.install ?? ''); + setHidden(q(row, '.ft-dock-menu-cmd'), found || !st?.install); + if (kind.name || button.title === name) continue; + button.title = name; + button.setAttribute('aria-label', name); + setText(q(row, '.ft-dock-menu-go > span:last-child'), name); + } + } + + private offers(kind: string): boolean { + return this.a.tabs().builtin.includes(kind) && (kind !== 'chat' || !!this.a.chat); + } + + activeTab(): string | null { return this.active; } + + refresh(): void { + this.listPrograms(); + setHidden(q(this.root, '.ft-dock-new'), !this.offers('shell')); + setHidden(q(this.root, '.ft-dock-chat'), !this.offers('chat')); + setHidden(q(this.root, '.ft-dock-claude'), !this.offers('claude')); + setHidden(this.restartBtn, !this.a.terminal.restart); + setClass(this.root, 'has-no-ask', !this.offers('claude') && !this.offers('chat')); + setClass(this.root, 'has-ask-line', this.ownAsk !== null && (this.offers('claude') || this.offers('chat'))); + const want = new Map((this.a.tabs().own ?? []).map((spec) => [spec.id, spec])); + for (const [id, o] of [...this.owned]) { + if (want.has(id)) continue; + o.off?.(); + o.tab.remove(); + o.host.remove(); + this.owned.delete(id); + if (this.active !== `own:${id}`) continue; + this.active = null; + const next = [...this.tabs.keys()].pop() ?? (this.chatTab ? 'chat' : undefined); + if (next) this.select(next); else { setHidden(this.empty, false); this.onTab(); } + } + for (const spec of want.values()) { + if (this.owned.has(spec.id)) continue; + const tab = el(''); + q(tab, '.ft-dock-tab-icon').innerHTML = spec.icon; + setText(q(tab, '.ft-dock-tab-title'), spec.label); + const host = el(''); + tab.addEventListener('click', () => this.select(`own:${spec.id}`)); + this.tabsEl.appendChild(tab); + this.stage.appendChild(host); + this.owned.set(spec.id, { spec, tab, host, mounted: false, off: undefined }); + setHidden(this.empty, true); + } + if (this.started) void this.programs(); + } + + private menu(open: boolean): void { + const m = q(this.root, '.ft-dock-menu'); + if (m.hidden === !open) return; + if (open) void this.programs(); + setHidden(m, !open); + q(this.root, '.ft-dock-more').setAttribute('aria-expanded', String(open)); + } + + async program(kind: string): Promise { + const size = this.size(); + try { + const info = await this.a.terminal.open(kind, { cols: size.cols, rows: size.rows }); + if (!this.isOpen()) this.toggle(true, 'none'); + await this.attach(info, true); + this.dismiss(); + return true; + } catch (err) { + const kind = this.a.errors.kind?.(err); + if (kind === 'oldEngine' || kind === 'notInstalled') { void this.programs(); this.menu(true); } + else this.warn(err); + return false; + } + } + + async toggleKind(kind: DockKind | K): Promise { + if (this.isShowing(kind)) this.toggle(false); + else await this.show(kind); + } + + async sync(): Promise { + if (!this.started) return; + for (const info of await this.list()) if (info.kind === 'agent') this.adopt(info); + } + + private keep(): void { this.place.keep(this.activeKind()); } + + async guide(): Promise { + if (!this.isOpen()) { + const first = !this.place.seen(); + this.toggle(true, 'none'); + if (first) return; + } + await this.showChat(); + const claude = (await this.agents())?.claude ?? null; + const middle: TourStep = !claude?.installed ? { target: '.ft-dock-claude', title: 'tourMissingTitle', body: 'tourMissingBody', cmd: claude?.install || 'npm install -g @anthropic-ai/claude-code' } + : claude.signedIn === false ? { target: '.ft-dock-claude', title: 'tourSignInTitle', body: 'tourSignInBody' } + : claude.signedIn === true ? { target: '.ft-dock-claude', title: 'tourReadyTitle', body: 'tourReadyBody' } + : { target: '.ft-dock-claude', title: 'tourInstalledTitle', body: 'tourInstalledBody' }; + const steps: TourStep[] = [ + { target: '.ft-dock', title: 'tourPanelTitle', body: 'tourPanelBody' }, + { target: this.ownAsk?.element ? '.ft-dock-ask' : this.ownAsk ? '.ft-dock-ask-input' : this.chat?.askTarget?.() ?? '.ft-dock-ask-input', title: 'tourChatTitle', body: 'tourChatBody' }, + middle, + ...(this.consent ? [{ target: '.ft-dock-more', title: 'tourAskTitle', body: 'tourAskBody' } as TourStep] : []), + { target: '.ft-dock-side', title: 'tourSideTitle', body: 'tourSideBody' }, + ]; + this.tour.start(steps, () => this.place.markSeen()); + } + + side(): DockSide { return this.place.side(); } + + storedSide(): DockSide { return this.place.storedSide(); } + + setSide(side: DockSide): void { + if (side === this.place.storedSide() && side === this.side()) return; + this.place.setSide(side); + this.labelSide(); + this.keep(); + this.onChange(); + window.dispatchEvent(new Event('resize')); + } + + private labelSide(): void { + const right = this.side() === 'right'; + const label = right ? this.s('toBottom') : this.s('toRight'); + const btn = q(this.root, '.ft-dock-side'); + if (btn.title !== label) { btn.title = label; btn.setAttribute('aria-label', label); } + q(this.root, '.ft-dock-grip').setAttribute('aria-orientation', right ? 'vertical' : 'horizontal'); + setHidden(btn, !this.place.canRight()); + } + + private retheme(): void { + for (const x of this.tabs.values()) x.term?.retheme(); + this.fitActive(); + } + + private load(): Promise { + this.emulator ??= import('./terminal'); + return this.emulator; + } + + private agents(): Promise | null> { + if (!this.asked) { + this.asked = this.a.agentStatus().catch(() => null); + void this.asked.then(() => window.setTimeout(() => { this.asked = null; }, 1500)); + } + return this.asked; + } + + private async list(): Promise[]> { + try { return await this.a.terminal.list(); } catch { return []; } + } + + private ensure(seed: DockKind | 'none' = 'shell'): Promise { + this.pending ??= this.boot(seed).finally(() => { this.pending = null; }); + return this.pending; + } + + private async boot(seed: DockKind | 'none'): Promise { + if (!this.started) { + this.started = true; + const listed = await this.list(); + for (const info of listed) this.adopt(info); + } + const shown = !!this.chatTab || [...this.tabs.values()].some((x) => x.kind !== 'agent'); + if (!shown && seed === 'shell') { + const first = this.owned.keys().next(); + if (this.offers('chat') && (this.place.savedTab() === 'chat' || !this.offers('shell'))) await this.showChat(); + else if (this.offers('shell')) await this.open(); + else if (!first.done) this.select(`own:${first.value}`); + } + setHidden(this.empty, !!this.chatTab || this.tabs.size > 0); + void this.programs(); + this.fitActive(); + this.focus(); + this.awaitReveal(); + this.onTab(); + } + + private awaitReveal(): void { + const root = this.root; + const hiddenNow = (): boolean => root.getClientRects().length === 0 || getComputedStyle(root).visibility === 'hidden'; + const lost = document.activeElement; + if (this.revealing || !this.isOpen() || root.contains(lost) || !hiddenNow()) return; + this.revealing = true; + const watch = new MutationObserver(() => { + const moved = document.activeElement !== lost || !this.isOpen(); + if (!moved && hiddenNow()) return; + watch.disconnect(); + this.revealing = false; + if (!moved) this.focus(); + }); + for (let node: Node | null = root.parentNode; node instanceof Element; node = node.parentNode) watch.observe(node, { attributes: true, attributeFilter: ['class', 'style', 'hidden'] }); + } + + focus(): void { + if (this.active === 'chat' && this.ownAsk && !this.ownAsk.element) this.ask.focus({ preventScroll: true }); + else if (this.active === 'chat' && this.chat?.focus) this.chat.focus(); + else if (this.active === 'chat') this.ask.focus({ preventScroll: true }); + else if (this.active) this.tabs.get(this.active)?.term?.focus(); + } + + async sendChat(text: string): Promise { + await this.show('chat'); + return this.chat ? this.chat.send(text) : false; + } + + async showChat(): Promise { + const c = this.a.chat; + if (!c) return; + if (!this.chat) { + if ('pane' in c) this.chat = new OwnChat(c); + else { + const chat = new ChatPane({ ...this.a, chat: c }); + chat.onFail = (err) => this.warn(err); + chat.onHandoff = (session) => void this.claude(undefined, session); + chat.onBash = () => void this.sync(); + this.chat = chat; + } + this.stage.appendChild(this.chat.root); + } + if (!this.chatTab) { + const tab = el(``); + tab.addEventListener('click', (e) => { + if ((e.target as HTMLElement).closest('.ft-dock-tab-x')) this.closeChat(); + else this.select('chat'); + }); + this.tabsEl.prepend(tab); + this.chatTab = tab; + } + setHidden(this.empty, true); + this.select('chat'); + await this.chat.load(); + } + + private closeChat(): void { + this.chatTab?.remove(); + this.chatTab = null; + this.tell('tab'); + this.chat?.release(); + if (this.chat) setHidden(this.chat.root, true); + if (this.active === 'chat') { + this.active = null; + const next = [...this.tabs.keys()].pop(); + if (next) this.select(next); + else { setHidden(this.empty, false); this.syncAsk(); setDisabled(this.restartBtn, true); this.onTab(); } + } + } + + private syncAsk(): void { + const chat = this.active === 'chat'; + const text = chat ? this.s('chatPlaceholder') : this.s('askPlaceholder'); + if (this.ask.placeholder !== text) this.ask.placeholder = text; + } + + private async send(): Promise { + const text = this.ask.value.trim(); + if (!text) return; + const chat = this.chat; + if (this.ownAsk && (this.ownAsk.send || (this.active === 'chat' && chat))) { + const route = this.ownAsk.send; + if (!route && chat?.isBusy()) return; + this.ask.value = ''; + const went = route ? (await route(text, this.activeKind())) !== false : chat ? await chat.send(text) : false; + if (!went && !this.ask.value) this.ask.value = text; + return; + } + if (this.active === 'chat' && this.chat) { + if (this.chat.isBusy()) return; + this.ask.value = ''; + await this.chat.send(text); + return; + } + this.ask.value = ''; + const ok = await this.claude(text); + if (!ok && !this.ask.value) this.ask.value = text; + } + + private say(text: string, cmd = ''): void { + setText(this.noteText, text); + setText(this.noteCmd, cmd); + setHidden(this.noteCmd, cmd === ''); + setHidden(this.noteCopy, cmd === ''); + setHidden(this.note, false); + } + + private dismiss(): void { setHidden(this.note, true); } + + private warn(err: unknown): void { + const kind = this.a.errors.kind?.(err); + const said = this.a.errors.message(err) ?? (err instanceof Error ? err.message : ''); + if (kind === 'unreachable') this.say(this.a.words.start ? this.s('offlineStart') : this.s('offline')); + else if (kind === 'refused') this.say(said || this.s('refused')); + else this.say(said || this.s('failed')); + } + + private async fail(err: unknown, what: 'shell' | 'claude'): Promise { + const kind = this.a.errors.kind?.(err); + if (what === 'shell' || kind === 'refused' || kind === 'unreachable') { this.warn(err); return; } + const status = (await this.agents())?.claude; + if (status && !status.installed) { + this.say(this.s('notInstalled'), status.install); + return; + } + if (kind === 'oldEngine') this.say(this.s('oldEngine')); + else this.say(`${this.s('notStarted')} ${err instanceof Error ? err.message : ''}`.trim()); + } + + private ended(x: Tab, on: boolean): void { + setClass(x.tab, 'is-ended', on); + if (x.kind === 'agent') return; + const tip = on ? this.s('endedTab') : x.tab.dataset.tip ?? ''; + if (x.tab.title !== tip) x.tab.title = tip; + } + + private adopt(info: DockTerminal): void { + if (this.tabs.has(info.id)) return; + void this.attach(info, this.active === null || info.kind !== 'agent'); + } + + private async open(): Promise { + try { + const info = await this.a.terminal.open('shell', { cols: 100, rows: 24 }); + await this.attach(info, true); + this.dismiss(); + } catch (err) { await this.fail(err, 'shell'); } + } + + async claude(prompt?: string, resume?: string): Promise { + const size = this.size(); + try { + const info = await this.a.terminal.open('claude', { cols: size.cols, rows: size.rows, ...(prompt ? { prompt } : {}), ...(resume ? { resume } : {}) }); + if (!this.isOpen()) this.toggle(true, 'none'); + if (this.tabs.has(info.id)) this.select(info.id); + else await this.attach(info, true); + this.dismiss(); + return true; + } catch (err) { + await this.fail(err, 'claude'); + return false; + } + } + + private size(): { cols: number; rows: number } { + const tab = this.active ? this.tabs.get(this.active) : null; + return tab?.term ? { cols: tab.term.cols(), rows: tab.term.rows() } : { cols: 100, rows: 20 }; + } + + private async attach(info: DockTerminal, show: boolean): Promise { + if (this.tabs.has(info.id)) { if (show) this.select(info.id); return; } + const program = DOCK_AGENTS.some((k) => k.id === info.kind) || this.kinds.has(info.kind); + const kind: string = program || info.kind === 'agent' ? info.kind : 'shell'; + const agent = kind === 'agent'; + const mark = program ? agentKind(kind).icon : 'terminal'; + const host = el(''); + const tab = el(``); + setText(q(tab, '.ft-dock-tab-title'), info.title); + if (agent) tab.title = this.s('agentTab'); + tab.addEventListener('click', (e) => { + if ((e.target as HTMLElement).closest('.ft-dock-tab-x')) void this.close(info.id); + else this.select(info.id); + }); + this.stage.appendChild(host); + this.tabsEl.appendChild(tab); + if (info.tip) tab.dataset.tip = info.tip; + const entry: Tab = { id: info.id, term: null, host, tab, channel: null, kind, seen: false, closed: false, status: info.status ?? '' }; + this.tabs.set(info.id, entry); + setHidden(this.empty, true); + this.ended(entry, !info.alive); + if (show) this.select(info.id, false); + const { createTerm } = await this.load(); + if (entry.closed) return; + const term = createTerm({ agent, scrollback: this.a.terminal.scrollback, leaves: (e) => leaves(this.a, e) }); + entry.term = term; + term.open(host); + term.onInput((data) => entry.channel?.send(data)); + if (this.active === info.id) { this.fitActive(); if (show && !agent) term.focus(); } + await this.connect(entry); + } + + private async connect(entry: Tab): Promise { + const silent = (): void => { if (!entry.seen && !entry.closed) this.say(this.s('noAnswer')); }; + let channel: DockChannel; + try { channel = await this.a.terminal.channel(entry.id); } catch { silent(); return; } + if (entry.closed) { channel.close(); return; } + entry.channel = channel; + channel.onData((data) => { entry.seen = true; entry.term?.write(data); }); + channel.onExit(() => { entry.seen = true; this.ended(entry, true); }); + channel.onClose?.(() => { if (entry.channel === channel) entry.channel = null; silent(); }); + channel.onStatus?.((text) => { entry.status = text; this.showStatus(); }); + this.sendSize(entry); + } + + private showStatus(): void { + const x = this.active ? this.tabs.get(this.active) : undefined; + setText(q(this.root, '.ft-dock-spacer'), x?.status ?? ''); + } + + private sendSize(x: Tab): void { + if (x.term) x.channel?.resize(x.term.cols(), x.term.rows()); + } + + private fitActive(): void { + const x = this.active ? this.tabs.get(this.active) : null; + if (!x?.term || x.host.hidden || this.stage.clientHeight < 20) return; + if (x.term.fit()) this.sendSize(x); + } + + private select(id: string, focus = true): void { + this.active = id; + for (const [tid, x] of this.tabs) { + const on = tid === id; + setHidden(x.host, !on); + x.tab.classList.toggle('is-on', on); + x.tab.setAttribute('aria-selected', String(on)); + } + if (this.chat) setHidden(this.chat.root, id !== 'chat'); + if (this.chatTab) { + this.chatTab.classList.toggle('is-on', id === 'chat'); + this.chatTab.setAttribute('aria-selected', String(id === 'chat')); + } + for (const [oid, o] of this.owned) { + const on = `own:${oid}` === id; + if (on && !o.mounted) { o.mounted = true; const off = o.spec.mount(o.host); o.off = typeof off === 'function' ? off : undefined; } + setHidden(o.host, !on); + setClass(o.tab, 'is-on', on); + o.tab.setAttribute('aria-selected', String(on)); + } + this.syncAsk(); + this.showStatus(); + setDisabled(this.restartBtn, !this.tabs.has(id) || this.tabs.get(id)?.kind === 'agent'); + this.fitActive(); + if (focus) this.focus(); + this.keep(); + this.tell('tab'); + this.onTab(); + } + + private async restart(): Promise { + const x = this.active ? this.tabs.get(this.active) : null; + if (!x || x.kind === 'agent' || !this.a.terminal.restart) return; + try { await this.a.terminal.restart(x.id); } catch (err) { this.warn(err); return; } + this.ended(x, false); + if (!x.channel) { x.term?.reset(); x.seen = false; await this.connect(x); } + this.sendSize(x); + x.term?.focus(); + } + + private async close(id: string): Promise { + const x = this.tabs.get(id); + if (!x) return; + x.closed = true; + x.channel?.close(); + x.term?.dispose(); + x.host.remove(); + x.tab.remove(); + this.tabs.delete(id); + await this.a.terminal.close(id).catch(() => undefined); + if (this.active === id) { + this.active = null; + const next = [...this.tabs.keys()].pop() ?? (this.chatTab ? 'chat' : undefined); + if (next) this.select(next); + else { setDisabled(this.restartBtn, true); this.syncAsk(); this.showStatus(); this.onTab(); } + } + setHidden(this.empty, this.tabs.size > 0 || !!this.chatTab); + } +} diff --git a/frontend/src/dock/dom.ts b/frontend/src/dock/dom.ts new file mode 100644 index 0000000..d18d06a --- /dev/null +++ b/frontend/src/dock/dom.ts @@ -0,0 +1,27 @@ +export function el(html: string): T { + const t = document.createElement('template'); + t.innerHTML = html.trim(); + return document.adoptNode(t.content.firstElementChild as T); +} + +export function q(root: ParentNode, sel: string): T { + const n = root.querySelector(sel); + if (!n) throw new Error(`missing element: ${sel}`); + return n as T; +} + +export function setText(node: Element | null, text: string): void { + if (node && node.textContent !== text) node.textContent = text; +} + +export function setClass(node: Element | null, cls: string, on: boolean): void { + if (!node) return; + if (node.classList.contains(cls) !== on) node.classList.toggle(cls, on); +} + +export function setHidden(node: HTMLElement, hidden: boolean): void { if (node.hidden !== hidden) node.hidden = hidden; } +export function setDisabled(node: HTMLButtonElement | HTMLInputElement | HTMLSelectElement, disabled: boolean): void { if (node.disabled !== disabled) node.disabled = disabled; } + +export function cssToken(name: string, fallback: string): string { + return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback; +} diff --git a/frontend/src/dock/icons.ts b/frontend/src/dock/icons.ts new file mode 100644 index 0000000..b57b519 --- /dev/null +++ b/frontend/src/dock/icons.ts @@ -0,0 +1,22 @@ +const ICONS: Record = { + plus: ``, + close: ``, + refresh: ``, + send: ``, + agent: ``, + agentChat: ``, + terminal: ``, + codex: ``, + cursor: ``, + antigravity: ``, + dockRight: ``, + dockBottom: ``, + menu: ``, +}; + +export type DockIcon = keyof typeof ICONS; + +export function dockIcon(name: string, size = 16): string { + const svg = ICONS[name] ?? ICONS.terminal; + return ``; +} diff --git a/frontend/src/dock/keys.ts b/frontend/src/dock/keys.ts new file mode 100644 index 0000000..d8f8e51 --- /dev/null +++ b/frontend/src/dock/keys.ts @@ -0,0 +1,35 @@ +import type { DockAdapter } from './adapter'; + +export type DockKeys = Pick; + +export function onMac(): boolean { + return /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent); +} + +export function isChord(a: DockKeys, e: KeyboardEvent): boolean { + if (a.isDockChord) return a.isDockChord(e); + if (e.code !== 'KeyJ' || e.shiftKey || e.altKey) return false; + return onMac() ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey; +} + +export function chordLabel(a: DockKeys): string { + return a.chordLabel ? a.chordLabel() : onMac() ? 'Cmd+J' : 'Ctrl+J'; +} + +export function leaves(a: DockKeys, e: KeyboardEvent): boolean { + return isChord(a, e) || a.passKey?.(e) === true; +} + +export function contain(node: HTMLElement, a: DockKeys): void { + const stop = (e: Event): void => { if (!leaves(a, e as KeyboardEvent)) e.stopPropagation(); }; + for (const type of ['keydown', 'keypress', 'keyup']) node.addEventListener(type, stop); +} + +export function ownsEvent(e: Event): boolean { + const at = e.target; + return at instanceof Element && at.closest('.ft-dock, .ft-consent, .ft-tour') !== null; +} + +export function keeps(a: DockKeys, e: Event): boolean { + return ownsEvent(e) && !(e instanceof KeyboardEvent && leaves(a, e)); +} diff --git a/frontend/src/dock/placement.ts b/frontend/src/dock/placement.ts new file mode 100644 index 0000000..d23caba --- /dev/null +++ b/frontend/src/dock/placement.ts @@ -0,0 +1,166 @@ +import type { DockAdapter, DockSizes, DockStorage } from './adapter'; +import { moveLegacy, readSeen, readState, type DockSide, type DockState } from './state'; + +export interface PlacementHooks { changed(): void; resizing(): void; settled(): void } + +export interface Placement { + readonly hosted: boolean; + start(root: HTMLElement, grip: HTMLElement, hooks: PlacementHooks): void; + isOpen(): boolean; + setOpen(on: boolean): void; + side(): DockSide; + storedSide(): DockSide; + canRight(): boolean; + setSide(side: DockSide): void; + keep(tab: string | null): void; + savedTab(): string; + seen(): boolean; + markSeen(): void; + shown(on: boolean): void; +} + +const store = (): Storage | null => { try { return window.localStorage; } catch { return null; } }; + +class OwnPlacement implements Placement { + readonly hosted = false; + private state: DockState; + private hooks: PlacementHooks | null = null; + + constructor(private readonly keyed: DockStorage, private readonly z: DockSizes, private readonly right: (() => boolean) | undefined) { + const s = store(); + const defaults = { h: z.defaultHeight, w: z.defaultWidth }; + if (s) moveLegacy(s, keyed.key, keyed.legacy, defaults); + this.state = s ? readState(s, keyed.key, keyed.legacy, defaults) : { open: false, side: 'bottom', h: defaults.h, w: defaults.w, tab: '' }; + } + + start(_root: HTMLElement, grip: HTMLElement, hooks: PlacementHooks): void { + this.hooks = hooks; + this.state.open = this.isOpen(); + this.apply(); + window.addEventListener('resize', () => { if (this.apply()) hooks.changed(); }); + this.drag(grip); + } + + isOpen(): boolean { + const at = document.documentElement.getAttribute('data-ft-dock'); + return at === null ? this.state.open : at === 'open'; + } + + setOpen(on: boolean): void { + this.state.open = on; + this.apply(); + } + + storedSide(): DockSide { return this.state.side; } + + side(): DockSide { return this.state.side === 'right' && this.canRight() ? 'right' : 'bottom'; } + + canRight(): boolean { + if (this.right && !this.right()) return false; + return this.z.keepWidth === undefined && !this.z.maxWidth ? true : this.maxWidth() >= this.z.minWidth; + } + + setSide(side: DockSide): void { + this.state.side = side; + this.apply(); + } + + keep(tab: string | null): void { + const s = store(); + if (!s) return; + if (tab) this.state.tab = tab; + const seen = readSeen(s, this.keyed.key); + try { s.setItem(this.keyed.key, JSON.stringify(seen ? { ...this.state, seen } : this.state)); } catch { return; } + } + + savedTab(): string { return this.state.tab; } + + seen(): boolean { + const s = store(); + return s ? readSeen(s, this.keyed.key) : true; + } + + markSeen(): void { + const s = store(); + if (!s) return; + try { s.setItem(this.keyed.key, JSON.stringify({ ...this.state, seen: true })); } catch { return; } + } + + shown(): void { return; } + + private maxWidth(): number { + return Math.min(window.innerWidth * this.z.maxWidthShare, window.innerWidth - (this.z.keepWidth ?? 0), this.z.maxWidth ? this.z.maxWidth() : Infinity); + } + + private maxHeight(): number { + return Math.min(window.innerHeight * this.z.maxHeightShare, window.innerHeight - (this.z.keepHeight ?? 0), this.z.maxHeight ? this.z.maxHeight() : Infinity); + } + + private width(w: number): number { return Math.round(Math.max(this.z.minWidth, Math.min(this.maxWidth(), w))); } + + private height(h: number): number { return Math.round(Math.max(this.z.minHeight, Math.min(this.maxHeight(), h))); } + + private apply(): boolean { + const html = document.documentElement; + const want: Array<[string, string]> = [ + ['data-ft-dock', this.state.open ? 'open' : 'closed'], ['data-ft-dock-side', this.side()], + ['data-ft-dock-h', String(this.height(this.state.h))], ['data-ft-dock-w', String(this.width(this.state.w))], + ]; + let changed = false; + for (const [name, value] of want) if (html.getAttribute(name) !== value) { html.setAttribute(name, value); changed = true; } + const sizes: Array<[string, string]> = [['--ft-dock-size', `${this.height(this.state.h)}px`], ['--ft-dock-wsize', `${this.width(this.state.w)}px`]]; + for (const [name, value] of sizes) if (html.style.getPropertyValue(name) !== value) html.style.setProperty(name, value); + return changed; + } + + private drag(grip: HTMLElement): void { + grip.addEventListener('pointerdown', (e) => { + if (e.button !== 0) return; + e.preventDefault(); + grip.setPointerCapture(e.pointerId); + grip.classList.add('is-dragging'); + const right = this.side() === 'right'; + const from = right ? this.width(this.state.w) : this.height(this.state.h); + const at = right ? e.clientX : e.clientY; + const move = (ev: PointerEvent): void => { + const size = from + at - (right ? ev.clientX : ev.clientY); + if (right) this.state.w = this.width(size); else this.state.h = this.height(size); + if (this.apply()) this.hooks?.resizing(); + }; + const up = (): void => { + grip.removeEventListener('pointermove', move); + grip.removeEventListener('pointerup', up); + grip.removeEventListener('pointercancel', up); + grip.classList.remove('is-dragging'); + this.hooks?.settled(); + }; + grip.addEventListener('pointermove', move); + grip.addEventListener('pointerup', up); + grip.addEventListener('pointercancel', up); + }); + } +} + +class HostedPlacement implements Placement { + readonly hosted = true; + private on = false; + private tab = ''; + + start(root: HTMLElement): void { root.classList.add('is-hosted'); } + isOpen(): boolean { return this.on; } + setOpen(): void { return; } + side(): DockSide { return 'bottom'; } + storedSide(): DockSide { return 'bottom'; } + canRight(): boolean { return false; } + setSide(): void { return; } + keep(tab: string | null): void { if (tab) this.tab = tab; } + savedTab(): string { return this.tab; } + seen(): boolean { return true; } + markSeen(): void { return; } + shown(on: boolean): void { this.on = on; } +} + +export function placementFor(a: Pick): Placement { + const p = a.placement; + return p.mode === 'hosted' ? new HostedPlacement() : new OwnPlacement(p.storage, p.sizes, p.canDockRight); +} diff --git a/frontend/src/dock/state.ts b/frontend/src/dock/state.ts new file mode 100644 index 0000000..6fc4b41 --- /dev/null +++ b/frontend/src/dock/state.ts @@ -0,0 +1,45 @@ +export type DockSide = 'bottom' | 'right'; +export interface DockState { open: boolean; side: DockSide; h: number; w: number; tab: string } +export interface DockStore { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void } + +export interface DockLegacy { keys: string[]; read(store: DockStore): (Partial & { seen?: boolean }) | null } + +export function jsonLegacy(keys: string[], seen = false): DockLegacy { + return { + keys, + read: (store) => { + for (const k of keys) { + try { const v = store.getItem(k); const s: unknown = v ? JSON.parse(v) : null; if (s && typeof s === 'object') return { ...(s as Partial), seen }; } catch { continue; } + } + return null; + }, + }; +} + +export function readState(store: DockStore, key: string, from: DockLegacy | string[] | undefined, defaults: { h: number; w: number }): DockState { + const legacy = Array.isArray(from) ? jsonLegacy(from) : from; + const own = (): Partial | null => { + try { const v = store.getItem(key); const s: unknown = v ? JSON.parse(v) : null; return s && typeof s === 'object' ? s as Partial : null; } catch { return null; } + }; + const old = (): Partial | null => { try { return legacy ? legacy.read(store) : null; } catch { return null; } }; + const s = own() ?? old() ?? {}; + return { + open: s.open === true, side: s.side === 'right' ? 'right' : 'bottom', + h: typeof s.h === 'number' ? s.h : defaults.h, w: typeof s.w === 'number' ? s.w : defaults.w, tab: typeof s.tab === 'string' ? s.tab : '', + }; +} + +export function readSeen(store: DockStore, key: string): boolean { + try { const v = store.getItem(key); return v ? (JSON.parse(v) as { seen?: unknown }).seen === true : false; } catch { return false; } +} + +export function moveLegacy(store: DockStore, key: string, from: DockLegacy | string[] | undefined, defaults: { h: number; w: number }): boolean { + const legacy = Array.isArray(from) ? jsonLegacy(from) : from; + try { + if (!legacy || store.getItem(key) !== null || !legacy.keys.some((k) => store.getItem(k) !== null)) return false; + const state = readState(store, key, legacy, defaults); + store.setItem(key, JSON.stringify(legacy.read(store)?.seen === true ? { ...state, seen: true } : state)); + for (const k of legacy.keys) store.removeItem(k); + return true; + } catch { return false; } +} diff --git a/frontend/src/dock/strings.ts b/frontend/src/dock/strings.ts new file mode 100644 index 0000000..ec8296c --- /dev/null +++ b/frontend/src/dock/strings.ts @@ -0,0 +1,115 @@ +import type { DockAdapter } from './adapter'; + +export const STRINGS = { + terminal: 'Terminal', + resize: 'Resize the terminal', + terminals: 'Terminals', + newTerminal: 'New Terminal', + chatAbout: 'Chat with Claude about your {noun}', + chatWith: 'Chat with Claude', + claudeCode: 'Claude Code', + restart: 'Restart this tab', + hide: 'Hide Terminal', + codex: 'Codex', + cursor: 'Cursor', + antigravity: 'Antigravity', + moreAgents: 'More agents', + programMissing: '{program} is not on this computer yet: install it with the command below, then sign in once in a terminal.', + programReady: '{program} is installed. Start it in a new tab.', + toRight: 'Move the terminal to the right', + toBottom: 'Move the terminal to the bottom', + hideTitle: 'Hide Terminal ({chord}); programs keep running', + empty: 'No terminal is open. Start a shell with the plus button, Claude Code with the agent button, or Chat with the speech bubble.', + copy: 'Copy', + dismiss: 'Dismiss', + askPlaceholder: 'Ask Claude Code to work on your {noun}', + askLabel: 'Ask Claude Code', + send: 'Send to Claude Code', + chat: 'Chat', + closeChat: 'Close the Chat tab', + chatPlaceholder: 'Ask Claude about your {noun} (Enter to send)', + failed: 'The request failed.', + notInstalled: 'Claude Code is not installed. Install it with the command below, then sign in once by running claude in a terminal.', + oldEngine: 'This copy of the {app} engine cannot run Claude Code in a tab yet. Restart the engine, then try again.', + notStarted: 'Claude Code could not be started.', + closeTab: 'Close this tab', + agentTab: "Claude's commands, read only", + endedTab: 'This program has ended. Restart this tab to run it again.', + noAnswer: 'The engine did not answer on this terminal. Restart the engine, then close this tab and open it again.', + modeLabel: 'Permission mode', + stop: 'Stop', + handoffTitle: 'Continue this conversation in a Claude Code terminal tab', + handoff: 'Continue in Claude Code', + newChat: 'New Chat', + modeAsk: 'Ask', + modeAuto: 'Auto-accept edits', + modePlan: 'Plan', + sendFailed: 'The message could not be sent.', + offline: 'The {app} engine is not reachable.', + offlineStart: 'The {app} engine is not reachable. Start it with {start}.', + refused: 'This is not allowed for you here.', + missing: 'Claude Code is not installed', + signedIn: 'signed in', + notSignedIn: 'not signed in: run claude in a terminal and sign in with /login', + working: 'working', + ready: 'ready', + idle: 'not started', + handoffFirst: 'Start a conversation here first; then it can continue in Claude Code', + handoffBusy: 'Wait for Claude to finish, or press Stop, before moving the conversation', + allowed: 'Allowed', + declined: 'Declined', + stoppedError: 'Claude Code stopped with an error.', + allow: 'Allow', + deny: 'Deny', + asksToUse: 'Claude Code asks to use {tool}', + consentTitle: 'Allow an agent calling itself {agent} to make changes in {app}?', + consentTitleUnnamed: 'Allow an outside agent to make changes in {app}?', + consentWhat: 'It asked to {what}.', + consentCount: 'Request {n} of {total}', + consentDeny: 'Deny', + consentOnce: 'Allow once', + consentAlways: 'Always allow any agent named {agent}', + consentAlwaysUnnamed: 'Always allow this agent', + consentAlwaysAll: 'Always allow all outside agents', + consentChanged: 'The Outside agents setting was changed outside {app}, so {app} asks again.', + outsideAgents: 'Outside agents', + showAround: 'Show me around', + tourCount: 'Step {n} of {total}', + tourBack: 'Back', + tourNext: 'Next', + tourDone: 'Done', + tourClose: 'Close the guide', + tourPanelTitle: 'This is your helper panel', + tourPanelBody: 'This panel is where you talk to Claude, an assistant that can work on your {noun} for you. It stays out of the way until you open it.', + tourChatTitle: 'Ask for something in plain words', + tourChatBody: 'Type what you want in this line, for example "{example}", and press Enter. Claude does it in {app}.', + tourInstalledTitle: 'Claude Code is installed', + tourInstalledBody: 'Claude Code is installed. The robot button here opens it; the first time, it may ask you to sign in. Codex, Cursor and Antigravity each get a button of their own here when they are on this computer.', + tourMissingTitle: 'Claude Code is not on this computer yet', + tourMissingBody: 'For the bigger jobs, {app} uses a free program called Claude Code. To add it, copy the line below, open your computer\'s command window, paste it and press Enter.', + tourSignInTitle: 'Sign in to Claude Code once', + tourSignInBody: 'Claude Code is installed but not signed in. Press the robot button here: a window opens where you type /login and follow the steps. You only do this once.', + tourReadyTitle: 'Claude Code is ready', + tourReadyBody: 'Claude Code is installed and signed in. The robot button here opens it when you want it to take on a bigger job. Codex, Cursor and Antigravity each get a button of their own here when they are on this computer.', + tourAskTitle: 'You decide what other programs may change', + tourAskBody: 'If another AI program on this computer wants to change your {noun}, {app} asks you first in a box in the middle of the window. Choose Deny, Allow once or Always allow. You can change your answer later under Outside agents in the menu here.', + tourSideTitle: 'Put the panel where you like it', + tourSideBody: 'This button moves the panel to the right side of the window, and back to the bottom. Drag its edge to make it bigger or smaller.', +} as const; + +export type StringKey = keyof typeof STRINGS; +export type Say = (key: StringKey, vars?: Record) => string; +export const SENTENCES: readonly string[] = Object.values(STRINGS); + +export function fill(text: string, vars: Record): string { + return text.replace(/\{(\w+)\}/g, (m, name: string) => { const v = vars[name]; return v === undefined ? m : String(v); }); +} + +export function strings(a: Pick): Say { + const words = { app: a.words.app, noun: a.words.noun, example: a.words.example, start: a.words.start ?? '' }; + return (key, vars) => fill(a.t(key, a.strings?.[key] ?? STRINGS[key]), { ...words, ...vars }); +} + +export function lead(a: Pick): string { + return fill(a.t('lead', a.words.lead), { app: a.words.app, noun: a.words.noun, example: a.words.example }); +} diff --git a/frontend/src/dock/terminal.ts b/frontend/src/dock/terminal.ts new file mode 100644 index 0000000..a934d2b --- /dev/null +++ b/frontend/src/dock/terminal.ts @@ -0,0 +1,88 @@ +import { FitAddon } from '@xterm/addon-fit'; +import { Terminal } from '@xterm/xterm'; +import '@xterm/xterm/css/xterm.css'; +import { cssToken as token } from './dom'; + +export interface DockTermOptions { agent: boolean; scrollback?: number | undefined; leaves(event: KeyboardEvent): boolean } + +export interface DockTerm { + cols(): number; + rows(): number; + open(host: HTMLElement): void; + fit(): boolean; + focus(): void; + write(data: string | Uint8Array): void; + reset(): void; + retheme(): void; + onInput(handler: (data: string) => void): void; + dispose(): void; +} + +function number(name: string, fallback: number): number { + const n = parseFloat(token(name, String(fallback))); + return n > 0 ? n : fallback; +} + +function colour(probe: HTMLElement | null, name: string, fallback: string): string { + const raw = token(name, ''); + if (!raw) return fallback; + if (!probe || /^#[0-9a-f]{3,8}$/i.test(raw)) return raw; + probe.style.color = raw; + const seen = probe.style.color ? getComputedStyle(probe).color : ''; + probe.style.removeProperty('color'); + return /^rgba?\(/.test(seen) ? seen : raw; +} + +function theme(probe: HTMLElement | null): { background: string; foreground: string; cursor: string; cursorAccent: string; selectionBackground: string } { + const background = colour(probe, '--dock-term-bg', '#111111'); + return { + background, + foreground: colour(probe, '--dock-term-fg', '#f7f7f7'), + cursor: colour(probe, '--dock-term-cursor', '#f97316'), + cursorAccent: background, + selectionBackground: colour(probe, '--dock-term-selection', '#f9731633'), + }; +} + +export function createTerm(o: DockTermOptions): DockTerm { + const term = new Terminal({ + fontFamily: token('--dock-font-mono', 'monospace'), fontSize: number('--dock-term-font-size', 13), lineHeight: number('--dock-term-line-height', 1.25), + cursorBlink: !o.agent, disableStdin: o.agent, scrollback: o.scrollback ?? 5000, minimumContrastRatio: number('--dock-term-contrast', 1), + theme: theme(null), overviewRuler: { width: 0 }, + }); + const fit = new FitAddon(); + let probe: HTMLElement | null = null; + let look = ''; + term.loadAddon(fit); + term.attachCustomKeyEventHandler((e) => !o.leaves(e)); + const retheme = (): void => { + const now = theme(probe); + const size = number('--dock-term-font-size', 13); + const next = JSON.stringify([now, size]); + if (next === look) return; + look = next; + term.options.theme = now; + if (term.options.fontSize !== size) term.options.fontSize = size; + }; + return { + cols: () => term.cols, + rows: () => term.rows, + open: (host) => { + probe = host; + term.open(host); + retheme(); + if (o.agent) term.write('\x1b[?25l'); + }, + fit: () => { + const before = `${term.cols}x${term.rows}`; + fit.fit(); + return `${term.cols}x${term.rows}` !== before; + }, + focus: () => term.focus(), + write: (data) => term.write(data), + reset: () => term.reset(), + retheme, + onInput: (handler) => { term.onData(handler); }, + dispose: () => term.dispose(), + }; +} diff --git a/frontend/src/dock/tour.ts b/frontend/src/dock/tour.ts new file mode 100644 index 0000000..358cac3 --- /dev/null +++ b/frontend/src/dock/tour.ts @@ -0,0 +1,182 @@ +import type { DockAdapter } from './adapter'; +import { el, q, setHidden, setText } from './dom'; +import { contain } from './keys'; +import { strings, type Say, type StringKey } from './strings'; + +export interface TourStep { target: string | HTMLElement; title: StringKey; body: StringKey; cmd?: string } + +const find = (target: string | HTMLElement): Element | null => (typeof target === 'string' ? document.querySelector(target) : target); + +const GAP = 12; +const EDGE = 8; +const PAD = 4; + +const shown = (node: Element | null): node is HTMLElement => { + if (!(node instanceof HTMLElement) || !node.isConnected) return false; + const r = node.getBoundingClientRect(); + return r.width > 0 && r.height > 0; +}; + +export class Tour { + private root: HTMLElement | null = null; + private ring!: HTMLElement; + private card!: HTMLElement; + private count!: HTMLElement; + private title!: HTMLElement; + private body!: HTMLElement; + private cmdRow!: HTMLElement; + private cmd!: HTMLElement; + private back!: HTMLButtonElement; + private next!: HTMLButtonElement; + private readonly s: Say; + private steps: TourStep[] = []; + private at = -1; + private target: HTMLElement | null = null; + private returnTo: HTMLElement | null = null; + private done: (() => void) | null = null; + private readonly watch = new ResizeObserver(() => this.place()); + private readonly onMove = (): void => this.place(); + private readonly onKey = (e: KeyboardEvent): void => { + if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); this.end(true); } + }; + + constructor(private readonly a: DockAdapter) { + this.s = strings(a); + } + + isRunning(): boolean { return this.at >= 0; } + + start(steps: TourStep[], done: () => void): void { + if (this.isRunning()) this.end(false); + this.build(); + this.steps = steps; + this.done = done; + this.at = -1; + if (!this.go(0, 1)) { this.done = null; return; } + const active = document.activeElement; + this.returnTo = active instanceof HTMLElement && active !== document.body ? active : null; + window.addEventListener('resize', this.onMove); + window.addEventListener('scroll', this.onMove, true); + document.addEventListener('keydown', this.onKey, true); + setHidden(this.root as HTMLElement, false); + this.place(); + this.card.focus({ preventScroll: true }); + } + + private build(): void { + if (this.root) return; + const s = this.s; + const c = this.a.classes; + this.root = el(``); + this.ring = q(this.root, '.ft-tour-ring'); + this.card = q(this.root, '.ft-tour-card'); + this.count = q(this.root, '.ft-tour-count'); + this.title = q(this.root, '.ft-tour-title'); + this.body = q(this.root, '.ft-tour-body'); + this.cmdRow = q(this.root, '.ft-tour-cmd'); + this.cmd = q(this.cmdRow, 'code'); + this.back = q(this.root, '.ft-tour-back'); + this.next = q(this.root, '.ft-tour-next'); + contain(this.card, this.a); + q(this.root, '.ft-tour-copy').addEventListener('click', () => { void navigator.clipboard?.writeText(this.cmd.textContent ?? '').catch(() => undefined); }); + q(this.root, '.ft-tour-x').addEventListener('click', () => this.end(true)); + this.back.addEventListener('click', () => { this.go(this.at - 1, -1); this.place(); }); + this.next.addEventListener('click', () => { + if (!this.go(this.at + 1, 1)) { this.end(true); return; } + this.place(); + }); + document.body.append(this.root); + } + + private go(from: number, dir: 1 | -1): boolean { + for (let i = from; i >= 0 && i < this.steps.length; i += dir) { + const at = this.steps[i]; + const node = at ? find(at.target) : null; + if (!shown(node)) continue; + this.at = i; + this.watch.disconnect(); + this.target = node; + this.watch.observe(node); + this.fill(); + return true; + } + return false; + } + + private fill(): void { + const step = this.steps[this.at]; + if (!step) return; + const before = this.steps.slice(0, this.at).filter((x) => shown(find(x.target))).length; + const after = this.steps.slice(this.at + 1).filter((x) => shown(find(x.target))).length; + setText(this.count, this.s('tourCount').replace('{n}', String(before + 1)).replace('{total}', String(before + 1 + after))); + setText(this.title, this.s(step.title)); + setText(this.body, this.s(step.body)); + setText(this.cmd, step.cmd ?? ''); + setHidden(this.cmdRow, !step.cmd); + const first = before === 0; + const last = after === 0; + setHidden(this.back, first); + setText(this.next, last ? this.s('tourDone') : this.s('tourNext')); + } + + private place(): void { + if (!this.isRunning() || !this.root) return; + if (!shown(this.target)) { + if (!this.go(this.at + 1, 1) && !this.go(this.at - 1, -1)) { this.end(true); return; } + } + const r = (this.target as HTMLElement).getBoundingClientRect(); + const vw = window.innerWidth, vh = window.innerHeight; + const box = { left: Math.max(0, r.left - PAD), top: Math.max(0, r.top - PAD), right: Math.min(vw, r.right + PAD), bottom: Math.min(vh, r.bottom + PAD) }; + this.put(this.ring, box.left, box.top, box.right - box.left, box.bottom - box.top); + const cw = this.card.offsetWidth || 320, ch = this.card.offsetHeight || 160; + const clampX = (x: number): number => Math.min(Math.max(EDGE, x), vw - cw - EDGE); + const clampY = (y: number): number => Math.min(Math.max(EDGE, y), vh - ch - EDGE); + const midX = clampX((box.left + box.right) / 2 - cw / 2), midY = clampY((box.top + box.bottom) / 2 - ch / 2); + const spots: Array<[boolean, number, number]> = [ + [box.bottom + GAP + ch <= vh - EDGE, midX, box.bottom + GAP], + [box.top - GAP - ch >= EDGE, midX, box.top - GAP - ch], + [box.left - GAP - cw >= EDGE, box.left - GAP - cw, midY], + [box.right + GAP + cw <= vw - EDGE, box.right + GAP, midY], + ]; + const spot = spots.find((x) => x[0]); + this.put(this.card, spot ? spot[1] : clampX(box.left + EDGE), spot ? spot[2] : clampY(box.top + EDGE), 0, 0); + } + + private put(node: HTMLElement, x: number, y: number, w: number, h: number): void { + const st = node.style; + const tx = `translate(${Math.round(x)}px, ${Math.round(y)}px)`; + if (st.transform !== tx) st.transform = tx; + if (w > 0 && st.width !== `${Math.round(w)}px`) st.width = `${Math.round(w)}px`; + if (h > 0 && st.height !== `${Math.round(h)}px`) st.height = `${Math.round(h)}px`; + } + + end(finished: boolean): void { + if (!this.isRunning()) return; + this.at = -1; + this.target = null; + this.watch.disconnect(); + window.removeEventListener('resize', this.onMove); + window.removeEventListener('scroll', this.onMove, true); + document.removeEventListener('keydown', this.onKey, true); + if (this.root) setHidden(this.root, true); + const back = this.returnTo; + this.returnTo = null; + if (back?.isConnected) back.focus({ preventScroll: true }); + const done = this.done; + this.done = null; + if (finished) done?.(); + } +} diff --git a/frontend/src/engine/commands.ts b/frontend/src/engine/commands.ts index 8ec977f..5d1fd9f 100644 --- a/frontend/src/engine/commands.ts +++ b/frontend/src/engine/commands.ts @@ -1,9 +1,40 @@ export interface Command { id: string; title: string; + keys?: string; run(args: unknown): void; } +export interface ShellHooks { + home(): void; + preferences(): void; + toggleDock(): void; + toggleMenusInWindow(): void; +} + +export const SHELL_COMMANDS = { + home: 'app.home', + preferences: 'app.preferences', + dock: 'view.dock', + menusInWindow: 'view.menus-in-window', +} as const; + +export function registerShellCommands(commands: CommandRegistry, hooks: ShellHooks): void { + commands.register({ id: SHELL_COMMANDS.home, title: 'Home', run: () => hooks.home() }); + commands.register({ id: SHELL_COMMANDS.preferences, title: 'Preferences...', keys: 'Mod+,', run: () => hooks.preferences() }); + commands.register({ id: SHELL_COMMANDS.dock, title: 'Agent Dock', run: () => hooks.toggleDock() }); + commands.register({ id: SHELL_COMMANDS.menusInWindow, title: 'Menus in Window', run: () => hooks.toggleMenusInWindow() }); +} + +export function matchesKeys(e: KeyboardEvent, keys: string): boolean { + const parts = keys.split('+'); + const key = parts.pop() ?? ''; + const mod = parts.includes('Mod'); + const mac = /Mac|iPhone|iPad/.test(navigator.platform); + const modDown = mac ? e.metaKey : e.ctrlKey; + return e.key === key && modDown === mod && e.shiftKey === parts.includes('Shift') && e.altKey === parts.includes('Alt') && (mac ? !e.ctrlKey : !e.metaKey); +} + export class CommandRegistry { private readonly commands = new Map(); diff --git a/frontend/src/engine/itemlist.ts b/frontend/src/engine/itemlist.ts index 24dae84..22f1831 100644 --- a/frontend/src/engine/itemlist.ts +++ b/frontend/src/engine/itemlist.ts @@ -28,14 +28,28 @@ export class ItemListModel { reload(): void { this.generation++; + this.settled = false; for (const c of this.pending.values()) c.abort(); this.pending.clear(); this.spans.clear(); void this.load(0, PAGE, true); } + private settled = false; + + private asked = ''; + + private trim(): void { + for (const i of Array.from(this.cache.keys())) { + if (i < this.total) continue; + const r = this.cache.get(i); + this.cache.delete(i); + if (r && this.index.get(r.id) === i) this.index.delete(r.id); + } + } + ensure(first: number, last: number): void { - if (!this.ready) return; + if (!this.ready || !this.settled) return; const lo = Math.max(0, first); const hi = Math.min(last, this.total - 1); let i = lo; @@ -58,17 +72,21 @@ export class ItemListModel { private async load(offset: number, limit: number, fresh: boolean): Promise { const gen = this.generation; const ctl = new AbortController(); + const where = this.where(); + const key = JSON.stringify(where); + if (fresh) this.asked = key; this.pending.set(offset, ctl); this.spans.set(offset, [ctl, limit]); if (fresh) this.sink.busy(true); try { - const res = await fetchRows({ scope: this.lib.scope, q: this.lib.query, sort: this.lib.sort, offset, limit }, ctl.signal); - if (gen !== this.generation) return; - if (fresh) { this.cache.clear(); this.index.clear(); } - res.rows.forEach((r, k) => { this.cache.set(res.offset + k, r); this.index.set(r.id, res.offset + k); }); + const res = await fetchRows({ ...where, offset, limit }, ctl.signal); + if (gen !== this.generation || key !== this.asked || key !== JSON.stringify(this.where())) return; + if (fresh) { this.cache.clear(); this.index.clear(); this.settled = true; } + res.rows.forEach((r, k) => { if (res.offset + k < res.total) { this.cache.set(res.offset + k, r); this.index.set(r.id, res.offset + k); } }); if (fresh || res.total !== this.total) { this.total = res.total; this.ready = true; + this.trim(); this.lib.setCounts({ shown: res.total, total: res.total }); this.sink.reset(res.total); } @@ -93,6 +111,7 @@ export class ItemListModel { this.pending.clear(); this.spans.clear(); this.total = Math.max(0, total); + this.trim(); this.lib.setCounts({ shown: this.total, total: this.total }); this.sink.reset(this.total); } @@ -111,6 +130,7 @@ export class ItemListModel { private async removeNow(ids: string[]): Promise { if (!this.ready) return; + if (!this.settled) { this.reload(); return; } const gen = this.generation; const gone = new Set(); const unseen: string[] = []; @@ -143,6 +163,7 @@ export class ItemListModel { private async insertNow(ids: string[]): Promise { if (!this.ready) return; + if (!this.settled) { this.reload(); return; } const gen = this.generation; const fresh = Array.from(new Set(ids)).filter((id) => this.indexOf(id) < 0); if (!fresh.length) return; diff --git a/frontend/src/engine/preferences.ts b/frontend/src/engine/preferences.ts index 4017bba..210e8ed 100644 --- a/frontend/src/engine/preferences.ts +++ b/frontend/src/engine/preferences.ts @@ -147,6 +147,39 @@ export const prefs = { useLibrary, }; +export type ShellPref = 'homeAtLaunch' | 'menusInWindow' | 'dockShown'; + +const SHELL_PREFS: Record Parameters[0] }> = { + homeAtLaunch: { key: 'formcite.homeAtLaunch', fallback: true, send: (on) => ({ home: on ? 'launch' : 'off' }) }, + menusInWindow: { key: 'formcite.menusInWindow', fallback: false, send: (on) => ({ menus: on ? 'window' : 'bar' }) }, + dockShown: { key: 'formcite.dockShown', fallback: false, send: (on) => ({ dock: on ? 'shown' : 'hidden' }) }, +}; +const shellListeners = new Set<(pref: ShellPref, on: boolean) => void>(); + +export function shellPref(pref: ShellPref): boolean { + const p = SHELL_PREFS[pref]; + try { + const v = localStorage.getItem(p.key); + return v === null ? p.fallback : v === '1'; + } catch { + return p.fallback; + } +} + +export function setShellPref(pref: ShellPref, on: boolean): void { + const p = SHELL_PREFS[pref]; + try { localStorage.setItem(p.key, on ? '1' : '0'); } catch (e) { console.error('[shell prefs] save failed:', e); } + saveLook(p.send(on)); + for (const fn of shellListeners) fn(pref, on); +} + +export function onShellPref(fn: (pref: ShellPref, on: boolean) => void): () => void { + shellListeners.add(fn); + return () => { shellListeners.delete(fn); }; +} + +export const desktopMac = (): boolean => '__TAURI_INTERNALS__' in window && /Mac/.test(navigator.platform); + function moveLocalLookToEngine(): void { if (engineHasLook()) return; let found = false; diff --git a/frontend/src/io/look.ts b/frontend/src/io/look.ts index fbd2402..4ceba4b 100644 --- a/frontend/src/io/look.ts +++ b/frontend/src/io/look.ts @@ -1,7 +1,7 @@ import { api } from './api'; import { hasWindowKey } from './window-key'; -export interface SavedLook { mode: string; dark: string; light: string; accent: string; title_field: string; saved: boolean } +export interface SavedLook { mode: string; dark: string; light: string; accent: string; title_field: string; home: string; menus: string; dock: string; saved: boolean } export type LookPatch = Partial>; const WAIT_MS = 250; diff --git a/frontend/src/io/window-key.ts b/frontend/src/io/window-key.ts index 16e2767..a50e0b6 100644 --- a/frontend/src/io/window-key.ts +++ b/frontend/src/io/window-key.ts @@ -27,19 +27,28 @@ async function exchange(body?: { code: string }): Promise { } } -export async function loadWindowKey(): Promise { - if (key) return true; +let pending: Promise | null = null; + +async function claim(): Promise { const code = takeLaunchCode(); if (code) { launched = true; - key = await exchange({ code }); + const got = await exchange({ code }); + if (got) key = got; return key !== ''; } - if (launched) return false; - key = await exchange(); + if (launched) return key !== ''; + const got = await exchange(); + if (got) key = got; return key !== ''; } +export function loadWindowKey(): Promise { + if (key) return Promise.resolve(true); + pending ??= claim().finally(() => { pending = null; }); + return pending; +} + export const hasWindowKey = (): boolean => key !== ''; export const wasLaunched = (): boolean => launched; export const keyHeaders = (): Record => (key ? { [HEADER]: key } : {}); diff --git a/frontend/src/styles/dock-tokens.css b/frontend/src/styles/dock-tokens.css new file mode 100644 index 0000000..2d398fb --- /dev/null +++ b/frontend/src/styles/dock-tokens.css @@ -0,0 +1,48 @@ +:root, .ft-dock { + --dock-bg: var(--sheet); + --dock-bar-bg: var(--surface-1); + --dock-raised: var(--surface-raised); + --dock-hover: var(--bg-hover); + --dock-input-bg: var(--surface-2); + --dock-border: var(--line-1); + --dock-edge: var(--line-1); + --dock-divider: var(--line-0); + --dock-tab-border: var(--line-2); + --dock-outline: var(--border-light); + --dock-scrim: color-mix(in srgb, var(--ground) 60%, transparent); + --dock-text: var(--text-primary); + --dock-text-dim: var(--text-secondary); + --dock-text-muted: var(--text-muted); + --dock-tab-text: var(--text-muted); + --dock-accent: var(--accent-color); + --dock-accent-line: color-mix(in srgb, var(--accent-color) 45%, transparent); + --dock-accent-ink: var(--accent-color); + --dock-danger: var(--danger); + --dock-danger-text: var(--danger-text); + --dock-space-1: var(--space-1); + --dock-space-2: var(--space-2); + --dock-space-3: var(--space-3); + --dock-space-4: var(--space-4); + --dock-radius-xs: var(--radius-hair); + --dock-radius-sm: var(--radius-sm); + --dock-radius: var(--radius); + --dock-radius-md: var(--radius-md); + --dock-tab-radius: var(--radius); + --dock-head-h: var(--fc-pane-head-h); + --dock-tab-h: var(--ctl-sm); + --dock-ibtn: var(--ctl-sm); + --dock-ask-h: 40px; + --dock-ask-ctl-h: var(--ctl-md); + --dock-stage-pad: var(--space-1) var(--space-1) 0 var(--space-3); + --dock-fs-xs: var(--fs-11); + --dock-fs-sm: var(--fs-12); + --dock-fs-md: var(--fs-14); + --dock-font-mono: var(--font-mono); + --dock-term-bg: var(--sheet); + --dock-term-fg: var(--text-primary); + --dock-term-cursor: var(--accent-color); + --dock-term-selection: var(--accent-color-dim); + --dock-term-font-size: 12; + --dock-term-line-height: 1.2; +} +:root[data-oled], :root[data-oled] .ft-dock { --dock-bar-bg: var(--bg-primary); } diff --git a/frontend/src/styles/home.css b/frontend/src/styles/home.css new file mode 100644 index 0000000..f9fa880 --- /dev/null +++ b/frontend/src/styles/home.css @@ -0,0 +1,60 @@ +.fc-panes[data-view="home"] .fc-tb-title > [data-v="home"] { display: inline; } +.fc-panes[data-view="home"] > .fc-view[data-pane="home"] { display: grid; } +.fc-view[data-pane="home"] > .fc-pane-body { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; } + +.fc-home { + --fc-home-tile-h: 76px; + --fc-home-card-h: 60px; + display: grid; align-content: start; row-gap: var(--space-6); max-width: 1040px; margin: 0 auto; padding: var(--space-6) var(--space-8) var(--space-8); +} +.fc-home-head { display: grid; row-gap: var(--space-1); } +.fc-home-brand { display: grid; grid-template-columns: 28px auto auto; justify-content: start; align-items: center; column-gap: var(--space-2h); height: 36px; margin-bottom: var(--space-3); color: var(--text-primary); font-size: var(--fs-14); font-weight: var(--weight-semibold); letter-spacing: -0.005em; } +.fc-home-mark { display: block; width: 28px; height: 28px; border-radius: var(--radius-md); } +.fc-home-brand-ver { color: var(--text-muted); font-size: var(--fs-12); font-weight: 400; font-variant-numeric: tabular-nums; } +.fc-home-title { margin: 0; min-height: 32px; color: var(--text-primary); font-size: 26px; font-weight: 500; line-height: 32px; letter-spacing: -0.015em; } +.fc-home-sub { margin: 0; color: var(--text-secondary); font-size: var(--fs-13); line-height: 20px; } + +.fc-home-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-6); padding: var(--space-6); border: 1px dashed var(--line-3); border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 0% 0%, var(--accent-wash), transparent 55%), var(--surface-2); } +.fc-home-hero-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--line-3); border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--accent-color); box-shadow: var(--shadow-inset-hl); } +.fc-home-hero-text { display: grid; row-gap: var(--space-1h); min-width: 0; } +.fc-home-hero-title { color: var(--text-primary); font-size: 18px; font-weight: var(--weight-semibold); letter-spacing: -0.01em; } +.fc-home-hero-sub { max-width: 560px; color: var(--text-secondary); font-size: var(--fs-13); line-height: 1.5; } +.fc-home-formats { display: flex; flex-wrap: wrap; gap: var(--space-1h); margin-top: var(--space-1h); } +.fc-home-format { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--text-muted); font-family: var(--font-mono); font-size: var(--fs-11); letter-spacing: 0.04em; } +.fc-home-hero-actions { display: grid; row-gap: var(--space-2); min-width: 188px; } +.fc-home-hero-actions .fc-btn { display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: center; column-gap: var(--space-2); height: 36px; padding: 0 var(--space-3); text-align: start; white-space: nowrap; } +.fc-home-pick { cursor: pointer; } + +.fc-home-section { display: grid; row-gap: var(--space-3); } +.fc-home-section-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); min-height: var(--ctl); } +.fc-home-section-head:not(:has(.fc-home-see)) { grid-template-columns: auto; } +.fc-home-section-title { margin: 0; color: var(--text-primary); font-size: 15px; font-weight: var(--weight-semibold); } +.fc-home-lib-name { overflow: hidden; color: var(--text-muted); font-size: var(--fs-12); white-space: nowrap; text-overflow: ellipsis; } + +.fc-home-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); } +.fc-home-tile { display: grid; grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: 30px 18px; align-items: center; column-gap: var(--space-2); height: var(--fc-home-tile-h); padding: var(--space-3) var(--space-4); border: 1px solid var(--line-1); border-radius: var(--radius-lg); background: var(--surface-2); color: var(--text-primary); font: inherit; text-align: start; box-sizing: border-box; } +.fc-home-tile-icon { grid-row: 2; grid-column: 1; display: inline-flex; color: var(--accent-color); } +.fc-home-tile-num { grid-row: 1; grid-column: 1 / -1; overflow: hidden; font-size: 22px; font-weight: 500; line-height: 30px; font-variant-numeric: tabular-nums; white-space: nowrap; } +.fc-home-tile-label { grid-row: 2; grid-column: 2; color: var(--text-secondary); font-size: var(--fs-12); } +button.fc-home-tile { cursor: pointer; transition: border-color var(--transition-fast), background-color var(--transition-fast); } +button.fc-home-tile:hover { border-color: var(--line-3); background: var(--bg-hover); } + +.fc-home-cards { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: var(--fc-home-card-h); gap: var(--space-3); min-height: calc(var(--fc-home-card-h) * 2 + var(--space-3)); } +.fc-home-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; column-gap: var(--space-3); height: var(--fc-home-card-h); padding: 0 var(--space-3); border: 1px solid var(--line-1); border-radius: var(--radius-lg); background: var(--surface-2); color: var(--text-primary); font: inherit; text-align: start; cursor: pointer; box-sizing: border-box; transition: border-color var(--transition-fast), background-color var(--transition-fast); } +.fc-home-card:hover { border-color: var(--line-3); background: var(--bg-hover); } +.fc-home-card-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--surface-1); color: var(--accent-color); } +.fc-home-card-text { display: grid; row-gap: 2px; min-width: 0; } +.fc-home-card-name, .fc-home-card-meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } +.fc-home-card-name { font-size: var(--fs-13); font-weight: var(--weight-medium); } +.fc-home-card-meta { color: var(--text-muted); font-size: var(--fs-12); font-variant-numeric: tabular-nums; } +.fc-home-none { position: absolute; inset: 0 0 auto 0; margin: 0; padding: var(--space-3) 0; color: var(--text-muted); font-size: var(--fs-13); } +.fc-home-none[hidden] { display: none; } +.fc-home-error { margin: 0; min-height: 20px; color: var(--danger-text); font-size: var(--fs-12); } + +@media (max-width: 900px) { + .fc-home { padding: var(--space-4); } + .fc-home-hero { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); } + .fc-home-hero-icon { display: none; } + .fc-home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } + .fc-home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } +} diff --git a/frontend/src/styles/light-mode.css b/frontend/src/styles/light-mode.css index 99edcac..62fefbf 100644 --- a/frontend/src/styles/light-mode.css +++ b/frontend/src/styles/light-mode.css @@ -1 +1,6 @@ +:root[data-theme="light"] { + --group-head: var(--surface-2); + --bg-scrim: rgba(40, 36, 28, 0.45); + --glass-shadow: 0 18px 44px rgba(40, 30, 10, 0.18), 0 2px 8px rgba(40, 30, 10, 0.08); +} :root[data-theme="light"] .fc-toast { box-shadow: var(--shadow-lg); } diff --git a/frontend/src/styles/menu.css b/frontend/src/styles/menu.css new file mode 100644 index 0000000..a1bc34b --- /dev/null +++ b/frontend/src/styles/menu.css @@ -0,0 +1,28 @@ +@property --menu-more { syntax: ''; inherits: false; initial-value: 0; } + +.fc-menubar { display: flex; align-items: center; gap: var(--space-0); min-width: 0; } +.fc-menu-btn { height: var(--ctl-sm); padding: 0 var(--space-2); border: 0; border-radius: var(--radius); background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-12); cursor: default; white-space: nowrap; } +.fc-menu-btn:hover, .fc-menu-btn.is-open, .fc-menu-btn:focus-visible { background: var(--bg-tertiary); color: var(--text-primary); outline: none; } +.is-menu-mnemonics .fc-menu-btn::first-letter { text-decoration: underline; } +.has-native-menus .fc-menubar { display: none; } + +.fc-menu { position: fixed; z-index: var(--z-popover); box-sizing: border-box; min-width: 232px; max-width: min(420px, calc(100vw - 8px)); padding: var(--space-1h); border: 1px solid var(--glass-border, var(--border-strong)); border-radius: var(--radius-lg); background: var(--glass-bg, color-mix(in srgb, var(--surface) 88%, transparent)); backdrop-filter: var(--glass-filter, blur(20px) saturate(1.4)); -webkit-backdrop-filter: var(--glass-filter, blur(20px) saturate(1.4)); box-shadow: var(--shadow-window); color: var(--text-primary); pointer-events: auto; } +.fc-menu[hidden] { display: none; } +.fc-menu:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; } +.fc-menu-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; --menu-more: 0; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - min(88px, 40%)), rgb(0 0 0 / calc(1 - var(--menu-more))) calc(100% - min(22px, 10%))); mask-image: linear-gradient(to bottom, #000 calc(100% - min(88px, 40%)), rgb(0 0 0 / calc(1 - var(--menu-more))) calc(100% - min(22px, 10%))); transition: --menu-more 160ms ease-out; } +.fc-menu-more { position: absolute; left: 50%; bottom: 6px; width: 56px; height: 12px; margin-left: -28px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 1px solid var(--glass-border, var(--border-strong)); border-radius: var(--radius-pill); background: var(--glass-bg, color-mix(in srgb, var(--surface) 88%, transparent)); color: var(--text-secondary); pointer-events: none; opacity: 0; transition: opacity 160ms ease-out; } +.fc-menu-more svg { width: 12px; height: 8px; } +.fc-menu.has-more > .fc-menu-list { --menu-more: 1; scroll-padding-block-end: min(88px, 40%); transition-duration: 490ms; } +.fc-menu.has-more > .fc-menu-more { opacity: 1; transition-duration: 490ms; } +.fc-menu.no-fade > .fc-menu-list, .fc-menu.no-fade > .fc-menu-more { transition: none; } +@media (prefers-reduced-motion: reduce) { .fc-menu-list, .fc-menu-more { transition: none; } } + +.fc-menu-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); width: 100%; height: var(--ctl-md); padding: 0 var(--space-2h) 0 var(--space-2); border: 0; border-radius: var(--radius); background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-13); text-align: left; cursor: default; } +.fc-menu-item:hover:not(:disabled), .fc-menu-item:focus:not(:disabled), .fc-menu-sub.is-open:not(:disabled) { background: var(--active); color: var(--text-primary); outline: none; } +.fc-menu-item:disabled { color: var(--text-muted); opacity: 0.55; } +.fc-menu-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.fc-menu-check { display: inline-flex; visibility: hidden; } +.fc-menu-item.is-checked .fc-menu-check { visibility: visible; } +.fc-menu-keys { display: inline-flex; color: var(--text-muted); font-size: var(--fs-12); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; } +.fc-menu-sub .fc-menu-keys { margin-right: calc(-1 * var(--space-1)); } +.fc-menu-sep { height: 1px; margin: var(--space-1h) var(--space-2h); background: var(--border-strong); } diff --git a/frontend/src/styles/preferences.css b/frontend/src/styles/preferences.css index 41d882c..da97c0e 100644 --- a/frontend/src/styles/preferences.css +++ b/frontend/src/styles/preferences.css @@ -6,11 +6,33 @@ --fc-pr-line-h: 20px; --fc-pr-text-line-h: 15px; --fc-pr-label-w: 200px; - display: grid; align-content: start; row-gap: var(--space-6); max-width: 760px; padding: var(--space-4); + --fc-pr-rail-w: 196px; + display: grid; grid-template-columns: var(--fc-pr-rail-w) minmax(0, 820px); align-items: start; column-gap: var(--space-5); padding: var(--space-4); } -.fc-pr-sec { display: grid; align-content: start; row-gap: var(--space-2); transition: opacity 120ms linear; } +.fc-pr-rail { position: sticky; top: 0; z-index: var(--z-raised); display: grid; align-content: start; row-gap: var(--space-1); padding: var(--space-1h); border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg-secondary); box-shadow: var(--shadow-sm); } +.fc-pr-railtab { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; column-gap: var(--space-2h); height: 36px; padding: 0 var(--space-2h); border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--bg-tertiary); color: var(--text-secondary); font: inherit; font-size: var(--fs-13); text-align: start; cursor: pointer; box-sizing: border-box; } +.fc-pr-railtab:hover { background: var(--bg-hover); color: var(--text-primary); } +.fc-pr-railtab.is-active { border-color: var(--accent-color); background: var(--accent-color); color: var(--text-on-accent); } +.fc-pr-tabicon, .fc-pr-secicon { display: inline-flex; color: var(--accent-color); } +.fc-pr-railtab.is-active .fc-pr-tabicon { color: currentColor; } +.fc-pr-tablabel { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } +.fc-pr-pages { display: grid; align-content: start; row-gap: var(--space-3); min-width: 0; } +.fc-pr-sec { display: grid; align-content: start; border-radius: var(--radius-lg); background: var(--bg-secondary); box-shadow: var(--shadow-md); overflow: clip; transition: opacity 120ms linear, box-shadow var(--transition-fast); } +.fc-pr-sec.is-current { box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-color-dim); } .fc-pr-sec.is-busy { opacity: 0.6; } -.fc-pr-sec > .fc-section-head { padding: 0; height: var(--fc-section-head-h); } +.fc-pr-sechead { display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px; align-items: center; column-gap: var(--space-2h); width: 100%; height: 44px; padding: 0 var(--space-3h, 14px); border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-13); font-weight: var(--weight-semibold); text-align: start; cursor: pointer; } +.fc-pr-sechead:hover { background: var(--bg-hover); } +.fc-pr-chev { display: inline-flex; width: 16px; height: 16px; color: var(--text-muted); transition: rotate 160ms ease; } +.fc-pr-chev > svg { width: 16px; height: 16px; } +.fc-pr-sec.is-folded .fc-pr-chev { rotate: -90deg; } +.fc-pr-secbody { display: grid; row-gap: var(--space-2h); padding: 0 var(--space-3h, 14px) var(--space-3h, 14px); } +.fc-pr-secbody[hidden] { display: none; } +.fc-pr-group { display: grid; align-content: start; row-gap: var(--space-2); min-width: 0; padding: var(--space-3) var(--space-3h, 14px) var(--space-3h, 14px); border-radius: var(--radius-md); background: color-mix(in srgb, var(--bg-tertiary) 55%, var(--bg-secondary)); box-shadow: var(--shadow-sm); } +.fc-pr-glabel { margin: 0; color: var(--accent-color); font-size: var(--fs-11); font-weight: var(--weight-semibold); letter-spacing: 0.07em; text-transform: uppercase; } +@media (max-width: 900px) { + .fc-pr { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-3); } + .fc-pr-rail { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); column-gap: var(--space-1); } +} .fc-pr-note { margin: 0; min-height: calc(var(--fc-pr-line-h) * 2); color: var(--text-secondary); font-size: var(--fs-13); line-height: var(--fc-pr-line-h); } .fc-pr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); min-height: var(--fc-pr-row-h); } .fc-pr-row:has(> .fc-pr-input) { grid-template-columns: var(--fc-pr-label-w) minmax(0, 1fr); } diff --git a/frontend/src/styles/shell.css b/frontend/src/styles/shell.css index ea6ec03..8e3a2bf 100644 --- a/frontend/src/styles/shell.css +++ b/frontend/src/styles/shell.css @@ -7,7 +7,12 @@ body { font-size: var(--fs-12); line-height: 1.35; } :where(button, select, summary, a[href], [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible { outline: 1px solid var(--accent-color); outline-offset: -1px; } -.fc-app { display: grid; grid-template-rows: minmax(0, 1fr) var(--fc-status-h); height: 100%; overflow: clip; background: var(--ground); color: var(--text); user-select: none; -webkit-user-select: none; } +:root { --fc-menu-row: 0px; } +:root[data-fc-menubar="window"] { --fc-menu-row: var(--fc-titlebar-h); } +.fc-menubar-host { grid-row: 1; position: relative; z-index: var(--z-chrome); min-width: 0; min-height: 0; height: var(--fc-menu-row); } +.fc-app > .fc-panes { grid-row: 2; } +.fc-app > .fc-status { grid-row: 3; } +.fc-app { display: grid; grid-template-rows: var(--fc-menu-row) minmax(0, 1fr) var(--fc-status-h); height: 100%; overflow: clip; background: var(--ground); color: var(--text); user-select: none; -webkit-user-select: none; } .fc-sb-head { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); height: var(--topbar-h); padding: 0 var(--space-4); } .fc-sb-icon { display: block; width: 20px; height: 20px; border-radius: var(--radius-xs, 4px); } diff --git a/frontend/src/styles/terminal.css b/frontend/src/styles/terminal.css new file mode 100644 index 0000000..8cd16d1 --- /dev/null +++ b/frontend/src/styles/terminal.css @@ -0,0 +1,20 @@ +:root { --ft-dock-size: 280px; --ft-dock-wsize: 460px; --ft-dock-h: 0px; --ft-dock-w: 0px; } +:root[data-ft-dock="open"]:not([data-ft-dock-side="right"]) { --ft-dock-h: min(var(--ft-dock-size), 70vh); } +:root[data-ft-dock="open"][data-ft-dock-side="right"] { --ft-dock-w: min(var(--ft-dock-wsize), 60vw); } +:root .fc-app { grid-template-rows: var(--fc-menu-row, 0px) minmax(0, 1fr) var(--ft-dock-h) var(--fc-status-h); } +:root .fc-app > .fc-panes { grid-row: 2; } +:root .fc-app > .ft-dock { grid-row: 3; grid-column: 1 / -1; } +:root .fc-app > .fc-status { grid-row: 4; } +:root:not([data-ft-dock="open"]) .fc-app > .ft-dock { display: none; } +:root[data-ft-dock="open"][data-ft-dock-side="right"] .fc-app { grid-template-rows: var(--fc-menu-row, 0px) minmax(0, 1fr) 0px var(--fc-status-h); grid-template-columns: minmax(0, 1fr) var(--ft-dock-w); } +:root[data-ft-dock="open"][data-ft-dock-side="right"] .fc-app > * { grid-column: 1 / -1; } +:root[data-ft-dock="open"][data-ft-dock-side="right"] .fc-app > .fc-panes { grid-area: 2 / 1; } +:root[data-ft-dock="open"][data-ft-dock-side="right"] .fc-app > .ft-dock { grid-area: 2 / 2; } +:root[data-ft-dock="open"] #toast-root { bottom: calc(var(--fc-status-h) + var(--ft-dock-h) + var(--space-3)); } + +.fc-dock-ibtn { display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; } +.fc-dock-ibtn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); } +.fc-dock-input { min-width: 0; padding: 0 var(--space-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-primary); font: inherit; font-size: var(--fs-12); } +.fc-dock-input:focus { outline: 1px solid var(--accent-color); outline-offset: -1px; } +.fc-dock-note { margin: 0; color: var(--text-muted); font-size: var(--fs-12); line-height: 1.4; } +.ft-dock .fc-btn, .ft-consent .fc-btn, .ft-tour .fc-btn { height: var(--ctl-sm); font-size: var(--fs-12); } diff --git a/frontend/src/styles/titles.css b/frontend/src/styles/titles.css index c8beea5..02219e0 100644 --- a/frontend/src/styles/titles.css +++ b/frontend/src/styles/titles.css @@ -1,5 +1,5 @@ .fc-panes[data-view="titles"] > .fc-view[data-pane="titles"] { display: grid; } -.fc-tt { --tt-row: 112px; --tt-strip: 28px; --tt-sug-max: 260px; } +.fc-tt { --tt-row: 112px; --tt-strip: 28px; --tt-sug-max: 260px; --rv-line: 24px; } .fc-tt-row { display: grid; grid-template-rows: var(--rv-line) var(--rv-btn) var(--tt-strip); row-gap: var(--space-1h); align-content: center; height: var(--tt-row); padding: 0 var(--space-4); border-bottom: 1px solid var(--line-0); box-sizing: border-box; contain: layout; } .fc-tt-known { color: var(--text-secondary); font-size: var(--fs-12); line-height: var(--rv-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fc-tt-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); margin: 0; } diff --git a/frontend/src/styles/tokens.css b/frontend/src/styles/tokens.css index b742897..84f01c3 100644 --- a/frontend/src/styles/tokens.css +++ b/frontend/src/styles/tokens.css @@ -65,28 +65,38 @@ --space-2: 8px; --space-2h: 10px; --space-3: 12px; + --space-3h: 14px; --space-4: 16px; --space-5: 20px; --space-6: 24px; + --space-7: 28px; --space-8: 32px; --radius-hair: 2px; + --radius-xs: 3px; --radius-sm: 4px; --radius: 6px; --radius-md: 8px; --radius-lg: 10px; + --radius-xl: 12px; --radius-pill: 999px; --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace; + --fs-9: 9px; + --fs-10: 10px; --fs-11: var(--text-xs); --fs-12: var(--text-sm); --fs-13: var(--text-nav); --fs-14: var(--text-md); + --fs-16: var(--text-lg); + --fs-18: 18px; --ctl-sm: 24px; --ctl-md: 28px; --ctl: 32px; + --ctl-lg: 36px; + --ctl-xl: 40px; --size-dot: 8px; --size-icon-sm: 14px; --size-icon: 16px; @@ -116,21 +126,50 @@ --line-2: var(--border-strong); --line-3: color-mix(in srgb, var(--border-strong) 60%, var(--text-muted)); + --bg-input: var(--surface-2); + --bg-scrim: rgba(0, 0, 0, 0.6); + --surface-field: var(--bg-input); + --group-head: color-mix(in srgb, var(--sheet) 30%, #000000); + --ease-glass: cubic-bezier(0.22, 0.61, 0.36, 1); + + --accent-intensity: 1; + --accent-tint: color-mix(in srgb, var(--accent) 6%, transparent); + --accent-tint-strong: color-mix(in srgb, var(--accent) 10%, transparent); + --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface-2)); + --accent-line: color-mix(in srgb, var(--accent) 48%, var(--border-strong)); + --accent-glow: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); + --accent-ink: color-mix(in srgb, var(--accent) 80%, var(--text)); + + --glass-bg: color-mix(in srgb, var(--surface-2) 82%, transparent); + --glass-border: color-mix(in srgb, var(--text) 16%, transparent); + --glass-highlight: color-mix(in srgb, var(--text) 12%, transparent); + --glass-filter: blur(40px) saturate(1.8); + --glass-shadow: 0 22px 56px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25); + --ok: #4ade80; + --ok-soft: #86efac; --warn: #fbbf24; --danger: #f87171; --danger-soft: #f87171; --danger-text: #fca5a5; --danger-fill: #dc2626; + --danger-fill-hover: #b91c1c; + --success-fill: #059669; + --success-fill-hover: #047857; + --z-under: -1; --z-base: 0; --z-raised: 100; --z-sticky: 200; --z-chrome: 300; + --z-dock: 350; --z-dropdown: 400; + --z-menu: var(--z-dropdown); --z-scrim: 500; --z-overlay: 600; + --z-modal: var(--z-overlay); --z-popover: 700; + --z-context: var(--z-popover); --z-toast: 800; --z-tooltip: 900; --z-debug: 1000; diff --git a/frontend/src/ui/app.ts b/frontend/src/ui/app.ts index 050782a..8ebcccf 100644 --- a/frontend/src/ui/app.ts +++ b/frontend/src/ui/app.ts @@ -3,7 +3,7 @@ import { loadWindowKey, wasLaunched } from '../io/window-key'; import { bindConnections, CONNECTIONS_PANE, navItems, watchConnections } from './connections'; import { mountAdd } from './add'; import { mountDetail } from './detail'; -import { mountOnce, q, revealApp } from './dom'; +import { el, mountOnce, q, revealApp, setClass } from './dom'; import { mountDuplicates } from './duplicates'; import { icon } from './icons'; import { mountItemList } from './itemlist'; @@ -12,11 +12,17 @@ import { mountSide } from './side'; import { mountTrash } from './trash'; import { mountTitles } from './titles'; import { bindStatus, watchEngine } from './status'; -import { setMode } from '../engine/preferences'; +import { desktopMac, onShellPref, setMode, setShellPref, shellPref } from '../engine/preferences'; +import { matchesKeys, registerShellCommands } from '../engine/commands'; +import type { ViewId } from '../engine/library'; +import { HOME_ICON, mountHome } from './home'; +import { mountMenus, registerItemCommands } from './menus'; +import { mountDock } from '../dock-adapter'; import { toast } from './toast'; const SHELL = `
+
-

ItemsDuplicatesTrashNeeds a titleConnectionsPreferences

+

HomeItemsDuplicatesTrashNeeds a titleConnectionsPreferences

@@ -58,6 +64,10 @@ const SHELL = `

${icon('info', 14)}Needs a title

+
+

${HOME_ICON}Home

+
+

${icon('sliders', 14)}Preferences

@@ -73,9 +83,69 @@ export function mountApp(engine: Engine): void { const host = document.getElementById('app'); if (!host) throw new Error('missing #app'); mountOnce(host, SHELL); + const panes = q(host, '.fc-panes'); + const nav = q(host, '.fc-nav'); + nav.prepend(el(``)); + const showView = (view: string): void => { + if (panes.dataset.view !== view) panes.dataset.view = view; + for (const b of nav.querySelectorAll('.fc-nav-item')) { + const on = b.dataset.view === view; + setClass(b, 'is-active', on); + if (b.getAttribute('aria-current') !== (on ? 'page' : 'false')) b.setAttribute('aria-current', on ? 'page' : 'false'); + } + }; + if (shellPref('homeAtLaunch')) { + engine.library.setView('home' as ViewId); + showView('home'); + } + engine.library.events.on('view', (v) => showView(v)); bindStatus(engine, host); bindConnections(engine, host); const at = (name: string): HTMLElement => q(host, `[data-mount="${name}"]`); + const openView = (view: string): void => { nav.querySelector(`.fc-nav-item[data-view="${view}"]`)?.click(); }; + const dock = mountDock(q(host, '.fc-app')); + const root = document.documentElement; + const dockOpen = (): boolean => root.getAttribute('data-ft-dock') === 'open'; + if (shellPref('dockShown') !== dockOpen()) { if (shellPref('dockShown')) dock.open(); else dock.close(); } + new MutationObserver(() => { if (shellPref('dockShown') !== dockOpen()) setShellPref('dockShown', dockOpen()); }).observe(root, { attributes: true, attributeFilter: ['data-ft-dock'] }); + onShellPref((pref, on) => { if (pref === 'dockShown' && on !== dockOpen()) { if (on) dock.open(); else dock.close(); } }); + registerShellCommands(engine.commands, { + home: () => openView('home'), + preferences: () => openView('preferences'), + toggleDock: () => dock.toggle(), + toggleMenusInWindow: () => { + if (!desktopMac()) return; + const next = !shellPref('menusInWindow'); + setShellPref('menusInWindow', next); + toast(next ? 'The menus move into the window at the next start.' : 'The menus move to the menu bar at the next start.'); + }, + }); + const openAdd = (tab: string): void => { + document.querySelector(`.fc-add-tab[data-tab="${tab}"]`)?.click(); + document.querySelector('.fc-add-open')?.click(); + }; + const app: Array<[string, string, () => void]> = [ + ['library.add', 'Add by identifier', () => openAdd('id')], + ['library.import', 'Import', () => openAdd('import')], + ['library.export', 'Export', () => openAdd('export')], + ['collection.new', 'New collection', () => { openView('library'); host.querySelector('.fc-side-add')?.click(); }], + ['edit.find', 'Find in items', () => { openView('library'); host.querySelector('.fc-il-q')?.focus(); }], + ['view.items', 'Items', () => openView('library')], + ['view.duplicates', 'Duplicates', () => openView('duplicates')], + ['view.trash', 'Trash', () => openView('trash')], + ['view.connections', 'Connections', () => openView('connections')], + ]; + for (const [id, title, run] of app) engine.commands.register({ id, title, run }); + registerItemCommands(engine); + mountMenus(at('menubar'), (id) => { if (engine.commands.has(id)) engine.dispatch(id); }, (id) => engine.commands.has(id)); + window.addEventListener('keydown', (e) => { + if (e.defaultPrevented || e.repeat) return; + const cmd = engine.commands.list().find((c) => c.keys && matchesKeys(e, c.keys)); + if (!cmd) return; + e.preventDefault(); + engine.dispatch(cmd.id); + }); + mountHome(engine, at('home')); mountSide(engine, at('side')); mountItemList(engine, at('list')); mountDetail(engine, at('detail')); diff --git a/frontend/src/ui/home.ts b/frontend/src/ui/home.ts new file mode 100644 index 0000000..4af430f --- /dev/null +++ b/frontend/src/ui/home.ts @@ -0,0 +1,177 @@ +import type { Engine } from '../engine'; +import { Adding } from '../engine/add'; +import { readCurrentLibrary } from '../io/preferences'; +import { sideApi, type CollectionRow } from '../io/side'; +import { loadWindowKey } from '../io/window-key'; +import { VERSION } from '../version'; +import { el, escapeHtml, mountOnce, patchList, q, setHidden, setText } from './dom'; +import { icon } from './icons'; +import { toast } from './toast'; + +const S = 'viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"'; +export const HOME_ICON = ``; +const INBOX = ``; +const PLUS = ``; +const UPLOAD = ``; +const PDF = ``; + +const RECENT = 6; + +type Collection = CollectionRow & { created_at?: string }; + +interface Counts { items: number; unfiled: number; collections: number; tags: number } + +const TILES: Array<[keyof Counts, string, string]> = [ + ['items', 'Items', 'viewList'], + ['unfiled', 'Unfiled', 'library'], + ['collections', 'Collections', 'collection'], + ['tags', 'Tags', 'tag'], +]; + +function shell(): string { + const tiles = TILES.map(([k, label, ic]) => { + const inner = `${icon(ic, 16)}${label}`; + return k === 'items' || k === 'unfiled' + ? `` + : `
${inner}
`; + }).join(''); + return ` +
+
+
FormCite${escapeHtml(VERSION)}
+

+

Your references stay in your library on this computer.

+
+
+ ${INBOX} +
+
Start from a paper or a reference file
+
Add by DOI, arXiv id, ISBN or PubMed ID, import BibTeX, RIS or CSL-JSON, or drop a PDF anywhere in this window and FormCite identifies it.
+
DOIARXIVISBNPMIDBIBRISJSONPDF
+
+
+ + + +
+
+
+

Library

+
${tiles}
+
+
+

Recent collections

+

No collections yet. Make one in the side panel.

+
+ +
`; +} + +function greeting(): string { + const h = new Date().getHours(); + return h < 12 ? 'Good morning' : h < 18 ? 'Good afternoon' : 'Good evening'; +} + +function newestFirst(list: Collection[]): Collection[] { + return [...list].sort((a, b) => (b.created_at ?? '').localeCompare(a.created_at ?? '') || a.name.localeCompare(b.name)).slice(0, RECENT); +} + +export function mountHome(engine: Engine, host: HTMLElement): void { + mountOnce(host, shell()); + const root = q(host, '.fc-home'); + const cards = q(root, '.fc-home-cards'); + const none = q(root, '.fc-home-none'); + const error = q(root, '.fc-home-error'); + const libName = q(root, '.fc-home-lib-name'); + const pick = q(root, '.fc-home-pick input'); + const adding = new Adding(engine.library); + let loading = false; + let stale = true; + + setText(q(root, '.fc-home-title'), greeting()); + + const showCounts = (c: Counts): void => { + for (const [k] of TILES) setText(q(root, `[data-count="${k}"] .fc-home-tile-num`), c[k].toLocaleString()); + }; + + const card = (c: Collection): HTMLElement => { + const n = el(``); + fill(n, c); + return n; + }; + const fill = (n: HTMLElement, c: Collection): void => { + n.dataset.name = c.name; + setText(q(n, '.fc-home-card-name'), c.name); + setText(q(n, '.fc-home-card-meta'), c.item_count === 1 ? '1 item' : `${c.item_count.toLocaleString()} items`); + }; + + const load = async (): Promise => { + if (loading) return; + loading = true; + stale = false; + try { + await loadWindowKey(); + const [colls, tags, items, unfiled, current] = await Promise.all([ + sideApi.collections() as Promise, sideApi.tags(), sideApi.scopeTotal('all'), sideApi.scopeTotal('unfiled'), + readCurrentLibrary().catch(() => null), + ]); + showCounts({ items, unfiled, collections: colls.length, tags: tags.length }); + setText(libName, current ? current.name : ''); + const recent = newestFirst(colls); + patchList(cards, recent, { key: (c) => c.id, create: card, update: fill }); + setHidden(none, recent.length > 0); + setText(error, ''); + } catch (e) { + setText(error, `The library could not be read: ${e instanceof Error ? e.message : String(e)}`); + } finally { + loading = false; + } + }; + + const openAdd = (tab: 'id' | 'import'): void => { + document.querySelector(`.fc-add-tab[data-tab="${tab}"]`)?.click(); + document.querySelector('.fc-add-open')?.click(); + }; + const openItems = (): void => { document.querySelector('.fc-nav-item[data-view="library"]')?.click(); }; + + root.addEventListener('click', (e) => { + const t = e.target instanceof Element ? e.target : null; + const c = t?.closest('.fc-home-card'); + if (c?.dataset.key) { + engine.library.setScope({ kind: 'collection', id: c.dataset.key, label: c.dataset.name ?? '' }); + openItems(); + return; + } + const a = t?.closest('[data-a]')?.dataset.a; + if (a === 'add') openAdd('id'); + else if (a === 'import') openAdd('import'); + else if (a === 'unfiled') { engine.library.setScope({ kind: 'unfiled', id: '', label: 'Unfiled' }); openItems(); } + else if (a === 'items') { engine.library.setScope({ kind: 'all', id: '', label: 'All items' }); openItems(); } + }); + + pick.addEventListener('change', () => { + const files = Array.from(pick.files ?? []); + pick.value = ''; + void (async () => { + for (const f of files) { + const r = await adding.identify(f); + toast(`${f.name}: ${r.text}`, r.ok ? 'info' : 'error'); + } + })(); + }); + + const onHome = (): boolean => (engine.library.view as string) === 'home'; + const touch = (): void => { stale = true; if (onHome()) void load(); }; + engine.library.events.on('view', (v) => { + if ((v as string) !== 'home') return; + setText(q(root, '.fc-home-title'), greeting()); + if (stale) void load(); + }); + engine.library.events.on('items:added', touch); + engine.library.events.on('items:removed', touch); + engine.library.events.on('items:restored', touch); + engine.library.events.on('collections:changed', touch); + engine.library.events.on('tags:changed', touch); + engine.library.events.on('library:switched', touch); + void load(); +} diff --git a/frontend/src/ui/itemlist.ts b/frontend/src/ui/itemlist.ts index 0f1e906..56e757d 100644 --- a/frontend/src/ui/itemlist.ts +++ b/frontend/src/ui/itemlist.ts @@ -163,6 +163,18 @@ export function mountItemList(engine: Engine, host: HTMLElement): void { if (row?.dataset.id) lib.select(row.dataset.id); }); + scroll.addEventListener('contextmenu', (ev) => { + const row = (ev.target as Element).closest('.fc-il-row'); + const keyboard = !row && ev.button !== 2 && !!lib.selected; + const id = row?.dataset.id || (keyboard ? lib.selected : ''); + if (!id) return; + ev.preventDefault(); + lib.select(id); + const at = keyboard ? pool.find((p) => !p.hidden && p.dataset.id === id)?.getBoundingClientRect() : null; + const x = at ? at.left + 24 : ev.clientX, y = at ? at.bottom : ev.clientY; + void import('./menus').then((m) => m.openRowMenu(engine, id, x, y, keyboard)); + }); + scroll.addEventListener('keydown', (ev) => { const cur = lib.selected ? model.indexOf(lib.selected) : -1; const page = Math.max(1, Math.floor(scroll.clientHeight / ROW_H) - 1); diff --git a/frontend/src/ui/menu.ts b/frontend/src/ui/menu.ts new file mode 100644 index 0000000..e2801f5 --- /dev/null +++ b/frontend/src/ui/menu.ts @@ -0,0 +1,397 @@ +import { el, isMac, q, setClass, setDisabled, setText, setTitle } from './dom'; + +export type MenuItem = string | '-' | SubMenu; +export interface SubMenu { label: string; items: MenuItem[] } +const isSub = (i: MenuItem): i is SubMenu => typeof i === 'object'; + +export interface MenuSource { + has(id: string): boolean; + label(id: string): string; + keys(id: string): string | undefined; + enabled(id: string): boolean; + checked(id: string): boolean | undefined; + why?(id: string): string; + run(id: string): void; +} + +export interface MenuDef { label: string; items: MenuItem[] | (() => MenuItem[]) } + +const MENU_SHARE = 0.75, MENU_PAD = 4; +export const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(window.innerHeight - top - MENU_PAD))); +export const barFloor = (): number => { const r = document.querySelector('.fc-menubar')?.getBoundingClientRect(); return r && r.height > 0 ? r.bottom + MENU_PAD : MENU_PAD; }; + +const CHECK_SVG = ''; +const CHEVRON_SVG = ''; +const MORE_SVG = ''; + +const MAC_KEYS: Record = { Mod: '⌘', Shift: '⇧', Alt: '⌥', Ctrl: '⌃', Backspace: '⌫', Delete: '⌦', Enter: '↩', Escape: '⎋', Tab: '⇥', Space: 'Space' }; +const PC_KEYS: Record = { Mod: 'Ctrl', Backspace: 'Backspace', Delete: 'Del', Escape: 'Esc' }; + +export function keyLabel(combo: string | undefined): string { + if (!combo) return ''; + const parts = combo.split('+'); + if (isMac) return parts.map((p) => MAC_KEYS[p] ?? p.toUpperCase()).join(''); + return parts.map((p) => PC_KEYS[p] ?? (p.length === 1 ? p.toUpperCase() : p)).join('+'); +} + +export const anyDialogOpen = (): boolean => !!document.querySelector('.fc-add.is-open, [role="dialog"][aria-modal="true"].is-open, dialog[open]'); + +export class PopupMenu { + readonly panel: HTMLElement; + private readonly list: HTMLElement; + private rows: Array<{ id: string; node: HTMLButtonElement }> = []; + private subs: Array<{ sub: SubMenu; node: HTMLButtonElement; menu: PopupMenu }> = []; + private key = ''; + private openSub: PopupMenu | null = null; + private subTop = 0; + private floor: number | null = null; + onClose: (() => void) | null = null; + + constructor(private readonly src: MenuSource, private readonly parent: PopupMenu | null = null, standalone = false) { + this.panel = el(``); + this.list = q(this.panel, '.fc-menu-list'); + document.body.appendChild(this.panel); + this.panel.addEventListener('contextmenu', (e) => e.preventDefault()); + this.list.addEventListener('scroll', () => { if (this.list.scrollTop !== this.subTop) this.closeSub(); this.showMore(); }, { passive: true }); + if (standalone) { + document.addEventListener('pointerdown', (e) => { if (this.isOpen && !this.contains(e.target as Node)) this.close(); }, true); + document.addEventListener('keydown', (e) => { if (this.isOpen) this.standaloneKey(e); }, true); + window.addEventListener('blur', () => this.close()); + window.addEventListener('resize', () => this.close()); + } + } + + get isOpen(): boolean { return !this.panel.hidden; } + + contains(t: Node): boolean { return this.panel.contains(t) || !!this.openSub?.contains(t); } + + setItems(items: MenuItem[]): void { + const key = JSON.stringify(items); + if (key === this.key) return; + this.key = key; + this.closeSub(); + for (const s of this.subs) s.menu.panel.remove(); + this.list.replaceChildren(); + this.rows = []; + this.subs = []; + for (const item of items) { + if (item === '-') { this.list.appendChild(el('')); continue; } + if (isSub(item)) { + const node = el(``); + setText(q(node, '.fc-menu-label'), item.label); + const menu = new PopupMenu(this.src, this); + menu.setItems(item.items); + node.addEventListener('pointerenter', () => this.showSub(menu, node)); + node.addEventListener('click', () => this.showSub(menu, node)); + this.subs.push({ sub: item, node, menu }); + this.list.appendChild(node); + continue; + } + if (!this.src.has(item)) continue; + const node = el(``); + setText(q(node, '.fc-menu-keys'), keyLabel(this.src.keys(item))); + node.addEventListener('pointerenter', () => this.closeSub()); + node.addEventListener('click', () => { this.root().close(); this.src.run(item); }); + this.rows.push({ id: item, node }); + this.list.appendChild(node); + } + } + + private root(): PopupMenu { let m: PopupMenu = this; while (m.parent) m = m.parent; return m; } + + items(): HTMLButtonElement[] { return Array.from(this.list.children).filter((n): n is HTMLButtonElement => n instanceof HTMLButtonElement && !n.disabled); } + + deepest(): PopupMenu { let m: PopupMenu = this; while (m.openSub?.isOpen) m = m.openSub; return m; } + + openSubAt(row: HTMLElement): PopupMenu | null { + const s = this.subs.find((x) => x.node === row); + if (!s) return null; + this.showSub(s.menu, row); + return s.menu; + } + + leave(): boolean { + const p = this.parent; + if (!p) return false; + const row = p.subs.find((x) => x.menu === this)?.node; + p.closeSub(); + row?.focus(); + return true; + } + + private showSub(menu: PopupMenu, row: HTMLElement): void { + if (this.openSub === menu && menu.isOpen) return; + this.closeSub(); + this.openSub = menu; + this.subTop = this.list.scrollTop; + setClass(row, 'is-open', true); + menu.onClose = () => setClass(row, 'is-open', false); + menu.openBeside(row.getBoundingClientRect()); + } + + private closeSub(): void { + const s = this.openSub; + this.openSub = null; + s?.close(); + } + + openAt(x: number, y: number): void { + this.floor = barFloor(); + this.refresh(); + this.panel.style.visibility = 'hidden'; + this.panel.hidden = false; + this.panel.style.maxHeight = `${menuCap(this.floor)}px`; + this.list.scrollTop = 0; + const { width: w, height: h } = this.panel.getBoundingClientRect(); + const fitsRight = x + w <= window.innerWidth - MENU_PAD, fitsBelow = y + h <= window.innerHeight - MENU_PAD; + const left = Math.max(MENU_PAD, Math.min(fitsRight ? x : x - w, window.innerWidth - w - MENU_PAD)); + const top = Math.max(this.floor, Math.min(fitsBelow ? y : y - h, window.innerHeight - h - MENU_PAD)); + this.panel.style.left = `${Math.round(left)}px`; + this.panel.style.top = `${Math.round(top)}px`; + this.showMore(true); + this.panel.style.visibility = ''; + } + + openUnder(x: number, y: number): void { + this.floor = y; + this.refresh(); + this.panel.style.visibility = 'hidden'; + this.panel.hidden = false; + this.panel.style.maxHeight = `${menuCap(y)}px`; + this.list.scrollTop = 0; + const w = this.panel.offsetWidth; + const left = Math.max(MENU_PAD, Math.min(x, window.innerWidth - w - MENU_PAD)); + this.panel.style.left = `${Math.round(left)}px`; + this.panel.style.top = `${Math.round(y)}px`; + this.showMore(true); + this.panel.style.visibility = ''; + } + + private openBeside(row: DOMRect): void { + this.refresh(); + this.panel.style.visibility = 'hidden'; + this.panel.hidden = false; + const floor = this.root().floor, pad = MENU_PAD; + this.panel.style.maxHeight = floor === null ? '' : `${menuCap(floor)}px`; + this.list.scrollTop = 0; + const w = this.panel.offsetWidth, h = this.panel.offsetHeight; + const right = row.right - 2, left = row.left - w + 2; + const x = right + w <= window.innerWidth - pad ? right : Math.max(pad, left); + const y = Math.max(floor ?? pad, Math.min(row.top - pad, window.innerHeight - h - pad)); + this.panel.style.left = `${Math.round(x)}px`; + this.panel.style.top = `${Math.round(y)}px`; + this.showMore(true); + this.panel.style.visibility = ''; + } + + private showMore(instant = false): void { + const l = this.list; + const more = this.root().floor !== null && !this.panel.hidden && l.scrollHeight - l.clientHeight - l.scrollTop > 1; + if (instant) setClass(this.panel, 'no-fade', true); + setClass(this.panel, 'has-more', more); + if (instant) { void getComputedStyle(this.panel.lastElementChild ?? this.panel).opacity; setClass(this.panel, 'no-fade', false); } + } + + private refresh(): void { + for (const r of this.rows) { + setText(q(r.node, '.fc-menu-label'), this.src.label(r.id)); + setDisabled(r.node, !this.src.enabled(r.id)); + const why = this.src.why?.(r.id) ?? ''; + if (why || r.node.dataset.why) { setTitle(r.node, why); r.node.dataset.why = why; } + const checked = this.src.checked(r.id); + setClass(r.node, 'is-checkable', checked !== undefined); + setClass(r.node, 'is-checked', !!checked); + if (checked !== undefined) { if (r.node.getAttribute('role') !== 'menuitemcheckbox') r.node.setAttribute('role', 'menuitemcheckbox'); if (r.node.getAttribute('aria-checked') !== String(checked)) r.node.setAttribute('aria-checked', String(checked)); } + } + } + + private returnTo: HTMLElement | null = null; + + openAtFromKeyboard(x: number, y: number, keyboard: boolean): void { + const from = document.activeElement; + this.returnTo = from instanceof HTMLElement && !from.closest('.fc-menu') ? from : null; + this.openAt(x, y); + if (keyboard) this.items()[0]?.focus(); + } + + private standaloneKey(e: KeyboardEvent): void { + if (e.ctrlKey || e.metaKey || e.altKey) return; + const stop = (): void => { e.preventDefault(); e.stopPropagation(); }; + const cur = this.deepest(), items = cur.items(), at = items.findIndex((n) => n === document.activeElement); + const go = (i: number): void => { if (items.length) items[(i + items.length) % items.length].focus(); }; + if (e.key === 'ArrowDown') { stop(); go(at + 1); } + else if (e.key === 'ArrowUp') { stop(); go(at < 0 ? -1 : at - 1); } + else if (e.key === 'Home') { stop(); go(0); } + else if (e.key === 'End') { stop(); go(-1); } + else if (e.key === 'ArrowRight') { stop(); const sub = at >= 0 ? cur.openSubAt(items[at]) : null; sub?.items()[0]?.focus(); } + else if (e.key === 'ArrowLeft') { stop(); cur.leave(); } + else if ((e.key === 'Enter' || e.key === ' ') && at >= 0) { stop(); const sub = cur.openSubAt(items[at]); if (sub) sub.items()[0]?.focus(); else items[at].click(); } + else if (e.key === 'Escape') { stop(); if (!cur.leave()) { const back = this.returnTo; this.close(); if (back?.isConnected) back.focus(); } } + else if (e.key === 'Tab') { stop(); this.close(); } + } + + close(): void { + this.closeSub(); + if (this.panel.hidden) return; + this.panel.hidden = true; + this.returnTo = null; + this.onClose?.(); + } +} + +const itemsOf = (def: MenuDef): MenuItem[] => (typeof def.items === 'function' ? def.items() : def.items); + +export class MenuBar { + private readonly bars: Array<{ btn: HTMLButtonElement; menu: PopupMenu; def: MenuDef }> = []; + private openIndex = -1; + private returnTo: HTMLElement | null = null; + private typed = ''; + private typedAt = 0; + private altLone = false; + private barBack: HTMLElement | null = null; + + constructor(host: HTMLElement, src: MenuSource, defs: MenuDef[]) { + setClass(host, 'fc-menubar', true); + if (host.getAttribute('role') !== 'menubar') host.setAttribute('role', 'menubar'); + for (const def of defs) { + const btn = el(''); + setText(btn, def.label); + host.appendChild(btn); + const menu = new PopupMenu(src); + menu.setItems(itemsOf(def)); + const idx = this.bars.length; + menu.onClose = () => { + if (this.openIndex === idx) { + const inside = !!document.activeElement?.closest('.fc-menu'), back = this.returnTo; + this.openIndex = -1; + setClass(btn, 'is-open', false); + this.returnTo = null; + if (inside && back?.isConnected) back.focus(); + } + }; + btn.addEventListener('pointerdown', (e) => { + if (e.button !== 0) return; + e.preventDefault(); + if (this.openIndex === idx) this.close(); else this.open(idx); + }); + btn.addEventListener('pointerenter', () => { if (this.openIndex >= 0 && this.openIndex !== idx) this.open(idx); }); + this.bars.push({ btn, menu, def }); + } + document.addEventListener('pointerdown', (e) => { + if (this.openIndex < 0) return; + const m = this.bars[this.openIndex]; + const t = e.target as Node; + if (!m.menu.contains(t) && !m.btn.contains(t)) this.close(); + }, true); + window.addEventListener('blur', () => this.close()); + window.addEventListener('resize', () => this.close()); + document.addEventListener('keydown', (e) => this.key(e), true); + document.addEventListener('keyup', (e) => this.altUp(e), true); + document.addEventListener('pointerdown', () => { this.altLone = false; }, true); + window.addEventListener('blur', () => { this.altLone = false; setClass(document.documentElement, 'is-menu-mnemonics', false); }); + } + + get isOpen(): boolean { return this.openIndex >= 0; } + + private altUp(e: KeyboardEvent): void { + if (e.key !== 'Alt') return; + setClass(document.documentElement, 'is-menu-mnemonics', false); + if (!this.altLone) return; + this.altLone = false; + if (this.openIndex >= 0 || anyDialogOpen() || !this.bars.length) return; + e.preventDefault(); + const from = document.activeElement; + this.barBack = from instanceof HTMLElement && !this.bars.some((b) => b.btn === from) ? from : this.barBack; + this.bars[0].btn.focus(); + } + + private leaveBar(): void { + const back = this.barBack; + this.barBack = null; + if (back?.isConnected && back !== document.body) back.focus(); else (document.activeElement as HTMLElement | null)?.blur(); + } + + private key(e: KeyboardEvent): void { + const stop = (): void => { e.preventDefault(); e.stopPropagation(); }; + if (e.key === 'Alt') { + if (!e.repeat && !isMac && this.openIndex < 0 && !anyDialogOpen() && !e.ctrlKey && !e.metaKey && !e.shiftKey) { this.altLone = true; setClass(document.documentElement, 'is-menu-mnemonics', true); } + return; + } + this.altLone = false; + if (this.openIndex < 0) { + if (anyDialogOpen() || e.ctrlKey || e.metaKey) return; + const at = this.bars.findIndex((b) => b.btn === document.activeElement); + if (at >= 0 && !e.altKey && !e.shiftKey) { + const focus = (i: number): void => this.bars[(i + this.bars.length) % this.bars.length].btn.focus(); + if (e.key === 'ArrowRight') { stop(); focus(at + 1); return; } + if (e.key === 'ArrowLeft') { stop(); focus(at - 1); return; } + if (e.key === 'Home') { stop(); focus(0); return; } + if (e.key === 'End') { stop(); focus(-1); return; } + if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === ' ') { stop(); this.open(at, true); return; } + if (e.key === 'Escape') { stop(); this.leaveBar(); return; } + if (e.key.length === 1 && /\S/.test(e.key)) { + const hit = this.bars.findIndex((b) => (b.btn.textContent ?? '').trim().charAt(0).toLowerCase() === e.key.toLowerCase()); + if (hit >= 0) { stop(); this.open(hit, true); } + return; + } + } + if (e.key === 'F10' && !e.altKey && !e.shiftKey) { stop(); this.open(0, true); return; } + if (!e.altKey || e.shiftKey || isMac || !/^Key[A-Z]$/.test(e.code)) return; + const letter = e.code.slice(3).toLowerCase(), hits = this.bars.map((b, i) => (b.btn.textContent ?? '').trim().charAt(0).toLowerCase() === letter ? i : -1).filter((i) => i >= 0); + if (!hits.length) return; + stop(); + this.open(hits[0], true); + return; + } + if (e.ctrlKey || e.metaKey || e.altKey) return; + const cur = this.bars[this.openIndex].menu.deepest(), items = cur.items(), row = document.activeElement, at = items.findIndex((n) => n === row); + const go = (i: number): void => { if (items.length) items[(i + items.length) % items.length].focus(); }; + if (e.key === 'ArrowDown') { stop(); go(at + 1); } + else if (e.key === 'ArrowUp') { stop(); go(at < 0 ? -1 : at - 1); } + else if (e.key === 'Home') { stop(); go(0); } + else if (e.key === 'End') { stop(); go(-1); } + else if (e.key === 'ArrowRight') { stop(); const sub = at >= 0 ? cur.openSubAt(items[at]) : null; if (sub) sub.items()[0]?.focus(); else this.open((this.openIndex + 1) % this.bars.length, true); } + else if (e.key === 'ArrowLeft') { stop(); if (!cur.leave()) this.open((this.openIndex + this.bars.length - 1) % this.bars.length, true); } + else if ((e.key === 'Enter' || e.key === ' ') && at >= 0) { stop(); const sub = cur.openSubAt(items[at]); if (sub) sub.items()[0]?.focus(); else items[at].click(); } + else if (e.key === 'Escape') { stop(); if (!cur.leave()) this.close(); } + else if (e.key === 'Tab') { stop(); this.close(); } + else if (e.key.length === 1 && /\S/.test(e.key) && !e.shiftKey) { + stop(); + const now = performance.now(), word = now - this.typedAt < 700 ? this.typed + e.key.toLowerCase() : e.key.toLowerCase(); + this.typed = word; + this.typedAt = now; + const starts = (n: HTMLElement): boolean => (n.querySelector('.fc-menu-label')?.textContent ?? '').trim().toLowerCase().startsWith(word); + const from = word.length === 1 ? at + 1 : Math.max(0, at); + for (let k = 0; k < items.length; k++) { const n = items[(from + k) % items.length]; if (starts(n)) { n.focus(); break; } } + } + } + + open(i: number, keyboard = false): void { + const from = document.activeElement, keep = this.returnTo; + this.shut(); + this.returnTo = keep ?? (keyboard && from instanceof HTMLElement && !from.closest('.fc-menu') ? from : null); + const b = this.bars[i]; + b.menu.setItems(itemsOf(b.def)); + this.openIndex = i; + setClass(b.btn, 'is-open', true); + const r = b.btn.getBoundingClientRect(); + b.menu.openUnder(r.left, Math.max(r.bottom + MENU_PAD, barFloor())); + if (keyboard) b.menu.items()[0]?.focus(); + } + + private shut(): void { + if (this.openIndex < 0) return; + const b = this.bars[this.openIndex]; + this.openIndex = -1; + setClass(b.btn, 'is-open', false); + b.menu.close(); + } + + close(): void { + const inside = !!document.activeElement?.closest('.fc-menu'); + this.shut(); + const back = this.returnTo; + this.returnTo = null; + if (inside && back && back.isConnected) back.focus(); + } +} diff --git a/frontend/src/ui/menus.ts b/frontend/src/ui/menus.ts new file mode 100644 index 0000000..72c2644 --- /dev/null +++ b/frontend/src/ui/menus.ts @@ -0,0 +1,240 @@ +import type { Engine } from '../engine'; +import { api } from '../io/api'; +import { chooseTheme, currentAppearance } from '../engine/preferences'; +import { detailApi } from '../io/detail'; +import { VERSION } from '../version'; +import { isMac } from './dom'; +import { anyDialogOpen, MenuBar, PopupMenu, type MenuDef, type MenuItem, type MenuSource } from './menu'; +import { inTauri, isMacShell, menusInWindow, NativeMenus, wantsNativeMenus } from './native-menu'; +import { toast } from './toast'; +import '../styles/menu.css'; + +interface Entry { label: string; keys?: string } + +const ENTRIES: Record = { + 'app.about': { label: 'About FormCite' }, + 'app.home': { label: 'Home', keys: 'Mod+Shift+H' }, + 'app.preferences': { label: 'Preferences…', keys: 'Mod+,' }, + 'library.add': { label: 'Add by Identifier…', keys: 'Mod+N' }, + 'library.import': { label: 'Import…', keys: 'Mod+I' }, + 'library.export': { label: 'Export…', keys: 'Mod+E' }, + 'collection.new': { label: 'New Collection', keys: 'Mod+Shift+N' }, + 'edit.undo': { label: 'Undo', keys: 'Mod+Z' }, + 'edit.redo': { label: 'Redo', keys: 'Mod+Shift+Z' }, + 'edit.cut': { label: 'Cut', keys: 'Mod+X' }, + 'edit.copy': { label: 'Copy', keys: 'Mod+C' }, + 'edit.paste': { label: 'Paste', keys: 'Mod+V' }, + 'edit.select-all': { label: 'Select All', keys: 'Mod+A' }, + 'edit.find': { label: 'Find in Items', keys: 'Mod+F' }, + 'view.items': { label: 'Items', keys: 'Mod+1' }, + 'view.duplicates': { label: 'Duplicates', keys: 'Mod+2' }, + 'view.trash': { label: 'Trash', keys: 'Mod+3' }, + 'view.connections': { label: 'Connections', keys: 'Mod+4' }, + 'view.dock': { label: 'Agent Dock', keys: 'Mod+J' }, + 'view.menus-in-window': { label: 'Menus in Window' }, + 'item.open': { label: 'Open Attachment', keys: 'Mod+O' }, + 'item.copy-citation': { label: 'Copy Citation', keys: 'Mod+Shift+C' }, + 'item.copy-bibliography': { label: 'Copy Bibliography Entry', keys: 'Mod+Alt+C' }, + 'item.trash': { label: 'Move to Trash', keys: 'Mod+Backspace' }, + 'connections.refresh': { label: 'Check for Connection Requests' }, + 'window.minimize': { label: 'Minimize', keys: 'Mod+M' }, + 'window.zoom': { label: 'Zoom' }, + 'window.fullscreen': { label: 'Enter Full Screen' }, + 'window.close': { label: 'Close Window', keys: 'Mod+W' }, + 'help.about': { label: 'About FormCite' }, + 'view.appearance.system': { label: 'System' }, + 'view.appearance.light': { label: 'Light' }, + 'view.appearance.dark': { label: 'Dark' }, +}; + +const APP_MENU: MenuItem[] = ['app.home', 'app.preferences']; + +export const MENUS: MenuDef[] = [ + { label: 'File', items: ['library.add', 'library.import', 'library.export', '-', 'collection.new', '-', 'app.home'] }, + { label: 'Edit', items: ['edit.undo', 'edit.redo', '-', 'edit.cut', 'edit.copy', 'edit.paste', 'edit.select-all', '-', 'edit.find'] }, + { label: 'View', items: ['view.items', 'view.duplicates', 'view.trash', 'view.connections', '-', { label: 'Appearance', items: ['view.appearance.system', 'view.appearance.light', 'view.appearance.dark'] }, '-', 'view.dock', 'view.menus-in-window'] }, + { label: 'Library', items: ['item.open', 'item.copy-citation', 'item.copy-bibliography', '-', 'item.trash', '-', 'connections.refresh'] }, + { label: 'Window', items: ['window.minimize', 'window.zoom', 'window.fullscreen', '-', 'window.close'] }, + { label: 'Help', items: ['help.about'] }, +]; + +const IN_WINDOW: MenuDef[] = [{ label: 'FormCite', items: ['app.about', '-', ...APP_MENU] }, ...MENUS]; + +const NOT_TEXT = new Set(['button', 'checkbox', 'radio', 'range', 'color', 'file', 'submit', 'reset', 'image']); +const isField = (a: Element | null): a is HTMLElement => { + if (a instanceof HTMLTextAreaElement) return !a.readOnly && !a.disabled; + if (a instanceof HTMLInputElement) return !NOT_TEXT.has(a.type) && !a.readOnly && !a.disabled; + return a instanceof HTMLElement && a.isContentEditable; +}; + +let lastField: HTMLElement | null = null; +const field = (): HTMLElement | null => (isField(document.activeElement) ? document.activeElement as HTMLElement : lastField?.isConnected ? lastField : null); + +const EDIT_COMMANDS: Record = { 'edit.undo': 'undo', 'edit.redo': 'redo', 'edit.cut': 'cut', 'edit.copy': 'copy', 'edit.select-all': 'selectAll' }; + +function editAction(id: string): void { + const f = field(); + if (!f) return; + f.focus({ preventScroll: true }); + if (id === 'edit.paste') { + void navigator.clipboard?.readText().then((text) => { if (text) document.execCommand('insertText', false, text); }).catch(() => { document.execCommand('paste'); }); + return; + } + document.execCommand(EDIT_COMMANDS[id]); +} + +function windowAction(id: string): void { + void import('@tauri-apps/api/window').then(({ getCurrentWindow }) => { + const w = getCurrentWindow(); + if (id === 'window.minimize') return w.minimize(); + if (id === 'window.zoom') return w.toggleMaximize(); + if (id === 'window.close') return w.close(); + return undefined; + }).catch(() => undefined); +} + +let bound: Engine | null = null; + +const BUILT_IN: Record = { + 'app.about': { has: () => true, run: () => { toast(`FormCite ${VERSION}`); } }, + 'help.about': { has: () => true, run: () => { toast(`FormCite ${VERSION}`); } }, + ...Object.fromEntries(['edit.undo', 'edit.redo', 'edit.cut', 'edit.copy', 'edit.paste', 'edit.select-all'].map((id) => [id, { has: () => true, run: () => editAction(id), enabled: () => !!field() }])), + ...Object.fromEntries(['window.minimize', 'window.zoom', 'window.close'].map((id) => [id, { has: inTauri, run: () => windowAction(id) }])), + 'window.fullscreen': { has: () => false, run: () => undefined }, + ...Object.fromEntries(['system', 'light', 'dark'].map((mode) => [`view.appearance.${mode}`, { has: () => true, enabled: () => !!bound, run: () => { if (bound) chooseTheme(bound, mode); }, checked: () => currentAppearance().theme === mode }])), +}; + +function makeSource(run: (id: string) => void, isEnabled?: (id: string) => boolean): MenuSource { + return { + has: (id) => id in ENTRIES && (BUILT_IN[id] ? BUILT_IN[id].has() : id === 'view.menus-in-window' ? isMacShell() : true), + label: (id) => ENTRIES[id]?.label ?? id, + keys: (id) => ENTRIES[id]?.keys, + enabled: (id) => { const b = BUILT_IN[id]; if (b) return b.enabled ? b.enabled() : true; return isEnabled ? isEnabled(id) : true; }, + checked: (id) => (id === 'view.menus-in-window' ? menusInWindow() : BUILT_IN[id]?.checked?.()), + run: (id) => { const b = BUILT_IN[id]; if (b) b.run(); else run(id); }, + }; +} + +function comboOf(e: KeyboardEvent): string { + const parts: string[] = []; + if (isMac ? e.metaKey : e.ctrlKey) parts.push('Mod'); + if (isMac && e.ctrlKey) parts.push('Ctrl'); + if (e.altKey) parts.push('Alt'); + if (e.shiftKey) parts.push('Shift'); + const k = /^Key[A-Z]$/.test(e.code) ? e.code.slice(3) : /^Digit[0-9]$/.test(e.code) ? e.code.slice(5) : e.code === 'Comma' ? ',' : e.key; + parts.push(k); + return parts.join('+'); +} + +const norm = (combo: string): string => { const p = combo.split('+'); const key = p.pop() ?? ''; const order = ['Mod', 'Ctrl', 'Alt', 'Shift']; return [...order.filter((m) => p.includes(m)), key.length === 1 ? key.toUpperCase() : key].join('+'); }; +const FIELD_KEYS = new Set(['A', 'C', 'V', 'X', 'Z', 'Backspace', 'Delete']); + +function bindKeys(src: MenuSource): void { + const byCombo = new Map(); + for (const [id, entry] of Object.entries(ENTRIES)) if (entry.keys && (!id.startsWith('edit.') || id === 'edit.find')) byCombo.set(norm(entry.keys), id); + window.addEventListener('keydown', (e) => { + if (e.defaultPrevented || e.repeat || anyDialogOpen() || document.querySelector('.fc-menu:not([hidden])')) return; + const combo = norm(comboOf(e)); + if (!combo.startsWith('Mod+')) return; + const id = byCombo.get(combo); + if (!id || !src.has(id) || !src.enabled(id)) return; + if (isField(document.activeElement) && FIELD_KEYS.has(combo.split('+').pop() ?? '')) return; + e.preventDefault(); + src.run(id); + }); +} + +export function mountMenus(host: HTMLElement, run: (id: string) => void, isEnabled?: (id: string) => boolean): void { + document.addEventListener('focusin', (e) => { + const t = e.target as Element | null; + if (isField(t)) lastField = t; + else if (t && !t.closest('.fc-menu, .fc-menubar')) lastField = null; + }); + const src = makeSource(run, isEnabled); + if (wantsNativeMenus()) { + const native = new NativeMenus(src, () => MENUS, APP_MENU); + void native.build().catch(() => { document.documentElement.dataset.fcMenubar = 'window'; new MenuBar(host, src, IN_WINDOW); bindKeys(src); }); + return; + } + new MenuBar(host, src, IN_WINDOW.filter((def) => (typeof def.items === 'function' ? def.items() : def.items).some((i) => i !== '-' && (typeof i !== 'string' || src.has(i))))); + bindKeys(src); +} + +let styleName: Promise | null = null; +const citeStyle = (): Promise => { + styleName ??= api.get<{ common: string[]; styles: string[] }>('/format/styles').then((s) => s.common[0] ?? s.styles[0] ?? 'apa').catch((e) => { styleName = null; throw e; }); + return styleName; +}; + +const errText = (e: unknown): string => (e instanceof Error ? e.message : String(e)); + +async function copyFormatted(id: string, kind: 'cite' | 'bibliography'): Promise { + try { + const style = await citeStyle(); + const out = await api.post<{ text: string; style?: string }>(`/format/${kind}`, { ids: [id], style }); + await navigator.clipboard.writeText(out.text); + toast(kind === 'cite' ? `Citation copied (${out.style ?? style}).` : `Bibliography entry copied (${out.style ?? style}).`); + } catch (e) { + toast(`Could not copy: ${errText(e)}`, 'error'); + } +} + +async function openFirstAttachment(id: string): Promise { + try { + const item = await detailApi.item(id); + const first = item.attachments[0]; + if (!first) { toast('This item has no attachment to open.'); return; } + await detailApi.openAttachment(first.id); + } catch (e) { + toast(`Could not open: ${errText(e)}`, 'error'); + } +} + +async function trashItem(engine: Engine, id: string): Promise { + try { + await detailApi.trash(id); + engine.library.itemsRemoved([id]); + } catch (e) { + toast(`Could not move to Trash: ${errText(e)}`, 'error'); + } +} + +export const ITEM_COMMANDS = ['item.open', 'item.copy-citation', 'item.copy-bibliography', 'item.trash'] as const; + +export function itemAction(engine: Engine, cmd: string, id: string): void { + if (cmd === 'item.open') void openFirstAttachment(id); + else if (cmd === 'item.copy-citation') void copyFormatted(id, 'cite'); + else if (cmd === 'item.copy-bibliography') void copyFormatted(id, 'bibliography'); + else if (cmd === 'item.trash') void trashItem(engine, id); +} + +export function registerItemCommands(engine: Engine): void { + bound = engine; + for (const cmd of ITEM_COMMANDS) { + engine.commands.register({ id: cmd, title: ENTRIES[cmd].label, run: (args) => { + const id = typeof args === 'string' && args ? args : engine.library.selected; + if (id) itemAction(engine, cmd, id); + } }); + } +} + +const ROW_ITEMS: MenuItem[] = ['item.open', '-', 'item.copy-citation', 'item.copy-bibliography', '-', 'item.trash']; +let rowMenu: PopupMenu | null = null; +let rowId = ''; + +export function openRowMenu(engine: Engine, id: string, x: number, y: number, keyboard = false): void { + rowId = id; + if (!rowMenu) { + rowMenu = new PopupMenu({ + has: (c) => c in ENTRIES, + label: (c) => ENTRIES[c].label, + keys: (c) => ENTRIES[c].keys, + enabled: () => !!rowId, + checked: () => undefined, + run: (c) => itemAction(engine, c, rowId), + }, null, true); + rowMenu.setItems(ROW_ITEMS); + } + rowMenu.close(); + rowMenu.openAtFromKeyboard(x, y, keyboard); +} diff --git a/frontend/src/ui/native-menu.ts b/frontend/src/ui/native-menu.ts new file mode 100644 index 0000000..289f1f5 --- /dev/null +++ b/frontend/src/ui/native-menu.ts @@ -0,0 +1,110 @@ +import type { MenuDef, MenuItem, MenuSource } from './menu'; +import { VERSION } from '../version'; + +export const MENUS_IN_WINDOW_KEY = 'formcite.menusInWindow'; + +export function menusInWindow(): boolean { + try { return localStorage.getItem(MENUS_IN_WINDOW_KEY) === '1'; } catch { return false; } +} + +export const inTauri = (): boolean => '__TAURI_INTERNALS__' in window; +export const isMacShell = (): boolean => inTauri() && /Mac/.test(navigator.platform); +export const wantsNativeMenus = (): boolean => isMacShell() && !menusInWindow(); + +export function accelerator(combo: string | undefined): string | null { + if (!combo) return null; + const names: Record = { Mod: 'CmdOrCtrl', Alt: 'Alt', Shift: 'Shift', Ctrl: 'Ctrl', Delete: 'Delete', Backspace: 'Backspace', Escape: 'Escape', Enter: 'Enter', Tab: 'Tab', Space: 'Space', ',': ',', '.': '.', '/': '/', '[': '[', ']': ']', '=': '=', '-': '-' }; + const out: string[] = []; + for (const p of combo.split('+')) { + if (names[p]) out.push(names[p]); + else if (/^[A-Za-z0-9]$/.test(p)) out.push(p.toUpperCase()); + else if (/^F([1-9]|1[0-2])$/.test(p)) out.push(p); + else return null; + } + return out.join('+'); +} + +export const PREDEFINED: Record = { + 'edit.undo': 'Undo', 'edit.redo': 'Redo', 'edit.cut': 'Cut', 'edit.copy': 'Copy', 'edit.paste': 'Paste', 'edit.select-all': 'SelectAll', + 'window.minimize': 'Minimize', 'window.zoom': 'Maximize', 'window.fullscreen': 'Fullscreen', 'window.close': 'CloseWindow', +}; + +type Api = typeof import('@tauri-apps/api/menu'); +interface Live { setEnabled(on: boolean): Promise; setChecked?(on: boolean): Promise } + +export class NativeMenus { + private items: Array<{ id: string; item: Live }> = []; + private building = false; + private again = false; + private stateTimer = 0; + + constructor(private readonly src: MenuSource, private readonly menus: () => MenuDef[], private readonly appMenu: MenuItem[]) { + for (const ev of ['pointerup', 'keyup', 'focusin', 'focusout'] as const) window.addEventListener(ev, () => { if (this.items.length) this.refresh(); }, { passive: true }); + } + + async build(): Promise { + if (this.building) { this.again = true; return; } + this.building = true; + try { + const api: Api = await import('@tauri-apps/api/menu'); + const items: typeof this.items = []; + const make = async (spec: MenuItem): Promise => { + if (spec === '-') return api.PredefinedMenuItem.new({ item: 'Separator' }); + if (typeof spec === 'object') return api.Submenu.new({ text: spec.label, items: (await Promise.all(spec.items.map(make))).filter(Boolean) as never[] }); + const pre = PREDEFINED[spec]; + if (pre) return api.PredefinedMenuItem.new({ item: pre }); + if (!this.src.has(spec)) return null; + const acc = accelerator(this.src.keys(spec)); + const opts = { text: this.src.label(spec), enabled: this.src.enabled(spec), action: () => { this.src.run(spec); this.refresh(); } }; + const checked = this.src.checked(spec); + let item: Live; + if (checked !== undefined) { + const copts = { ...opts, checked }; + try { item = await api.CheckMenuItem.new(acc ? { ...copts, accelerator: acc } : copts); } catch { item = await api.CheckMenuItem.new(copts); } + } else { + try { item = await api.MenuItem.new(acc ? { ...opts, accelerator: acc } : opts); } catch { item = await api.MenuItem.new(opts); } + } + items.push({ id: spec, item }); + return item; + }; + const app = await api.Submenu.new({ text: 'FormCite', items: [ + await api.PredefinedMenuItem.new({ item: { About: { name: 'FormCite', version: VERSION, copyright: 'Copyright (C) 2026 NodeAgentc, Inc.', license: 'GPL-3.0-only' } }, text: 'About FormCite' }), + await api.PredefinedMenuItem.new({ item: 'Separator' }), + ...((await Promise.all(this.appMenu.map(make))).filter(Boolean)), + await api.PredefinedMenuItem.new({ item: 'Separator' }), + await api.PredefinedMenuItem.new({ item: 'Services' }), + await api.PredefinedMenuItem.new({ item: 'Separator' }), + await api.PredefinedMenuItem.new({ item: 'Hide' }), + await api.PredefinedMenuItem.new({ item: 'HideOthers' }), + await api.PredefinedMenuItem.new({ item: 'ShowAll' }), + await api.PredefinedMenuItem.new({ item: 'Separator' }), + await api.PredefinedMenuItem.new({ item: 'Quit' }), + ] as never[] }); + const top: unknown[] = [app]; + for (const def of this.menus()) { + const list = typeof def.items === 'function' ? def.items() : def.items; + const made = (await Promise.all(list.map(make))).filter(Boolean); + if (made.length) top.push(await api.Submenu.new({ text: def.label, items: made as never[] })); + } + const menu = await api.Menu.new({ items: top as never[] }); + await menu.setAsAppMenu(); + this.items = items; + document.documentElement.classList.add('has-native-menus'); + } finally { + this.building = false; + if (this.again) { this.again = false; void this.build(); } + } + } + + refresh(): void { + if (this.stateTimer) return; + this.stateTimer = window.setTimeout(() => { + this.stateTimer = 0; + for (const { id, item } of this.items) { + void item.setEnabled(this.src.enabled(id)).catch(() => undefined); + const checked = this.src.checked(id); + if (checked !== undefined && item.setChecked) void item.setChecked(checked).catch(() => undefined); + } + }, 150); + } +} diff --git a/frontend/src/ui/preferences.ts b/frontend/src/ui/preferences.ts index cbfbdbe..029804a 100644 --- a/frontend/src/ui/preferences.ts +++ b/frontend/src/ui/preferences.ts @@ -1,9 +1,10 @@ import type { Engine } from '../engine'; import { - LOG_ROWS, chooseAccent, chooseTheme, currentAppearance, describeEntry, prefs, themeOptions, validContact, + LOG_ROWS, chooseAccent, chooseTheme, currentAppearance, describeEntry, desktopMac, onShellPref, prefs, setShellPref, shellPref, themeOptions, validContact, + type ShellPref, } from '../engine/preferences'; import type { LibraryInfo, NetOverview, NetService } from '../io/preferences'; -import { delayedIndicator, el, escapeHtml, mountOnce, patchList, q, setChecked, setClass, setDisabled, setText, setValue } from './dom'; +import { delayedIndicator, el, escapeHtml, isMac, mountOnce, patchList, q, setChecked, setClass, setDisabled, setHidden, setText, setValue } from './dom'; import { icon } from './icons'; import { loadWindowKey } from '../io/window-key'; import { mountDetailPrefs } from './pref-detail'; @@ -23,39 +24,66 @@ function themeList(): string { return `
All themes
    ${rows}
Picking one also switches the appearance to its kind.
`; } -function shell(): string { +const PS = 'viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"'; +const RAIL_ICONS: Record = { + general: ``, + menus: ``, + agents: ``, +}; +const CHEV = ``; + +const railIcon = (id: string, size: number): string => (RAIL_ICONS[id] ? `` : icon(id === 'appearance' ? 'sliders' : id === 'network' ? 'link' : 'library', size)); + +interface PrSection { id: string; label: string; body: string } + +function section(s: PrSection): string { + return `
+ +
${s.body}
+
`; +} + +const group = (label: string, body: string): string => `

${label}

${body}
`; + +function shell(withMenus: boolean): string { const themes = themeOptions().map((t) => ``).join(''); + const sections: PrSection[] = [ + { id: 'general', label: 'General', body: group('Startup', ` +
Show Home at launchOff opens FormCite on Items.
${SWITCH}
+

Home holds the ways to add references and the library at a glance. Open it at any time from the side panel or with the Home command.

`) }, + { id: 'appearance', label: 'Appearance', body: group('Theme', ` +
+ ${themeGrid('dark', 'Dark theme', DARK_THEMES)} + ${themeGrid('light', 'Light theme', LIGHT_THEMES)} + ${themeList()} +
`) + + group('Details pane', '
') }, + { id: 'network', label: 'Network', body: group('Lookups', ` +

FormCite connects to nothing unless you or an agent asks for a lookup. Every call is listed below.

+
Allow network lookups
${SWITCH}
+

+
+

Sent to the services that ask for a contact, and nowhere else.

`) + + group('Recent calls', ` +
The last ${LOG_ROWS} calls
+
    ${LOG_SLOTS}
+ `) }, + { id: 'libraries', label: 'Libraries', body: group('Libraries in the data folder', ` +

+
+ `) }, + ...(withMenus ? [{ id: 'menus', label: 'Menus', body: group('Menu bar', ` +
Menus in WindowTakes effect at the next start.
${SWITCH}
+

Off puts FormCite's menus in the macOS menu bar at the top of the screen. On keeps them in a bar inside the window, as on Linux and Windows.

`) }] : []), + { id: 'agents', label: 'Agents', body: group('Agent dock', ` +
Show the agent dockAlso View, Agent Dock, or ${isMac ? 'Cmd' : 'Ctrl'}+J.
${SWITCH}
+

The dock runs a coding agent in a terminal beside your library. Apps that ask to use the library are answered under Connections.

`) }, + ]; + const tabs = sections.map((s) => ``).join(''); return `
-
-

${icon('sliders', 14)}Appearance

-
- ${themeGrid('dark', 'Dark theme', DARK_THEMES)} - ${themeGrid('light', 'Light theme', LIGHT_THEMES)} - ${themeList()} -
-
-
-

${icon('sliders', 14)}Details pane

-
-
-
-

${icon('link', 14)}Network

-

FormCite connects to nothing unless you or an agent asks for a lookup. Every call is listed below.

-
Allow network lookups
${SWITCH}
-

-
-

Sent to the services that ask for a contact, and nowhere else.

-
Recent calls
-
    ${LOG_SLOTS}
- -
-
-

${icon('library', 14)}Libraries

-

-
- -
+ +
${sections.map(section).join('')}
`; } @@ -72,9 +100,78 @@ function libRow(l: LibraryInfo): HTMLElement { return row; } +function mountRail(scroller: HTMLElement, root: HTMLElement): void { + const tabs = Array.from(root.querySelectorAll('.fc-pr-railtab')); + const secs = Array.from(root.querySelectorAll('.fc-pr-sec')); + let pinned = ''; + let frame = 0; + const mark = (id: string): void => { + for (const t of tabs) { + const on = t.dataset.go === id; + setClass(t, 'is-active', on); + if (t.getAttribute('aria-selected') !== String(on)) t.setAttribute('aria-selected', String(on)); + } + for (const s of secs) setClass(s, 'is-current', s.dataset.sec === id); + }; + const fold = (sec: HTMLElement, folded: boolean): void => { + setClass(sec, 'is-folded', folded); + const head = q(sec, '.fc-pr-sechead'); + if (head.getAttribute('aria-expanded') !== String(!folded)) head.setAttribute('aria-expanded', String(!folded)); + setHidden(q(sec, '.fc-pr-secbody'), folded); + }; + const spy = (): void => { + frame = 0; + if (pinned || !scroller.clientHeight) return; + const top = scroller.getBoundingClientRect().top; + let at = secs[0]?.dataset.sec ?? ''; + if (scroller.scrollTop + scroller.clientHeight >= scroller.scrollHeight - 2) at = secs[secs.length - 1]?.dataset.sec ?? at; + else for (const s of secs) if (s.getBoundingClientRect().top - top <= 48) at = s.dataset.sec ?? at; + mark(at); + }; + root.addEventListener('click', (ev) => { + const t = ev.target instanceof Element ? ev.target : null; + const tab = t?.closest('.fc-pr-railtab'); + if (tab?.dataset.go) { + const sec = secs.find((s) => s.dataset.sec === tab.dataset.go); + if (!sec) return; + pinned = tab.dataset.go; + if (sec.classList.contains('is-folded')) fold(sec, false); + mark(pinned); + const y = sec.getBoundingClientRect().top - scroller.getBoundingClientRect().top + scroller.scrollTop - 12; + scroller.scrollTo({ top: Math.max(0, y), behavior: 'smooth' }); + return; + } + const head = t?.closest('.fc-pr-sechead'); + const sec = head?.closest('.fc-pr-sec'); + if (sec) fold(sec, !sec.classList.contains('is-folded')); + }); + const release = (): void => { if (pinned) { pinned = ''; if (!frame) frame = requestAnimationFrame(spy); } }; + scroller.addEventListener('wheel', release, { passive: true }); + scroller.addEventListener('pointerdown', release); + scroller.addEventListener('keydown', release); + scroller.addEventListener('scroll', () => { if (!frame) frame = requestAnimationFrame(spy); }, { passive: true }); + mark(secs[0]?.dataset.sec ?? ''); +} + +function mountShellSwitches(root: HTMLElement): void { + const rows: Array<[string, ShellPref]> = [['home', 'homeAtLaunch'], ['menus', 'menusInWindow'], ['dock', 'dockShown']]; + const boxes = new Map(); + for (const [row, pref] of rows) { + const box = root.querySelector(`[data-row="${row}"] input`); + if (!box) continue; + box.setAttribute('aria-label', q(root, `[data-row="${row}"] .fc-pr-label`).textContent ?? ''); + setChecked(box, shellPref(pref)); + box.addEventListener('change', () => setShellPref(pref, box.checked)); + boxes.set(pref, box); + } + onShellPref((pref, on) => { const box = boxes.get(pref); if (box) setChecked(box, on); }); +} + export function mountPreferences(engine: Engine, host: HTMLElement): void { - mountOnce(host, shell()); + mountOnce(host, shell(desktopMac())); const root = q(host, '.fc-pr'); + mountRail(host, root); + mountShellSwitches(root); mountDetailPrefs(q(root, '.fc-pref-slot[data-slot="detail"]'), engine); const theme = q(root, '#fc-pr-theme'); const accent = q(root, '#fc-pr-accent'); diff --git a/frontend/src/ui/side.ts b/frontend/src/ui/side.ts index 63f1f66..b3ec3a0 100644 --- a/frontend/src/ui/side.ts +++ b/frontend/src/ui/side.ts @@ -502,6 +502,7 @@ export function mountSide(engine: Engine, host: HTMLElement): void { ev.on('collections:changed', refreshTotals); ev.on('collections:changed', refreshCollections); ev.on('tags:changed', refreshTags); + ev.on('library:switched', refreshAll); document.addEventListener('keydown', (e) => { const input = e.target instanceof HTMLInputElement && e.target.classList.contains('fc-dt-tag-input') ? e.target : null; if (input && e.key === 'Enter' && !e.isComposing) addPendingTag(pane, input.value); diff --git a/frontend/src/version.ts b/frontend/src/version.ts index bc75a42..c6c247e 100644 --- a/frontend/src/version.ts +++ b/frontend/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.14.0'; +export const VERSION = '0.15.0'; diff --git a/native/formcite-style/Cargo.lock b/native/formcite-style/Cargo.lock index d34017e..839ccc0 100644 --- a/native/formcite-style/Cargo.lock +++ b/native/formcite-style/Cargo.lock @@ -81,7 +81,7 @@ dependencies = [ [[package]] name = "formcite-style" -version = "0.14.0" +version = "0.15.0" dependencies = [ "hayagriva", "pyo3", diff --git a/native/formcite-style/Cargo.toml b/native/formcite-style/Cargo.toml index 17c0094..7a02173 100644 --- a/native/formcite-style/Cargo.toml +++ b/native/formcite-style/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "formcite-style" -version = "0.14.0" +version = "0.15.0" edition = "2024" rust-version = "1.95" license = "Apache-2.0" diff --git a/native/formcite-style/pyproject.toml b/native/formcite-style/pyproject.toml index be0f107..bc4b85e 100644 --- a/native/formcite-style/pyproject.toml +++ b/native/formcite-style/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "formcite-style" -version = "0.14.0" +version = "0.15.0" description = "FormCite citation style engine for the FormCite engine service" license = { text = "Apache-2.0" } requires-python = ">=3.10" diff --git a/packaging/formcompiler/apps/formcite.json b/packaging/formcompiler/apps/formcite.json index d800945..d6dcb15 100644 --- a/packaging/formcompiler/apps/formcite.json +++ b/packaging/formcompiler/apps/formcite.json @@ -14,7 +14,7 @@ "rust_targets": "", "rust_cache": ["src-tauri", "native/formcite-style"], "go": "", - "linux_packages": "", + "linux_packages": "libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev libssl-dev patchelf file gstreamer1.0-plugins-base gstreamer1.0-plugins-good", "windows_msvc": false }, "build": { @@ -31,7 +31,16 @@ }, "setup": {"macos": "", "linux": "", "windows": ""}, "post_build": {"macos": "", "linux": "", "windows": ""}, - "artifacts": [], + "artifacts": [ + "src-tauri/target/**/bundle/dmg/*.dmg", + "src-tauri/target/**/bundle/macos/*.app.tar.gz", + "src-tauri/target/**/bundle/appimage/*.AppImage", + "src-tauri/target/**/bundle/deb/*.deb", + "src-tauri/target/**/bundle/rpm/*.rpm", + "src-tauri/target/**/bundle/msi/*.msi", + "src-tauri/target/**/bundle/nsis/*-setup.exe", + "src-tauri/target/**/bundle/*/*.sig" + ], "extras": [], "assets": "", "notes": "", @@ -47,7 +56,7 @@ "licence": "GPL-3.0-only", "state": "prelaunch", "project_extensions": [], - "minimum_os": {"macos": "", "windows": "", "linux": ""} + "minimum_os": {"macos": "macOS 10.13", "windows": "Windows 10", "linux": "glibc 2.35"} }, - "notes_for_owner": "Proposed from formcite 0.10.0; written in the FormCite repository under packaging/formcompiler and read by nothing there. Contract mode, as formrig: ./formcite install runs setup/install_all (the engine venv, the style engine, the frontend), install-desktop installs PyInstaller and checks the Tauri toolchain, and desktop build builds the frontend, freezes the engine and passes --config on to tauri build; formcite.bat has the same commands under cmd. The engine carries a native part, the Rust style module formcite_style (Hayagriva pinned =0.10.1, pyo3 abi3-py310), so every platform builds on its own runner. formcompiler needs no maturin step of its own: setup/freeze_backend (setup\\freeze_backend.bat on Windows) runs setup/build_style --wheel, which builds the module with maturin build --release --locked, installs that wheel into the engine venv, runs the style regression set (python -m app.style.regression.run, twelve cases) and stops the build unless every case passes, then freezes the engine with formcite_style as a hidden import. On macOS the frozen engine is a PyInstaller one-folder copied to src-tauri/engine and shipped as Resources/engine by src-tauri/tauri.macos.conf.json, signed by setup/freeze_backend when APPLE_SIGNING_IDENTITY is set; on Windows and Linux it is the one-file sidecar src-tauri/binaries/formcite-engine-. Ports 8330 (engine) and 5330 (window dev server). linux_packages is empty, which is Tauri 2's prerequisites. linux-arm64 is left out of platforms until a first build on ubuntu-22.04-arm passes; the app's own ci.yml already builds and gates the style wheel there. kind and summary must be checked against formportal's catalog/products.json, which was not readable when this was written. minimum_os is empty until it is read from the first built program (otool -l on the engine and the app, LC_BUILD_VERSION, minos), as formslot's entry says. Before the first run, give the read token access to nodemode-dev/formcite and let ci.yml pass on the compile commit." + "notes_for_owner": "Brought to 0.15.0 after the first full contract build (Linux x64, 2026-12-01): ./formcite install, ./formcite install-desktop, ./formcite desktop build --config under bash -eo pipefail gave FormCite__amd64.deb, FormCite__amd64.AppImage and FormCite--1.x86_64.rpm, each with the engine sidecar formcite-engine in usr/bin; the AppImage opened its window under a virtual display, started the engine and stopped it on exit. linux_packages is Tauri 2's list plus file and the GStreamer base and good plugins, because tauri.conf.json bundles the media framework into the AppImage. minimum_os: linux is the glibc of formcompiler's ubuntu-22.04 runner (objdump -T of a build on a glibc 2.39 host asks for GLIBC_2.39 in the shell and GLIBC_2.14 in the engine's bootloader, so the shell's figure follows the build host); macos is bundle.macOS.minimumSystemVersion in tauri.conf.json, which run_build.py exports as MACOSX_DEPLOYMENT_TARGET; windows is Tauri 2 and Rust's floor. macOS and Windows were not built here. Earlier history: proposed from formcite 0.10.0; written in the FormCite repository under packaging/formcompiler and read by nothing there. Contract mode, as formrig: ./formcite install runs setup/install_all (the engine venv, the style engine, the frontend), install-desktop installs PyInstaller and checks the Tauri toolchain, and desktop build builds the frontend, freezes the engine and passes --config on to tauri build; formcite.bat has the same commands under cmd. The engine carries a native part, the Rust style module formcite_style (Hayagriva pinned =0.10.1, pyo3 abi3-py310), so every platform builds on its own runner. formcompiler needs no maturin step of its own: setup/freeze_backend (setup\\freeze_backend.bat on Windows) runs setup/build_style --wheel, which builds the module with maturin build --release --locked, installs that wheel into the engine venv, runs the style regression set (python -m app.style.regression.run, twelve cases) and stops the build unless every case passes, then freezes the engine with formcite_style as a hidden import. On macOS the frozen engine is a PyInstaller one-folder copied to src-tauri/engine and shipped as Resources/engine by src-tauri/tauri.macos.conf.json, signed by setup/freeze_backend when APPLE_SIGNING_IDENTITY is set; on Windows and Linux it is the one-file sidecar src-tauri/binaries/formcite-engine-. Ports 8330 (engine) and 5330 (window dev server). linux-arm64 is left out of platforms until a first build on ubuntu-22.04-arm passes; the app's own ci.yml already builds and gates the style wheel there. kind and summary must be checked against formportal's catalog/products.json, which was not readable when this was written. Before the first run, give the read token (FORMCOMPILER_APP_TOKEN) and the release App access to nodemode-dev/formcite and let ci.yml pass on the compile commit." } diff --git a/setup/HASHOUT_LOG.md b/setup/HASHOUT_LOG.md index 770b7f3..cc7ed75 100644 --- a/setup/HASHOUT_LOG.md +++ b/setup/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, and removed code for the root launcher scripts and the `setup/` suite. The scripts stay comment-free; everything they would have said lives here, indexed. Read this first, then edit the scripts surgically. -Current build version: v0.14.0 +Current build version: v0.15.0 Last updated: 2026-11-27 · initial port of the launcher and setup suite --- @@ -423,3 +423,56 @@ Left out: `sync` and the `.agents/skills` mirror inside the repo, `agents/manife - logged: v0.11.0 · 2026-11-27 Replaces the note above that said the style engine is not part of `install_all` and CI does not run it. The owner asked for the module "pre-built like nodemode-dev/formslot through nodemode-dev/formcompiler". formcompiler builds a Python-engine app with a Rust module in contract mode (its `apps/formrig.json`: `./formrig install` builds the maturin module, `desktop build` freezes the engine, no platform crosses), so FormCite follows that and formcompiler needs no maturin step: `freeze_backend` runs `build_style --wheel` (`maturin build --release --locked`, install the wheel, `python -m app.style.regression.run`, stop on any FAIL) and freezes with `--hidden-import formcite_style`, since the engine imports it through `importlib` where PyInstaller cannot see it. `FORMCITE_STYLE_KEEP=1` freezes the module already in the venv. Auto mode tries `$FORMCITE_STYLE_WHEELS`, `wheels/`, `native/formcite-style/dist/` with `pip install --no-index --find-links`, so pip, not FormCite, decides whether a wheel's tags fit; a wheel that does not fit falls through to a Rust build. `--soft` (what `install_all` passes) turns "no wheel and no Rust" into one line and exit 0, so an install without Rust still gives a working library with formatting off. `install_all` takes `--from-source` off the arguments before `oc_install`. The CI `style` job pins `dtolnay/rust-toolchain@stable` (as formslot's `ci.yml`) and `actions/upload-artifact` at formcompiler's `release.yml` pin. + +## The first contract build, run as formcompiler runs it {#contract-build-0-15-0} + +Run on Linux x64 (Ubuntu 24.04, glibc 2.39, rustc 1.97.0, Node 22, Python 3.12) in a fresh clone, with the commands formcompiler's `scripts/run_build.py` writes for a contract-mode app: `./formcite install`, `./formcite install-desktop`, `./formcite desktop build --config ''`, under `bash -eo pipefail`. Each entry below is one failure or one fault found by reading, its cause, and the fix. + +### setup/freeze_backend(.bat) · the migrations were not in the frozen engine +- refers-to: setup/freeze_backend and setup/freeze_backend.bat :: pyinstaller call, `--collect-data app` +- kind: fix +- logged: v0.15.0 · 2026-12-01 14:02 EST + +`--collect-submodules app` takes Python modules only. `app/store/db.py` reads its schema from `app/store/migrations/*.sql` beside itself (`MIGRATIONS_DIR = Path(__file__).resolve().parent / "migrations"`), and those files were never in the frozen engine, so a packaged engine found no migrations and opened every library with no tables. `--selfcheck` only imports `app.main` and did not see it. `--collect-data app` puts every non-Python file under `app/` into the freeze (the two migrations and the style regression set). + +### setup/install_desktop(.bat) · there was no Tauri CLI to build with +- refers-to: frontend/package.json :: devDependencies `@tauri-apps/cli`; setup/install_desktop and setup/install_desktop.bat :: the second tauri check +- kind: fix +- logged: v0.15.0 · 2026-12-01 14:10 EST + +`desktop_build` runs `frontend/node_modules/.bin/tauri build`, but `frontend/package.json` never listed `@tauri-apps/cli` (FormVis's does; the port to FormCite dropped it). `install_desktop` ran `npm install` when the CLI was missing, which installs nothing new, and still printed "desktop toolchain ready", so every contract build stopped at the last step. The CLI is now a devDependency pinned at 2.12.5, the same release as `@tauri-apps/api` and the 2.12 line of the `tauri` crate in `Cargo.lock`, and `install_desktop` stops with a plain message when the CLI is still missing after `npm install`. The same commit carries the dock agent's `@xterm/xterm` 6.0.0 and `@xterm/addon-fit` 0.11.0 lines in the same two files, at the lead's request. + +### backend/requirements(_macos).txt, setup/freeze_backend(.bat) · the Windows engine could not start +- refers-to: backend/requirements.txt :: `tzdata==2026.6`; backend/requirements_macos.txt :: `tzdata`; setup/freeze_backend(.bat) :: `--collect-data tzdata` +- kind: fix (found by reading; Windows cannot run here) +- logged: v0.15.0 · 2026-12-01 14:15 EST + +`app/service/writelog.py`, `app/net/calllog.py` and `app/service/store.py` build `ZoneInfo("America/New_York")` at import, and all three load with `app.main` (checked: they are in `sys.modules` after `import app.main`). Windows has no IANA time zone database, and Python's `zoneinfo` then needs the `tzdata` package, which was not installed. On Windows `import app.main` raised `ZoneInfoNotFoundError`, so `freeze_backend.bat`'s `--selfcheck` failed and the Windows build stopped; a source run on Windows failed the same way. `tzdata` is now a requirement on every platform (zoneinfo still prefers the system's data where there is some) and the freeze collects its data, which zoneinfo reads through `importlib.resources` where PyInstaller cannot see it. + +### setup/freeze_backend(.bat) · what the dock's terminals need in the freeze +- refers-to: setup/freeze_backend :: `--hidden-import ptyprocess`, `--collect-submodules websockets`, the three `uvicorn.protocols.websockets` imports; setup/freeze_backend.bat :: the same with `--hidden-import winpty --collect-all winpty` +- kind: fix +- logged: v0.15.0 · 2026-12-01 14:20 EST + +The dock's terminal backend (`app/services/terminal.py`) imports `ptyprocess` on macOS and Linux and `winpty` (pywinpty) on Windows, and its `/api/terminal` route is a WebSocket. uvicorn picks its WebSocket implementation at run time by module name, and `websockets` loads its parts lazily, so PyInstaller sees none of it: a frozen engine would answer the terminal's upgrade with "Unsupported upgrade request". Asked for by the lead. On Windows `--collect-all winpty` is used in place of `--collect-binaries winpty`: it takes the binaries and also the helper programs pywinpty starts (`OpenConsole.exe`, `winpty-agent.exe`), which are neither modules nor libraries. `wsproto_impl` warns during analysis because `wsproto` is not installed; uvicorn's `auto` choice then uses `websockets`. + +### setup/freeze_backend(.bat) · the freeze took none of the app package +- refers-to: setup/freeze_backend :: `PYTHONPATH=... pyinstaller`; setup/freeze_backend.bat :: `set "PYTHONPATH=%ROOT%\backend"` +- kind: fix +- logged: v0.15.0 · 2026-12-01 14:40 EST + +The run stopped at the frozen engine's own `--selfcheck`: `"app": "failed: ModuleNotFoundError(\"No module named 'app.routers.pair'\")"`, exit 1. PyInstaller prints `WARNING: collect_data_files - skipping data collection for module 'app' as it is not a package.` `--collect-submodules app` and `--collect-data app` are worked out while the spec runs, in a Python whose path is the venv's, not `backend/`: the `pyinstaller` command's own folder is first on its path, not the working directory, so `app` could not be imported there and both flags collected nothing (checked: `collect_submodules('app')` gives 0 modules without `backend/` on the path, 126 with it, and `collect_data_files('app')` 0 and 17). Only what `formcite_engine.py` imports by name was frozen; every router and service the registry loads through `importlib` was missing. So no frozen FormCite engine has ever started, on any platform; the 0.14.0 desktop run used the engine from source. `backend/` is now on `PYTHONPATH` for the freeze. + +### setup/lib.sh, backend/oc_install(.bat) · the build used whichever Python was newest +- refers-to: setup/lib.sh :: fc_python; backend/oc_install :: the candidate loop; backend/oc_install.bat :: the two PY lines +- kind: fix (found in the run log and by reading) +- logged: v0.15.0 · 2026-12-01 14:45 EST + +The engine venv was made with the first of `python3.14 python3.13 python3.12 python3` that was 3.12 or newer (on Windows `py -3`, the newest registered Python, before `python`). formcompiler installs the Python its registry names (3.12) with `actions/setup-python` and puts it first on `PATH` as `python3` and `python`, but a runner that also has a newer Python (here 3.13; Homebrew's on the macOS images) built the engine with that one instead, so the frozen engine carried an interpreter nobody chose, and on macOS one built for the runner's own macOS rather than for the app's minimum. The run here froze Python 3.13.18. The Python on `PATH` is now tried first; the versioned names remain the fallback when it is older than 3.12. Removed orders, quoted: `for c in python3.14 python3.13 python3.12 python3 python; do` (oc_install), `for c in python3.14 python3.13 python3.12 python3; do` (lib.sh), and `py -3` before `python` (oc_install.bat). + +### The run after the fixes, and the registry entry +- refers-to: packaging/formcompiler/apps/formcite.json :: toolchain.linux_packages, artifacts, catalog.minimum_os, notes_for_owner +- kind: explainer +- logged: v0.15.0 · 2026-12-01 14:50 EST + +With the fixes above, `desktop build` passed: the style regression set 12 of 12 against `formcite_style-*-cp310-abi3-manylinux_2_34_x86_64.whl`; the frozen engine's `--selfcheck` `"app": "ok"`; the frozen engine answered `/api/health`, formatted an APA citation through `/api/format/preview`, created a library at schema version 2, and echoed a command through a dock terminal over `/api/terminal//stream`; `tauri build` gave the `.deb`, `.rpm` and `.AppImage` with `usr/bin/formcite-engine` beside the shell. The AppImage, run with `--appimage-extract-and-run` under `xvfb-run`, started the engine, the window loaded and claimed its key, and the engine stopped when the app closed. The registry entry now lists the Tauri bundles as artifacts, the apt packages (Tauri's list, `file`, and the GStreamer base and good plugins that `bundleMediaFramework` needs on a clean runner) and the minimum systems: `glibc 2.35` (formcompiler's ubuntu-22.04 runner; this host's build asks for `GLIBC_2.39` because the host has it), `macOS 10.13` from `tauri.conf.json`, `Windows 10`. diff --git a/setup/freeze_backend b/setup/freeze_backend index 66e18fa..f97c5ef 100755 --- a/setup/freeze_backend +++ b/setup/freeze_backend @@ -30,11 +30,15 @@ fi [ "${FORMCITE_STYLE_KEEP:-0}" = 1 ] || "$FORMCITE_ROOT/setup/build_style" --wheel python -c "import formcite_style" 2>/dev/null || fc_die "the style engine module is not in backend/venv; the frozen engine would answer 503 on every format: run setup/build_style --wheel" rm -rf build/pyinstaller dist-engine -pyinstaller --noconfirm --clean "$mode" --name formcite-engine \ +PYTHONPATH="$FORMCITE_ROOT/backend${PYTHONPATH:+:$PYTHONPATH}" pyinstaller --noconfirm --clean "$mode" --name formcite-engine \ --distpath dist-engine --workpath build/pyinstaller --specpath build/pyinstaller \ --add-data "$FORMCITE_ROOT/frontend/dist${sep}frontend_dist" \ - --collect-submodules app --collect-submodules uvicorn \ - --hidden-import formcite_style \ + --collect-submodules app --collect-data app --collect-submodules uvicorn \ + --hidden-import formcite_style --collect-data tzdata \ + --hidden-import ptyprocess --collect-submodules websockets \ + --hidden-import uvicorn.protocols.websockets.websockets_impl \ + --hidden-import uvicorn.protocols.websockets.websockets_sansio_impl \ + --hidden-import uvicorn.protocols.websockets.wsproto_impl \ "${extra[@]}" \ "$FORMCITE_ROOT/backend/formcite_engine.py" if [ "$os" = macos ]; then diff --git a/setup/freeze_backend.bat b/setup/freeze_backend.bat index aeb4e35..64a2c1f 100644 --- a/setup/freeze_backend.bat +++ b/setup/freeze_backend.bat @@ -16,10 +16,15 @@ if exist build\pyinstaller rmdir /s /q build\pyinstaller if exist dist-engine rmdir /s /q dist-engine set "WINDOWED=--noconsole" if "%FORMCITE_ENGINE_WINDOWED%"=="0" set "WINDOWED=" +set "PYTHONPATH=%ROOT%\backend" pyinstaller --noconfirm --clean --onefile %WINDOWED% --name formcite-engine --distpath dist-engine --workpath build\pyinstaller --specpath build\pyinstaller ^ --add-data "%ROOT%\frontend\dist;frontend_dist" ^ - --collect-submodules app --collect-submodules uvicorn ^ - --hidden-import formcite_style ^ + --collect-submodules app --collect-data app --collect-submodules uvicorn ^ + --hidden-import formcite_style --collect-data tzdata ^ + --hidden-import winpty --collect-all winpty --collect-submodules websockets ^ + --hidden-import uvicorn.protocols.websockets.websockets_impl ^ + --hidden-import uvicorn.protocols.websockets.websockets_sansio_impl ^ + --hidden-import uvicorn.protocols.websockets.wsproto_impl ^ "%ROOT%\backend\formcite_engine.py" || exit /b 1 if not exist "%ROOT%\src-tauri\binaries" mkdir "%ROOT%\src-tauri\binaries" copy /y dist-engine\formcite-engine.exe "%ROOT%\src-tauri\binaries\formcite-engine-%TRIPLE%.exe" >nul || exit /b 1 diff --git a/setup/install_desktop b/setup/install_desktop index 6d06648..21ffadb 100755 --- a/setup/install_desktop +++ b/setup/install_desktop @@ -14,4 +14,5 @@ if [ "$(fc_os)" = linux ] && ! pkg-config --exists webkit2gtk-4.1 2>/dev/null; t exit 1 fi [ -x "$FORMCITE_ROOT/frontend/node_modules/.bin/tauri" ] || ( cd "$FORMCITE_ROOT/frontend" && npm install ) +[ -x "$FORMCITE_ROOT/frontend/node_modules/.bin/tauri" ] || fc_die "the Tauri CLI is not in frontend/node_modules; @tauri-apps/cli belongs in frontend/package.json devDependencies" fc_say "desktop toolchain ready: rustc $(rustc --version | awk '{print $2}')" diff --git a/setup/install_desktop.bat b/setup/install_desktop.bat index 6c7fd4f..72d645e 100644 --- a/setup/install_desktop.bat +++ b/setup/install_desktop.bat @@ -6,4 +6,5 @@ call venv\Scripts\activate.bat pip install pyinstaller || exit /b 1 where cargo >nul 2>nul || ( echo [formcite] Rust is not installed, get it from https://rustup.rs then rerun formcite.bat install-desktop & exit /b 1 ) if not exist ..\frontend\node_modules\.bin\tauri.cmd ( pushd ..\frontend & call npm install & popd ) +if not exist ..\frontend\node_modules\.bin\tauri.cmd ( echo [formcite] error: the Tauri CLI is not in frontend\node_modules; @tauri-apps/cli belongs in frontend\package.json devDependencies & exit /b 1 ) echo [formcite] desktop toolchain ready diff --git a/setup/lib.sh b/setup/lib.sh index 742be51..d8a6fc1 100755 --- a/setup/lib.sh +++ b/setup/lib.sh @@ -20,7 +20,7 @@ fc_os() { } fc_python() { local c - for c in python3.14 python3.13 python3.12 python3; do + for c in python3 python3.14 python3.13 python3.12; do if command -v "$c" >/dev/null 2>&1 && "$c" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 12) else 1)' 2>/dev/null; then echo "$c" return 0 diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ed3c12b..f38265e 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -918,7 +918,7 @@ dependencies = [ [[package]] name = "formcite" -version = "0.14.0" +version = "0.15.0" dependencies = [ "fontdb", "objc2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 9b2e7ce..50b88aa 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "formcite" -version = "0.14.0" +version = "0.15.0" description = "FormCite desktop shell" authors = ["NodeAgentc, Inc."] license = "GPL-3.0-only" diff --git a/src-tauri/HASHOUT_LOG.md b/src-tauri/HASHOUT_LOG.md index cc05a4d..ff2f1bc 100644 --- a/src-tauri/HASHOUT_LOG.md +++ b/src-tauri/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for the desktop shell 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.14.0 +Current build version: v0.15.0 Last updated: 2026-11-26 (US Eastern) · Tauri 2 shell ported from FormTxt, renamed, launch code added --- @@ -97,6 +97,13 @@ The icon paths are the donor's. The `icons/` folder is not in the repo, so `taur The owner supplied the official artwork on 2026-11-26; the six originals (1024 px, with alpha) are in `assets/brand/`. This set is made from `assets/brand/formcite_icon_dark.png` by resizing with a Lanczos filter: 32, 128, 256 (`128x128@2x.png`) and 512 (`icon.png`) px PNGs, `icon.ico` holding 16, 24, 32, 48, 64, 128 and 256 px, and `icon.icns` holding 16 to 1024 px. Nothing was redrawn. `tauri build` has still not been run here, so the set is unproven in a bundle. When the artwork changes, remake every file from the new original rather than editing one. +### tauri.conf.json · bundle.macOS.minimumSystemVersion +- refers-to: tauri.conf.json :: bundle.macOS.minimumSystemVersion +- kind: rationale +- logged: v0.15.0 · 2026-12-01 14:30 EST + +`10.13` is the value Tauri 2 used anyway when the field was absent, now written down so that one number is the app's stated minimum. formcompiler's `run_build.py` reads this field and exports it as `MACOSX_DEPLOYMENT_TARGET` for the whole build, so the shell, the maturin wheel of the style engine and the frozen engine are all built against it (the Python 3.12 that `actions/setup-python` installs on macOS is built for 10.13 as well; on Apple silicon every target is raised to 11.0 by the toolchain). The registry's `catalog.minimum_os.macos` says the same. + --- ## tauri.macos.conf.json {#tauri-macos-conf-json} @@ -278,3 +285,12 @@ The shell, ported from formtxt, waited ten seconds for the engine to print `form - logged: v0.14.0 · 2026-11-27 The splash is on the app's own origin and cannot read the engine's saved look, so it only followed the system's light or dark setting. When the window is ready, `remember_look` reads `window-look.json` from the data folder and writes `formcite.theme` and `formcite.look` into the splash's own storage, which the splash page already reads before paint. The next launch's splash opens in the saved theme: seen in Ocean on the second launch after the file was written. The splash is one launch behind a change of theme, by design; nothing is written when the file is missing or unreadable. + +## src/main.rs, src/engine_start.rs · the engine's address no longer depends on a console stream {#engine-port-handshake} + +### src/engine_start.rs · free_port, announce_when_listening; src/main.rs · setup +- refers-to: src/engine_start.rs :: free_port, announce_when_listening; src/main.rs :: setup, `engine_port`, `FORMCITE_ENGINE_PORT` +- kind: fix +- logged: v0.15.0 · 2026-12-01 15:20 EST + +The shell learned the engine's port only from uvicorn's "running on http://127.0.0.1:" line on the engine's stdout or stderr. On Windows the engine is frozen `--noconsole`, and a windowed PyInstaller program can start with `sys.stderr` set to None; `formcite_engine.py` then points it at `os.devnull`, so the line would never reach the shell, and the window would wait out `ADDRESS_WAIT` and report that the engine never said its address. The shell now asks the system for a free loopback port (`free_port`, bind `127.0.0.1:0` and let go), passes it as `FORMCITE_ENGINE_PORT` where it passed `"0"`, and a small thread (`announce_when_listening`) tries a TCP connect to it every 100 ms until `Wait::Address.limit()`; when the engine accepts, it puts the same address line into the event channel the engine's output already feeds, so the rest of the start (the launch code, the window, the failure dialog with the engine's last lines) is unchanged. Whichever comes first, the printed line or the connect, gives the same port. If no free port can be found the shell passes `0` as before and relies on the printed line. A port taken by another program between the shell's check and the engine's bind makes the engine stop with its bind error, which the existing "stopped before the window could open" dialog shows. Asked for by the lead; FormVis still reads the printed line only. diff --git a/src-tauri/src/engine_start.rs b/src-tauri/src/engine_start.rs index 489650e..9758456 100644 --- a/src-tauri/src/engine_start.rs +++ b/src-tauri/src/engine_start.rs @@ -115,6 +115,30 @@ pub fn engine_log() -> Option { log_path(&|name: &str| std::env::var(name).ok(), std::env::home_dir().as_deref()) } +pub fn free_port() -> u16 { + std::net::TcpListener::bind(("127.0.0.1", 0)) + .and_then(|listener| listener.local_addr()) + .map_or(0, |address| address.port()) +} + +pub fn announce_when_listening(port: u16, tx: tauri::async_runtime::Sender>>) { + if port == 0 { + return; + } + std::thread::spawn(move || { + let address = std::net::SocketAddr::from(([127, 0, 0, 1], port)); + let until = std::time::Instant::now() + Wait::Address.limit(); + while std::time::Instant::now() < until && !tx.is_closed() { + if std::net::TcpStream::connect_timeout(&address, Duration::from_millis(250)).is_ok() { + let line = format!("http://127.0.0.1:{port}").into_bytes(); + let _ = tx.blocking_send(Ok(tauri_plugin_shell::process::CommandEvent::Stdout(line))); + return; + } + std::thread::sleep(Duration::from_millis(100)); + } + }); +} + pub fn launch_code() -> String { use std::hash::{BuildHasher, Hasher}; let nanos = std::time::SystemTime::now() diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index a304e76..54bdd55 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -195,9 +195,10 @@ fn main() { None => app.shell().sidecar("formcite-engine").map_err(|_| engine_start::Failure::Missing), }; let code = engine_start::launch_code(); + let engine_port = engine_start::free_port(); let started = engine.and_then(|engine| { engine - .env("FORMCITE_ENGINE_PORT", "0") + .env("FORMCITE_ENGINE_PORT", engine_port.to_string()) .env(engine_start::PARENT_ENV, std::process::id().to_string()) .env(engine_start::SHELL_ENV, std::process::id().to_string()) .env("FORMCITE_LAUNCH_CODE", &code) @@ -219,6 +220,7 @@ fn main() { let pattern = regex::Regex::new(r"http://127\.0\.0\.1:(\d+)").unwrap(); let (tx, mut events) = tauri::async_runtime::channel::(64); let late = tx.clone(); + engine_start::announce_when_listening(engine_port, tx.clone()); tauri::async_runtime::spawn(async move { while let Some(event) = rx.recv().await { if tx.send(Ok(event)).await.is_err() { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 751c83f..0d66748 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "FormCite", - "version": "0.14.0", + "version": "0.15.0", "identifier": "ai.nodemode.formcite", "build": { "devUrl": "http://localhost:5330", @@ -47,6 +47,7 @@ } }, "macOS": { + "minimumSystemVersion": "10.13", "hardenedRuntime": true, "entitlements": "entitlements.plist" }, diff --git a/templates/CREDITS.md b/templates/CREDITS.md new file mode 100644 index 0000000..4f782dd --- /dev/null +++ b/templates/CREDITS.md @@ -0,0 +1,14 @@ +# Credits for FormCite's templates + +## Citation styles from the Citation Style Language project + +These 40 files in `styles/` are independent citation styles from the official CSL style repository, . They were taken from the `master` branch at commit `38e17c7aa01fe97a169c7b037ff07726dfe4d45a` on 2026-12-01 and are unmodified. Each file names its authors and contributors in its own `` block. + +They are licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported licence, , as each file's `` element states. If you change one, share the changed file under the same licence and keep its authors' names. + +american-anthropological-association, american-chemical-society, american-geophysical-union, american-institute-of-physics, american-medical-association, american-physics-society, american-political-science-association, american-society-for-microbiology, american-society-of-civil-engineers, american-sociological-association, annual-reviews, apa-6th-edition, apa-annotated-bibliography, apa, association-for-computing-machinery, bmj, cambridge-university-press-author-date, cell, chicago-author-date, chicago-notes-bibliography, din-1505-2, elsevier-harvard, elsevier-vancouver, elsevier-with-titles, frontiers, harvard-cite-them-right, ieee, institute-of-physics-numeric, iso690-author-date-en, modern-language-association, multidisciplinary-digital-publishing-institute, nature, plos, royal-society-of-chemistry, science, springer-basic-author-date, springer-basic-brackets, springer-lecture-notes-in-computer-science, taylor-and-francis-chicago-author-date, the-lancet. + +## FormCite's own + +- `styles/formcite-plain-author-date.csl`: written for FormCite, Apache-2.0, as stated in the file. +- `starters/*`: written for FormCite by nodemode.ai, under FormCite's licence (GPL-3.0-only). diff --git a/templates/README.md b/templates/README.md new file mode 100644 index 0000000..6dff5f0 --- /dev/null +++ b/templates/README.md @@ -0,0 +1,29 @@ +# FormCite templates + +51 starting points. `index.json` lists each one with its id, kind, name, description, file, licence and credit. + +## Citation styles (41) + +`styles/*.csl` are independent CSL 1.0 styles. FormCite formats with them as your own style file: + +``` +./formcite cli format --style-file templates/styles/nature.csl --ids ID [ID ...] +``` + +The cite service takes the file's text too (`POST /api/cite/v1/own-style`, see `docs/CITE_SERVICE.md`). Forty of the styles come unmodified from the Citation Style Language project under CC BY-SA 3.0; see `CREDITS.md`. One, `formcite-plain-author-date.csl`, is FormCite's own. + +Every style was checked by formatting three references from a demo library with the command above, through this branch's style engine (Hayagriva 0.10.1). + +## Library starters (10) + +Each folder in `starters/` holds an empty `library.sqlite` with collections and tags already in place, plus an `about.json`. The starters are: thesis, grant, course, systematic-review, journal-article, book-project, lab-group, conference-talk, teaching-portfolio and policy-brief. + +To start a library from one, copy its `library.sqlite` into a new folder in your data folder, then register it: + +``` +mkdir "$HOME/FormCite/My thesis" +cp templates/starters/thesis/library.sqlite "$HOME/FormCite/My thesis/" +./formcite cli library new "My thesis" +``` + +Then switch to it in Preferences, under Libraries. `demos/make_demos.py` builds the starters. diff --git a/templates/index.json b/templates/index.json new file mode 100644 index 0000000..e906a93 --- /dev/null +++ b/templates/index.json @@ -0,0 +1,465 @@ +{ + "format": "formcite-templates", + "format_version": 1, + "templates": [ + { + "id": "american-anthropological-association", + "kind": "style", + "name": "American Anthropological Association", + "description": "A author-date citation style. Citation style for the American Anthropological Association - Support from the Society for Cultural Anthropology is thankfully acknowledged.", + "file": "styles/american-anthropological-association.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-chemical-society", + "kind": "style", + "name": "ACS Guide 2026 revision", + "description": "A numbered citation style. The American Chemical Society style.", + "file": "styles/american-chemical-society.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-geophysical-union", + "kind": "style", + "name": "American Geophysical Union", + "description": "A author-date citation style. The American Geophysical Union generic style.", + "file": "styles/american-geophysical-union.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-institute-of-physics", + "kind": "style", + "name": "AIP Style Manual 4th edition", + "description": "A numbered citation style. Common style used by AIP publications.", + "file": "styles/american-institute-of-physics.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-medical-association", + "kind": "style", + "name": "AMA Manual of Style 11th edition", + "description": "A numbered citation style. AMA Manual of Style: A Guide for Authors and Editors (11th ed.).", + "file": "styles/american-medical-association.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-physics-society", + "kind": "style", + "name": "American Physical Society", + "description": "A numbered citation style. Common style use by APS publications.", + "file": "styles/american-physics-society.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-political-science-association", + "kind": "style", + "name": "APSA Style Manual revised 2018 edition", + "description": "A author-date citation style. The American Political Science Association style. Et al rules based on published APSR articles.", + "file": "styles/american-political-science-association.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-society-for-microbiology", + "kind": "style", + "name": "American Society for Microbiology", + "description": "A numbered citation style. Style for all American Society for Microbiology journals.", + "file": "styles/american-society-for-microbiology.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-society-of-civil-engineers", + "kind": "style", + "name": "American Society of Civil Engineers", + "description": "A author-date citation style. A style for American Society of Civil Engineers publications.", + "file": "styles/american-society-of-civil-engineers.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "american-sociological-association", + "kind": "style", + "name": "ASA Style Guide 6th/7th edition", + "description": "A author-date citation style. The ASA style following the 6th/7th edition of the Style Guide (reference formatting is the same for both editions).", + "file": "styles/american-sociological-association.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "annual-reviews", + "kind": "style", + "name": "Annual Reviews (sorted by order of appearance)", + "description": "A numbered citation style. Annual Reviews (sorted by order of appearance).", + "file": "styles/annual-reviews.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "apa-6th-edition", + "kind": "style", + "name": "APA Style 6th edition", + "description": "A author-date citation style. APA Style 6th edition.", + "file": "styles/apa-6th-edition.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "apa-annotated-bibliography", + "kind": "style", + "name": "APA Style 7th edition (annotated bibliography)", + "description": "A author-date citation style. APA Style, with annotated bibliography.", + "file": "styles/apa-annotated-bibliography.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "apa", + "kind": "style", + "name": "APA Style 7th edition", + "description": "A author-date citation style. Author-date system of the Publication Manual of the American Psychological Association (2020).", + "file": "styles/apa.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "association-for-computing-machinery", + "kind": "style", + "name": "Association for Computing Machinery", + "description": "A numbered citation style. Association for Computing Machinery.", + "file": "styles/association-for-computing-machinery.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "bmj", + "kind": "style", + "name": "BMJ", + "description": "A numbered citation style. Vancouver style adapted for BMJ journals.", + "file": "styles/bmj.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "cambridge-university-press-author-date", + "kind": "style", + "name": "Cambridge University Press, CambridgeB (author-date)", + "description": "A author-date citation style. Cambridge University Press, CambridgeB (author-date).", + "file": "styles/cambridge-university-press-author-date.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "cell", + "kind": "style", + "name": "Cell", + "description": "A numbered citation style. The Cell journal style, switched to numeric superscript as per the Cell editorial office in Sept. 2022.", + "file": "styles/cell.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "chicago-author-date", + "kind": "style", + "name": "Chicago Manual of Style 18th edition (author-date)", + "description": "A author-date citation style. Chicago-style source citations (with Bluebook for legal citations), author-date system.", + "file": "styles/chicago-author-date.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "chicago-notes-bibliography", + "kind": "style", + "name": "Chicago Manual of Style 18th edition (notes and bibliography)", + "description": "A footnote citation style. Chicago-style source citations (with Bluebook for legal citations), notes and bibliography system.", + "file": "styles/chicago-notes-bibliography.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "din-1505-2", + "kind": "style", + "name": "DIN 1505-2 (author-date, Deutsch) - standard superseded by ISO-690", + "description": "A author-date citation style. Style following DIN 1505-2, for other media types on additional standards \n Hinweise zur Benutzung: \n * Zitieren von Gesetzen: \n - hier m\u00fcssen manuell \u00a7, Abs und S. zur Seitenangabe beim Zitieren eingetragen werden \n - im Kurzbeleg wird der Kurztitel verwendet, daf\u00fcr keine Autoren eintragen! \n - als Jahresangabe wird 'Datum des Inkrafttretens' herangezogen, Verwenden nur bei Verweis auf nicht z.Z. g\u00fcltige Gesetze, z.B. (idF. v. 12.12.1972) \n * Zitieren von Normen und Standards - nicht vollst\u00e4ndig nach DIN 1505\n - Nutzen Sie den Typ 'Bericht' - als Abhilfe, da es keinen Typ 'Standard' gibt.\n - als Autor die Kurzbezeichnung inkl. Nummer und Jahr eingeben (z.B. VDI 2222-1997), Vorname leer, Jahr leer\n - als Titel den ausf\u00fchrlichen Titel bei Bedarf (z.B. VDI Richtlinie 2222 Blatt 1 - Konstruktionsmethodik - Methodisches Entwickeln von L\u00f6sungsprinzipien).", + "file": "styles/din-1505-2.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "elsevier-harvard", + "kind": "style", + "name": "Elsevier (author-date/Harvard, with titles)", + "description": "A author-date citation style. Elsevier (author-date/Harvard, with titles).", + "file": "styles/elsevier-harvard.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "elsevier-vancouver", + "kind": "style", + "name": "Elsevier - NLM/Vancouver (citation-sequence)", + "description": "A numbered citation style. A style for some Elsevier journals, resembles Vancouver style.", + "file": "styles/elsevier-vancouver.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "elsevier-with-titles", + "kind": "style", + "name": "Elsevier (numeric, with titles)", + "description": "A numbered citation style. A style for many of Elsevier's journals that includes article titles in the reference list.", + "file": "styles/elsevier-with-titles.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "formcite-plain-author-date", + "kind": "style", + "name": "FormCite Plain Author-Date", + "description": "A author-date citation style. FormCite Plain Author-Date.", + "file": "styles/formcite-plain-author-date.csl", + "licence": "Apache-2.0", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "frontiers", + "kind": "style", + "name": "Frontiers journals", + "description": "A author-date citation style. Style for the Open Access Frontiers in .. Journals.", + "file": "styles/frontiers.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "harvard-cite-them-right", + "kind": "style", + "name": "Cite Them Right 12th edition (author-date/Harvard)", + "description": "A author-date citation style. Harvard according to Cite Them Right, 11th edition.", + "file": "styles/harvard-cite-them-right.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "ieee", + "kind": "style", + "name": "IEEE Reference Guide version 11.29.2023", + "description": "A numbered citation style. IEEE style as per the 2023 guidelines.", + "file": "styles/ieee.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "institute-of-physics-numeric", + "kind": "style", + "name": "Institute of Physics (numeric)", + "description": "A numbered citation style. Institute of Physics (numeric).", + "file": "styles/institute-of-physics-numeric.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "iso690-author-date-en", + "kind": "style", + "name": "ISO-690 (author-date, English)", + "description": "A author-date citation style. Style based on ISO 690:2021(E).", + "file": "styles/iso690-author-date-en.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "modern-language-association", + "kind": "style", + "name": "MLA Handbook 9th edition (in-text citations)", + "description": "A author-page citation style. MLA source citations, in-text citations system (chapter 6).", + "file": "styles/modern-language-association.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "multidisciplinary-digital-publishing-institute", + "kind": "style", + "name": "Multidisciplinary Digital Publishing Institute", + "description": "A numbered citation style. Style for the MDPI Open access journals.", + "file": "styles/multidisciplinary-digital-publishing-institute.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "nature", + "kind": "style", + "name": "Nature", + "description": "A numbered citation style. Nature.", + "file": "styles/nature.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "plos", + "kind": "style", + "name": "Public Library of Science", + "description": "A numbered citation style. Vancouver for PLoS Journals as of January 2015.", + "file": "styles/plos.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "royal-society-of-chemistry", + "kind": "style", + "name": "Royal Society of Chemistry", + "description": "A numbered citation style. The Royal Society of Chemistry journal style.", + "file": "styles/royal-society-of-chemistry.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "science", + "kind": "style", + "name": "Science", + "description": "A numbered citation style. The Science journal style.", + "file": "styles/science.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "springer-basic-author-date", + "kind": "style", + "name": "Springer - Basic (author-date)", + "description": "A author-date citation style. Springer Author Date Style for the disciplines Medicine, Biomedicine, Life Sciences, Chemistry, Geosciences, Computer Science, Engineering, Economics. This style is based on Harvard style and recommendations of the Council of Biology Editors.", + "file": "styles/springer-basic-author-date.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "springer-basic-brackets", + "kind": "style", + "name": "Springer - Basic (numeric, brackets)", + "description": "A numbered citation style. Springer Numbered Style for the disciplines Medicine, Biomedicine, Life Sciences, Chemistry, Geosciences, Computer Science, Engineering, Economics. This style is based on Harvard style and recommendations of the Council of Biology Editors.", + "file": "styles/springer-basic-brackets.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "springer-lecture-notes-in-computer-science", + "kind": "style", + "name": "Springer - Lecture Notes in Computer Science", + "description": "A numbered citation style. Springer - Lecture Notes in Computer Science.", + "file": "styles/springer-lecture-notes-in-computer-science.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "taylor-and-francis-chicago-author-date", + "kind": "style", + "name": "Taylor & Francis Journals Standard Reference Style Guide: Chicago author-date version 2.0", + "description": "A author-date citation style. Taylor & Francis Journals adaptation of Chicago-style source citations (with Bluebook for legal citations), author-date system, 17th edition: with expanded page ranges, no substitution of repeated authors with em dashes.", + "file": "styles/taylor-and-francis-chicago-author-date.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "the-lancet", + "kind": "style", + "name": "The Lancet", + "description": "A numbered citation style. Vancouver style adapted for The Lancet.", + "file": "styles/the-lancet.csl", + "licence": "CC-BY-SA-3.0", + "credit": "Citation Style Language project, unmodified, see CREDITS.md" + }, + { + "id": "starter-book-project", + "kind": "starter", + "name": "Book project", + "description": "Collections for a book by part and chapter, with permissions and archive material.", + "file": "starters/book-project/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-conference-talk", + "kind": "starter", + "name": "Conference talk or poster", + "description": "Collections for a talk or poster: the slides' sources, the abstract and the venue's earlier work.", + "file": "starters/conference-talk/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-course", + "kind": "starter", + "name": "Course reading list", + "description": "Collections for a twelve-week course, a core shelf and further reading.", + "file": "starters/course/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-grant", + "kind": "starter", + "name": "Grant proposal", + "description": "Collections for a research grant: case for support, prior work, methods, impact and the team's own papers.", + "file": "starters/grant/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-journal-article", + "kind": "starter", + "name": "Journal article", + "description": "Collections for one paper: introduction, methods, results, discussion and the target journal's guidance.", + "file": "starters/journal-article/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-lab-group", + "kind": "starter", + "name": "Lab group library", + "description": "Collections for a research group: techniques, protocols, the group's papers and a journal club shelf.", + "file": "starters/lab-group/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-policy-brief", + "kind": "starter", + "name": "Policy brief", + "description": "Collections for a policy brief: evidence base, official documents, case studies and press.", + "file": "starters/policy-brief/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-systematic-review", + "kind": "starter", + "name": "Systematic review", + "description": "Collections that follow a review from search results through screening to the included studies.", + "file": "starters/systematic-review/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-teaching-portfolio", + "kind": "starter", + "name": "Teaching portfolio", + "description": "Collections for teaching practice: pedagogy, assessment, course design and evidence.", + "file": "starters/teaching-portfolio/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + }, + { + "id": "starter-thesis", + "kind": "starter", + "name": "Thesis or dissertation", + "description": "Collections for a thesis by chapter, with front matter, methods, data and a to-read shelf.", + "file": "starters/thesis/library.sqlite", + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai" + } + ] +} diff --git a/templates/starters/book-project/about.json b/templates/starters/book-project/about.json new file mode 100644 index 0000000..b17c4b7 --- /dev/null +++ b/templates/starters/book-project/about.json @@ -0,0 +1,25 @@ +{ + "id": "book-project", + "name": "Book project", + "description": "Collections for a book by part and chapter, with permissions and archive material.", + "kind": "starter", + "collections": [ + "Book", + "Part I", + "Part II", + "Part III", + "Archive material", + "Permissions", + "Epigraphs and quotations" + ], + "tags": [ + "chapter draft", + "quotation", + "image", + "permission asked", + "permission granted" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/book-project/library.sqlite b/templates/starters/book-project/library.sqlite new file mode 100644 index 0000000..bdc4274 Binary files /dev/null and b/templates/starters/book-project/library.sqlite differ diff --git a/templates/starters/conference-talk/about.json b/templates/starters/conference-talk/about.json new file mode 100644 index 0000000..da41105 --- /dev/null +++ b/templates/starters/conference-talk/about.json @@ -0,0 +1,21 @@ +{ + "id": "conference-talk", + "name": "Conference talk or poster", + "description": "Collections for a talk or poster: the slides' sources, the abstract and the venue's earlier work.", + "kind": "starter", + "collections": [ + "Talk", + "Abstract", + "Slides", + "Venue's earlier work", + "Follow-up" + ], + "tags": [ + "on a slide", + "background", + "question from audience" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/conference-talk/library.sqlite b/templates/starters/conference-talk/library.sqlite new file mode 100644 index 0000000..b9c61d8 Binary files /dev/null and b/templates/starters/conference-talk/library.sqlite differ diff --git a/templates/starters/course/about.json b/templates/starters/course/about.json new file mode 100644 index 0000000..16193bf --- /dev/null +++ b/templates/starters/course/about.json @@ -0,0 +1,33 @@ +{ + "id": "course", + "name": "Course reading list", + "description": "Collections for a twelve-week course, a core shelf and further reading.", + "kind": "starter", + "collections": [ + "Course", + "Week 1", + "Week 2", + "Week 3", + "Week 4", + "Week 5", + "Week 6", + "Week 7", + "Week 8", + "Week 9", + "Week 10", + "Week 11", + "Week 12", + "Core texts", + "Further reading" + ], + "tags": [ + "required", + "recommended", + "seminar", + "assessment", + "library copy" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/course/library.sqlite b/templates/starters/course/library.sqlite new file mode 100644 index 0000000..cf1c478 Binary files /dev/null and b/templates/starters/course/library.sqlite differ diff --git a/templates/starters/grant/about.json b/templates/starters/grant/about.json new file mode 100644 index 0000000..e435e3f --- /dev/null +++ b/templates/starters/grant/about.json @@ -0,0 +1,26 @@ +{ + "id": "grant", + "name": "Grant proposal", + "description": "Collections for a research grant: case for support, prior work, methods, impact and the team's own papers.", + "kind": "starter", + "collections": [ + "Proposal", + "Case for support", + "State of the art", + "Methods and work plan", + "Impact", + "Team publications", + "Funder guidance" + ], + "tags": [ + "background", + "preliminary data", + "competitor", + "impact", + "own work", + "must cite" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/grant/library.sqlite b/templates/starters/grant/library.sqlite new file mode 100644 index 0000000..4292b4e Binary files /dev/null and b/templates/starters/grant/library.sqlite differ diff --git a/templates/starters/journal-article/about.json b/templates/starters/journal-article/about.json new file mode 100644 index 0000000..29edac3 --- /dev/null +++ b/templates/starters/journal-article/about.json @@ -0,0 +1,25 @@ +{ + "id": "journal-article", + "name": "Journal article", + "description": "Collections for one paper: introduction, methods, results, discussion and the target journal's guidance.", + "kind": "starter", + "collections": [ + "Paper", + "Introduction", + "Methods", + "Results", + "Discussion", + "Reviewer requests", + "Journal guidance" + ], + "tags": [ + "cited", + "to cite", + "reviewer 1", + "reviewer 2", + "figure" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/journal-article/library.sqlite b/templates/starters/journal-article/library.sqlite new file mode 100644 index 0000000..f124fb5 Binary files /dev/null and b/templates/starters/journal-article/library.sqlite differ diff --git a/templates/starters/lab-group/about.json b/templates/starters/lab-group/about.json new file mode 100644 index 0000000..9d033ad --- /dev/null +++ b/templates/starters/lab-group/about.json @@ -0,0 +1,25 @@ +{ + "id": "lab-group", + "name": "Lab group library", + "description": "Collections for a research group: techniques, protocols, the group's papers and a journal club shelf.", + "kind": "starter", + "collections": [ + "Techniques", + "Imaging", + "Molecular", + "Analysis", + "Group papers", + "Protocols", + "Journal club" + ], + "tags": [ + "protocol", + "reagent", + "software", + "journal club", + "group paper" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/lab-group/library.sqlite b/templates/starters/lab-group/library.sqlite new file mode 100644 index 0000000..e999ea2 Binary files /dev/null and b/templates/starters/lab-group/library.sqlite differ diff --git a/templates/starters/policy-brief/about.json b/templates/starters/policy-brief/about.json new file mode 100644 index 0000000..db10741 --- /dev/null +++ b/templates/starters/policy-brief/about.json @@ -0,0 +1,23 @@ +{ + "id": "policy-brief", + "name": "Policy brief", + "description": "Collections for a policy brief: evidence base, official documents, case studies and press.", + "kind": "starter", + "collections": [ + "Brief", + "Evidence base", + "Official documents", + "Case studies", + "Press and commentary" + ], + "tags": [ + "evidence", + "official", + "case study", + "press", + "contested" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/policy-brief/library.sqlite b/templates/starters/policy-brief/library.sqlite new file mode 100644 index 0000000..38dbc08 Binary files /dev/null and b/templates/starters/policy-brief/library.sqlite differ diff --git a/templates/starters/systematic-review/about.json b/templates/starters/systematic-review/about.json new file mode 100644 index 0000000..54b43bd --- /dev/null +++ b/templates/starters/systematic-review/about.json @@ -0,0 +1,28 @@ +{ + "id": "systematic-review", + "name": "Systematic review", + "description": "Collections that follow a review from search results through screening to the included studies.", + "kind": "starter", + "collections": [ + "Review", + "Search results", + "Title and abstract screening", + "Full text screening", + "Included", + "Excluded", + "Protocol and guidance" + ], + "tags": [ + "include", + "exclude", + "maybe", + "duplicate", + "no full text", + "wrong population", + "wrong outcome", + "risk of bias" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/systematic-review/library.sqlite b/templates/starters/systematic-review/library.sqlite new file mode 100644 index 0000000..9d482fa Binary files /dev/null and b/templates/starters/systematic-review/library.sqlite differ diff --git a/templates/starters/teaching-portfolio/about.json b/templates/starters/teaching-portfolio/about.json new file mode 100644 index 0000000..94b7c8d --- /dev/null +++ b/templates/starters/teaching-portfolio/about.json @@ -0,0 +1,21 @@ +{ + "id": "teaching-portfolio", + "name": "Teaching portfolio", + "description": "Collections for teaching practice: pedagogy, assessment, course design and evidence.", + "kind": "starter", + "collections": [ + "Pedagogy", + "Assessment", + "Course design", + "Evidence and feedback" + ], + "tags": [ + "active learning", + "assessment", + "inclusion", + "feedback" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/teaching-portfolio/library.sqlite b/templates/starters/teaching-portfolio/library.sqlite new file mode 100644 index 0000000..fe663f1 Binary files /dev/null and b/templates/starters/teaching-portfolio/library.sqlite differ diff --git a/templates/starters/thesis/about.json b/templates/starters/thesis/about.json new file mode 100644 index 0000000..ba56e1b --- /dev/null +++ b/templates/starters/thesis/about.json @@ -0,0 +1,30 @@ +{ + "id": "thesis", + "name": "Thesis or dissertation", + "description": "Collections for a thesis by chapter, with front matter, methods, data and a to-read shelf.", + "kind": "starter", + "collections": [ + "Thesis", + "Introduction", + "Literature review", + "Methods", + "Results", + "Discussion", + "Conclusion", + "Data and software", + "To read", + "Cited" + ], + "tags": [ + "to read", + "read", + "cited", + "key source", + "method", + "dataset", + "quote" + ], + "licence": "GPL-3.0-only", + "credit": "Written for FormCite by nodemode.ai", + "file": "library.sqlite" +} diff --git a/templates/starters/thesis/library.sqlite b/templates/starters/thesis/library.sqlite new file mode 100644 index 0000000..a6b1563 Binary files /dev/null and b/templates/starters/thesis/library.sqlite differ diff --git a/templates/styles/american-anthropological-association.csl b/templates/styles/american-anthropological-association.csl new file mode 100644 index 0000000..aa95be2 --- /dev/null +++ b/templates/styles/american-anthropological-association.csl @@ -0,0 +1,404 @@ + + diff --git a/templates/styles/american-chemical-society.csl b/templates/styles/american-chemical-society.csl new file mode 100644 index 0000000..9fcedb6 --- /dev/null +++ b/templates/styles/american-chemical-society.csl @@ -0,0 +1,303 @@ + + diff --git a/templates/styles/american-geophysical-union.csl b/templates/styles/american-geophysical-union.csl new file mode 100644 index 0000000..99e6701 --- /dev/null +++ b/templates/styles/american-geophysical-union.csl @@ -0,0 +1,703 @@ + + diff --git a/templates/styles/american-institute-of-physics.csl b/templates/styles/american-institute-of-physics.csl new file mode 100644 index 0000000..968e7af --- /dev/null +++ b/templates/styles/american-institute-of-physics.csl @@ -0,0 +1,164 @@ + + diff --git a/templates/styles/american-medical-association.csl b/templates/styles/american-medical-association.csl new file mode 100644 index 0000000..ef052da --- /dev/null +++ b/templates/styles/american-medical-association.csl @@ -0,0 +1,298 @@ + + diff --git a/templates/styles/american-physics-society.csl b/templates/styles/american-physics-society.csl new file mode 100644 index 0000000..38e31fc --- /dev/null +++ b/templates/styles/american-physics-society.csl @@ -0,0 +1,219 @@ + + diff --git a/templates/styles/american-political-science-association.csl b/templates/styles/american-political-science-association.csl new file mode 100644 index 0000000..c5bbe47 --- /dev/null +++ b/templates/styles/american-political-science-association.csl @@ -0,0 +1,244 @@ + + diff --git a/templates/styles/american-society-for-microbiology.csl b/templates/styles/american-society-for-microbiology.csl new file mode 100644 index 0000000..5e34d4a --- /dev/null +++ b/templates/styles/american-society-for-microbiology.csl @@ -0,0 +1,175 @@ + + diff --git a/templates/styles/american-society-of-civil-engineers.csl b/templates/styles/american-society-of-civil-engineers.csl new file mode 100644 index 0000000..7dd81c6 --- /dev/null +++ b/templates/styles/american-society-of-civil-engineers.csl @@ -0,0 +1,240 @@ + + diff --git a/templates/styles/american-sociological-association.csl b/templates/styles/american-sociological-association.csl new file mode 100644 index 0000000..b29f237 --- /dev/null +++ b/templates/styles/american-sociological-association.csl @@ -0,0 +1,371 @@ + + diff --git a/templates/styles/annual-reviews.csl b/templates/styles/annual-reviews.csl new file mode 100644 index 0000000..4c498e2 --- /dev/null +++ b/templates/styles/annual-reviews.csl @@ -0,0 +1,264 @@ + + diff --git a/templates/styles/apa-6th-edition.csl b/templates/styles/apa-6th-edition.csl new file mode 100644 index 0000000..cfb36cb --- /dev/null +++ b/templates/styles/apa-6th-edition.csl @@ -0,0 +1,1585 @@ + + diff --git a/templates/styles/apa-annotated-bibliography.csl b/templates/styles/apa-annotated-bibliography.csl new file mode 100644 index 0000000..7e79768 --- /dev/null +++ b/templates/styles/apa-annotated-bibliography.csl @@ -0,0 +1,2270 @@ + + diff --git a/templates/styles/apa.csl b/templates/styles/apa.csl new file mode 100644 index 0000000..d663d1e --- /dev/null +++ b/templates/styles/apa.csl @@ -0,0 +1,2278 @@ + + diff --git a/templates/styles/association-for-computing-machinery.csl b/templates/styles/association-for-computing-machinery.csl new file mode 100644 index 0000000..50853ee --- /dev/null +++ b/templates/styles/association-for-computing-machinery.csl @@ -0,0 +1,215 @@ + + diff --git a/templates/styles/bmj.csl b/templates/styles/bmj.csl new file mode 100644 index 0000000..767216a --- /dev/null +++ b/templates/styles/bmj.csl @@ -0,0 +1,195 @@ + + diff --git a/templates/styles/cambridge-university-press-author-date.csl b/templates/styles/cambridge-university-press-author-date.csl new file mode 100644 index 0000000..1c6b5f8 --- /dev/null +++ b/templates/styles/cambridge-university-press-author-date.csl @@ -0,0 +1,529 @@ + + diff --git a/templates/styles/cell.csl b/templates/styles/cell.csl new file mode 100644 index 0000000..7f64f7a --- /dev/null +++ b/templates/styles/cell.csl @@ -0,0 +1,152 @@ + + diff --git a/templates/styles/chicago-author-date.csl b/templates/styles/chicago-author-date.csl new file mode 100644 index 0000000..78652be --- /dev/null +++ b/templates/styles/chicago-author-date.csl @@ -0,0 +1,4216 @@ + + diff --git a/templates/styles/chicago-notes-bibliography.csl b/templates/styles/chicago-notes-bibliography.csl new file mode 100644 index 0000000..af42890 --- /dev/null +++ b/templates/styles/chicago-notes-bibliography.csl @@ -0,0 +1,6006 @@ + + diff --git a/templates/styles/din-1505-2.csl b/templates/styles/din-1505-2.csl new file mode 100644 index 0000000..0cb9273 --- /dev/null +++ b/templates/styles/din-1505-2.csl @@ -0,0 +1,423 @@ + + diff --git a/templates/styles/elsevier-harvard.csl b/templates/styles/elsevier-harvard.csl new file mode 100644 index 0000000..3eb8f9e --- /dev/null +++ b/templates/styles/elsevier-harvard.csl @@ -0,0 +1,238 @@ + + diff --git a/templates/styles/elsevier-vancouver.csl b/templates/styles/elsevier-vancouver.csl new file mode 100644 index 0000000..c0b242a --- /dev/null +++ b/templates/styles/elsevier-vancouver.csl @@ -0,0 +1,163 @@ + + diff --git a/templates/styles/elsevier-with-titles.csl b/templates/styles/elsevier-with-titles.csl new file mode 100644 index 0000000..b12c655 --- /dev/null +++ b/templates/styles/elsevier-with-titles.csl @@ -0,0 +1,148 @@ + + diff --git a/templates/styles/formcite-plain-author-date.csl b/templates/styles/formcite-plain-author-date.csl new file mode 100644 index 0000000..7e80ddd --- /dev/null +++ b/templates/styles/formcite-plain-author-date.csl @@ -0,0 +1,69 @@ + + diff --git a/templates/styles/frontiers.csl b/templates/styles/frontiers.csl new file mode 100644 index 0000000..8246466 --- /dev/null +++ b/templates/styles/frontiers.csl @@ -0,0 +1,183 @@ + + diff --git a/templates/styles/harvard-cite-them-right.csl b/templates/styles/harvard-cite-them-right.csl new file mode 100644 index 0000000..b177f1b --- /dev/null +++ b/templates/styles/harvard-cite-them-right.csl @@ -0,0 +1,316 @@ + + diff --git a/templates/styles/ieee.csl b/templates/styles/ieee.csl new file mode 100644 index 0000000..7612c15 --- /dev/null +++ b/templates/styles/ieee.csl @@ -0,0 +1,519 @@ + + diff --git a/templates/styles/institute-of-physics-numeric.csl b/templates/styles/institute-of-physics-numeric.csl new file mode 100644 index 0000000..dbe8a59 --- /dev/null +++ b/templates/styles/institute-of-physics-numeric.csl @@ -0,0 +1,127 @@ + + diff --git a/templates/styles/iso690-author-date-en.csl b/templates/styles/iso690-author-date-en.csl new file mode 100644 index 0000000..493c846 --- /dev/null +++ b/templates/styles/iso690-author-date-en.csl @@ -0,0 +1,649 @@ + + diff --git a/templates/styles/modern-language-association.csl b/templates/styles/modern-language-association.csl new file mode 100644 index 0000000..233c13d --- /dev/null +++ b/templates/styles/modern-language-association.csl @@ -0,0 +1,1184 @@ + + diff --git a/templates/styles/multidisciplinary-digital-publishing-institute.csl b/templates/styles/multidisciplinary-digital-publishing-institute.csl new file mode 100644 index 0000000..745d4bb --- /dev/null +++ b/templates/styles/multidisciplinary-digital-publishing-institute.csl @@ -0,0 +1,263 @@ + + diff --git a/templates/styles/nature.csl b/templates/styles/nature.csl new file mode 100644 index 0000000..3b1e3d7 --- /dev/null +++ b/templates/styles/nature.csl @@ -0,0 +1,189 @@ + + diff --git a/templates/styles/plos.csl b/templates/styles/plos.csl new file mode 100644 index 0000000..7a726ea --- /dev/null +++ b/templates/styles/plos.csl @@ -0,0 +1,318 @@ + + diff --git a/templates/styles/royal-society-of-chemistry.csl b/templates/styles/royal-society-of-chemistry.csl new file mode 100644 index 0000000..ca4c05c --- /dev/null +++ b/templates/styles/royal-society-of-chemistry.csl @@ -0,0 +1,259 @@ + + diff --git a/templates/styles/science.csl b/templates/styles/science.csl new file mode 100644 index 0000000..28d27a7 --- /dev/null +++ b/templates/styles/science.csl @@ -0,0 +1,231 @@ + + diff --git a/templates/styles/springer-basic-author-date.csl b/templates/styles/springer-basic-author-date.csl new file mode 100644 index 0000000..42b5608 --- /dev/null +++ b/templates/styles/springer-basic-author-date.csl @@ -0,0 +1,238 @@ + + diff --git a/templates/styles/springer-basic-brackets.csl b/templates/styles/springer-basic-brackets.csl new file mode 100644 index 0000000..85d2473 --- /dev/null +++ b/templates/styles/springer-basic-brackets.csl @@ -0,0 +1,187 @@ + + diff --git a/templates/styles/springer-lecture-notes-in-computer-science.csl b/templates/styles/springer-lecture-notes-in-computer-science.csl new file mode 100644 index 0000000..fb86315 --- /dev/null +++ b/templates/styles/springer-lecture-notes-in-computer-science.csl @@ -0,0 +1,161 @@ + + diff --git a/templates/styles/taylor-and-francis-chicago-author-date.csl b/templates/styles/taylor-and-francis-chicago-author-date.csl new file mode 100644 index 0000000..5c28611 --- /dev/null +++ b/templates/styles/taylor-and-francis-chicago-author-date.csl @@ -0,0 +1,4243 @@ + + diff --git a/templates/styles/the-lancet.csl b/templates/styles/the-lancet.csl new file mode 100644 index 0000000..b9e2486 --- /dev/null +++ b/templates/styles/the-lancet.csl @@ -0,0 +1,181 @@ + +