Commit Graph

4447 Commits

Author SHA1 Message Date
Alex Gleason d98ae9cdbf fix: consistent feed header ordering — title above tabs on all feed pages
Fixes #153, #155, #156, #157, #158, #159
2026-03-25 18:29:52 -05:00
Alex Gleason 5100b76ad3 fix: improve contrast on focused emoji category text in picker
Increases the opacity of emoji-mart nav button text from 0.65 to 0.85
by injecting CSS overrides into the shadow DOM. This improves readability
and meets WCAG contrast requirements for the category navigation icons.

Fixes #174
2026-03-25 18:28:45 -05:00
Alex Gleason 8328af802f fix: auto-focus search box when emoji picker opens
Fixes #162
2026-03-25 18:27:43 -05:00
Alex Gleason d0e39ed8bf Fix blank pages for logged-out users on Videos, Vines, Photos, Events, Books
useFeedTab defaulted to 'ditto' when logged out, but pages like
Videos only accept ['follows', 'global'] as valid tabs. The 'ditto'
default was never validated against validTabs, so no feed query
matched and nothing loaded. Now the default is validated and falls
back to the last valid tab ('global') when it's not in the list.
2026-03-25 16:20:23 -05:00
Alex Gleason 9726fe3f8e Move Title font picker above Body in FontSection layout 2026-03-25 14:00:09 -05:00
Alex Gleason 247f174158 Show actual fallback font name in title font picker when unset
Instead of a generic 'Same as body' placeholder, the title font
combobox now displays the body font's name (rendered in that font's
typeface) when no title font is explicitly set. Falls back to
'Default (Inter)' when neither font is set.
2026-03-25 13:59:52 -05:00
Alex Gleason e0bca85cb6 Show 'Same as body' placeholder for title font when unset
The title font combobox was showing 'Default (Inter)' when no title
font was set, but the actual fallback is the body font. Add a
placeholder prop to FontPicker and pass 'Same as body' from
FontSection for the title picker.
2026-03-25 13:56:25 -05:00
Alex Gleason dd55fce88c Redesign font pickers into unified FontSection with title font fallback
- Refactor FontPicker into a bare combobox (no section header, no
  'quick brown fox' preview text)
- Add FontSection component that combines Body and Title font pickers
  in a single section with inline labels and a live preview showing
  both fonts in context (display name + body text)
- Title font falls back to the body font when not explicitly set, so
  the profile display name inherits the theme's body font rather than
  the default Inter
- Update ThemeSelector builder dialog and ProfilePage edit dialog to
  use FontSection with controlled body/title font props
2026-03-25 13:52:20 -05:00
Alex Gleason 64e11e4001 Replace full images in compact post views with 'Image' indicator chip
Embedded/quoted posts (EmbeddedNote, EmbeddedNaddr) no longer display
full image thumbnails. Instead, images are shown as a small icon+label
indicator at the bottom, consistent with how videos and audio are
already represented. This keeps compact views lightweight and focused
on text content.
2026-03-25 13:48:23 -05:00
Alex Gleason c9e447ff13 Add title font support for profile display name
Implement the title font feature across the full stack:

- Type system: Add titleFont to ThemeConfig, ThemePreset, ThemeDefinition,
  ActiveProfileTheme interfaces and Zod schema
- Event encoding: Update f-tag build/parse to emit role markers (body/title)
  with backward-compatible parsing of legacy roleless tags
- Font loading: Add loadAndApplyTitleFont with --title-font-family CSS var
- UI: Add Title Font picker to theme builder dialog and profile theme editor,
  with configurable label prop on FontPicker
- Profile rendering: Apply --title-font-family to the display name h2
- Data flow: Thread titleFont through ThemeSelector snapshots, theme
  presets, publish/update, NostrSync, ThemeContent, and diff detection
