mirror of
https://github.com/hoornet/vega.git
synced 2026-05-13 16:38:36 -07:00
Wire up NIP-19 / NIP-21 navigation + hashtag search from notes
- Mention clicks (nostr:npub1, nostr:nprofile) open internal ProfileView - njump.me links intercepted: npub/nprofile decoded and opened internally, note/nevent/naddr fall through to browser (no reader yet) - Hashtag clicks navigate to SearchView and auto-run the search - openSearch(query) action added to UIStore; pendingSearch consumed on mount Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,9 +10,11 @@ interface UIState {
|
||||
selectedPubkey: string | null;
|
||||
selectedNote: NDKEvent | null;
|
||||
previousView: View;
|
||||
pendingSearch: string | null;
|
||||
setView: (view: View) => void;
|
||||
openProfile: (pubkey: string) => void;
|
||||
openThread: (note: NDKEvent, from: View) => void;
|
||||
openSearch: (query: string) => void;
|
||||
goBack: () => void;
|
||||
toggleSidebar: () => void;
|
||||
}
|
||||
@@ -23,9 +25,11 @@ export const useUIStore = create<UIState>((set, _get) => ({
|
||||
selectedPubkey: null,
|
||||
selectedNote: null,
|
||||
previousView: "feed",
|
||||
pendingSearch: null,
|
||||
setView: (currentView) => set({ currentView }),
|
||||
openProfile: (pubkey) => set((s) => ({ currentView: "profile", selectedPubkey: pubkey, previousView: s.currentView as View })),
|
||||
openThread: (note, from) => set({ currentView: "thread", selectedNote: note, previousView: from }),
|
||||
openSearch: (query) => set({ currentView: "search", pendingSearch: query }),
|
||||
goBack: () => set((s) => ({
|
||||
currentView: s.previousView !== s.currentView ? s.previousView : "feed",
|
||||
selectedNote: null,
|
||||
|
||||
Reference in New Issue
Block a user