Commit Graph

2258 Commits

Author SHA1 Message Date
filemon 2cc7c7bcaf Fix Blobbi ground contact by compensating for SVG padding
The SVG viewBox has empty space at the bottom (~12% padding).
This was causing Blobbi to appear floating above the ground.

Fix:
- Changed inner container to use 'items-end' for bottom alignment
- Added negative marginBottom (-10% of size) to pull Blobbi down
- This compensates for the SVG's internal bottom padding

Shadow restored:
- Back to bottom: -4 (was 0)
- Size: 60% width, 12% height
- Blur: 2px
- Better visual separation from Blobbi

Result: Blobbi now visually sits on the ground with proper
shadow placement underneath.
2026-03-23 22:20:16 -03:00
filemon b314b98dd6 Fix Blobbi ground contact - now properly touches ground
Float animation fix:
- Changed from abs(sin) to (1-cos)/2 wave formula
- This creates a 0-to-1 range that regularly returns to zero (ground)
- Y offset now goes from 0 (ground contact) to -3/-4.5 (slight lift)
- Blobbi settles back to ground between float cycles

Walking animation:
- Faster cycle (~0.5s) for rhythmic bobbing
- Range: 0 to -4.5px lift
- Reduced sway (1.5px) and rotation (1.5°)

Idle animation:
- Slower cycle (~2.5s) for calm breathing
- Range: 0 to -3px lift
- Subtle sway (0.8px) and rotation (0.8°)

Shadow adjustments:
- Moved to bottom: 0 (right at ground level)
- Smaller size (55% width, 10% height) for subtler effect
- Less blur (1px) for sharper ground contact
- Stronger base opacity (0.4) that fades as Blobbi lifts
- Scale shrinks more noticeably when lifted
2026-03-23 22:13:40 -03:00
filemon 5ec79e9612 Fix Blobbi ground alignment and shadow anchoring
- Float animation now only moves Blobbi upward from ground level
  - Uses abs(sin) so Y offset is always negative (up) or zero
  - Base position = on the ground, animation lifts slightly above
- Shadow stays anchored to ground while Blobbi floats above it
  - Shadow doesn't move with float offset
  - Shadow scales/fades based on float height for depth illusion
- Reduced horizontal sway and rotation for subtler effect
  - Walking: 2px sway, 2° rotation (was 3px, 3°)
  - Idle: 1px sway, 1° rotation (was 1.5px, 1.5°)
2026-03-23 22:10:00 -03:00
filemon 9e89972008 Improve companion movement and visual polish
- Simplify entry animation to smooth walking emergence (no stuck/squeeze)
- Add forced initial walk after entry - Blobbi walks right immediately
- Improve walking behavior - 75% walk chance, shorter idle periods
- Remove visual flip when changing direction - Blobbi always faces same way
- Add soft floating/swaying animation with different speeds for walk vs idle
  - Walking: faster rhythmic bobbing (~0.8s cycle)
  - Idle: slower calm breathing (~3s cycle)
- Add soft shadow underneath for depth/floating effect
  - Stronger opacity (0.35), blur, and gradient for better visibility
  - Shadow reacts to float height
- Keep clipping behavior for sidebar emergence on desktop
- Mobile uses simple slide-in from left edge
2026-03-23 22:06:45 -03:00
filemon 05864d001a Improve companion entry animation - emerge from content area with playful squeeze effect
Entry position changes:
- Add layout config with sidebarWidth (300px) and maxContentWidth (1200px)
- Calculate main content left edge accounting for centered layout
- Entry now starts at left edge of main content area, not viewport edge
- Resting position is inside the content area with proper padding

Playful entry animation (2.2 seconds total):
- Phase 1 (0-25%): Emerge diagonally with slight forward lean and squish
- Phase 2 (25-40%): Get 'stuck' halfway with wobble effect
- Phase 3 (40-70%): Tug motions - 3 cycles of forward/back pulls, each stronger
- Phase 4 (70-100%): Break free and walk smoothly to final position

Visual effects during entry:
- Rotation (lean forward/back during tugging)
- ScaleX/ScaleY (squish/stretch for squeeze effect)
- Transform origin at center bottom for natural pivoting

The animation feels like Blobbi is squeezing out from the previous page
into the current one, getting briefly stuck, then breaking free.
2026-03-23 20:56:10 -03:00
filemon f9fc81ce71 Fix companion entry animation - no teleport, spawn from behind sidebar
- Change entry position to start behind the sidebar (padding.left/2 - size)
  instead of off-screen left edge, so companion emerges from sidebar
- Add setPosition function to motion hook for syncing position
- Sync motion position to restingPosition when entry animation completes
  to prevent teleport between animated and physics-controlled movement
