Commit Graph

4601 Commits

Author SHA1 Message Date
lemon cb9231d135 Refine wallet nav and fee helpers 2026-05-26 12:44:54 -07:00
lemon 13432b4865 Shorten SP scan Custom hours label to 'Hours'
Picked the noun each locale uses in its existing last3h / last24h
preset translations so the standalone label stays consistent with
the dropdown options it sits underneath.
2026-05-26 12:32:29 -07:00
lemon d4143ec47b Let Since presets actually rescan past blocks
The Math.max(resume, target) clamp inside resolveWindowFromHeight
turned the Since dropdown into a no-op whenever the wallet's
scanHeight had caught up to the chosen window. Picking 'Last week'
one minute after a successful scan resolved to scanHeight + 1, not
to a week ago, so the user couldn't actually rescan history from
the primary control — they had to drop into Advanced -> From block.

Removed the clamp so Since presets honor the wall-clock window
literally. Re-scanning blocks we've already scanned is cheap (the
indexer is just iterating tweak data) and is exactly what the user
asked for. Also dropped the isPresetUpToDate predicate that, after
the original clamp landed, was the mechanism by which Start went
disabled after a scan completed. isManualUpToDate is kept so the
override path still flags 'block number past the tip'.

Regression-of: 38946cbc
2026-05-26 12:32:29 -07:00
lemon be84d96d5f Add Custom Since option to SP scan dialog
Adds a Custom… entry to the Since select that, when picked, reveals
an hours number input directly under the select. The hours value is
parsed as a positive (fractional allowed) number, multiplied to
seconds, and fed through the same mempool.space resolver as the
fixed presets. The Start button stays disabled until a valid hours
value is entered so there's no ambiguous empty-equals-zero submit.

Power users who want sub-hour granularity (e.g. 0.5) get it without
having to drop into the Advanced block-height path.
2026-05-26 12:32:29 -07:00
lemon 0b7347210f Rewind 11 blocks for SP scan boundary, not 3
Bitcoin block timestamps obey BIP-113's median-time-past rule — they
must exceed the median of the previous 11 timestamps but don't have
to be strictly monotonic. Empirically, 1-2-block inversions show up
in the live chain regularly; 3-block rewinds covered the common case
but could still miss a payment landed in a block whose timestamp ran
backwards near the user's selected cutoff. 11 is the principled
upper bound (no inversion can extend further under MTP) and costs
only ~8 extra block fetches per scan.

Regression-of: 46d9952a
2026-05-26 12:32:29 -07:00
lemon 6c175870cb Drop Blockbook fallback for SP scan start-block lookup
mempool.space's timestamp-to-block endpoint is the sole source of
truth now. The Blockbook binary search fallback was sequential and
could stall the UI for ~20 round-trips with no progress feedback
when mempool.space was down. When the lookup fails, surface a toast
that points the user at the Advanced -> From block override and
auto-open the disclosure so the escape hatch is immediately visible.