2026-03-25 13:37:29 -05:00
Alex Gleason 0d6ad1d3d5 Fix illegible inline code in dark mode prose views
Add prose-code:text-foreground so inline code elements use the theme
foreground color instead of the typography plugin default (dark gray),
which was invisible against the muted background in dark mode.
2026-03-25 13:37:02 -05:00
Alex Gleason f680ccd75d Fix invisible bold text and other prose colors in dark mode
The Tailwind Typography plugin sets bold/strong text to gray-900 by default,
which is invisible on dark backgrounds. Added prose-strong:text-foreground
and other theme-aware color overrides for list markers, blockquotes, rules,
and table headers across all markdown prose views.
2026-03-25 13:33:08 -05:00
Alex Gleason be456853b0 Fix text layout gaps in markdown prose views by adding break-words and code styling
Long unbreakable strings (sha256 hashes, URLs, base36 pubkeys) in NIP documents
and articles caused large word-spacing gaps in narrow containers. Added break-words,
horizontal scroll for code blocks, and consistent inline code styling to
CustomNipCard, ArticleContent, and PullRequestCard.
2026-03-25 13:04:12 -05:00
Alex Gleason a921e640cc Add copyable Nostr clone URI to git repo cards
Port NostrURI module from Shakespeare to generate nostr:// clone URIs
from kind 30617 event data (pubkey, d-tag, relays). Display the Nostr
clone URI in GitRepoCard as the sole clone URL, replacing the previous
HTTPS clone URL. Also use the nostr:// URI for Shakespeare clone links.
2026-03-25 12:55:09 -05:00
Alex Gleason 0668d6602a Fix FAB ignoring custom avatar shape due to unconditional rounded-full
The FAB background div always had rounded-full applied, which added
border-radius: 9999px even when an emoji mask was active. This caused
square (and other non-circular) avatar shapes to still appear rounded.
Now rounded-full is only applied when there is no emoji shape mask,
matching the pattern used by the Avatar component.
2026-03-25 11:04:06 -05:00
filemon 0c7daef65e Add DEV MODE Blobbi state editor for testing
- Create BlobbiDevEditor modal component for direct state editing
- Add useBlobbiDevUpdate hook using standard update/publish flow
- Support editing: stage, state, adult form, all stats
- Support editing: experience, care streak, generation, breeding ready, visibility
- Add stat presets: Max Stats, Starving, Exhausted, Dirty, Sad, Critical Health, etc.
- Add wrench icon button to hero section (DEV only)
- Wire to existing updateBlobbiTags pipeline for consistent Nostr events
- Only renders in development mode (import.meta.env.DEV)
2026-03-25 12:42:44 -03:00
filemon 09da778d3b Add need-based Blobbi reactions when items land
- Create centralized need detection system with configurable thresholds
- Add continuous gravity for items dropped mid-air (fall to ground)
- Blobbi now glances at items it doesn't need (brief look)
- Blobbi shows interest in items it needs (longer attention)
- Add ItemLandedData interface with position info for reactions
- Create useCompanionItemReaction hook for need-based behavior
- Expose triggerAttention from useBlobbiCompanion hook
2026-03-25 12:23:13 -03:00
filemon 2ad64bbca7 Filter egg-only items from companion interaction system
Since companions can only be baby or adult (not egg), egg-only items
like Shell Repair Kit should never appear in the companion flow.

Changes:
- Update resolveItemsForAction to use centralized canUseItemForStage
- Add item-stage validation in useBlobbiItemUse mutation
- Egg-only items are now filtered at both display and use layers

The filtering is now enforced by:
1. resolveItemsForAction - items won't appear in hanging items menu
2. useBlobbiItemUse - validation prevents use even if somehow displayed
2026-03-25 11:33:05 -03:00
filemon 247b94f3b3 Fix item effect display consistency across Blobbi UIs
- Create shared ItemEffectDisplay component as single source for effect rendering
- Update BlobbiInventoryModal to show ALL effects (was truncated to 2)
- Update BlobbiShopItemRow to show ALL effects (was truncated to 3)
- Update BlobbiPurchaseDialog to use shared component
- Use canonical stat display order: hunger, happiness, energy, hygiene, health
- Deprecate formatEffectSummary in favor of ItemEffectDisplay component

The root cause was effect display truncation in the UI, not inconsistent data.
All item definitions remain in blobbi-shop-items.ts (single source of truth).
2026-03-25 11:24:36 -03:00
filemon 8078ad5609 Refactor hanging items to support multiple dropped instances
- Replace releasedItemIds (Set) with releasedCountByItemId (Map) to track
  how many instances of each item type have been released