- Entry is now continuous: emerges from sidebar -> slides to resting position
2026-03-23 20:48:43 -03:00
filemon 66a23cc99b Implement Blobbi companion system with modular architecture
Add a complete companion module under blobbi/companion with:

Core architecture:
- types/companion.types.ts - Type definitions for companion state, motion, gaze
- core/companionConfig.ts - Configuration constants and helpers
- core/companionMachine.ts - State machine for behavior transitions

Hooks:
- useBlobbiCompanionData - Fetches current_companion from kind 31125 profile
- useBlobbiCompanionState - Manages idle/walking/watching behavior
- useBlobbiCompanionMotion - Handles physics, walking, gravity, drag
- useBlobbiCompanionGaze - Eye movement, random observation, mouse following
- useBlobbiCompanion - Main hook combining all systems

Components:
- BlobbiCompanionVisual - Renders baby/adult with external eye control
- BlobbiCompanion - Interactive component with drag support
- BlobbiCompanionLayer - Global overlay layer

Utils:
- movement.ts - Position calculations, bounds, interpolation
- animation.ts - Bob, bounce, easing functions

Features:
- Fetches companion from user's Blobbonaut profile on app load
- Entry animation from behind left sidebar on route changes
- Autonomous walking with energy-based speed
- Random gaze observation when idle
- Mouse cursor following at random intervals
- Drag and gravity physics
- Bottom viewport roaming area
2026-03-23 20:19:31 -03:00
filemon aa2d724a13 Merge branch 'main' into feat-blobbi 2026-03-23 20:10:15 -03:00
filemon 67f840c0ec Add stage validation for companion - only baby/adult allowed
- Add canBeCompanion check to prevent eggs from being set as companion
- Show toast error if user tries to set egg as companion
- Disable companion button for eggs with helpful tooltip
- Update tooltip to show 'Hatch first to set as companion' for eggs
2026-03-23 20:06:35 -03:00
filemon f2e545ff09 Fix companion tag handling and add indicator in Blobbies modal
- Remove current_companion tag entirely when unsetting (instead of empty string)
- Filter out existing current_companion tags before adding new one
- Add Footprints icon indicator in BlobbiSelectorCard for current companion
- Include tooltip 'Current companion' on the indicator icon
- Pass currentCompanion prop through BlobbiSelectorPage and modal
2026-03-23 19:45:02 -03:00
filemon 11142bc96a Implement Set as Companion toggle in Blobbi Hero section
- Add isCurrentCompanion and isUpdatingCompanion props to BlobbiDashboardFloatingControls
- Implement handleSetAsCompanion to toggle current_companion tag on profile
- Show green icon color when Blobbi is the current companion
- Add disabled state support to FloatingActionDef for loading states
- Pass publishEvent to BlobbiDashboard for profile updates
2026-03-23 19:38:26 -03:00
filemon e3d01bc6aa Make Missions modal sections collapsible
- Daily Missions section is now collapsible with chevron toggle
- Hatch Tasks section is collapsible when active
- Evolve Tasks section is collapsible when active
- All sections expanded by default for easy access
- Header shows progress count (e.g., 2/4) for task sections
- Header shows coins earned for Daily Missions section
- Smooth chevron rotation animation on expand/collapse
2026-03-23 18:13:43 -03:00
filemon d3fc1c602a Add Users icon to Blobbi Selector modal title 2026-03-23 18:08:00 -03:00
filemon b55a9bae43 Add sticky header and close button to Blobbi Selector modal
Apply the same pattern used in other Blobbi modals:
- Sticky header with bg-background
- Explicit DialogClose button in header
- Scrollable content area with flex-1 min-h-0 overflow-y-auto
2026-03-23 17:29:19 -03:00
filemon f8c46d7a11 Add sticky header to BlobbiInfoModal and fix close buttons in all Blobbi modals
- Add sticky header pattern to BlobbiInfoModal (main Blobbi view)
- Add explicit DialogClose button inside each sticky header
- Hide default DialogContent close button with [&>button:last-child]:hidden
- Close button now stays visible when scrolling in all modals

Updated modals:
- BlobbiActionsModal
- BlobbiActionInventoryModal
- BlobbiInventoryModal
- BlobbiMissionsModal
- BlobbiShopModal
- BlobbiInfoModal
2026-03-23 17:21:36 -03:00
filemon 75ca14c900 Fix modal padding and add sticky headers for Blobbi modals
- Add pr-12 to DialogHeader to account for close button, fixing right padding
- Make DialogHeader sticky with proper background for all Blobbi modals
- Structure modals as flex column with min-h-0 for proper scrolling
- Apply pattern to: BlobbiActionsModal, BlobbiActionInventoryModal,
  BlobbiInventoryModal, BlobbiMissionsModal, BlobbiShopModal