Regression-of: d6e6d616
2026-05-26 12:32:29 -07:00
lemon b3290b2234 Use mempool timestamp lookup for scan presets 2026-05-26 12:32:29 -07:00
lemon d855d71254 Resolve silent payment scan presets by block time 2026-05-26 12:32:29 -07:00
lemon 5fa96db1c3 Use brand typography for wallet balances 2026-05-26 12:32:29 -07:00
lemon aefa5bc996 Show resolved profile preview for wallet recipients 2026-05-26 12:32:29 -07:00
lemon c5909d3740 Add person search to wallet recipient input 2026-05-26 12:32:29 -07:00
lemon 3ae7775a16 Align wallet send modal with zap amount styling 2026-05-26 12:32:29 -07:00
lemon bb29af595f Defer header wallet balance until after first paint 2026-05-26 12:32:29 -07:00
lemon cb11512e10 Translate SP scan dialog title, subtitle, help label 2026-05-26 12:32:29 -07:00
lemon 7506e7a10c Make SP scan dialog action button full width 2026-05-26 12:32:29 -07:00
lemon 8b24196f2e Restyle SP scan dialog: friendly title, help popover, 1h default 2026-05-26 12:32:29 -07:00
lemon 6a1dc6a8d7 Simplify SP scan dialog with Since presets and Advanced disclosure 2026-05-26 12:32:29 -07:00
lemon b9c8904d6f Tighten wallet column spacing and underline scan link 2026-05-26 12:32:29 -07:00
lemon bf3e80d444 Surface SP scan as 'Check for new payments' link under balance 2026-05-26 12:32:29 -07:00
lemon c5c3f5d63c Rework wallet receive actions layout 2026-05-26 12:32:29 -07:00
lemon 130d5d09c6 Streamline wallet receive panel: refresh icon in copy row, caption below 2026-05-26 12:32:29 -07:00
lemon d9357e624f Inline wallet receive panel under balance with logo QR 2026-05-26 12:32:29 -07:00
lemon 0cfad7cbaa Match wallet balance typography to brand and drop wallet icon 2026-05-26 12:32:29 -07:00
lemon 86e4fa6e24 Replace top-nav search icon with USD wallet balance 2026-05-26 12:32:29 -07:00
Alex Gleason baaf586ea5 Remove webmanifest screenshots from a different app 2026-05-26 13:23:36 -05:00
Alex Gleason 58112adfc6 Remove recent donations preview from campaign donate sidebar 2026-05-25 20:31:57 -05:00
Alex Gleason 57570f8037 Swap esploraApis positions 2026-05-25 20:25:11 -05:00
Alex Gleason 609f9f20b0 Loosen spacing around the campaign activity tabs
Two small fit-and-finish tweaks the previous restyle missed:

1. The tab strip's baseline border sat 1px above the rounded panel's top
   edge, so the panel's rounded corners visually overlapped the active
   tab's under-rule. TabsContent now carries an explicit mt-4 (16px) so
   the panel floats cleanly under the tab strip with breathing room
   above its rounded top corners.

2. Tab labels were spaced gap-1 (4px), too tight for labels that read
   as section headers. Bumped to gap-8 (32px) so 'Comments & donations'
   and 'Ledger' read as separate section titles.

CommentsSection's outer mt-4 is overridden with className=mt-0 at the
call site so the TabsContent gap controls the spacing — no more 32px
double-margin.
2026-05-25 20:22:49 -05:00
Alex Gleason e6dd3a04b8 Restyle campaign activity tabs to read as section headers
The shadcn default 'muted pill control' tab strip felt bolted onto the page
between the action bar and the comments panel. The tab labels also doubled
up with the 'Comments & donations' heading rendered inside the panel — two
section titles stacked.

Replaces the pill control with an underline-style tab strip that visually
serves as the section header for the panel below. The active tab label is
rendered at the same size and weight as the page's other h2 section
headings (text-lg font-semibold tracking-tight), inactive tabs are muted
siblings, and a 1px baseline border carries across the panel width while
the active tab paints a thicker primary under-rule that flows into the
content surface.

CommentsSection's title becomes optional and the campaign page omits it
now that the tab label owns the heading. The dead 'commentsAndDonations'
i18n key is removed from all 16 locales (tabComments carries the same
copy).
2026-05-25 20:04:53 -05:00
Alex Gleason eee74aa9bb Lead campaign ledger rows with USD; show BTC as the secondary number
Flips the headline + subline on each ledger row: USD is now the prominent
top number and the BTC equivalent (full units, not sats) sits below it in
muted text. Falls back to BTC-as-headline when the BTC/USD price isn't
available yet. Renames the i18n leaf 'campaignsDetail.ledger.satsUnit' to
'btcUnit' across en.json and all 15 other locales — BTC is a universal
ticker, so the unit string itself is now 'BTC' everywhere.
2026-05-25 16:27:13 -05:00
Alex Gleason d80e1b0a70 Tab Comments & donations and a new Ledger tab on campaign pages
Moves the existing comments + donations panel under a 'Comments & donations'
tab and introduces a sibling 'Ledger' tab that surfaces public on-chain
activity for the campaign's bc1 address — receives, sends, confirmation
status, block height, and the equivalent USD — sourced from the
already-configured Esplora endpoints with mempool.space deep links per row.