- Generate unique instanceId for each dropped item (format: itemId-timestamp-counter)
- Hanging items now show remaining quantity (quantity - releasedCount)
- Multiple instances of the same item type can exist on the ground simultaneously
- Each dropped instance tracks independently via instanceId
- Update all callbacks and state tracking to use instanceId instead of item.id
- When item is used successfully, decrement releasedCount for that item type

This enables the desired UX where clicking a hanging item immediately shows
a new copy in the hanging slot (if quantity > 1), while the released instance
falls independently.
2026-03-25 11:07:54 -03:00
filemon 7fd70ac0d9 fix(blobbi): make item-use work reliably from companion system
Major architectural fix for Blobbi companion item-use system:

1. Created shared useBlobbiItemUse hook
   - Works standalone outside of BlobbiPage
   - Uses same real item-use logic as BlobbiPage
   - Built-in per-item cooldown tracking
   - Fetches companion/profile data on-demand when needed

2. Refactored BlobbiActionsContext
   - Now has built-in fallback using useBlobbiItemUse
   - Item use works from ANY page, not just /blobbi
   - BlobbiPage registration is optional (provides better cache access)
   - No more 'canUseItems = false' when BlobbiPage not mounted

3. Fixed retry/flood issues in HangingItems
   - Added per-item cooldown (3s on failure, 0.5s on success)
   - Implemented zone ENTRY detection (not continuous overlap)
   - Items only trigger auto-use when ENTERING the Blobbi zone
   - Items must leave zone before re-triggering
   - Multiple protection layers prevent spam

4. Fixed useBlobbonautProfile side-effect
   - Moved setBootCache from useMemo to useEffect
   - Added ref-based signature tracking to prevent loops
   - Proper cleanup and stable dependencies

Files changed:
- NEW: src/blobbi/companion/interaction/useBlobbiItemUse.ts
- src/blobbi/companion/interaction/BlobbiActionsContext.tsx
- src/blobbi/companion/interaction/HangingItems.tsx
- src/blobbi/companion/interaction/index.ts
- src/blobbi/companion/components/BlobbiCompanionLayer.tsx
- src/hooks/useBlobbonautProfile.ts
2026-03-25 06:38:37 -03:00
Alex Gleason 3252ae2247 Add NIP-42 relay authentication support
Sign kind 22242 AUTH events automatically when relays send challenges.
Uses a signer ref pattern so the pool doesn't need to be recreated
when the user logs in/out or switches accounts.
2026-03-25 01:15:36 -05:00
Alex Gleason 6dde7bba0f Improve kind 4 DM display: simplify card style and add compact view for embeds
Remove gradient background and encryption footer from the full card, use
a clean bordered card with centered sender description. Add
EncryptedMessageCompact for quote posts, reply indicators, and the reply
composer — dispatched from EmbeddedNote like vanish events.
2026-03-25 00:26:07 -05:00
Alex Gleason a3acf48091 Display kind 4 encrypted DMs as mail-in-transit instead of raw ciphertext
Kind 4 (NIP-04 encrypted DM) events were rendering their encrypted
content as plain text. Now they show a visual card with sender and
recipient avatars connected by a mail icon, with encryption type
detection (NIP-04 vs NIP-44) displayed in a footer badge with a lock icon.

