72 Commits
Author SHA1 Message Date
Greg ShuflinandClaude Opus 5.5 5938e8cd9c just: lowprio, to run a recipe at idle CPU weight
A full-width cargo build of the workspace makes the desktop it runs on
sluggish. `just lowprio <recipe>` runs the recipe in its own systemd user
scope with CPUWeight=idle and a soft MemoryHigh cap, so it still uses
every free core but yields to anything interactive; it falls back to
nice -n19 where there is no systemd user session. AGENTS.md tells agents
to prefix long builds with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 17:51:11 -08:00
Greg ShuflinandClaude Opus 5.5 b00cd3cb82 docs: ADR 0053 covers commands and desktop sub-tabs
Build Debug APK / build (push) Failing after 28s
The keymap ADR and the AGENTS.md rule now say a key is a keymap::Action
(navigation or command, one meaning program-wide) and how desktop
sub-tabs reach a screen. The two finished TODO follow-ups are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:42:57 -07:00
Greg ShuflinandClaude Opus 5.5 e1aade7f9e docs: ADR 0053, one keymap for every modality
Records the keyboard convention and the choices behind it — Left is out one
level, sub-tabs and agents share a shifted key family, a text field keeps its
keys — adds the rule to AGENTS.md, and replaces the TODO it closes with the
follow-ups it leaves: desktop tabs on screens that never take focus, screen
commands into the keymap, and a shared TUI list/detail shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 05:47:32 -07:00
Greg ShuflinandClaude Opus 5.5 59bda95ea4 dev: a headless GUI workflow that works on the first try
- scripts/gui-input.py drives the headless session through wayvnc: one
  RFB connection keeps a pointer and keyboard alive, which wtype,
  wlrctl and swaymsg's seat cursor can't on a seat with no devices.
- just scratch-store makes an initialized store in a single-node
  ensemble of its own, so a look at the GUI needn't touch the default
  store or click through first-run setup.
- just doctor reports the sway-headless session, so a machine with no
  display doesn't read as one that can't show the GUI.