2026-03-23 17:10:56 -03:00
filemon 163712471c Improve Blobbi UI mobile responsiveness and add compact coin formatting
- Add formatCompactNumber utility for compact coin display (1.2K, 15.4K, 1.2M)
- Fix BlobbiActionInventoryModal (medicine items) layout for mobile
- Fix BlobbiBottomBar to prevent overflow on narrow screens
- Fix BlobbiInventoryModal item cards for mobile
- Fix BlobbiMissionsModal horizontal scroll and layout issues
- Fix DailyMissionsPanel and TasksPanel for mobile
- Fix BlobbiShopModal and related dialogs for mobile
- Apply compact number formatting to all coin displays
2026-03-23 17:07:16 -03:00
Alex Gleason a80b667327 Add Wikipedia and Archive results to autocomplete search dropdown
Integrate useWikipediaSearch and useArchiveSearch into both the desktop
sidebar dropdown (ProfileSearchDropdown) and mobile bottom-nav sheet
(MobileSearchSheet). At most 1 result from each source is shown, always
positioned after Nostr profiles to preserve profile precedence. Keyboard
navigation indices updated to include the new items.
2026-03-23 13:53:04 -05:00
Alex Gleason 894f692dea Display rich Wikipedia article content on /i/ pages instead of generic link preview
Detect Wikipedia URLs and render a custom WikipediaArticleHeader with hero
image, article title, Wikidata description, expandable extract, and a
Read on Wikipedia footer link. Also uses the Wikipedia API for accurate
page titles in the header bar and SEO metadata, and navigates back to
/wikipedia on the back button.
2026-03-23 13:31:40 -05:00
Alex Gleason a5dead1765 Show only view count number next to eye icon, drop 'views' label 2026-03-23 13:25:11 -05:00
Alex Gleason 02a16cad90 Fix Wikipedia icon to use the correct Simple Icons SVG path 2026-03-23 13:24:13 -05:00
Alex Gleason 4dd1ceb9b4 Add custom Wikipedia icon, use it in page header, card fallbacks, and sidebar 2026-03-23 13:23:22 -05:00
Alex Gleason 18b3da600d Include fair-use images in Wikipedia search thumbnails
Add pilicense=any to the pageimages query so articles with
non-free/fair-use images (common for games, movies, etc.) also
return thumbnails.
2026-03-23 13:19:24 -05:00
Alex Gleason 65c3512835 Add thumbnails to Wikipedia search autocomplete results 2026-03-23 13:16:52 -05:00
Alex Gleason 4e6a055e02 Remove redundant 'Today's Featured Article' badge from hero card 2026-03-23 13:15:18 -05:00
Alex Gleason 12700fd025 Change Wikipedia pills from filter tabs to scrollspy navigation
Pills now highlight based on which section is visible as you scroll.
Clicking a pill smooth-scrolls to that section. The 'All' pill and
filter-based empty states are removed since all sections are always shown.
2026-03-23 13:13:54 -05:00
Alex Gleason 030b277e8f Remove Did You Know and Picture of the Day sections from Wikipedia page 2026-03-23 13:10:21 -05:00
Alex Gleason daf3a38c21 Add /wikipedia page with dynamic featured content from Wikipedia's API 2026-03-23 12:59:33 -05:00
Alex Gleason a10feef57d Add 3-dots menu to badge detail page for sidebar and other actions 2026-03-23 12:37:27 -05:00
Alex Gleason 358e25560f Make only tabs sticky on follow pack detail page 2026-03-23 12:28:55 -05:00
Alex Gleason ba09214817 Make only tabs sticky on list detail page instead of entire header 2026-03-23 12:25:12 -05:00
filemon 974cdcccc9 Merge branch 'main' into feat-blobbi 2026-03-23 10:58:25 -03:00
Alex Gleason 3ba269172c Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-23 00:48:15 -05:00
Alex Gleason c4a67d5b05 Show list author with avatar and name in list page header
Display a small linked avatar and author name under the list title so
users can see who created the list and click through to their profile.
2026-03-23 00:44:40 -05:00
Alex Gleason 6d71fcaa45 Move image quality setting to Network Settings page
Remove the inline toggle from the post composer toolbar and add
imageQuality to AppConfig instead. The setting now lives in
Settings > Network under 'Image Uploads' with a Compressed/Original
pill toggle, persisted to localStorage like other app settings.
2026-03-23 00:44:30 -05:00
Alex Gleason 651f8a0518 Replace member count with stacked avatar preview on list pages
Remove the 'X members' subtitle from the header and add a row of stacked
member avatars (up to 8) with a clickable '+X more' that switches to the
Members tab, matching the style used in quote post list cards.
2026-03-23 00:42:34 -05:00
Alex Gleason fd740b8c6e Use default TabButton styling for starter pack and list page tabs
Remove custom className/indicatorClassName overrides and icon children
from tab buttons to match the cleaner default style used on badges page.
2026-03-23 00:38:51 -05:00
Alex Gleason 4d07aa050d Add Feed and Members tabs to starter pack detail pages
Starter pack pages now have two tabs: Feed (default) shows posts from all
pack members using useStreamPosts, and Members shows the existing member
list with follow/unfollow buttons.
2026-03-23 00:36:28 -05:00
Alex Gleason 235abf6add Add image quality toggle to post composer
Adds a Compressed/Original toggle button in the ComposeBox toolbar.
When set to Original, images are uploaded as-is without resizing or
re-encoding. Defaults to Compressed.
2026-03-23 00:35:31 -05:00
Alex Gleason 9e26446d7b Pick smallest format (JPEG vs PNG) when resizing images
Instead of always converting to JPEG, encode both JPEG and PNG in
parallel and keep whichever is smaller. Skip re-encoding entirely
when the image already fits within the dimension limit.
2026-03-23 00:32:13 -05:00
Alex Gleason fbf8c328f6 Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-23 00:22:12 -05:00
Alex Gleason 389a055872 Merge branch 'experimental-badges' 2026-03-23 00:21:33 -05:00
Alex Gleason e9fee66560 fix: audit cleanup — fix bugs, perf issues, and stale code in badge system
- Fix parseBadgeATag truncating d-tags with colons (use slice+join)
- Fix useEventStats: replace redundant useQuery wrapper with useMemo
- Fix isAddressableKind: remove incorrect kind 0/3 (replaceable, not addressable)
- Fix useBadgeFeed: add follow list to queryKey, compose abort signals
- Fix BadgesPage: move reorder mutation out of state updater, memoize pendingRefs
- Fix useCreateBadge: add onSuccess cache invalidation for badge-feed and my-created-badges
- Remove dead categories param and t-tag code from useCreateBadge
- Remove unnecessary badge-awards-to invalidation from useAcceptBadge
- Remove redundant queryClient usage from CreateBadgeDialog
- Remove stale 'Achievement' wording from extraKinds badge description
- Clean up NIP.md trailing blank lines
2026-03-23 00:21:02 -05:00
Alex Gleason 83fb9fd370 Extract human-readable title from URL slug for sidebar labels
Instead of showing just the site name (e.g. 'Internet Archive'), parse the
URL path for a readable slug and title-case it. Falls back to embed site
name or hostname when the path has no meaningful slug.
2026-03-23 00:17:57 -05:00
Alex Gleason ab3cb735ff Merge branch 'experimental-badges' into 'main'
feat: improvements to badges (NIP-58)