The Ledger tab is rendered only when the campaign declares an on-chain
endpoint ('bc1q…' / 'bc1p…'). Silent-payment-only campaigns intentionally
have no scannable address and degrade to the un-tabbed comments surface to
avoid showing a lone disabled tab.

A new fetchAddressTxs helper in src/lib/bitcoin.ts wraps Esplora's
/address/:addr/txs + /chain/:last_seen_txid pagination, and useAddressLedger
exposes it as an infinite query (50 confirmed tx page size, plus mempool on
the first page).
2026-05-25 15:32:27 -05:00
Alex Gleason 0a643de87f Merge branch 'main' of gitlab.com:soapbox-pub/agora 2026-05-25 15:19:01 -05:00
mkfain 8cc6d01b16 Add a 'Why do some donations say pending?' FAQ entry
Sits in the Bitcoin Donations chapter right after 'Are donations on
{{appName}} public?', so the natural flow goes from how donations
work to where they show up to why some take a while to confirm.
Translated into all sixteen locales.
2026-05-25 11:35:04 -05:00
mkfain 85632711c6 Surface pending donations on campaign pages
The campaign detail already verifies each donation receipt on-chain
and knows whether the underlying Bitcoin tx is confirmed, but the
flag was being dropped before it reached the UI. Mirror the wallet's
treatment so visitors can see funds that are inbound but still in
the mempool.

Three changes:

* Extract PendingBadge (orange + spinning RefreshCw) and use it on
  both the wallet headline and the campaign donate column. The
  wallet's inline JSX is replaced with the shared component.
* Widen useCampaignDonations to expose pendingSats (the mempool
  delta from Esplora) and a confirmedByTxid lookup built from the
  already-verified receipts.
* DonateColumn now renders the pending sats under the raised total
  and DonorPreviewList swaps the relative timestamp for the badge
  on any row whose underlying tx is still unconfirmed.
2026-05-25 11:20:42 -05:00
mkfain 8574350778 Show LoginArea on the pledge, group, and event create gates
CreateActionPage, CreateCommunityPage, and CreateEventPage each
showed a dead-end 'Back to pledges' / 'Back to groups' / 'Back to
events' link as their only logged-out CTA. Mirror the campaign-gate
fix and render LoginArea instead so visitors can join or log in
without leaving the page, and drop the three now-unused i18n keys
from every locale.

Regression-of: 2870d7a6
2026-05-25 11:09:57 -05:00
mkfain 2870d7a641 Show LoginArea on the create-campaign logged-out gate
The gate previously offered only a 'Go home' link, leaving visitors
to find the login flow themselves. Render the existing LoginArea CTA
in its place so the 'Join' / 'Log in' modal opens directly from the
gate, and drop the now-unused campaignsCreate.goHome string from all
sixteen locales.
2026-05-25 11:04:56 -05:00
Chad Curtis 2424c96fb9 Match the pledge show-more control to the My Groups styling 2026-05-25 02:28:08 -05:00
Chad Curtis 908585538a Stack the discovery search toolbar below the heading on mobile
Wraps the title/toolbar row with flex-col on mobile so the search input,
filter dropdown, and country picker no longer cram next to the section
title at narrow widths. The toolbar also lets the search input grow to
fill the row on mobile (flex-1) while keeping its compact 16rem width
from the sm breakpoint up.

Applies to /groups, /pledges, and /campaigns/all — every place the
DiscoverySearchToolbar sits on a section heading row.
2026-05-25 02:22:15 -05:00
Chad Curtis d31397f60b Restyle the TopNav brand mark with the Bebas Neue hero recipe
The brand mark in the top nav was rendered in the default UI font
(Inter Bold at text-lg). Swap it for the same typographic recipe the
CampaignsPage hero uses — Bebas Neue (font-display), uppercase, tracked,
with a 0.022em currentColor text-stroke that fattens the weight-400
letterforms without the fuzz a synthetic-bold would produce. The size
is bumped to text-3xl and the bolt icon to size-9 so the wordmark reads
as a deliberate logo lockup instead of a piece of UI chrome.

