From 933e85020c2cc56b511ff47a73943c92ea1d044a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 14 Nov 2026 22:03:23 -0700 Subject: Search inside someone's posts: their profile puts them in the search field, and "franca wildwood" is understood. "i found him by searching franca but then i was wanting some way to search his feed for something … i was wanting to search 'franca wildwood' but knew it wouldn't work … we couldn't just have a clever way of guessing what the user is trying to do?" (Adam, 2026-11-14). No second field: on a profile the header field (and the phone's search page opened from a profile) carries the person as a chip, "Search their posts, or anyone…"; Enter searches only their posts, people still show below for picking someone else, and × or Backspace on the empty field searches everywhere again. Words that begin or end with someone's name (first/last one or two words, matched at the start of a word of their name or address) are offered as "“wildwood” in Franca Yibisi's posts" at the top of the results; when that's someone you follow or whose profile you opened this session, it's the Enter choice (↵), otherwise only a row ("bitcoin wallet" is not Bitcoin Magazine's posts), and never when the whole query is someone's name. The search is a feed like any text search, /feed?q=wildwood&p=npub…: the NIP-50 relays asked with the author, plus the author's own recent posts (home, archive and their own relays, up to four pages of 400 until ten match) checked here word by word, since few people are in a search index; what their profile already loaded shows at once. tools/search-scope-test.js (real relays): chip on fiatjaf's profile, "relay" → only his posts, every one saying it; "fiatjaf relay" guessed and taken by Enter; × and Backspace; phone width. profile-stream, post-search, search-avatar-loading and features-smoke pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VMan6UKGJyuGyZFxddYRxS --- src/style.css | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/style.css') diff --git a/src/style.css b/src/style.css index 55badb6..022ae77 100644 --- a/src/style.css +++ b/src/style.css @@ -2130,3 +2130,33 @@ html:has(.call-overlay:not(.call-min)) { overflow: hidden; scrollbar-gutter: aut .note-ghosts { animation: ng-breathe 1.4s ease-in-out infinite; } @keyframes ng-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } } @media (prefers-reduced-motion: reduce) { .note-ghosts { animation: none; } } + +/* search within someone's posts: their chip in the field */ +.search-scope-chip { + display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; max-width: 55%; + padding: 2px 2px 2px 3px; border-radius: 999px; background: var(--chip, rgba(127,127,127,.14)); + font-size: 13px; font-weight: 600; color: var(--ink); +} +.search-scope-chip .chat-avatar.mini { width: 20px; height: 20px; min-width: 20px; font-size: 10px; } +.search-scope-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.search-scope-x { + border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; + width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer; flex-shrink: 0; +} +.search-scope-x:hover { color: var(--ink); background: rgba(127,127,127,.18); } +.header-search.header-search-scoped { + align-items: center; gap: 4px; padding: 3px 6px 3px 4px; + border: 1px solid var(--line-strong); background: var(--paper); +} +.header-search.header-search-scoped:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); } +.header-search-scoped > input.header-search-field { + flex: 1; min-width: 0; border: 0; background: none; padding: 5px 4px; font-size: 14px; border-radius: 0; +} +.header-search-scoped > input.header-search-field:focus { outline: none; } +@media (min-width: 900px) { + #app:has(> .app-bottom-nav) .header-search.header-search-scoped { display: flex; } +} +.search-enter-hint { + flex-shrink: 0; font: 600 12px/1 inherit; color: var(--muted); padding: 4px 6px; + border: 1px solid var(--line-strong); border-radius: 6px; +} -- cgit v1.2.3