From 3dfd15f9c10f3f1038ae7bdb77a9dc3a4b2d4cbb Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 24 Aug 2026 00:14:23 -0500 Subject: [PATCH] Checkpoint: feed profile filter --- CHECKPOINT-encryption.md | 87 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/CHECKPOINT-encryption.md b/CHECKPOINT-encryption.md index 40adc19..c2fa125 100644 --- a/CHECKPOINT-encryption.md +++ b/CHECKPOINT-encryption.md @@ -1,4 +1,89 @@ -# Checkpoint — Note publish latency trim (2026-08-24) +# Checkpoint — Feed "My notes" profile filter (2026-08-24) + +A stopping point you can return to if this session is closed. Everything below was +verified green at the moment this file was written. + +## Where things are + +- Project: `/home/avi/Projects/Nostr_Keynctr` +- Git repo: `master` @ `55a49b4` ("Feed: 'My notes' scope with per-profile + dropdown filter"). Before it: `b001b3c` (note publish latency trim), `8f63761` + (checkpoint), `2ad054e` (NIP-05 checkpoint). +- Working tree is **clean** apart from this checkpoint update, which is committed right after. + +## What was completed + +1. **Feed "My notes" scope (2026-08-24, `55a49b4`).** The Feed screen now has a + third scope button next to *Everyone* and *My contacts*: + - **My notes** shows only posts published by one of the user's own profiles. + It defaults to the currently selected (active) profile. + - While active, a **dropdown** lists every stored profile (`Label (active)`); + picking one re-fetches the feed filtered to that account's npub. + - Disabled (with tooltip) when no profiles exist; dedicated empty state when + a profile has no recent notes. +2. **Backend support:** new `feed::profile_feed()` (author-filtered variant of + the shared aggregate query); IPC `feed_get` gained an optional `author` + param (npub or hex) that takes precedence over `contacts_only`; author key + parsing happens outside the state lock so slow relays still never block + interactive requests. +3. Earlier today: note-publish latency trim (`b001b3c`) — no global connection + wait, parallel sends, 6 s per-relay cap in `src/publish.rs`. + +## Commits added most recently + +- `55a49b4` Feed: 'My notes' scope with per-profile dropdown filter +- `b001b3c` Trim note publish latency: skip global connection wait, parallel sends, 6s cap + +## Verification commands run (all green) + +Rust (repo root): + +``` +cargo test # 104 passed; 0 failed (2 new profile_feed tests) +cargo clippy --all-targets # only pre-existing warnings in src/profiles.rs +cargo fmt --check # clean +cargo build --release # success +``` + +Frontend (`frontend/`): + +``` +npm test # 14 files, 87 tests passed (3 new FeedScreen tests) +npm run typecheck # clean +npm run lint # 0 errors +npm run format:check # clean +npm run build # vite build success +npm run electron:build # tsc electron main success +``` + +## How to use / reproduce + +GUI: `cd ~/Projects/Nostr_Keynctr/frontend && npm start` → **Feed** → click +**My notes** (third segment). The feed reloads showing only the active profile's +notes; switch accounts with the dropdown that appears next to it. + +CLI (existing commands unchanged): + +```bash +B=~/Projects/Nostr_Keynctr/target/release/keynectr +$B feed [limit] # everyone +$B feed --contacts # contacts of active profile +``` + +## Notes & next steps + +- Possible follow-up: expose `--author ` on the CLI `feed` command for + parity with the GUI scope (IPC already supports it). +- Feed reads are bounded to the last 24 h (LOOKBACK in `src/feed.rs`); "My + notes" therefore hides older posts by design — same rule as Everyone. +- Relay health (checked earlier today): damus.io 503, nostr.band WS handshake + timing out; consider disabling nostr.band until it recovers. +- Pre-existing clippy warnings in `src/profiles.rs` remain (drop of reference, + unused `delete_profile`). + +--- + +# Older checkpoint — Note publish latency trim (2026-08-24) A stopping point you can return to if this session is closed. Everything below was verified green at the moment this file was written.