Two deviations from the hero recipe, tuned for the nav-bar context:

  - The hero uses Bebas Neue's native italic (~12° skew). Here we
    render the roman face and apply a softer skewX(-6deg) transform.
    Sharp italics at nav-bar size start to read as a glitch rather
    than personality; a gentle oblique keeps the family identity
    without sacrificing legibility next to the four right-leaning
    nav links.
  - A scaleX(1.1) widens the letterforms slightly. Bebas is naturally
    tall+narrow, which gets visually crowded at this size next to the
    chunky bolt mark — the horizontal scale rebalances the proportions
    so the wordmark sits as a peer to the icon instead of receding.

transform-origin: 0 100% anchors the skew to the baseline so the icon-
to-text relationship stays stable, and -ml-0.5 tucks the wordmark
tight against the bolt to read as a single lockup.

While here, change the active page indicator in the same nav from
text-foreground (white in dark / black in light) to text-primary so
the current page reads in brand orange. The mobile drawer's active
state already had a bg-primary/10 wash but kept text-foreground on
top; switch its text to text-primary as well so the orange wash and
the orange label reinforce each other instead of fighting.
2026-05-25 02:22:15 -05:00
Chad Curtis a6ba446e42 Strip CommunityGrid's built-in horizontal padding
Every caller wraps the grid in a `max-w-7xl mx-auto px-4 sm:px-6`
page container that already supplies the page-edge gutter — matching
the Campaigns and Pledges discovery pages. CommunityGrid then added a
second `px-4 sm:px-6` of its own, which every caller defensively
overrode with `className="px-0"`. The override only neutralized the
base utility: tailwind-merge happily kept the responsive variant, so
the `sm:px-6` survived. The result was group cards inset 24px further
than campaign and pledge cards at every `sm` breakpoint and up.

Drop the internal padding from CommunityGrid and remove the redundant
`px-0` overrides on the eleven CommunitiesPage callers. The page
container is now the single source of truth for horizontal padding on
all three discovery surfaces.
2026-05-25 02:22:15 -05:00
Chad Curtis 4c043eae55 Hide the country picker on the groups page
A community is its own scope — narrowing groups by country isn't a
useful axis the way it is for campaigns and pledges (which are about
local action). Drop the country prop from CommunitiesPage's
DiscoverySearchToolbar call so the Globe button doesn't render at
all there. Campaigns and Pledges keep theirs.
2026-05-25 02:22:15 -05:00
Chad Curtis b8b7f638ee Bake the country picker into the discovery search toolbar
The pledges page already had a Globe-icon country popover sitting next
to a sort dropdown and the relay-driven search toolbar. The three
side-by-side filter affordances duplicated each other and pulled focus
away from the section heading. Collapse the cluster into the shared
DiscoverySearchToolbar:

- Drop the page-local Recent / Bounty / Deadline sort dropdown on
  pledges. The toolbar's Default / Top / New sort, backed by NIP-50,
  already covers the same ground and applies to every discovery
  surface; pledges fall through to a newest-first chronological view
  inside each lifecycle section.

- Add the country picker as a first-class prop on
  DiscoverySearchToolbar (`country` + `onCountryChange`) so all
  three discovery pages share the same Globe button without a generic
  trailing-slot escape hatch. Brand-orange icon in the neutral state,
  country flag emoji when selected.

- Extend useNip50Search with an optional `iTags` array, forwarded as
  a standard `#i` filter alongside the `search` field. A non-empty
  iTags array also activates the hook so picking a country with no
  typed query produces a country-scoped grid, narrowing kind 34550 /
  36639 by NIP-73 external identifier.

- Extend useAllCampaigns with a `countryCode` parameter that adds
  the same `#i` filter to the relay query. AllCampaignsPage tracks
  the country on the URL alongside the existing `sort` and `q`
  params so country-scoped views are linkable.

- Brand-orange the ListFilter icon on the toolbar to match the
  pledges-page aesthetic the user wanted to spread to the other
  discovery pages.
