diff --git a/CHANGELOG.md b/CHANGELOG.md index e469755..37e446a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## 0.12.0 + +FormCite gets the Form family's themes, a reshaped Add dialog, a live dot in the sidebar head and a new splash page. + +### New +- **Themes:** every theme from form.md and FormPortal. Preferences keeps System, Light and Dark and adds a grid of 15 dark themes (Default, Studio, Night, Graphite, Midnight, Forest, Ember, Violet, Slate, Mono, Ocean, Rose, Terminal, AMOLED, High contrast) and 6 light themes (Default, Paper, Sand, Sage, Mist, High contrast). The theme is set before the first paint. +- **The sidebar head** shows a dot for the engine (live, reconnecting, down) and the version. +- **A splash page** with FormCite's own icon, in dark and light, for the desktop app. + +### Improved +- **The Add dialog** has the family's shape: a head, tabs, a body of fixed height and a foot with the main button at the end. Escape closes it from anywhere and focus returns to the Add button. +- **A long title wraps** in the details pane and no longer runs off its row. +- **Duplicates, Trash and Connections** show their empty and error notes the way the library does, with no blank band above the first row. + +### Changed +- A theme saved by an older version is moved to the matching new one on first load. The old light value that showed as dark now opens as Light with Mist. +- Enter and Shift+Enter both save a title. + +### Fixed +- On Linux and Windows the desktop window's own background follows the light or dark setting, so a light page no longer sits on a dark frame. Written and read against FormLedger's shell, not compiled for this version. + +### Known issues +- In the desktop app the splash follows the system's light or dark setting, not a named theme. +- Merging a duplicate set or restoring from Trash moves the rows below up to close the gap. +- Choosing an item with a much longer or shorter title moves the fields below the title by the difference in the title's height. + +### Under the hood +- `docs/CITE_SERVICE.md` records a run of the cite service against a real engine: a stand-in client paired, a person's approval was clicked in Connections, and search, get, cite, bibliography, add and import answered; all six were refused before approval and after access was removed. The caller was not form.ext's hello example. +- Not run for this version: the desktop shell was not compiled, and nothing ran on macOS or Windows. + ## 0.11.0 ### New diff --git a/NOTICE.md b/NOTICE.md index 330649a..e8ebb21 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -14,6 +14,9 @@ A file brought over from another Form repository gets a row here with its source | formvfx v0.60.0 (`nodemode-dev/formvfx`) | Apache-2.0 | The way a Rust crate is built into a Python module (`native/fvx-core` and `setup/build_native`), followed in `native/formcite-style` and `setup/build_style`; rewritten, not copied | | formtxt v0.38.0 (`nodemode-dev/formtxt`), since 0.6.0 | Apache-2.0 | `setup/agents.py`: the install half of FormTxt's `setup/agents.py` (the four agent clients, each config file's format, the timestamped backup, the skill copy), rewritten from it with the sync, manifest and dock parts left out. `backend/app/mcp/stdio.py`: the shape of FormTxt's `setup/mcp_stdio.py` (one JSON-RPC message a line, logs on stderr, the parse error), with the library opened in-process instead of forwarding to a running engine | | form.md (`nodemode-dev/form.md`) at its `main` of 2026-11-27, since 0.11.0 | Apache-2.0 | The pre-paint theme script in `frontend/index.html`, adapted to FormCite's stored key | +| form.md (`nodemode-dev/form.md`) at its `main` of 2026-11-27, since 0.12.0 | Apache-2.0 | The theme values in `frontend/src/styles/themes.css` and the theme picker's shape in `frontend/src/ui/themes.ts` and `ui/preferences.ts`, from `web/src/ui/theme/tokens.css`, `web/src/ui/theme.ts` and `web/src/ui/preferences.ts`. The live dot and version in the sidebar head, from `web/index.html`, `web/src/styles/pages.css` and `web/src/ui/status.ts`. The splash card in `frontend/public/splash/index.html`, from `src-tauri/splash/index.html`. The Add dialog's structure, after the patterns in `web/src/styles/overlays.css`, `web/src/styles/panels.css` and `web/src/ui/dialog.ts` | +| FormPortal (`nodemode-dev/formportal`) at its `main` of 2026-11-27, since 0.12.0 | See that repository's `LICENSE`; same owner | Theme values in `frontend/src/styles/themes.css`, from `design/tokens.css` and `frontend/src/extensions/theme/index.ts` | +| 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` | diff --git a/README.md b/README.md index 0348809..6e9b1a0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@
-
+
diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md
index 6e619ca..1f873a7 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.11.0
+Current build version: v0.12.0
Last updated: 2026-11-27 (US Eastern) · the lean rows route for the window's list and opening an attachment
---
@@ -1681,3 +1681,7 @@ New in v0.10.0 (2026-11-27). "Untitled" is a live item whose `title`, trimmed of
## app/services/opener.py {#app-open-in-formpdf}
Opening a stored PDF attachment now hands it to FormPDF by launching the install with the file path as its argument, an argv list and never a shell string. FormPDF 0.61 supports exactly this: its desktop shell reads `.pdf` paths from its command line (`src-tauri/src/main.rs` `from_args`), forwards the arguments of a second launch to the running window through the single-instance plugin, and on macOS receives them from `open -a` as `RunEvent::Opened`. Its HTTP `open-path` route is not used: `WindowKeyGuard` refuses every write without the window key, which is why FormTxt's hand-off to port 8198 gets a 403. The launch waits two seconds; an exit with a non-zero code, or a launch that fails, falls back to the system viewer and says why in `formpdf.reason`. Only copied or moved PDFs go: a linked file lives outside the library and a non-PDF is not something FormPDF opens, so both use the system viewer with a reason. `opened_with` is now `formpdf` or `system`. Run with stand-in scripts for FormPDF (one logging its argument, one exiting 3): the PDF reached the logging script as the stored path, the other cases fell back with the right reason. Not run: a real FormPDF, macOS `open -a`, Windows.
+
+## app/routers/pair.py, app/routers/service.py, app/routers/cite_read.py, app/routers/cite_write.py, app/service/ {#app-cite-service-real-run}
+
+Run in v0.12.0 work (2026-11-27), no code changed. A stand-in Python client asked to pair with scope `write`, a click on Approve in the Connections view in headless Chrome approved it, the client collected the token and ran search, get, cite (apa), bibliography (ieee), add and import against a 2,000-item library: 200, 200, 200, 200, 201, 201. Before approval every call was 403 (`none was sent` without a token, `not known` with a made-up one); after Remove access, 403 `was revoked`. Writes by a revoked token are refused in `auth.check` before `_write`, so they are not in `service-log.jsonl`; that matches the rule that a refusal without a valid holder is not logged. An unknown route under `/api/cite/v1` answers Starlette's 404 `Not Found` to GET and 405 to POST; the 405 is a route outside this slice matching the path for GET only. FormCite answers no JSON-RPC codes; -32001 and -32601 belong to the host that wraps these calls. One data folder was shared across the two runs, so the first click on Remove access in the first run hit the older token row; the revoke result above is from a second run aimed at the live token's row by `data-key`.
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
index ae6db5f..ea370a8 100644
--- a/backend/app/__init__.py
+++ b/backend/app/__init__.py
@@ -1 +1 @@
-__version__ = "0.11.0"
+__version__ = "0.12.0"
diff --git a/docs/CITE_SERVICE.md b/docs/CITE_SERVICE.md
index 6d611ce..3053b6a 100644
--- a/docs/CITE_SERVICE.md
+++ b/docs/CITE_SERVICE.md
@@ -291,3 +291,20 @@ Every write by a token holder is recorded, whether it succeeded or was refused,
```
The JSON on stdout is `{"file", "entries": [{"time", "host", "name", "token_id", "route", "created", "changed", "outcome", "error"}]}`.
+
+## What a host maps, and what FormCite itself answers
+
+The cite service speaks plain HTTP with JSON bodies, not JSON-RPC. A host that offers its add-ons a JSON-RPC call into FormCite (form.ext's `fcite.call`) turns these answers into its own error codes: a refusal (403) into its "denied" code, and a method the host does not know into -32601. FormCite never answers a JSON-RPC code. For a route it does not have it answers Starlette's own 404 `{"detail":"Not Found"}` to a `GET` and 405 `{"detail":"Method Not Allowed"}` to a `POST`, with or without a token.
+
+The consent sentence the owner approved for form.ext's `fcite.addon` permission is "Let {Name} search, cite and add to your FormCite library?". That sentence is the host's own prompt. FormCite's approval is a second, separate consent in its Connections view, which shows the request as "Asks to read and add to your library" with Approve, Approve reading only and Deny.
+
+## Run against a real engine (2026-11-27)
+
+Run once end to end on FormCite 0.11.0 (branch `feat/themes-polish-pairing-0.12.0`): a built window served by the engine on port 8515 with its own data folder, 2,000 BibTeX items imported, style engine hayagriva 0.10.1. The caller was a stand-in client, a Python script making the same loopback HTTP calls a host makes; it was not form.ext's hello example, because form.ext's `fcite.call` is not on form.ext's main. The approval and the revoke were clicks in the window in headless Chrome.
+
+- Before pairing, no token: search, get, cite, bibliography, add and import each answered 403 `This needs a FormCite service token, and none was sent.`
+- `POST /pair` `{"host":"standin","name":"Stand-in Host","scope":"write"}` answered 200 with a request id and secret; a poll answered `"status":"pending"`. While pending, a made-up token got 403 `This service token is not known to FormCite.` on all six.
+- After the click on Approve, the next poll answered `"status":"approved"` with the token, scope `write`.
+- With the token: `GET /search?q=consequences&limit=2` 200, total 2000, two items; `GET /items/{id}` 200; `POST /cite` apa 200, `(Author0 & Writer0, 1980; Author1 & Writer1, 1981)`; `POST /bibliography` ieee 200, two entries; `POST /items` 201, a new book; `POST /import` 201, one added (a second run of the same text skipped it as a duplicate). The four writes are in the write log under the token's holder.
+- After the click on Remove access, then Remove: all six answered 403 `This service token was revoked by the person who uses FormCite.`
+- Layout shift at CPU 4x and 400 ms, 50,000 bytes per second: 0 for opening Connections with the request waiting and 0 for the approval, with and without input.
diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md
index 601fc87..4f1e854 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.11.0
+Current build version: v0.12.0
Last updated: 2026-11-26 (US Eastern) · window skeleton: shell, engine store, window key, health status
---
@@ -440,3 +440,19 @@ New in v0.10.0 (2026-11-27). `patchList` now keeps the longest run of nodes that
## index.html, src/engine/preferences.ts, src/ui/app.ts, src/styles/tokens.css, src/styles/shell.css {#src-family-window}
New in v0.10.0 (2026-11-27). The window follows the family's look, ported from form.md (`web/index.html` pre-paint) and FormLedger (`web/src/ui/theme/tokens.css`). The pre-paint script reads `formcite.theme` (`{theme, accentColor}`, same key), resolves `system` through `prefers-color-scheme` and sets `data-theme` and `data-theme-pref` on `` before any stylesheet; any stored older profile name (`studio`, `amoled` and so on, including the old `light`) reads as dark, and the old default accent `#a077e0` reads as unset so each theme keeps its own accent. `engine/preferences.ts` owns the appearance now (`applyAppearance`, `setMode`, a `matchMedia` listener for `system`); `ui/themes.ts` is no longer called by the window, and `main.ts` still passes `readChoice().theme` to `createEngine`, which is only the engine's starting value. The older token names (`--bg-primary`, `--text-primary`, `--accent-color` and the rest) alias the family names, so pane styles not yet rewritten follow both themes. `--row` stays 28 px, not the family's 30, because `ui/itemlist.ts` holds `ROW_H = 28` beside `--il-row-h`; the two must change together. The top bar's view name is six spans shown by `.fc-panes[data-view]`, with no script. The list error line floats over the list foot instead of reserving an 18 px row (the blank gap above the first row). Checked in a private built copy with 2,000 items under CPU 4x, 400 ms, 50 kB/s, fresh engine per load: `data-theme` at DOMContentLoaded matched `color_scheme` (light and dark), pool 55, layout shift 0 with and without input at 1400 by 900 and 1100 by 800, and `fc_exit.py` total 0 and 0 with pool 55 at start and end.
+
+## src/ui/detail.ts, src/styles/detail.css, src/ui/add.ts, src/styles/add.css {#src-title-wrap-add-frame}
+
+New in v0.12.0 (2026-11-27). The Title field is a one-row `textarea.fc-dt-input.fc-dt-title` (row still `data-field="title"`, the other fields stay `input[type="text"]`). Its row has a 36 px minimum and no fixed height, so a short title is exactly the old size; the textarea is sized by CSS `field-sizing: content`, and `fit()` in `ui/detail.ts` sets `height` from `scrollHeight` only where that is unsupported, on paint, input and Escape. Enter and Shift+Enter both commit (a title has no line breaks); a pasted line break is turned into a space on input. Selecting between a short and a 300-character title moves only what is below the title row, by the title row's own height change (the creators box and fields shift 0.0156 once when the new value arrives). The Add dialog is now head (title and close), tab strip, and one section per tab made of a fixed 264 px body and a foot with the primary button trailing, in `#overlay-root`: scrim `var(--z-scrim)`, panel `var(--z-overlay)`, shown with `.is-open` (visibility and opacity, never `hidden`), so open and close change nothing in layout. It follows form.md's `.dialog` frame (`styles/overlays.css`, `panels.css`: sheet background, `--radius-lg`, `--shadow-pop`, head height `--topbar-h`, foot with a top border); `--scrim` and `--dur` do not exist in FormCite's tokens, so the scrim keeps the old `color-mix` and the fade 120 ms. Focus goes to the first field of the open tab, returns to what had focus (the Add button), Escape works from anywhere (the old handler sat on the dialog and never ran when focus was outside it), and Tab stays inside. Checked in a private built copy, 2,000 items plus two long and short titles, CPU 4x, 400 ms and 50 kB/s: open and close 0 with and without input (dark and light), an import 0 and 0, title edit 0.0021, select 0.0156 once; the Escape close worked after the change and did not before.
+
+## src/ui/duplicates.ts, src/ui/trash.ts, src/ui/connections.ts, src/styles/review.css, src/styles/connections.css {#src-review-light}
+
+New in v0.12.0 (2026-11-27). The three views were read in light and dark at 1400 by 900 in a private built copy (2,002 items, 4 duplicate sets, 6 trashed). Text contrast in light was already fine: muted labels and subs 5.34 on the sheet, danger text 5.53 on the button surface, primary button text 6.20, titles 16.61. Faults fixed: the Duplicates and Trash note reserved an empty 24 px row under the bar (a blank band above the first row); it now floats over the list, centered like the library's `.fc-empty-center`, and `--rv-line` is gone. `--rv-row`, `--rv-bar` and `--rv-btn` come from `--ctl`, `--space-3` and `--ctl-md`. The Connections empty lines lost their dashed boxes and read as centered muted 12 px text, like the library. No node changed, so no view is rebuilt to restyle it. Still raw because no token exists: `--rv-act` 232 px, `--rv-col` 280 px, `minmax(320px, 1fr)` in `.fc-conn-cols`, and the 32 px error row in `.fc-conn-body`. Layout shift, CPU 4x, 400 ms, 50 kB/s, hard reload, light and dark alike: opening Duplicates, Trash and Connections 0 with and without input; merging a set 0.1510 and restoring a trash row 0.0087 when the click is a script call (rows below close the gap), 0 when it is a real click (counted as input). The Connections pairing row action was not run: no pairing existed in this engine.
+
+## index.html, src/main.ts, src/ui/themes.ts, src/ui/preferences.ts, src/styles/themes.css, src/styles/preferences.css {#src-all-themes}
+
+New in v0.12.0 (2026-11-27). Every theme from form.md (`web/src/ui/theme/tokens.css`, `web/src/ui/theme.ts`, `web/src/ui/preferences.ts`) and formportal (`design/tokens.css`, `frontend/src/extensions/theme/index.ts`) is in, as form.md models it: the mode stays System, Light or Dark in `formcite.theme` (owned by `engine/preferences.ts`, unchanged), and a dark theme and a light theme are kept in a second key, `formcite.look` (`{dark, light}`), shown as `data-dark-theme` and `data-light-theme` on ``. Dark: Default, Studio, Night, Graphite, Midnight, Forest, Ember, Violet, Slate, Mono, Ocean, Rose, Terminal, AMOLED (also formportal's, so once; sets `data-oled`), High contrast. Light: Default, Paper, Sand, Sage, Mist, High contrast. form.md's token names are FormCite's, so `styles/themes.css` sets only `--ground`, `--sheet`, `--surface`, `--surface-2`, `--border`, `--border-strong`, `--text`, `--text-muted`, `--text-faint` (and `--hover`, `--active` for contrast and OLED); the older aliases follow. A second key was chosen because `engine/preferences.ts` rewrites `formcite.theme` with only `theme` and `accentColor` on every accent or mode change. `ui/themes.ts` is the one source for the theme lists and `applyLook`/`setLook`; the old profile route (`readChoice`, `applyTheme`, inline style vars) is gone, and `main.ts` hands `createEngine` the saved mode. The pre-paint boot moves older stored names once: `studio`, `midnight`, `mono`, `contrast`, `amoled` to the dark theme of that name, `nodemode-dark` to Night, `soft-light` (which read as dark in v0.10 and v0.11) to Light mode with Mist, anything else to dark Default, and writes both keys back. Picking a swatch flips attributes and `aria-checked` only; `data-switching` drops transitions for two frames. Checked in a private built copy with 2,000 items, CPU 4x, 400 ms, 50 kB/s: load in Ocean shift 0 and 0 with the first paint already `#06131c`; 21 theme switches 0 and 0, 959 nodes before and after each; three picker clicks and a mode change 0 added or removed nodes, shift 0.
+
+## src/ui/status.ts, src/styles/side.css, public/splash/ {#src-live-dot-splash}
+
+New in v0.12.0 (2026-11-27). The sidebar head carries the engine's live dot and the version, as form.md's `sidebar__version` does (`web/index.html`, `web/src/styles/pages.css` `.live-dot`, `web/src/ui/status.ts`). `bindStatus` appends `.fc-sb-live` to `.fc-sb-head` once, right after `mountOnce` and before `revealApp`, so the box is there at first visible paint; the version text is `VERSION` from `version.ts` and never changes. The dot's only moving part is `data-state`: `live` (link up), `reconnecting` (first check, and the first 30 s after a live engine stops answering), `down` (after that, or never reached). `side.css` widens the head grid to a third `auto` column; that rule belongs in `shell.css` beside `.fc-sb-head`. `public/splash/index.html` is the family card from form.md and FormLedger (`src-tauri/splash/index.html`) with FormCite's icon (`assets/brand/formcite_icon_dark.png` and `_light.png` at 256 px) and the window's pre-paint read of `formcite.theme`, so it is `#08080a` or `#f3f1ed` like the window it hands over to; the named theme in `formcite.look` is not read, so an Ocean window gets the plain dark card. Checked in a private built copy with 2,000 items, CPU 4x, 400 ms, 50 kB/s: engine stopped by pid and started again, dot `live`, `reconnecting` at 4.1 s, `live` 10.1 s after the start; in a second run held stopped 38 s, `down` at 34.3 s and `live` 6.0 s after the start; layout shift 0 with and 0 without input in both; splash and first window paint matched in all six cases (system light or dark, saved none, light, dark).
diff --git a/frontend/index.html b/frontend/index.html
index 7e22f6d..4d72a08 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -7,30 +7,48 @@
Starting FormCite
+ diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 68f3441..8b9393b 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,8 +1,10 @@ import { createEngine } from './engine'; import { activateAll } from './extensions/registry'; import { mountApp } from './ui/app'; -import { readChoice } from './ui/themes'; +import { currentAppearance } from './engine/preferences'; +import { applyLook } from './ui/themes'; -const engine = createEngine(readChoice().theme); +applyLook(); +const engine = createEngine(currentAppearance().theme); activateAll(engine); mountApp(engine); diff --git a/frontend/src/styles/add.css b/frontend/src/styles/add.css index 62187a1..a9a5792 100644 --- a/frontend/src/styles/add.css +++ b/frontend/src/styles/add.css @@ -1,28 +1,35 @@ .fc-add-open, .fc-add { --fc-add-w: 560px; - --fc-add-body-h: 300px; + --fc-add-body-h: 264px; --fc-add-line-h: 40px; - --fc-add-area-h: 150px; + --fc-add-area-h: 112px; --fc-add-icon: 16px; } .fc-add-open { display: inline-flex; align-items: center; gap: var(--space-1h); } .fc-add-open svg, .fc-add-x svg { width: var(--fc-add-icon); height: var(--fc-add-icon); flex: none; } -.fc-add { position: fixed; inset: 0; z-index: var(--z-overlay); display: grid; place-items: center; } -.fc-add[hidden] { display: none; } -.fc-add-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg-primary) 60%, transparent); } -.fc-add-panel { position: relative; width: var(--fc-add-w); max-width: calc(100vw - var(--space-8)); background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); } -.fc-add-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); } -.fc-add-tabs { display: flex; gap: var(--space-1); } +.fc-add { position: fixed; inset: 0; pointer-events: none; visibility: hidden; opacity: 0; transition: opacity 120ms, visibility 0s linear 120ms; } +.fc-add.is-open { pointer-events: auto; visibility: visible; opacity: 1; transition: opacity 120ms; } +.fc-add-scrim { position: fixed; inset: 0; z-index: var(--z-scrim); background: color-mix(in srgb, var(--bg-primary) 60%, transparent); } +.fc-add-panel { position: fixed; z-index: var(--z-overlay); inset-block-start: 12vh; inset-inline: 0; margin-inline: auto; box-sizing: border-box; display: grid; grid-template-rows: var(--topbar-h) auto auto; inline-size: min(var(--fc-add-w), calc(100vw - var(--space-8))); max-block-size: calc(100vh - 12vh - var(--space-4)); overflow: hidden; background: var(--sheet); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); } +.fc-add-panel:focus { outline: none; } +.fc-add-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); padding: 0 var(--space-2) 0 var(--space-5); border-block-end: 1px solid var(--border); } +.fc-add-title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); } +.fc-add-tabs { display: flex; gap: var(--space-1); padding: var(--space-2) var(--space-5) 0; } .fc-add-tab { height: var(--ctl-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--text-secondary); font: inherit; cursor: pointer; } +.fc-add-tab:hover { color: var(--text-primary); } .fc-add-tab.is-on { border-color: var(--line-2); background: var(--surface-2); color: var(--text-primary); } .fc-add-x { width: var(--ctl-md); height: var(--ctl-md); display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-secondary); cursor: pointer; } .fc-add-x:hover { background: var(--bg-hover); color: var(--text-primary); } -.fc-add-body { height: var(--fc-add-body-h); } -.fc-add-sec { display: flex; flex-direction: column; gap: var(--space-2); height: 100%; } +.fc-add-sec { display: grid; grid-template-rows: var(--fc-add-body-h) auto; min-block-size: 0; } .fc-add-sec[hidden] { display: none; } +.fc-add-body { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--space-3); min-block-size: 0; padding: var(--space-4) var(--space-5); overflow: hidden; } +.fc-add-foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-block-start: 1px solid var(--border); } +.fc-add-field { display: grid; row-gap: var(--space-1h); } +.fc-add-note { margin: 0; color: var(--text-muted); } .fc-add-label { color: var(--text-secondary); } .fc-add-row { display: flex; gap: var(--space-2); align-items: center; } +.fc-add-input:focus, .fc-add-select:focus, .fc-add-area:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); } .fc-add-input, .fc-add-select { height: var(--ctl); 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; min-width: 0; } .fc-add-input { flex: 1; } .fc-add-line { height: var(--fc-add-line-h); margin: 0; overflow: hidden; color: var(--text-secondary); transition: opacity 120ms; } @@ -32,7 +39,6 @@ .fc-add-pick { display: inline-flex; align-items: center; } .fc-add-file { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); } .fc-add-area { height: var(--fc-add-area-h); resize: none; padding: 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-family: var(--font-mono, monospace); } -.fc-add-end { justify-content: flex-end; } .fc-add-check { display: inline-flex; align-items: center; gap: var(--space-1h); margin-right: auto; color: var(--text-secondary); cursor: pointer; user-select: none; } .fc-add-check input { margin: 0; accent-color: var(--accent-color); } .fc-add-drop { position: fixed; inset: var(--space-3); z-index: var(--z-scrim); display: grid; place-items: center; border: 2px dashed var(--accent-color); border-radius: var(--radius-md); background: color-mix(in srgb, var(--bg-primary) 70%, transparent); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 160ms, visibility 0s linear 160ms; } diff --git a/frontend/src/styles/connections.css b/frontend/src/styles/connections.css index f3e78b2..a00e7db 100644 --- a/frontend/src/styles/connections.css +++ b/frontend/src/styles/connections.css @@ -15,7 +15,7 @@ .fc-conn-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; gap: var(--space-4); } .fc-conn-group > .fc-section-head { height: var(--fc-section-head-h); padding: 0; } .fc-conn-rows { position: relative; display: grid; align-content: start; row-gap: var(--space-2); min-height: calc(var(--fc-conn-row-h) * 2 + var(--space-2)); } -.fc-conn-empty { position: absolute; inset: 0 0 auto 0; margin: 0; padding: var(--space-3); border: 1px dashed var(--line-1); border-radius: var(--radius); color: var(--text-muted); visibility: hidden; } +.fc-conn-empty { position: absolute; inset: 0 0 auto 0; margin: 0; padding: var(--space-3); text-align: center; color: var(--text-muted); font-size: var(--fs-12); visibility: hidden; } .fc-conn.is-loaded .fc-conn-rows:not(:has(> .fc-conn-row)) > .fc-conn-empty { visibility: visible; } .fc-conn-row { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-2); min-height: var(--fc-conn-row-h); padding: var(--space-2) var(--space-3); border: 1px solid var(--line-1); border-radius: var(--radius); background: var(--surface-1); box-sizing: border-box; } diff --git a/frontend/src/styles/detail.css b/frontend/src/styles/detail.css index 3f40d85..f6724f5 100644 --- a/frontend/src/styles/detail.css +++ b/frontend/src/styles/detail.css @@ -34,9 +34,10 @@ .fc-dt-label { color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .fc-dt-input { box-sizing: border-box; width: 100%; height: var(--dt-row-h); min-width: 0; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; } .fc-dt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); } -.fc-dt-row[data-field="title"] { grid-template-columns: minmax(0, 1fr) var(--dt-mark-w); grid-template-rows: var(--text-lg) 36px; height: calc(var(--text-lg) + 36px + var(--space-1)); row-gap: var(--space-1); } +.fc-dt-row[data-field="title"] { --dt-title-h: 36px; grid-template-columns: minmax(0, 1fr) var(--dt-mark-w); grid-template-rows: var(--text-lg) auto; height: auto; min-height: calc(var(--text-lg) + var(--dt-title-h) + var(--space-1)); row-gap: var(--space-1); align-items: start; } .fc-dt-row[data-field="title"] > .fc-dt-label { grid-column: 1 / -1; } -.fc-dt-row[data-field="title"] > .fc-dt-input { height: 36px; font-size: var(--text-md); font-weight: var(--weight-medium); } +.fc-dt-row[data-field="title"] > .fc-dt-input { height: auto; min-height: var(--dt-title-h); padding: var(--space-1h) var(--space-2); font-size: var(--text-md); font-weight: var(--weight-medium); line-height: 1.3; resize: none; overflow: hidden; overflow-wrap: anywhere; field-sizing: content; } +.fc-dt-row[data-field="title"] > .fc-dt-mark { align-self: center; } .fc-dt-block { height: var(--dt-block-h); padding: var(--space-1) var(--space-2); resize: none; overflow: auto; line-height: 1.4; } .fc-dt-mark { width: var(--dt-mark-w); height: var(--dt-mark-w); border-radius: 50%; background: transparent; } .fc-dt-row.is-saving .fc-dt-mark { background: var(--text-muted); } diff --git a/frontend/src/styles/preferences.css b/frontend/src/styles/preferences.css index 85f4893..93341b2 100644 --- a/frontend/src/styles/preferences.css +++ b/frontend/src/styles/preferences.css @@ -53,4 +53,14 @@ .fc-pr-log-row > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .fc-pr-log-res { text-align: end; } .fc-pr-log-row.is-error { color: var(--danger-text); } +.fc-pr-themes { display: grid; row-gap: var(--space-1h); padding: var(--space-1) 0; } +.fc-theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); } +.fc-theme-pick { display: grid; row-gap: var(--space-1); padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-md); background: none; color: var(--text-secondary); font-size: var(--fs-12); text-align: start; cursor: pointer; } +.fc-theme-pick:hover { background: var(--hover); } +.fc-theme-pick[aria-checked="true"] { border-color: var(--accent); color: var(--text-primary); } +.fc-theme-pick:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 1px; } +.fc-swatch { display: grid; grid-template-columns: 30% 1fr; height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--sheet); overflow: hidden; } +.fc-swatch-bar { background: var(--surface-2); border-inline-end: 1px solid var(--border); } +.fc-swatch-line { align-self: center; height: var(--space-1); margin: 0 var(--space-2); border-radius: var(--radius-hair); background: var(--text-muted); } +.fc-theme-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .fc-pr-error { margin: 0; height: var(--fc-pr-line-h); line-height: var(--fc-pr-line-h); color: var(--danger-text); font-size: var(--fs-12); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } diff --git a/frontend/src/styles/review.css b/frontend/src/styles/review.css index 795a821..68707a5 100644 --- a/frontend/src/styles/review.css +++ b/frontend/src/styles/review.css @@ -1,19 +1,20 @@ .fc-rv { - --rv-row: 44px; - --rv-bar: 44px; - --rv-line: 24px; - --rv-btn: 28px; + --rv-row: calc(var(--ctl) + var(--space-3)); + --rv-bar: calc(var(--ctl) + var(--space-3)); + --rv-btn: var(--ctl-md); --rv-act: 232px; --rv-col: 280px; display: grid; - grid-template-rows: var(--rv-bar) var(--rv-line) minmax(0, 1fr); + grid-template-rows: var(--rv-bar) minmax(0, 1fr); + position: relative; height: 100%; min-height: 0; } .fc-rv-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--line-0); } .fc-rv-summary { color: var(--text-secondary); font-size: var(--fs-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fc-rv-bar-act { display: grid; grid-auto-flow: column; column-gap: var(--space-2); align-items: center; justify-content: end; min-width: var(--rv-act); } -.fc-rv-note { padding: 0 var(--space-4); line-height: var(--rv-line); font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.fc-rv-note { position: absolute; inset: var(--rv-bar) 0 auto 0; padding: var(--space-4); text-align: center; pointer-events: none; font-size: var(--fs-12); color: var(--text-muted); } +.fc-rv-note:empty { display: none; } .fc-rv-note.is-error { color: var(--danger-text); } .fc-rv-list { overflow-y: auto; min-height: 0; position: relative; } .fc-rv-btn { height: var(--rv-btn); padding: 0 var(--space-3); 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); cursor: pointer; white-space: nowrap; } diff --git a/frontend/src/styles/shell.css b/frontend/src/styles/shell.css index a511d90..ea6ec03 100644 --- a/frontend/src/styles/shell.css +++ b/frontend/src/styles/shell.css @@ -9,7 +9,7 @@ body { font-size: var(--fs-12); line-height: 1.35; } .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; } -.fc-sb-head { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; column-gap: var(--space-2); height: var(--topbar-h); padding: 0 var(--space-4); } +.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); } .fc-brand-name { color: var(--text); font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: -0.01em; white-space: nowrap; } diff --git a/frontend/src/styles/side.css b/frontend/src/styles/side.css index b35a20b..ea14af0 100644 --- a/frontend/src/styles/side.css +++ b/frontend/src/styles/side.css @@ -5,6 +5,11 @@ --fc-side-actions-w: 48px; } +.fc-sb-live { display: inline-grid; grid-auto-flow: column; align-items: center; column-gap: var(--space-1); color: var(--text-faint); font-size: var(--fs-11); font-variant-numeric: tabular-nums; white-space: nowrap; } +.fc-sb-dot { width: var(--size-dot); height: var(--size-dot); border-radius: var(--radius-pill); background: var(--warn); contain: strict; } +.fc-sb-dot[data-state="live"] { background: var(--ok); } +.fc-sb-dot[data-state="down"] { background: var(--danger); } + .fc-side-list { list-style: none; margin: 0; padding: 0; } .fc-side-tags { max-height: calc(var(--fc-side-row-h) * 12); overflow-y: auto; overscroll-behavior: contain; } .fc-side-row.is-pending { pointer-events: none; } diff --git a/frontend/src/styles/themes.css b/frontend/src/styles/themes.css new file mode 100644 index 0000000..c3dcdce --- /dev/null +++ b/frontend/src/styles/themes.css @@ -0,0 +1,94 @@ +.fc-swatch[data-dark] { + --ground: #08080a; --sheet: #0f0f12; --surface: #141418; --surface-2: #1b1b21; + --border: rgba(255, 255, 255, 0.075); --border-strong: rgba(255, 255, 255, 0.14); + --text: #e6e6e9; --text-muted: #8d8d95; --text-faint: #5d5d66; +} +.fc-swatch[data-light] { + --ground: #f3f1ed; --sheet: #fdfcfa; --surface: #f6f4f0; --surface-2: #eeebe5; + --border: rgba(0, 0, 0, 0.085); --border-strong: rgba(0, 0, 0, 0.16); + --text: #1d1c1a; --text-muted: #6c6963; --text-faint: #9c988f; +} + +:root[data-theme="dark"][data-dark-theme="studio"], .fc-swatch[data-dark="studio"] { + --ground: #111111; --sheet: #141316; --surface: #17151b; --surface-2: #222127; + --border: #262526; --border-strong: #34333a; --text: #f7f7f7; --text-muted: #8a8a8b; --text-faint: #5c5c5d; +} +:root[data-theme="dark"][data-dark-theme="night"], .fc-swatch[data-dark="night"] { + --ground: #0a0a0a; --sheet: #0e0e11; --surface: #121218; --surface-2: #1a1a24; + --border: #24242e; --border-strong: #3a3a48; --text: #e8e8ee; --text-muted: #838393; --text-faint: #55555f; +} +:root[data-theme="dark"][data-dark-theme="graphite"], .fc-swatch[data-dark="graphite"] { + --ground: #0d1117; --sheet: #12161c; --surface: #161b22; --surface-2: #21262d; + --border: #2a3036; --border-strong: #3d444d; --text: #e6edf3; --text-muted: #878e98; --text-faint: #595e67; +} +:root[data-theme="dark"][data-dark-theme="midnight"], .fc-swatch[data-dark="midnight"] { + --ground: #0b1020; --sheet: #0e1428; --surface: #101830; --surface-2: #182242; + --border: #202c52; --border-strong: #324274; --text: #e4e9f7; --text-muted: #7f8bb3; --text-faint: #535c7b; +} +:root[data-theme="dark"][data-dark-theme="forest"], .fc-swatch[data-dark="forest"] { + --ground: #0c130e; --sheet: #0f1812; --surface: #121c15; --surface-2: #1a281e; + --border: #25382a; --border-strong: #375441; --text: #e4efe7; --text-muted: #789381; --text-faint: #4f6255; +} +:root[data-theme="dark"][data-dark-theme="ember"], .fc-swatch[data-dark="ember"] { + --ground: #140d0a; --sheet: #18100d; --surface: #1d1310; --surface-2: #2a1c16; + --border: #3c281e; --border-strong: #5a3d2e; --text: #f2e8e2; --text-muted: #9f8273; --text-faint: #6a564b; +} +:root[data-theme="dark"][data-dark-theme="violet"], .fc-swatch[data-dark="violet"] { + --ground: #100b1c; --sheet: #140e22; --surface: #171129; --surface-2: #221a3c; + --border: #312652; --border-strong: #493b78; --text: #ece6f9; --text-muted: #8f82b6; --text-faint: #5f557b; +} +:root[data-theme="dark"][data-dark-theme="slate"], .fc-swatch[data-dark="slate"] { + --ground: #101418; --sheet: #14181e; --surface: #171d23; --surface-2: #212a32; + --border: #2c3843; --border-strong: #415260; --text: #e7edf2; --text-muted: #8493a0; --text-faint: #58636c; +} +:root[data-theme="dark"][data-dark-theme="mono"], .fc-swatch[data-dark="mono"] { + --ground: #0e0e0e; --sheet: #121212; --surface: #161616; --surface-2: #202020; + --border: #2c2c2c; --border-strong: #454545; --text: #f0f0f0; --text-muted: #898989; --text-faint: #5a5a5a; +} +:root[data-theme="dark"][data-dark-theme="ocean"], .fc-swatch[data-dark="ocean"] { + --ground: #06131c; --sheet: #081822; --surface: #0a1c29; --surface-2: #10293c; + --border: #193a52; --border-strong: #285578; --text: #e2eef7; --text-muted: #7394aa; --text-faint: #4a6374; +} +:root[data-theme="dark"][data-dark-theme="rose"], .fc-swatch[data-dark="rose"] { + --ground: #170b10; --sheet: #1c0e14; --surface: #211117; --surface-2: #301a22; + --border: #432531; --border-strong: #653a49; --text: #f5e7ec; --text-muted: #a87e8d; --text-faint: #71525e; +} +:root[data-theme="dark"][data-dark-theme="terminal"], .fc-swatch[data-dark="terminal"] { + --ground: #050d05; --sheet: #081008; --surface: #0a140a; --surface-2: #102010; + --border: #1a341a; --border-strong: #2b522b; --text: #d8f5d8; --text-muted: #5d925d; --text-faint: #3c5f3c; +} +:root[data-theme="dark"][data-dark-theme="amoled"], .fc-swatch[data-dark="amoled"] { + --ground: #000000; --sheet: #000000; --surface: #141414; --surface-2: #1f1f1f; + --border: #262626; --border-strong: #3a3a3a; --text: #ededed; --text-muted: #a6a6a6; --text-faint: #858585; +} +:root[data-theme="dark"][data-oled] { --hover: rgba(255, 255, 255, 0.1); --active: rgba(255, 255, 255, 0.16); } +:root[data-theme="light"][data-oled] { --surface-1: var(--surface); --bg-hover: var(--hover); --border-soft: var(--border); --line-0: var(--border); } +:root[data-theme="dark"][data-dark-theme="contrast"], .fc-swatch[data-dark="contrast"] { + --ground: #000000; --sheet: #050505; --surface: #0a0a0a; --surface-2: #161616; + --border: #555555; --border-strong: #777777; --text: #ffffff; --text-muted: #c8c8c8; --text-faint: #9a9a9a; + --hover: rgba(255, 255, 255, 0.1); --active: rgba(255, 255, 255, 0.16); +} + +:root[data-theme="light"][data-light-theme="paper"], .fc-swatch[data-light="paper"] { + --ground: #ecebe6; --sheet: #fafaf7; --surface: #f7f6f1; --surface-2: #e7e6df; + --border: #dcd9cf; --border-strong: #beb9aa; --text: #26241d; --text-muted: #646256; --text-faint: #9f9d94; +} +:root[data-theme="light"][data-light-theme="sand"], .fc-swatch[data-light="sand"] { + --ground: #efe8da; --sheet: #fbf8f2; --surface: #f8f3e9; --surface-2: #eae2d1; + --border: #dfd4be; --border-strong: #c2b28e; --text: #2a2418; --text-muted: #695f49; --text-faint: #a29a89; +} +:root[data-theme="light"][data-light-theme="sage"], .fc-swatch[data-light="sage"] { + --ground: #e9ede6; --sheet: #f7f9f5; --surface: #eff3ec; --surface-2: #e3e9df; + --border: #d6ded0; --border-strong: #b5c2ad; --text: #1d241b; --text-muted: #56614f; --text-faint: #8b9585; +} +:root[data-theme="light"][data-light-theme="mist"], .fc-swatch[data-light="mist"] { + --ground: #e9edf2; --sheet: #f8fafc; --surface: #f0f3f7; --surface-2: #e3e8ef; + --border: #d3dae4; --border-strong: #b2bdcc; --text: #1a2230; --text-muted: #556070; --text-faint: #8a95a5; +} +:root[data-theme="light"][data-light-theme="contrast"], .fc-swatch[data-light="contrast"] { + --ground: #f2f2f2; --sheet: #ffffff; --surface: #f7f7f7; --surface-2: #ebebeb; + --border: #8a8a8a; --border-strong: #4d4d4d; --text: #000000; --text-muted: #2e2e2e; --text-faint: #555555; + --hover: rgba(0, 0, 0, 0.07); --active: rgba(0, 0, 0, 0.12); +} + +:root[data-switching] *, :root[data-switching] *::before, :root[data-switching] *::after { transition: none !important; } diff --git a/frontend/src/ui/add.ts b/frontend/src/ui/add.ts index 49579da..7c0a773 100644 --- a/frontend/src/ui/add.ts +++ b/frontend/src/ui/add.ts @@ -10,18 +10,19 @@ const CLOSE = ``; type Tab = 'id' | 'import' | 'export'; const DIALOG = ` -Export
-Exports
+