refactor 2

This commit is contained in:
2026-09-13 12:20:49 +07:00
parent a4dcbbc560
commit 025fd15837
9 changed files with 124 additions and 128 deletions
+24 -11
View File
@@ -1,6 +1,6 @@
# Repository state and panel flow plan
Status: proposed (2026-09-13)
Status: phases 1-2 implemented, phase 3 next (2026-09-13)
Builds on `docs/backend-rearchitecture.md`, especially §7 (notify audit),
§11 (split independently-observed state), §12 (one debounce at the source)
@@ -237,10 +237,8 @@ flow for announced repositories.
- `open_repo_item(dock_area, addr: &RepoAddr, item, window, cx)`.
- Inbox passes its already-parsed `address` (`signed_core::InboxItem.address`,
the root event's `a` tag) and drops the `RepoListStore` lookup.
- `open_upstream` drops the 60 x 250 ms wait loop: the store's
`repo_filters` already include the announcement filter and
`subscribe_remote` runs on creation, so the panel opens immediately and
fills in.
- `open_upstream` no longer polls the list; it opens the panel by address and
the store fills it in (Phase 2).
- `RepoItem::Patch` behavior is unchanged.
## Phases
@@ -271,17 +269,32 @@ Status: implemented, except step 6.
### Phase 2 - entry points by identity
1. `views/repo/actions.rs`: `repo_store(addr, hint, cx)`;
`open_repo_item(addr, ...)`; `open_upstream` opens directly.
2. `views/inbox.rs`: pass `address`, delete the announcement lookup and its
silent early-return.
Status: implemented.
1. `views/repo/actions.rs`: `repo_store(addr, hint, cx)` seeds the store's
relays from an optional hint but needs nothing else; the store loads the
announcement itself. `open_repo_item(addr, hint, item, window, cx)` takes
the address, not a hydrated announcement.
2. `views/inbox.rs`: `open` passes its already-parsed `address` and the
`RepoListStore` lookup with its silent early-return is gone. An inbox row
opens whether or not the repository is in the list yet.
3. `open_repo_panel` and `RepoDetailView::new` take an address plus an optional
hint, so a repository panel opens from a `RepoAddr` alone. This pulls the
address-based constructor forward from Phase 3 step 2.
4. `RepoDetailView::attach_store` adopts the store's first announcement when
`initial` is still empty and calls `load_repo`, so a panel opened by address
fills in instead of waiting for the caller to have the announcement.
5. `open_upstream`: the 60 x 250 ms poll and the `pending_upstream` field are
gone. It opens the panel by address; the store's `subscribe_remote` fetches
the announcement from the bootstrap relays and step 4 loads the explorer.
### Phase 3 - one entity for local and NIP-34
1. `signed_state/src/repo.rs`: `addr`/`path` options, `new_local`,
`announce`, `Option<Subscription>`, action guards.
2. `views/repo/mod.rs`: single `store` field; `new`/`new_local`; header,
display name, `load_repo`, `open_init_dialog` derive from the store.
2. `views/repo/mod.rs`: single `store` field; `new_local`; header,
display name, `load_repo`, `open_init_dialog` derive from the store. The
address-based `new` is already in place from Phase 2.
3. `views/repo/store.rs`: always observe; `refresh_statuses` returns false
when not announced.
4. `views/repo/actions.rs`, `header.rs`, `banners.rs`: drop