2026-05-25 02:22:15 -05:00
Chad Curtis a98384ab32 Remove the search toolbar from the home page
The DiscoverySearchToolbar (search input + sort + show-hidden) was
duplicating affordances the dedicated /campaigns/all page already
provides. The home page is now a curated landing: hero, featured row,
community grid, and moderator/creator sections.
2026-05-25 02:20:16 -05:00
Chad Curtis 786ce799a1 Add a 'Default' sort and tag-aware keyword matching to discovery search
The three discovery pages (Campaigns, Pledges, Communities) already
pass sortMode and getKeywordHaystack to useNip50Search, but the hook
only supported 'top' / 'new' and did no client-side keyword filter —
so 'default' fell back to 'new' (a chronological feed of the entire
kind on first paint, not the curated layout the page actually wants)
and queries for kinds whose human-readable title lives in tags
(33863 campaigns, 34550 organizations, 36639 pledges) silently
returned nothing whenever the relay's NIP-50 index only indexed
'content'.

Extend Nip50Sort with a 'default' variant: empty-query + 'default'
deactivates the hook so the page renders its featured/curated layout,
while a typed query still issues a chronological search. 'top' and
'new' keep their existing semantics; 'new' now also drives an empty-
query chronological feed (previously only 'top' could). Plumb the
new option through DiscoverySearchToolbar as a LayoutGrid-iconed
segmented button and adjust the active-filter detector.

Add an optional getKeywordHaystack callback that lets callers supply
per-event strings (title / name / summary tag values + content) for
a case-insensitive substring re-filter over the relay response. This
costs a small amount of recall (we still rely on the relay to surface
the candidate) but fixes the 'search returns nothing' failure mode
for tag-titled kinds without changing the relay protocol or pinning
to a different index.

Regression-of: c61e9a06
2026-05-25 02:20:16 -05:00
Chad Curtis e33f306a64 Land the missing usePledgeModeration hook and document pledge labels
The moderation menu / overlay / review-queue refactor wired pledges
into the same shared moderation components as campaigns and groups,
and three call sites (ActionsPage, ModerationMenu, ModerationOverlay)
imported usePledgeModeration from @/hooks/usePledgeModeration. The
hook file itself was never staged, so the tree didn't build and any
fresh clone would have failed tsc at those imports.

Add the hook (two-axis model — hide + featured, no approval gate, same
agora.moderation namespace and Team Soapbox moderator pack as
campaigns/organizations) and document the kind 36639 surface in
NIP.md alongside the existing 33863 / 34550 entries so the spec
matches the implementation.