- AGENTS.md points at rust/gui-app/AGENTS.md before any GUI work, and
  that file now covers the store, the launch (with lavapipe from the
  flake's nixpkgs), and input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7mmwfXLyeYuKc4RdWEkc8
2026-10-31 00:25:30 -07:00
Greg ShuflinandClaude Opus 5.5 73d66b25c9 AGENTS.md: GUI output is looked at by the developer or by the agent; ask which
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 02:30:14 -07:00
Greg ShuflinandClaude Opus 5.5 297e3f25d5 lib: copy.rs splits into one file per subject under copy/
copy.rs now only declares the subjects, holds msg!, and re-exports the
formatters (copy/format.rs). The few loose items join their subject:
ContentRowCopy and PeerSyncCopy get files of their own, placement_content/
summary become placement::content/summary, job_activity becomes
job_state::activity, job_history_times* become job_list::history_times*, and
the podcast search and pomodoro sessions copy move into podcasts and pomodoro.
Each subject's tests move with it. The two tests that read the copy's own
source (no run of spaces in a string, msg! ids against the .ftl) now read
every file under copy/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:39:15 -07:00
Greg ShuflinandClaude Opus 5.5 1add44c766 lib: counts in copy are Fluent messages, pluralized by CLDR rules
A sentence with a number in it is now a message in copy/en-US.ftl,
rendered through fluent-bundle by copy.rs's msg!, so "1 artifact" and
"3 artifacts" come from the locale's plural rules instead of
"artifact(s)" or an if n == 1 at each site. Only English for now, but a
second language is a second .ftl. A test keeps copy.rs and the .ftl
naming the same set of messages.

Adds copy::count for bare "N things" labels and the sentences the CLI,
desktop and Android still composed for themselves, ready for them to
call. Fixes the plurals that were simply wrong ("1 total nodes").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:39:15 -07:00
Greg ShuflinandClaude Opus 5.5 f8fad97f81 AGENTS.md: a background result knows what it was for
The rule F1's sweep applied across Notes, the player, document detail and the
readers: a buffer carries its record's id, a load into a selection is held
rather than detached, and work that can't be canceled checks a generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 04:44:34 -07:00
Greg ShuflinandClaude Opus 5.5 1a3eb9f65f AGENTS.md: a preferences screen is not a record, so editing-as-a-mode doesn't reach it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 20:44:19 -07:00
Greg ShuflinandClaude Opus 5.5 1409666a5e AGENTS.md: no database migrations; a store is recreated, not converted
Build Debug APK / build (push) Failing after 2m58s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:42:28 -07:00
Greg ShuflinandClaude Opus 5.5 d3d9f08782 gui: Notes guards its open note with SyncGuarded
The open note's stored_body/incoming_body pair and its hand-written
broadcast loop (watch_open_note) were the last hand-rolled copy of the
alert-don't-apply shape. Notes now holds the body as
OpenNote { id, body: SyncGuarded<String> }, and check_open_note does
Clippings' check: read the note on the background executor, treat text
equal to the editor as this node's own save, and only then
observe_fetched. It runs from store_watch::follow, so it follows the
store while Notes is on display and catches up on arrival.

Two behaviors change, both accepted in the audit decision:
- Keep mine dismisses the incoming version, so a re-read of that same
  version no longer re-alerts. That memory replaces stopping the watch
  until the overwrite finished.
- A version that arrives while Notes is off display is announced on
  return rather than as it lands, and a newer version replaces a pending
  one instead of being missed until the first is resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 04:19:51 -07:00
Greg ShuflinandClaude Opus 5.5 d7b3947d3a android: one stacked label/value row, ui/LabeledValue
Four private variants — InfoRow, DocumentSettingsRow, MetadataRow and
FactRow — and Humans' ReadOnlyField each laid out the same line, two of
them as a two-column grid that CLAUDE.md says Android does not use. They
are all LabeledValue now, which carries the stacked-on-a-phone rationale
that lived on ReadOnlyField.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 02:48:27 -07:00
Greg ShuflinandClaude Opus 5.5 8c43229925 AGENTS.md: ids keep their prefix when shortened; the middle cut is for readable text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X3HRVnoLened7RocqUkvFs
2026-09-28 20:13:17 -07:00
Greg ShuflinandClaude Fable 5.1 5889b6d985 AGENTS.md: a truncation cuts from the middle
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 23:35:22 -07:00
Greg ShuflinandClaude Sonnet 5 15b0db7a9d Spelling: British -> American across in-app copy, docs, and code
Build Debug APK / build (push) Successful in 5m51s
Rewrites every British spelling found in the codebase to American: neighbour,
colour, catalogue, behaviour, honour, flavour, grey, judgement,
acknowledgement, licence, defence, organise/optimise/initialise/recognise/
analyse, artefact, cancelled/cancelling, labelled/labelling, modelled/
modelling, and centre/centred/centring all become their American forms —
consistently in prose (docs, ADRs, comments) and in identifiers, including
the FFI-shared CatalogueSync/Cancelled enum variants and catalogue_* fields
that cross the Rust/Kotlin boundary.

Left untouched: external API names that only look like a spelling variant
(kotlinx.coroutines.CancellationException/NonCancellable, Compose Material3's
labelLarge) and the EFF diceware wordlist used for key derivation.

Adds a Code Style rule to AGENTS.md/CLAUDE.md requiring American spelling in
user-facing copy and documentation going forward, with that same carve-out.

Verified: cargo build --workspace, all 1410 Rust tests, Kotlin compile,
fmt-rust/fmt-kotlin, lint-kotlin-fast (detekt), and the lint-gui-layout/
lint-sql-params/lint-p2p-admission custom checks all pass clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017fHWzCF6oNiCV4ue1bBf1t
2026-09-01 03:01:16 -07:00
Greg ShuflinandClaude Opus 5 2104fc9e62 Docs: the alert-don't-apply flow now has three callers, not one
Build Debug APK / build (push) Successful in 5m11s
TODO.md's clippings item is closed. ADR 0039's `NoteEditor` prediction
gets its second correction: the guard was the hard part, not the editor,
and TextArea is what a card-sized buffer with no TextFormat wants.

ADR 0031 gains an amendment for what the third caller surfaced — that the
'identical to what the editor already holds' comparison cannot live in
SyncGuarded, because the type would then have to hold a text buffer and
stop being gpui-free. Both editable-buffer callers make it before feeding
the guard, and that is a decision worth recording rather than
rediscovering. It also stops claiming Android has no equivalent: it has
the rule (ui/IncomingBody) and the shared words, just not the type.

AGENTS.md's worked examples pointed at notes/NotesScreen.kt for a symbol
that now lives in ui/IncomingBody.kt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsACwkLMA9MUh5bvgAnZnK
2026-08-31 20:28:51 -07:00
Greg Shuflin b3c3e440eb An ALPN's version number lives in its constant and nowhere else
Build Debug APK / build (push) Successful in 18m34s
Every P2P protocol's ALPN carries a version suffix, and it moves whenever the
wire shape does — this project has no backwards-compatibility constraint, so
bumps are routine. A number copied into prose is wrong from the next bump
onward and nothing fails when it rots, so seven of the eleven versioned
references in docs/ were already stale, and so were twelve of the nineteen in
doc comments.

Everything outside the constants now reads `/syn/doc-sync/…` and names the
constant for the live value. Where a bump is itself the point — a change to
what a message *means*, which is what the convention exists for — the docs
still say a bump happened, just not which number it landed on.

Three things this turned up that were not merely stale:

- `p2p/revocation_delivery.rs`'s module header called the protocol
  `/syn/revocation`. There is no such ALPN; the constant eight lines below it
  is `/syn/membership`. NODE_REVOCATION.md had copied the wrong name twice.
- `document-sync.md` carried a per-version changelog that stopped at 6 and
  skipped 4. Rewritten as what the bumps added, keeping every cross-reference
  and dropping the numbering that rots.
- ADR 0014's title named `/syn/node-admin/1` in the heading and in the index
  row, two bumps ago. The ADR number and filename are unchanged, so links
  still resolve.

AGENTS.md gets the rule, since this is the second time it has been cleaned up
and nothing was stopping it coming back.
2026-08-31 00:32:17 -07:00
Greg ShuflinandClaude Opus 5 ecb7e41c7a AGENTS.md: scope the build detail to the trees that need it
Build Debug APK / build (push) Successful in 3m42s
The root file loads into every session, and about a quarter of it was
build guidance that only applies inside one directory. The Android block
(the three `just doctor` toolchain cases) and the two-detekt-recipes
block now live in android/AGENTS.md; the gpui block (check-gui-nix,
build-gui-nix, and why rust-analyzer.json sets checkOnSave: false) lives
in rust/gui-app/AGENTS.md. Each is reached by a one-line pointer from the
root, and each opens by saying it is scoped and that the root file still
holds the project-wide rules. 21.5k chars down to 15.5k — roughly 1.5k
tokens back in every session, whatever the session is about.

Both new files get a CLAUDE.md symlink beside them, the same arrangement
the root already uses, so Claude Code picks them up when it works under
those directories while AGENTS.md stays the name on disk.

The split has one seam worth knowing about: the Kotlin lint entry warns
that a suddenly-slow `just lint-kotlin` means rust/lib/build.rs is
rebuilding, and that file sits outside android/, so the warning is not
loaded when you are the one editing build.rs. It stays in android/ anyway
because that is where someone hits the symptom.

Also dropped four lines the codebase already answers: the camelCase and
explicit-types conventions, the standard --tests invocation for a single
Gradle test, and an Architecture: line that still said JNI where the rest
of the file describes uniffi.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7prPWuHReKauUzU34qyCh
2026-08-26 10:21:31 -07:00
Greg Shuflin e085ba683d copy: revocation says the same thing on every modality
I shipped four paraphrases of the same sentences. The desktop said a retired
node "prints" a record, Android and the TUI said it "shows" one; the revoke
dialog explained itself in three different ways; the self-revoked banner had
four wordings across GUI, Android, TUI and CLI.

copy::revocation is now the single definition, and every modality imports it —
the three Rust ones directly, Android through revocation_copy() in
ffi/free_fns.rs alongside placeholder_copy and action_labels. The sentences
that carry a node's name are their own exported functions, since a record of
constants cannot interpolate.

These are load-bearing rather than decorative: they are what tells someone that
revoking a node does *not* wipe it, that a retirement nobody heard can still be
repaired, and what "wipe now" costs. Four answers to that is four answers.

CLAUDE.md gains the rule, including the part I got wrong — paraphrase across
modalities is the same defect as duplication and harder to spot, and the
derivation belongs in copy.rs too, not just the strings.
2026-08-26 02:46:36 -07:00
Greg Shuflin 07fe09670f just: a recipe for the Kotlin unit tests, which can take a filter
There was none — Kotlin tests were run as `just gradlew test`, the raw
incantation the justfile exists to codify, and CLAUDE.md documented
`--tests` against it. Under AGP 9 that combination cannot work: `test` is a
lifecycle task owning no test executor, so it rejects the option and leaves
no way to run a single test; it also runs both variants' suites, which is the
same tests twice. `unit-tests-kotlin` runs testDebugUnitTest and forwards
args, matching unit-tests-rust/-gui.
2026-08-26 00:11:45 -07:00
Greg Shuflin 9127726ddb SQL: a value goes in a ?, and a lint that says so
Build Debug APK / build (push) Successful in 3m49s
`SyncRequest.since` is an `Option<String>` the *requesting peer* chooses, and
it reached `format!(" AND modified_at >= '{s}'")` verbatim in three sync
queries. rusqlite compiles only the first statement, so this was not
`; DROP TABLE` — but closing the quote and appending `OR '1'='1` defeats the
document-scope filter, and a correlated subquery is a boolean oracle over every
table in store.db, `secrets` included. That is strictly more than syncing
already grants an admitted member.

Two layers. At the boundary, `wire_time::wire_since` parses the value as
RFC3339 and re-renders it, so what travels onward is this node's own string and
never the peer's bytes; a malformed `since` fails the request rather than
quietly widening it to the whole catalogue. In the store, `SyncScope` replaces
the four hand-written `WHERE` tails those queries each built for themselves —
it hands back a predicate and the values to bind together, so there is no way
to use it that puts a caller's string into SQL text. An empty id scope now
means "no documents" instead of `IN ()`, which was a syntax error.

The rest of the tree got the same treatment while it was open: the search
queries' doc-type and provenance filters, and the set-element backfill, all
emit `?`s now. `placeholders(n)` is the one way to build a list of them.

And `just lint-sql-params`, because the bug is invisible at the call site —
whether that `format!` is a security hole depends entirely on where `s` came
from, which the line does not say. It flags an interpolation wrapped in SQL
quotes, or sitting where only a value can go, in any file that mentions
rusqlite; it deliberately does not flag an interpolated identifier or fragment,
which would mean a marker on nearly every query and no one reading any of them.
Three sites are left, all splicing one CASE expression built from closed enums,
each carrying a `// sql-literal-ok:` with its reason.
2026-08-25 03:13:31 -07:00
Greg Shuflin 71b9c16954 gui: cap the four remaining uncapped detail screens, and stop forking the idiom
Build Debug APK / build (push) Successful in 3m54s
**Correction to the commit that added `detail_form`.** Its message said
`CONTENT_MAX_WIDTH` "already existed and documented exactly this problem, with
no consumers". The second half is wrong: it has eleven call sites across eight
files, and a documented house shape in `sizing`'s module docs. The claim came
from grepping `CONTENT_WIDTH`, which is not a substring of `CONTENT_MAX_WIDTH`
and therefore matched nothing. That commit is already on master@origin, so
this corrects it forward rather than rewriting it.

The consequence was a forked idiom: `detail_form::reading_column` wrapped the
body in an extra capped div, where every other screen puts a plain
`.max_w(CONTENT_MAX_WIDTH)` on the scrolling body itself. One idiom with a
dozen call sites beats two with thirteen, so `reading_column` is gone and
`human.rs` uses the house shape. `labeled_row`/`row_label` stay -- the
label/value grid is genuinely new -- and the module now says width is not its
job and points at where that lives.

**The sweep.** Every `overflow_y_scroll`/`uniform_list` in gui-app, against
whether its file caps. Four screens were detail-shaped and uncapped:

- `agents/jobs.rs` -- a job row is `justify_between`, so its label and its
  state/progress sit at opposite ends of the window.
- `agents/podcasts/queue.rs` -- controls stranded from the episode they act
  on, the same shape the subscriptions list beside it already fixed.
- `agents/podcasts/episode.rs`, `agents/podcasts/detail.rs` -- detail bodies.

Deliberately left uncapped, and why: the document table, presence view and
media library are grids where width *is* the information; `agent_sidebar`,
`hierarchical_sidebar`, `scrollbar` and `settings/widgets` are already narrow
or are components that should let their host decide; `settings/mod.rs` is a
shell whose three tabs each cap themselves.

Left as an open question rather than changed: `agents/notes/mod.rs`'s editor
and preview panes, and `components/markup_view.rs`. Both are prose surfaces
where a measure cap is arguably right and arguably not, markup_view is a
component with several consumers, and Split mode already halves the width --
that is a typographic decision to make deliberately, not a sweep's business.

CLAUDE.md's rule is rewritten to describe the real idiom, and gains the
uncapped cases.

Verified: cargo check/clippy --all-targets clean, 218 tests pass, just
lint-gui-layout clean. Not visually inspected -- four screens changed width.
2026-08-24 13:46:21 -07:00
Greg Shuflin 8b7e39bc3c CLAUDE.md: a label/value list is two-column on desktop, stacked on Android
Build Debug APK / build (push) Successful in 5m0s
Records a divergence rather than introducing one -- the previous commits left
the desktop profile as a label/value grid and Android's stacked, and without
this that reads as drift for the next person to compare the two.

The reasoning is width, not platform taste. A desktop `reading_column` is
1040px and leaves the value ~870 beside a 160px label column; a phone's
content width is ~330-380dp, leaving 156-208, which wraps long values to
three lines and makes each row taller than the stacked version it would
replace. That is the same split the desktop and mobile versions of the same
apps make -- macOS and GNOME Contacts are two-column, iOS and Google Contacts
stack.

Written as "don't make them match", because the tidying instinct is the
failure mode here. The genuinely open question is a tablet or foldable, not a
phone: the app has no adaptive-layout machinery at all (no WindowSizeClass,
no BoxWithConstraints), so Android's choice is unconditional today, and
introducing that machinery is worth doing on its own merits before it is
worth doing for this.

Pointers at both ends -- `read_only_row` and `ReadOnlyField` each name the
other -- so someone reading either screen finds the reasoning without having
to already know the rule exists.

Verified: just check-gui-nix and just lint-kotlin clean.
2026-08-24 13:35:36 -07:00
Greg Shuflin d9015d7360 humans: editable fact values, a capped reading column, a label/value grid
Four things the desktop screen got wrong, from a look at it on a 4K display.

**Fact values are editable.** A fact row was read-only with a Remove button,
so correcting a typo meant deleting the row and retyping both halves. The
value is now a field; the *key* stays fixed, because the (key, value) pair is
what the store derives the artifact id from -- "renaming" one is a delete plus
an add, and a text field there would promise an in-place edit that does not
exist. An edited value reaches `save_current` as exactly that remove/add pair,
which `diff_staged` already produces without knowing it was an edit. Clearing
a value deletes the fact: a blank value is not a fact, and clearing the field
is the obvious way to say so.

`FactEdit` (key + live `TextInput`) is what the form holds; `orig_facts` stays
plain `FactRow` data, and `staged_facts` reads the fields back for the diff.

**Save commits a filled entry row.** Typing a fact in full and pressing Save
lost it -- only Add staged it. Save now folds both entry rows in first. A row
with one of its two fields filled is an unfinished edit and *stops* Save with
a message on the field rather than being dropped, which is the same bug in
quieter clothes. `add_fact`/`add_contact` return whether Save may proceed.

**The form no longer spans the window.** Every row stretched the full width,
so on a 4K monitor the Add and Remove buttons sat 2400px from their labels.
`sizing::layout::CONTENT_MAX_WIDTH` already existed and documented exactly
this problem, with no consumers; `components::detail_form::reading_column` is
the general way to take it, applied here to both tabs. The module explains why
`max_w` is right there and not the banned `flex_1`-plus-`max_w`: the column
sets no `flex_1`, so its width is ordinary cross-axis sizing resolved before
its children are placed. The `flex_1` stays on the scroll container outside it.
CLAUDE.md gains the rule, and `LABEL_COLUMN_WIDTH` joins the sizing tokens.

**View mode is a label/value grid.** Label in a fixed left column, value
beside it -- the property-list shape used wherever values are short (macOS and
GNOME Contacts, Notion, Linear). Values on this screen are one line apiece, so
stacking doubled the screen's vertical run to align things already aligned.
Two exceptions: an empty collection collapses to a single "Not recorded" row
rather than a heading with an apology under it, and Notes keeps its label
above full-width prose, since a paragraph in the value column gets a measure
too narrow to read -- which is why it also moves to the end of the form. Edit
mode stays stacked: an input needs the width. A fact key with several values
is written once with its values stacked beside it.

Verified: cargo check/clippy --all-targets clean, 218 tests pass, just
lint-gui-layout clean. Not visually inspected -- needs a look.
2026-08-24 13:02:30 -07:00
Greg Shuflin ac87464e37 CLAUDE.md: editing is a mode, and the mode is the whole screen
Writes down the rule the previous two commits implement, as TODO.md's Humans
entry asked ("a note in CLAUDE.md that all editable fields should work this
way"), and removes that entry.

The substance beyond "have an edit mode" is the three things that went wrong
on the Humans screen and would go wrong again unprompted:

- Collections on a form are staged like its fields, whatever the store does
  underneath. "Each row is its own artifact, so there's nothing to batch
  behind Save" is the reasoning both frontends independently used to write
  facts and contact methods straight through, and it is a fact about storage
  rather than a licence -- it makes Save mean two different things on one
  form and leaves a removal unrecoverable.
- Cancel and reload are one code path, because they are one act. Named
  because the desktop's fields live in TextInput entities rather than in the
  screen's own struct, so a Cancel that dropped only the staged collections
  would have left a cancelled rename on screen.
- Not everything on a screen is part of its form. An interaction is its own
  document shared with its other attendees, so it is written when the user
  says to write it and stays outside the mode. The test is field-of-record
  versus record-of-its-own, not "is it on this screen".
2026-08-24 13:02:30 -07:00
Greg Shuflin ac83271875 CLAUDE.md update
Build Debug APK / build (push) Successful in 4m10s
2026-08-24 00:53:02 -07:00
Greg ShuflinandClaude Opus 5 f6fc542372 AGENTS.md and TODO: alert-don't-apply now has three worked examples
The design principle listed the desktop's and the TUI's; Android's is the
third, and `IncomingBody.alertFor`'s doc comment is where the rule for
telling their write from ours is actually written down.

What's left is narrower than the item it replaces: the alert itself works,
but Android's state lives in the `NotesScreen` composable, which
navigation disposes — so leaving with the choice unanswered drops the
unsaved buffer and returns to their version. That is one of the acts
AGENTS.md lets the incoming version through on, so it is the right
outcome; it just happens silently, and the desktop keeps its banner.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PZKNoVdLEtNvcbgCpc9Bq6
2026-08-23 21:18:42 -07:00
Greg ShuflinandClaude Opus 5 fb086f69c8 ADR 0041 and TODO: record the change-signal generalization
Also drops the provenance repair-path item: it needs a pre-0038 peer to
have synced first, and this project has no old clients to be compatible
with at this stage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PZKNoVdLEtNvcbgCpc9Bq6
2026-08-23 21:18:42 -07:00
Greg Shuflin 29f21c033d gui: update gpui to 7913984 and fix the palette color API break
gpui-ce moved its color types onto the `palette` crate — `Hsla`/`Rgba` are
now re-exports of `palette::Alpha<Hsl/Rgb, f32>`, so the old
`From<Rgba> for Hsla` is gone and conversion goes through palette's
`IntoColor`. gui-app takes `palette` as a direct dependency (pinned to
gpui's own 0.7.6) so it can name that trait:

- `components::note`'s three helpers take `impl IntoColor<Hsla>`, matching
  gpui's own `text_color`; that alone fixes every note/fill_note/overlay_note
  call site passing a theme `Rgba`.
- `HighlightStyle`/`TextRun` colors built from theme `Rgba` use
  `.into_color()` instead of `.into()`.

Two other API changes in the same bump:
- `TextRun` gained `letter_spacing: Option<Pixels>` — `None` everywhere we
  build one.
- `flex_shrink()` now takes an f32; the old no-arg form is `flex_shrink_1()`.
  Renamed the two call sites and the sizing/AGENTS.md notes that name it.
2026-08-23 02:43:29 -07:00
Greg ShuflinandClaude Opus 5 cb017f582a gpui: virtualize HierarchicalSidebar with uniform_list
Build Debug APK / build (push) Failing after 8m7s
The tree sidebar looped over every uncollapsed row each render — the same
plain `.children()` shape MediaLibrary shed on 2026-08-18, and on the
collection that grows fastest, since a notebook is what a user adds to every
day. It now uses uniform_list, which builds and lays out only the rows in the
viewport.

Three things uniform_list demands in return, because it measures row 0 and
gives every row that height:

- No gap between items. The 1px inter-row separation moves inside the item,
  as a row_slot wrapper padding below a row of exactly control::ROW.
- The inline rename editor can no longer grow its row (min_h -> h). TextInput
  gains a compact() variant whose tighter vertical padding lets the whole
  field — border, padding, and a 20px line — sit inside a 32px row.
- Scrolling moves to a UniformListScrollHandle; the hand-rolled scrollbar
  reads the plain ScrollHandle that one wraps, via plain_scroll().

And one behaviour change worth knowing about: while a rename is in progress
the list anchors to that row. The editor exists only while its row is
rendered, and a field that stops being rendered loses focus, which the sidebar
reads as a click-away and commits — so scrolling the row out of view would
silently commit the rename. It can still be scrolled to either edge of the
viewport, just not past.

ADR 0037 records the cross-modality convention this completes, and TODO.md's
entry is retired into it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CbS8L587Q6qxbnZt1QHoxg
2026-08-23 01:11:51 -07:00
Greg ShuflinandClaude Opus 5 29c493b6f8 dev: stop editor rust-analyzer from running cargo outside the devShell
Build Debug APK / build (push) Successful in 8m11s
rustaceanvim overrides rust-analyzer's own defaults when `cargo-clippy` is on
PATH (config/server.lua): it forces `checkOnSave = true` with
`check.command = "clippy"`, so every write to a Rust buffer runs clippy across
the whole workspace. That cargo invocation happens outside `nix develop`, where
this workspace's native deps can't build — observed in a rust-analyzer log as
`failed to run custom build command for alsa-sys` / `yeslogic-fontconfig-sys`.
So it recompiles a large dependency tree on every save, dies in a build script,
and returns no diagnostics at all. It doesn't even share artifacts with a real
build: the editor drives the rustup toolchain while flake.nix pins 1.92.0.

`rust/rust-analyzer.json` turns it off, and excludes the archived slint GUI from
indexing. rustaceanvim looks for that filename at the cargo workspace root,
which `cargo metadata` reports as `rust/` for every crate here. Keys are flat
and dotted rather than nested so a developer's own machine-specific settings
merge with these rather than replacing them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172MSMpGA7YaqAHkUSSo8bo
2026-08-22 23:56:50 -07:00
Greg ShuflinandClaude Opus 5 cf9f7754e3 gui: give the settings node-name field a definite width, and lint the shape that broke it
The field was `div().flex_1().max_w(FIELD_MAX_WIDTH)` — the same
grow-then-clamp shape that gave the Notes search field 2px of input inside a
630px box. With free space larger than the cap, the frame's final width comes
from growing and then being clamped, but its children were laid out against
its max-content width and are never replaced, so the field drew as a slice too
narrow to read what was being typed into it.

- `render_node_name` now takes a definite `.w(FIELD_WIDTH)` plus
  `flex_shrink()`/`min_w(px(0.))`, so it still gives way to the Save button on
  a narrow window — the only half of growing that was doing real work.
- `FIELD_MAX_WIDTH` -> `FIELD_WIDTH`: it is a definite width, and its old name
  is what invited `.max_w()`.
- `sizing.rs`'s `layout` docs blessed `.flex_1().max_w(TOKEN)` for "a field
  sharing a row with something else" and named this very function as the
  example. That exception is why the bug came back; it's gone.
- `just lint-gui-layout` (scripts/lint-gui-layout.py) now fails on `.flex_1()`
  and `.max_w()` in one element chain. It matches parens rather than lines, so
  an exploded chain and a `.child(div()...)` argument are each seen correctly,
  and it exempts chains that also declare `.flex_col()` — there `flex_1` grows
  height and the cap is on the untouched cross axis. Clippy cannot see this
  class: both calls are perfectly ordinary on their own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172MSMpGA7YaqAHkUSSo8bo
2026-08-22 23:41:04 -07:00
Greg ShuflinandClaude Opus 5 7e7cafe7d0 docs: correct the Kotlin lint timings in AGENTS.md
Build Debug APK / build (push) Successful in 16m42s
AGENTS.md told agents to budget ~14-15 min for `just lint-kotlin` and pointed
them at `lint-kotlin-fast` as the practical alternative. That cost was the
build-sha rebuild, and it is gone: warm, the recipe is 2s with nothing changed
and 26s after a Kotlin edit. Left as written, the guidance would send a future
session planning around a two-second command — and toward the fast recipe,
which cannot see the six type-resolution rules that are the whole reason
lint-kotlin exists.

A genuinely cold tree still pays ~15 min to build the aarch64 dependency tree
once, so that number stays, scoped to the case it applies to.

Also records the failure signature, since this is a regression that hides well:
if the recipe takes minutes again with nothing changed, look at lib/build.rs
first, and the tell is rustc running during a lint.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016n5WWHbMmck6B6LM67Vi8a
2026-08-22 02:57:23 -07:00
Greg Shuflin 2afb6fff51 docs: record the flex_1-plus-max_w layout trap in CLAUDE.md
Build Debug APK / build (push) Successful in 21m23s
The failure it produces is silent, contents-dependent, and looks like a
bug in the child rather than the container — worth stating next to the
other gpui sizing rules so it isn't rediscovered by instrumenting a text
element again.
2026-08-22 02:55:45 -07:00
Greg Shuflin 80bc85d745 android: emit uniffi bindings as generated sources, not into the source root
Build Debug APK / build (push) Successful in 20m53s
uniffi's Kotlin bindings were written into
android/app/src/main/java/com/gregshuflin/synchronicity/uniffi/ — an untracked
build output living in a tracked source root. Everything around it was a
workaround for that: a .gitignore entry, and three separate tooling exclusions
(the ktfmt SourceTask filter, Detekt, DetektCreateBaselineTask) to keep
formatters and linters off a file none of them should touch. `gradlew clean`
also could not remove it, so a file generated from an older .so could survive
indefinitely.

Emit them under the module's build/ directory instead, handed to AGP through
the Variant API: a GenerateUniffiBindings task with a DirectoryProperty output,
wired per variant with variant.sources.kotlin.addGeneratedSourceDirectory. That
carries the task dependency with it, so preBuild no longer needs to list the
task. The Android SourceSet API was the obvious route but AGP 9 rejects a
Provider there outright, pointing at the Variant API precisely so Studio can
tell generated from static sources.

The justfile recipe now takes the output directory as a parameter; Gradle
passes the per-variant path AGP chose. The task is named
generate<Variant>UniffiBindings now, since addGeneratedSourceDirectory owns the
output location and so cannot share one task between variants.

Verified that ktfmtCheck and detektDebug no longer see the generated file at
all (0 matching source entries) with the exclusions deleted, that clean removes
it, and that a from-scratch assembleDebug regenerates it.

The one argument for the old arrangement — reading the Kotlin FFI surface on a
machine with no Android toolchain — was already moot: the directory was
gitignored, so a fresh clone never had it either.
2026-08-21 20:13:35 -07:00
Greg Shuflin 2e4d133d35 justfile: move the extension recipes into browser-extension/justfile
The three extension recipes only ever touched browser-extension/, so they now
live there as a just module: `mod extension 'browser-extension/justfile'` in
the root justfile, reached as `just extension build`/`check`/`dev-path`, or
as bare `just build`/`check`/`dev-path` from inside browser-extension/.

just runs a module's recipes with the working directory set to the module's
own directory, so the recipes drop the repeated `browser-extension/` prefix
and refer to `src/` and `dist/` directly; `../rust` reaches the workspace for
the check recipe's cargo invocation.

The names lose their now-redundant `-extension` suffix, so every reference to
them moves with them: flake.nix, AGENTS.md, the extension README, discovery.js,
and syn-daemon's lib.rs and browser_extension.rs comments.
2026-08-21 03:47:25 -07:00
Greg Shuflin 80eb8526c0 TODO/CLAUDE: awaiting the network is the rule, not an open question
Build Debug APK / build (push) Successful in 22m36s
The 'blocking network work must not occupy a UI worker thread' entry is done,
so it leaves TODO.md; what replaces it is a design principle, since the next
agent that reaches the network needs to know the answer before it writes the
call, not after.
2026-08-20 05:40:14 -07:00
Greg ShuflinandClaude Sonnet 5 ed31c08bf5 docs: further trim CLAUDE.md/AGENTS.md fat
Compress Project Overview from scene-setting prose to the load-bearing
facts, tighten the just-doctor/justfile intros, the Nix Android-toolchain
bullet, the build-gui-nix and Two-Kotlin-lint-recipes bullets, and the
gstack branch-identity bullet — cutting restated rationale and historical
color while keeping every concrete command, name, and number.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zrXcdUHfxGmgWta4pNN8B
2026-08-16 03:06:39 -07:00
Greg ShuflinandClaude Sonnet 5 3e24381f4f docs: tighten sizing/typeface/scroll bullets in CLAUDE.md
Trim restated rationale now that it's redundant with what ADR 0024 and the
sizing module's own doc comments already cover; keep the enforceable rule,
the concrete API names, and the pixel-exception list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zrXcdUHfxGmgWta4pNN8B
2026-08-16 02:57:46 -07:00
Greg ShuflinandClaude Sonnet 5 f1b40f1dec docs: trim CLAUDE.md/AGENTS.md — dedupe Kotlin lint explanation, merge VCS bullets, fix typos, and sharpen the jj commit-message directive into an explicit jj describe -m / jj new instruction
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zrXcdUHfxGmgWta4pNN8B
2026-08-16 02:52:29 -07:00
Greg Shuflin c617166109 CLAUDE.md tweak
Build Debug APK / build (push) Successful in 38m14s
2026-08-16 02:21:33 -07:00
Greg Shuflin dabd6c0d1f AGENTS.md tweak
Build Debug APK / build (push) Successful in 24m51s
2026-08-15 04:15:52 -07:00
Greg ShuflinandClaude Opus 5 50de992bb8 docs: a sync must never disrupt what the user is doing, as a principle
Build Debug APK / build (push) Successful in 21m53s
This was a two-line TODO entry, which is the wrong shape for it. Data
arriving from another node is the normal case in this system, not an event,
and "don't yank the thing the user is holding" is not a feature anyone
finishes — it is a constraint every agent and every modality has to satisfy
for as long as the project exists. A backlog item gets done and deleted; a
principle gets checked against.

AGENTS.md grows a Design Principles section for it, stated concretely enough
to argue with: alert in place rather than apply, name what each answer costs
because with whole-buffer writes both of them cost something, and stop
writing over a pending change while it is pending. It points at the two
implementations that now exist rather than describing them again. Two
neighbours move in beside it — absence is not an error and an empty editor
is a lie, and the instant-feedback invariant, which was likewise stated in
one document and observed everywhere.

TODO keeps what remains genuinely undone: Android's editor still does none
of this, and the whole conflict UI is downstream of whole-buffer saves — an
editor emitting incremental ops merges both sides instead, and makes the
choice a rarity rather than the normal path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01846bHy18nLBVn8inzmBLkk
2026-08-15 03:52:23 -07:00
Greg Shuflin a97535630e add a directory for design explorations
Initially with the typeface design checks.
2026-08-09 02:37:14 -07:00
Greg ShuflinandClaude Opus 5 b61cdc1bfa docs: ADR 0024, the typography decision
Build Debug APK / build (push) Failing after 23m33s
Records what was measured rather than what was assumed. Two findings inverted
advice given earlier in the design discussion:

  * A CJK-monospaced font is necessarily a narrow-Latin font. Keeping Japanese
    on the grid needs a CJK:Latin advance ratio of exactly 2.000, which forces
    the Latin to 0.500em — Cascadia Mono (0.586) and JetBrains Mono (0.600)
    are both squeezed in their CJK-capable cuts. The narrowness is arithmetic,
    not taste.
  * Inter pairs with Japanese better than Source Sans 3 does, despite Source
    Han Sans embedding Source Sans as its Latin. What governs the seam is
    x-height parity: Inter 0.546 against Noto Sans CJK's 0.543, versus Source
    Sans 3's 0.478.

Also records why Cascadia is out (no CJK at all; the official Cascadia Next JP
pre-release is missing 日, 一, 人, 大, 十, 二 and ~30 of the 80 commonest
kanji, verified against every cmap subtable), and that jj silently refuses to
snapshot the larger vendored faces until snapshot.max-new-file-size is raised.

Closes the TODO item that prompted this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WEEHetSTuEH5amjXVKPVn
2026-08-08 19:57:33 -07:00
Greg ShuflinandClaude Opus 5 68cae0069c docs: ADR 0022 Accepted; record the two designs that changed under contact
Build Debug APK / build (push) Successful in 37m58s
Flips ADR 0022 from Proposed to Accepted and rewrites it to describe what
survived implementation rather than what was designed. Two parts changed, and the
measurements are more useful than the original reasoning, so they are recorded in
a "What changed under contact" section rather than quietly edited out:

- The kotlinx.coroutines.launch ban was implemented, measured at 47 sites of which
  ~44 were legitimate, and dropped. Its premise — that an unguarded launch is how a
  throw escapes — held when repositories threw; once Result is total and getOrThrow
  is gone, IgnoredReturnValue catches an unhandled failure at the ignored Result
  itself. Enforcing on the builder was a proxy for something we can now check
  directly. Residual gap stated and accepted.
- The load-bearing config line turned out to be `ignoreFunctionCall: [kotlin.onFailure]`,
  not `returnValueTypes: [kotlin.Result]`. Must-use Result alone flags every handled
  failure (59 findings, ~50 noise); ignoring onFailure while deliberately not ignoring
  onSuccess takes it to 2, both real.

Also corrects two things the design got wrong: retryOnBusy should not "widen its
catch to match" (retrying an NPE is pointless — it now retries any failure because
a wrapped bug is indistinguishable from lock contention), and banning getOrThrow
does not close the class, only its common spelling, since `getOrElse { throw it }`
is invisible to ForbiddenMethodCall.

States the yield honestly: 132 findings, ~8 real defects. That is a good return on
four config lines, but "132 findings" would overstate it.

AGENTS.md gains a Kotlin-lint section documenting the two recipes and, importantly,
that the fast one validates detekt.yml in 13s where the real one takes 15 min — and
the measured ~14-15 min cost of lint-kotlin, replacing the old "detekt finishes in
seconds" claim which is now true only of lint-kotlin-fast.

TODO.md's entry is closed and replaced with what was deliberately left open: widening
Rust's SyncError variants (the prerequisite for UI retry affordances and for any
future compiler-exhaustive Outcome type), the getOrElse-throw hole, LaunchedEffect,
and InjectDispatcher.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WEEHetSTuEH5amjXVKPVn
2026-08-08 10:54:10 -07:00
Greg ShuflinandClaude Opus 5 09a205b142 docs: record that the full Kotlin toolchain now runs under nix
Follow-up to the justfile JAVA_HOME fix. Both AGENTS.md and the Android
dependency-modernization TODO entry still described the pre-fix limitation —
that a machine without Android Studio could compile the app via
build-android-nix but could not run Kotlin unit tests, detekt, or ktfmt.

That is no longer true. Verified on a machine with no local Android toolchain:
`nix develop --command just gradlew test` BUILD SUCCESSFUL in 14m 1s
(testDebugUnitTest executed), `just fmt-kotlin-check` and `just gradlew detekt
--rerun-tasks` both succeed in seconds. Note the asymmetry in AGENTS.md: tasks
depending on buildRustLib pay a full aarch64-linux-android release build first,
detekt/ktfmt do not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WEEHetSTuEH5amjXVKPVn
2026-08-05 02:34:18 -07:00
Greg ShuflinandClaude Opus 5 d6b722aae1 AGENTS.md: correct the stale Android build-capability instructions
The Android bullet claimed there is no Nix-sandboxed Android build and pointed
at a TODO.md entry for adding one. That recipe now exists (just
build-android-nix), just doctor advertises it, and the referenced TODO entry is
gone — so the instruction was telling agents to report Android changes as
unverifiable on machines where they can in fact be compiled.

Replace it with the three cases doctor actually distinguishes, and record the
real limitation of the Nix path: build-android-nix covers assembleDebug only,
because just gradlew/lint-kotlin/fmt-kotlin export JAVA_HOME unconditionally
(unlike android-build) and so fail even inside the devShell. Kotlin tests,
detekt, and ktfmt remain unrunnable without a local toolchain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WEEHetSTuEH5amjXVKPVn
2026-08-05 02:34:18 -07:00
Greg ShuflinandClaude Opus 5 b882c9811a docs: record the gpui sizing and scroll-container rules
Two conventions the sizing work established that aren't discoverable from
the code alone, both of which fail quietly rather than loudly.

A hard-coded `px()` in render code looks correct and renders correctly at
100% zoom; it just silently stops following the zoom control. And a
`flex_1` scroll container without `min_h(px(0.))` sizes to its content
instead of the space available, so `overflow_y_scroll` never gets a bounded
height and the content below the fold becomes unreachable — which is how
the document detail screen shipped.

Both were rediscovered the expensive way during this work, so they belong
next to the other cross-cutting UI rules rather than only in `sizing`'s
module docs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WEEHetSTuEH5amjXVKPVn
2026-08-04 00:17:44 -07:00
Greg Shuflin 44f90cec79 AGENTS.md: add note about rstest 2026-08-02 02:23:13 -07:00