See merge request soapbox-pub/ditto!100
2026-03-23 05:17:32 +00:00
Alex Gleason 062e170501 Add sidebar toggle to profile page 3-dots menu 2026-03-23 00:13:00 -05:00
Alex Gleason 4b386fe592 Show book title and BookOpen icon for ISBN sidebar items
ExternalContentSidebarItem now fetches the book title from OpenLibrary
via useBookInfo for ISBN entries instead of showing the generic 'Books'
label. The icon uses BookOpen instead of the Globe fallback.
2026-03-23 00:07:12 -05:00
Alex Gleason 201dd60cb7 Add sidebar toggle to external content pages and post 3-dots menu
ExternalContentPage (country, URL, ISBN pages) gains a 3-dots menu on
the right side of the action bar with Add/Remove from sidebar.

NoteMoreMenu gets an Add/Remove from sidebar item after 'Add to list',
so any post can be pinned to the sidebar from its options menu.

Both locations toggle between add (PanelLeft icon) and remove (Trash2
icon) based on whether the item is already in the sidebar.
2026-03-23 00:02:00 -05:00
Alex Gleason e2503f3573 refactor: remove custom badge tag extensions (t categories and tier)
Remove all non-standard NIP-58 extensions:
- Delete BadgeTierPill component and badge tier system (bronze/silver/gold/diamond)
- Delete isShopBadge, isAchievementBadge, getBadgeTier, BadgeTier type
- Delete publish-achievement-badges.sh script
- Remove kind 30009 section from NIP.md
- Clean up badge category pills from detail page and tier pills from badge rows

Badges now use pure standard NIP-58 with no custom tags.
2026-03-22 23:59:03 -05:00
Alex Gleason 3bbb6eae7e Toggle sidebar action on list detail page: add or remove
The share dropdown on ListDetailPage now shows 'Remove from sidebar'
with a trash icon when the list is already pinned, instead of hiding
the action entirely. This lets users unpin lists without entering
sidebar edit mode.
2026-03-22 23:57:47 -05:00