Registered kind 4 across NoteCard, PostDetailPage, and CommentContext.
2026-03-24 23:55:37 -05:00
Alex Gleason 1b85be36f5 Fix theme icon in NoteCard: use Sparkles instead of Palette 2026-03-24 23:07:39 -05:00
Alex Gleason b7b84a8cc4 Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-24 22:24:37 -05:00
Alex Gleason 0459590d24 Replace domain bar with favicon next to the title 2026-03-24 22:12:35 -05:00
Alex Gleason a8fed56929 Always display 'nsite.lol' as domain, ignore OEmbed provider_name 2026-03-24 22:11:13 -05:00
Alex Gleason 973e62115d Show 'nsite.lol' instead of the full gateway URL in the domain bar 2026-03-24 22:09:20 -05:00
Alex Gleason beee52e3e5 Remove unused 'Users' import to fix ESLint error 2026-03-24 22:08:26 -05:00
Alex Gleason 2ad3fe1e4a Render nsite events with rich link preview from OEmbed data 2026-03-24 22:05:25 -05:00
Alex Gleason 215ae07143 Enable development kinds in feed by default 2026-03-24 21:52:54 -05:00
Alex Gleason 8143d8b9ac Add Zapstore apps (32267) to development feed kinds 2026-03-24 21:51:58 -05:00
Alex Gleason 73b063bf1b Fix plural kind labels in comment context — use singular forms only
The fallthrough to EXTRA_KINDS produced plural/categorical labels like
'requests to vanish' and 'user statuses'. Now getKindLabel only uses
KIND_LABELS which has proper singular forms ('a request to vanish',
'a status'). Added missing entries for kinds 6, 16, 62, 30315.
2026-03-24 21:39:50 -05:00
Alex Gleason bf4ec364f7 Fix theme icon to Sparkles and rephrase profile badges to 'by @User'
- Themes use Sparkles (matching sidebar), not Palette (that's color moments)
- Profile badges now reads 'Commenting on profile badges by @Mary'
  instead of 'Commenting on @Mary's profile badges'
2026-03-24 21:37:11 -05:00
Alex Gleason 1c6ccaaeca Use correct icons in CommentContext KIND_ICONS matching sidebar and NoteCard
CardsIcon for Magic decks, ChestIcon for geocaches/found logs,
Clapperboard for vines, Music for tracks/playlists, Camera for photos,
Film for videos, GitBranch for repos, GitPullRequest for PRs,
BookOpen for articles, Podcast for episodes/trailers, BarChart3 for polls,
PartyPopper for follow packs, Palette for color moments.
2026-03-24 21:35:16 -05:00
Alex Gleason 946e5823bd Improve CommentContext display for all supported kinds
- Add kind-specific suffixes: badge, theme, follow pack, emoji pack, etc.
- Add kind-specific postfixes: apps show 'on Zapstore', releases show 'release'
- Profile badges (30008) show '@User's profile badges' with author hover card
- Add icons for all supported kinds (Award, Palette, Package, etc.)
- Add BookOpen icon inline next to book titles in ISBN context
- Add @ prefix to author names in reaction context
- Expand KIND_LABELS to cover all Ditto-supported kinds with proper articles
2026-03-24 21:29:19 -05:00
Alex Gleason acddb196d5 Add hover card previews for books and countries in CommentContext
- IsbnCommentContext: Wrap book title link in HoverCard showing cover
  thumbnail, title, and authors (reusing useBookInfo data)
- CountryCommentContext: New component extracted from ExternalCommentContext,
  wraps country link in HoverCard showing flag, region/country label,
  name, and parent country for subdivisions
- Both follow the same HoverCard pattern as UrlCommentContext
2026-03-24 21:17:27 -05:00
Alex Gleason 3b6633c330 Add missing ProfileHoverCards to author links across embed and context components
- EmbeddedNaddrCard: Add MaybeProfileHoverCard wrapper on avatar and
  name links with disableHoverCards prop (matching EmbeddedNoteCard)
- NoteCard EventActionHeader: Wrap author name in ProfileHoverCard
- CommentContext: Wrap author links in ReplyToCommentContext,
  ProfileCommentContext, and ReactionCommentContext
- LiveStreamPage ParticipantRow: Wrap avatar and name links
2026-03-24 21:06:13 -05:00
Alex Gleason 4fecb7b32e Show globe icon for nsites in embed cards instead of parent category code icon
Add KIND_SPECIFIC_ICONS override map in extraKinds.ts so kinds in
extraFeedKinds arrays get their own icon instead of inheriting the
parent def's icon. Nsites (15128/35128) now show Globe, patches
show GitPullRequestArrow, etc.
2026-03-24 20:59:03 -05:00
Alex Gleason a8cb7240bf Use specific kind labels in embed cards instead of parent category name
Add getKindLabel() to extraKinds.ts as the canonical resolver for
per-kind labels. Kinds in extraFeedKinds (like nsites 15128/35128)
now show 'nsite' instead of the parent category 'development'.
2026-03-24 20:57:20 -05:00
Alex Gleason d94ff90bc7 Show kind label with icon in compact embed cards for non-text kinds
Embed cards for non-text kinds (nsites, follow packs, etc.) now show a kind
label line with icon below the title/description, giving context about what
the event is. Previously a quoted nsite just showed 'ditto' with no indication
it was an nsite deployment.
2026-03-24 20:53:13 -05:00
Alex Gleason ae236718e3 Remove NOTECARD_KINDS — render all quote posts and hover cards as compact embed cards
Quote posts and hover previews should always be compact (author + title/content).
Rendering a full NoteCard with action headers, buttons, and nested card components
inside a quote post or hover card is too much UI for an inline context.

- Remove NOTECARD_KINDS from EmbeddedNote.tsx and EmbeddedNaddr.tsx
- Remove NoteCard imports from both embed components
- Add tag-based metadata fallback (title/name/d, summary/description) to
  EmbeddedNoteCard for non-text kinds with empty content
- Update AGENTS.md checklist to reflect that embeds no longer need per-kind registration
2026-03-24 20:48:20 -05:00
Alex Gleason ebafc87fd5 Improve CommentContext consistency and unify event preview rendering
- Extract shared CommentContextRow wrapper to eliminate duplicated div/className/skeleton patterns
- Unify getKindLabel into getEventDisplayName so kind-to-label mappings exist in one place
- Fix inconsistent min-w-0 overflow-hidden between loading and content states
- Add hover card previews to addressable event roots (A tag) using EmbeddedNaddr
- Replace bespoke reply composer embed with shared EmbeddedNote/EmbeddedNaddr components
2026-03-24 20:42:44 -05:00
Alex Gleason 76b9b3d623 Show rocket icon and site name in comment context for nsite events
'Commenting on ditto' becomes 'Commenting on 🚀 ditto nsite' with
a Rocket icon rendered inline.
2026-03-24 20:32:54 -05:00
Alex Gleason b3193bdde0 Use static 'deployed an nsite' header for consistency with other kinds 2026-03-24 20:27:39 -05:00
Alex Gleason 81fe69dc6b Use rocket icon and show site title in nsite action headers
Changes 'deployed an nsite' to 'deployed Ditto' (or whatever the
title tag contains) and swaps the Globe icon for a Rocket.
2026-03-24 20:27:11 -05:00
Alex Gleason 8e76650a5f Render nsite events correctly across all views
Add NsiteCard rendering to PostDetailPage, reply composer, quote
embeds, comment context labels, and external content headers so
kind 15128/35128 events display properly everywhere.
2026-03-24 20:23:17 -05:00
filemon dbdaff2ada fix(blobbi): resolve performance issues in falling-item drag-drop system
Root cause analysis and fixes:

1. Drag-to-use freeze/loop (HangingItems):
   - Problem: When dropping on Blobbi, item position was set ON Blobbi,
     triggering contact detection to also call attemptUseItem, creating a loop
   - Problem: attemptUseItem had itemsBeingUsed as a dependency, so when it
     changed (inside the callback), the callback identity changed, re-triggering
     the contact detection effect
   - Fix: Changed itemsBeingUsed from state to ref to avoid callback recreation
   - Fix: When dropping on Blobbi, reset item to ORIGINAL position before
     attempting use (prevents contact detection from firing)
   - Fix: Made attemptUseItem have no dependencies (uses refs for everything)
   - Fix: Gated all console.log calls behind import.meta.env.DEV

2. useBlobbonautProfile console flood:
   - Problem: Unconditional console.log at line 63 ran on EVERY render
   - Problem: queryFn had multiple console.logs that ran on every query
   - Fix: Removed/commented out all console.logs in the hook
   - Analysis: The hook itself was NOT causing extra renders - it was just
     exposing the render frequency with its logging

3. BlobbiActionsContext registration instability:
   - Problem: Registration used useState which triggered re-renders on every
     update, and the registration effect depended on useItem identity
   - Fix: Refactored to use refs instead of state for registration data
   - Fix: Added subscription pattern for manual notification only when
     canUseItems actually changes (major state change)
   - Fix: Consumer hook's useItem callback is now stable (reads from ref)
   - Fix: Provider context value is now stable (never changes identity)

Guards now preventing repeated item-use attempts:
- itemsBeingUsedRef.current check at start of attemptUseItem
- Contact detection skips items in itemsBeingUsedRef
- Drag-drop resets item position BEFORE calling attemptUseItem
- attemptUseItem has no dependencies that could trigger recreation
2026-03-24 22:20:04 -03:00
Alex Gleason dc406ff276 Use nsite.lol gateway instead of nosto.re 2026-03-24 20:14:50 -05:00