Regression-of: c61e9a06
2026-05-25 02:20:16 -05:00
Chad Curtis b2f8311d5e Use a consistent section heading on /campaigns/all and /groups
The /pledges page introduces large bold section headers above its grid
("text-2xl sm:text-3xl font-bold tracking-tight" + muted tagline +
right-side controls). /campaigns/all had no section heading at all, and
/groups was using the smaller SectionHeader pattern ("text-base
font-semibold") for its 'My groups' and 'Featured groups' shelves —
even though its own search-mode branch already used the large-bold
pattern. Three pages, three different section-header treatments.

Aligns both pages with the /pledges style:

- /campaigns/all: add a heading above the grid that switches between
  Search / Top / New labels based on toolbar state, with a constant
  tagline ("Browse every cause on the network").
- /groups: replace the SectionHeader usages on the My groups / Featured
  groups shelves with the same large-bold heading + tagline pattern;
  drop the now-unused SectionHeader import. Inner shelves
  (CommunityGrid, EmptyShelf, show-more) get their internal
  px-4 sm:px-6 stripped since the outer container now provides it.
- Moderator review sections use the same px-0 grid + collapsed trigger
  padding inside the new wrapper.

/ (Index → Feed) keeps tabs as its visual navigation, so it doesn't
need a heading — that exception is the rule that proves the pattern.
2026-05-25 02:20:16 -05:00
Chad Curtis b4696338aa Merge the pledge card's share/delete kebab and moderator kebab into one
ActionCard rendered two kebabs side-by-side: ActionShareMenu (Copy link +
owner Delete) and the shared ModerationOverlay's mod-only kebab. The two
buttons were also styled differently — the share menu had no banner
backdrop, so on photo-heavy cards it floated against the image while
the moderator kebab next to it sat in a translucent pill.

Extract ModerationMenuItems from ModerationMenu — the dropdown rows
themselves (label + items) without the trigger/content wrapper. Standalone
ModerationMenu and ModerationOverlay still work the same; cards that need
to embed moderator actions inside an existing dropdown now compose them
directly:

  <DropdownMenuContent>
    <DropdownMenuItem onClick={copy}>Copy link</DropdownMenuItem>
    {isOwner && <DropdownMenuItem onClick={del}>Delete</DropdownMenuItem>}
    {isMod && <DropdownMenuSeparator />}
    <ModerationMenuItems coord={…} surface="pledge" axes={…} entityTitle={…} />
  </DropdownMenuContent>

ModerationOverlay grows a showMenu prop (default true) so a card can still
get the mod-gated 'Hidden' badge in its banner corner without the
redundant second kebab when the moderation items have been embedded in
another dropdown.

Then on ActionCard:
  - ActionShareMenu absorbs ModerationMenuItems under a separator, so the
    card carries exactly one kebab.
  - Its trigger now uses the same 'h-8 w-8 bg-background/80 backdrop-blur
    text-muted-foreground hover:text-foreground' classes as the campaign
    and group card kebabs so the pill is consistent across surfaces.
  - The mod-only 'Hidden' badge still renders, via ModerationOverlay with
    showMenu={false}.
  - Adds a generic pledges.card.actionsAriaLabel ('Pledge actions')
    aria-label since the kebab is no longer just for sharing — translated
    into all 15 non-English locales.
2026-05-25 02:20:16 -05:00
Chad Curtis 008f6604a8 Unify moderation menus and review queues across campaigns, pledges, and groups
Campaigns, pledges, and groups each had their own moderation kebab,
'Hidden' badge, and collapsible review sections. The three implementations
had drifted: the campaign card inlined the badge + menu while the pledge
and group cards used per-surface overlay wrappers, the pledge cards
imported the kebab without its 'Hidden' badge (so hidden pledges showed
the kebab but no visible status), pledges had no page-level Pending /
Hidden moderator queues at all, and each page reimplemented the
collapsible review section as a local component.

Consolidate everything into src/components/moderation/:

  HiddenBadge — the shared destructive chip with EyeOff + 'Hidden'.
  ModerationMenu — the shared kebab with an `axes` config prop, so
    campaigns can request ['approval', 'hide', 'featured'] and pledges /
    groups can request ['hide', 'featured']. Per-surface inner components
    each mount exactly one moderation hook so a pledge card never
    subscribes to the campaign label query (and vice versa).
  ModerationOverlay — the absolutely-positioned wrapper that bundles
    HiddenBadge + ModerationMenu in a card corner. Same gating contract:
    returns null for non-moderators.
  ModeratorCollapsibleSection — the shared 'Pending / Hidden' collapsible
    used by CampaignsPage, CommunitiesPage, and now ActionsPage.

Migrate the three card surfaces and three index pages onto these shared
pieces, fixing two concrete bugs along the way:

  ActionCard now renders a 'Hidden' badge on hidden pledges. Previously
    it imported PledgeModerationMenu directly (kebab only) instead of
    PledgeModerationOverlay (badge + kebab), so moderators saw the
    kebab but had no inline cue that a card was hidden.
  ActionsPage now has page-level Pending and Hidden moderator review
    queues at the bottom, mirroring the queues already present on
    CampaignsPage and CommunitiesPage. Pledges share the two-axis model
    with groups, so 'Pending' here means 'no curation decision yet' —
    pledges not yet featured or hidden.

useActions grows an optional `enabled` flag so the page can skip the
moderator-only review-queue query entirely for non-moderators rather
than firing it with limit:0.

Locale work: add the new moderation namespace and the pledges.list
needsReview / hidden / *Desc / *Empty keys to en.json and all 15
non-English locales (ar, es, fa, fr, hi, id, km, ps, pt, ru, sn, sw,
tr, zh, zh-Hant).
2026-05-25 02:18:08 -05:00
Chad Curtis 52f6ff9f9f Add a shared on-page NIP-50 search toolbar to every discovery page
Build a single search affordance shared by Campaigns home, All Campaigns,
Communities, and Pledges so the four discovery surfaces stop having
four different toolbars (or none at all).

New shared pieces
-----------------

DebouncedSearchInput renders a controlled shadcn Input with the lucide
Search icon on the left and a clear (X) button on the right that
appears once the user has typed something. Rounded-square corners
(rounded-lg, matching the global SearchPage). Stateless — the caller
pairs it with useDebounce and feeds the debounced value into a query
hook so the same component works for URL-synced searches, in-memory
searches, or anywhere else.

DiscoverySearchToolbar wraps DebouncedSearchInput with a compact filter
button on the right that opens a popover containing:
  - Top / New sort pills wired to NIP-50 'sort:top' (Top) and no sort
    token (New).
  - An optional Show-hidden switch — only rendered when the caller
    passes a showHidden prop, so surfaces without a hidden axis
    (Pledges) just hide the row.

The toolbar matches the visual idiom of the global SearchPage filter
button (40-ish-px rounded-lg square, primary-tinted border when any
modifier is active). Inline against the page background — no card
framing — so the hero anchors visual hierarchy. Fully controlled:
parent owns search / sort / show-hidden state, the toolbar is purely
presentational.

useNip50Search<T> issues a kind-scoped NIP-50 search against
nostr.group(DITTO_RELAYS). Routing through the Ditto group rather
than the default pool keeps results predictable: most non-NIP-50
relays either ignore the 'search' field (returning everything matching
the other filters) or return nothing — both modes drown the result
set in noise. Hook is generic over an event parser so each surface
parses its own kind (parseCampaign / parseCommunityEvent / parseAction).

Sort modes
----------

  - new (default): no sort token in the search payload; relay returns
    chronological results.
  - top: appends ' sort:top' to the search payload; relay scores by
    engagement. Also works with an empty keyword (sends just
    'sort:top') so 'Top' alone is a valid 'most-engaged' feed.

Empty keyword + New sort is the hook's only 'inactive' state, in
which case the page falls through to its existing curated layout
(featured rows, my-groups shelf, active-pledges sections, etc.).

Per-page wiring
---------------

Campaigns home (/campaigns) — toolbar with show-hidden; results
filtered against useCampaignModeration.hiddenCoords. Empty + New
falls through to the existing Featured / Community / moderator
sections.

Communities (/communities) — toolbar with show-hidden; results
filtered against useOrganizationModeration.hiddenCoords. The hook
is lifted to the page level so search results can drop hidden
groups (or include them via the switch). The ModeratorReviewSections
subtree still calls its own copy — query results are cached so the
second call is free.

Pledges (/pledges) — toolbar without show-hidden. Pledges lack a
moderator-driven hidden axis today, so the switch wouldn't have
anything to toggle. Adding it is tracked as a follow-up.

All Campaigns (/campaigns/all) — gets a new HeroBanner +
HeroAtmosphere hero matching the Pledges / Communities shape
(kicker, two-line heading, body, glass stat pill, glass CTA, warm
hope palette), so the route looks like a real discovery surface
instead of a bare grid under a plain H1. The page also migrates
from its bespoke inline toolbar to the shared one, with a small
adapter mapping the toolbar's 'top'/'new' vocabulary to the legacy
'top'/'none' URL param so existing share links keep working.

i18n
----

New common.* keys (sortAriaLabel, sortTop, sortNew, showHidden,
filtersAriaLabel) plus campaigns.all.* hero keys (heroKicker,
heroHeading, heroHeadingLine2, heroBody, campaignsCount_one,
campaignsCount_other). Translated across all sixteen locales.
2026-05-25 02:13:18 -05:00
Chad Curtis 85f3e5fd79 Widen the Communities body to match Campaigns and Pledges
The Communities page rendered its content column at max-w-5xl while
the Campaigns and Pledges bodies use max-w-7xl, making Communities
look squeezed by comparison on wide displays. Bump Communities to
max-w-7xl so the three discovery pages share a content width.
2026-05-25 02:11:04 -05:00