Commit Graph
522 Commits
Author SHA1 Message Date
jack 887faa89ac Notes icon: force a one-shot location refresh before (re)subscribing the counter so icon turns blue immediately on current 8-cell 2025-09-13 13:16:29 +02:00
jack 58eb83b73a Notes sheet: add light haptic feedback when building geohash changes (iOS only) 2025-09-13 12:56:41 +02:00
jack 24cebfebf2 Notes header: bold count text; ensure sheet updates when building geohash changes by calling manager.setGeohash on geohash change 2025-09-13 12:47:23 +02:00
jack 0a151f51df Notes header: move count before title as '<N> note(s) @ #gh'; remove parentheses; keep count non-bold 2025-09-13 12:39:02 +02:00
jack 8c9bfaa20e Notes header: show count as '(N note/notes)' with non-bold, secondary styling next to title 2025-09-13 12:33:49 +02:00
jack e08e5c8e65 Notes header: show count in parentheses; icon shows blue if any notes, grey if none; only start live location updates while sheet is open; reduce nickname width; set live distance filter to 10m 2025-09-13 12:31:02 +02:00
jack 78f1bd3ad9 Notes counter: subscribe only to building geohash (precision 8) so count reflects current 8-cell; auto-begin live location refresh on mesh (and permission) to update as you walk 2025-09-13 12:19:44 +02:00
jack 6cf6e3c420 Notes: subscribe counter to building + parent block (merge results); hide notes icon unless location is authorized; replace 10s timer with live location updates while sheet open 2025-09-13 12:09:41 +02:00
jack 8cc6d538ae Notes header: show building name when available (fallback to block name) 2025-09-13 12:04:14 +02:00
jack f10e5d1788 Notes counter: show 0 by default; subscribe at building-level (precision 8) for notes and counter; keep building hidden in channel list 2025-09-13 11:59:55 +02:00
jack 5bf28e5ba4 Fix Swift 6 isolation: hop to @MainActor inside Timer callback for EOSE tracker mutations 2025-09-13 11:53:19 +02:00
jack fecebb05d5 Nostr: add EOSE handling with callback support for subscriptions; wire to LocationNotesManager/Counter (initialLoadComplete). Remove 'building' level from channel enum and geocoder mapping; geohash list shows block/neighborhood/city/province/region only 2025-09-13 11:44:37 +02:00
jack b7e76e6da4 Location notes: show block name (from reverse geocode) in header instead of 'street-level notes' 2025-09-13 11:35:23 +02:00
jack eb63a62590 Revert notes geohash selection back to block-level (precision 7); keep building level available but unused; update counter and sheet accordingly 2025-09-13 11:29:49 +02:00
jack 939adcf1cb Location notes: change notes toolbar icon to SF Symbol 'long.text.page.and.pencil' 2025-09-13 11:27:46 +02:00
jack 46ca37ceaa Switch location notes and UI helpers to building-level geohash (precision 8): add GeohashChannelLevel.building, map length 8, use building for notes selection and counter, add building name mapping 2025-09-13 11:08:38 +02:00
jack ead1d1e9a2 Location notes: append 'ago' to relative timestamps (within 7 days) 2025-09-13 10:37:05 +02:00
jack e0f69d7f59 Location notes: show timestamp as relative within 7 days, else absolute date (MMM d or MMM d, y); keep monospaced styling 2025-09-13 10:36:26 +02:00
jack cd3dea3dc4 Location notes: drop 'teleport' tag from kind-1 events; simplify note builder API and usage 2025-09-13 10:32:35 +02:00
jack 086699961d Location notes: restore timestamps in notes list; remove loading state from manager and sheet (no spinner/animation) 2025-09-13 10:31:17 +02:00
jack d0bfb179ed Location notes: move notes icon to the right of #mesh badge in toolbar 2025-09-13 01:15:15 +02:00
jack 52bdf6745b Location notes: add background counter service and show count next to notes icon on mesh; auto-subscribe to current block geohash 2025-09-13 01:12:49 +02:00
jack bef4a30ea7 Location notes: fix intermittent first load by ensuring resubscribe after geohash change, removing over-eager subscribe guard, and widening note fetch window (no since filter) 2025-09-13 01:09:35 +02:00
jack c97de7a2f8 Location notes: remove per-note relative timestamp from sheet (no seconds display) 2025-09-13 01:07:32 +02:00
jack 9fd5957f46 Location notes: remove Matrix animation; use simple spinner when acquiring location; simplify notes view layout 2025-09-13 01:04:58 +02:00
jack 7eba856f13 Location notes: inline sheet wrapper to avoid missing file in target; force location refresh and show Matrix loader until block geohash resolves 2025-09-13 01:02:20 +02:00
jack 3a3da2f66d Location notes: acquire geohash on open (force refresh) and show Matrix loader until block-level geohash resolves; add LocationNotesSheet wrapper 2025-09-13 01:00:55 +02:00
jack 52933568d7 Location notes: add close (x) button in sheet header (upper-right) using @Environment(\.dismiss) 2025-09-13 00:55:47 +02:00
jack abeab5ae94 Location notes: render note bodies with monospaced font in notes list 2025-09-13 00:52:01 +02:00
jack 4a2d83ec78 Location notes: fix duplicate state redeclaration in ContentView 2025-09-13 00:48:12 +02:00
jack 56590c8ac3 Location notes: prevent duplicate loading/subscriptions (StateObject manager, geohash captured at open, guard subscribe) 2025-09-13 00:46:50 +02:00
jack d809351ab3 Location notes: Matrix loader with 1–3s minimum display; allow multiple notes; wire notes UI from mesh toolbar 2025-09-13 00:40:41 +02:00
920dc31795 Refactor: Testable Keychain and Identity Manager (#584)
* Make static functions instance functions to be testable

* Injectable KeychainManager + Mock + updated tests

* Remove `pendingActions` from identity manager (dead code)

* Remove `getHandshakeState` from identity manager (dead code)

* Remove `getAllSocialIdentities` from identity manager (dead code)

* Remove `getCryptographicIdentity` from identity manager (dead code)

* Remove `resolveIdentity` from identity manager (dead code)

* Identity Manager: minor clean up

* Put Identity Manager behind a protocol

* Remove Keychain and Identity Manager singletons

* Tests: include MockKeychain/MockIdentityManager in project; init identityManager in CommandProcessorTests

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-09-12 14:37:34 +02:00
bb3d99bdca Fix repeated favorite notifications; route system messages to mesh; simplify favorites (#588)
* Favorites: mesh-only system message; stop reconnect resends; gate system on state change

* Favorites: remove npub resend tracking and nickname-based key migration; rely on Noise key as identity

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-09-12 14:36:32 +02:00
jackandGitHub b01cac4649 Delete Frameworks/README.md 2025-09-12 13:16:08 +02:00
4b0634d1d0 Fix/general queue (#580)
* Fix emote targeting and grammar; add tests

Prevent 'system' mis-target via peerID-derived display name in actions sheet. Correct /hug and /slap usage/error grammar by passing base command name. Improve geohash nickname resolution to match displayName with #suffix. Add CommandProcessor tests.

* Geohash ordering: strict in-order inserts and timestamp clamp

Use channel-aware late-insert threshold with 0s for geohash to keep strict chronological order. Clamp future Nostr event timestamps to 'now' to avoid future-dated items skewing order in geohash timelines.

* Trim trailing/leading spaces in geohash nicknames and tag emission

Sanitize Nostr 'n' tag values on ingest and emit by trimming whitespace/newlines to prevent trailing spaces in displayed usernames. Local nickname is already trimmed on focus loss and submit.

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
v1.3.4
2025-09-11 21:02:48 +02:00
jack 97cbe37f09 Project: add OSLog+Categories.swift to iOS/macOS targets to fix missing OSLog categories (noise/security/keychain/etc.) 2025-09-11 20:14:00 +02:00
jack b5d6e4eeb5 Merge branch 'pr/575' 2025-09-11 20:07:04 +02:00
islam a1edf29bd3 Remove unnecessary import os.logs 2025-09-11 19:03:08 +01:00
islam 5f402698a1 Extract private functions into a separate extension 2025-09-11 19:03:08 +01:00
islam 1e997e1387 Statically typed logging of KeyOperations 2025-09-11 19:03:08 +01:00
islam e602024617 Remove dead code 2025-09-11 19:03:08 +01:00
islam deb464f5d8 Remove redundant .noise 2025-09-11 19:03:08 +01:00
islam e5a415d885 Overloading .debug/.error for ‘.logSecurityEvent’
Search/Replace Strategies:

1.
Search regex: `SecureLogger\.logSecurityEvent\(\s*(.*?),\s*level:\s*\.(\w+)\s*\)`
Replace regex: `SecureLogger.$2($1)`

Sample input:
`SecureLogger.logSecurityEvent(.authenticationFailed(peerID: peerID), level: .warning)`

Sample output:
`SecureLogger.warning(.authenticationFailed(peerID: peerID))`

---

2.
Search regex: `SecureLogger\.logSecurityEvent\(\s*(.*?)\s*\)`
Replace regex: `SecureLogger.info($1)`  (`info` is the default level)

Sample input:
`SecureLogger.logSecurityEvent(.handshakeStarted(peerID: peerID))`

Sample output:
`SecureLogger.info(.handshakeStarted(peerID: peerID))`
2025-09-11 19:03:08 +01:00
islam b5382b129e Rename logError(…) to error(…) 2025-09-11 19:03:08 +01:00
islam 5d6aecfc83 Replace .log w/ explicit .debug/.error functions
This would make the intention more explicit so we can overload different logging types as well like keychain, security events, etc…

Search/Replace Strategies:

1.
Search regex: `SecureLogger\.log\(\s*(.*?),\s*category:\s*(.*?),\s*level:\s*\.(\w+)\s*\)`
Replace regex: `SecureLogger.$3($1, category: $2)`

Sample input:
```
SecureLogger.log(
    "🔄 Found favorite for '\(peerInfo.nickname)' by nickname, updating noise key",
    category: .session,
    level: .debug
)
```

Sample output:
`SecureLogger.debug("🔄 Found favorite for '\(peerInfo.nickname)' by nickname, updating noise key", category: .session)`

---

2.
Search regex: `SecureLogger\.log\((.*?)\)`
Replace regex: `SecureLogger.debug($1)` (as it’s the default level)

Sample input:
`SecureLogger.log("some text")`

Sample output:
`SecureLogger.debug("some text")`

---

3
Manual changes:
ChatViewModel line 5393 (commented code)
NostrRelayManager line 196 (commented code)
NostrRelayManager lines 346-350 (if/else logic)
NostrRelayManager line 371 (commented code)
2025-09-11 19:03:08 +01:00
islam 5ca9222fc2 Make logging categories static properties of OSLog
So we can use `.<category name>` to simplify the code.

Search/Replace Strategy:
Search text: `category: SecureLogger.`
Replace text: `category: .`
2025-09-11 19:02:32 +01:00
jack ee16ff5ff4 Fix Nostr subscriptions: connect on subscribe; handle inbound frames correctly\n\n- Call ensureConnections(to:) in subscribe() so queued REQs open sockets immediately and flush after ping\n- Correct ParsedInbound failable initializer to return parsed EVENT/EOSE/OK/NOTICE instead of always nil\n- Improves chat receipt of geohash and DM events after Tor readiness 2025-09-11 19:53:19 +02:00
IslamandGitHub 2f83433247 Refactor parsing inbound messages (#577)
* DRY + helper extension to get data from Message

* Flatten guard > do > if > switch + use `try?`

* Use failable init instead of a global function
2025-09-11 19:18:06 +02:00
IslamandGitHub e72fe50ffa Perf: Add final to classes that are not inherited (#574) 2025-09-11 19:17:04 +02:00