Commit Graph

7 Commits

Author SHA1 Message Date
Your Name 797859ac80 Feature: Add search filtering on Enter key
Users can now:
1. Type a query and press Enter (without selecting a suggestion) to filter posts on the map
2. When picking a post suggestion, it navigates AND filters by that post's title
3. When picking a city/place, it navigates but clears the filter

Changes:
- SmartSearchBar: Added onSearch prop, triggers on Enter with no active item
- MapView: Added handleSearch() to set searchQuery for filtering
- Posts are automatically filtered by usePostsEngine's matchesSearch()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 16:10:06 -05:00
Your Name 28e760d616 Major UX improvements: Smart search, navigation, fixed markers
1. Smart Search Integration (MapView.jsx, SmartSearchBar.jsx):
   - Replace simple search bar with SmartSearchBar component
   - Suggestions appear on focus (popular cities/regions)
   - Suggestions update as user types (debounced 150ms)
   - Click suggestion → fly to location with appropriate zoom
   - Search triggers even with empty query for popular results

2. Navigation to Cities (MapView.jsx):
   - New handlePickSuggestion() function
   - Extracts coords from suggestion (supports coords array or lat/lon)
   - Uses map.flyTo() with smart zoom levels per type:
     * Cities: zoom 11
     * Regions: zoom 7
     * Posts: zoom 16
     * Profiles: zoom 14
   - Clears search after navigation

3. Fixed Marker Anchoring (markerManager.js):
   - Changed anchor: "center" → "bottom"
   - Markers now stay fixed at geographic position
   - Pin design: circle image + triangular point (52px height)
   - Point positioned at exact lat/lon location
   - No more drifting when map moves!

4. Improved Pin Design:
   - Circle (32px) with category color background
   - White border + shadow for visibility
   - Triangular point (16px) below circle
   - Image inside circle if available
   - Hover card positioned above pin (bottom: 58px)
   - Smooth transitions on hover/click

Mobile-friendly: Works on cellphone without console, visual feedback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 15:39:58 -05:00
Your Name 069072dc14 Fix: Allow search suggestions with empty query for popular results
Changes:
- Comment out early return when query is empty
- Allow recoSearch to be called with empty/trimmed query
- Backend returns popular cities/regions when query is empty
- Enables showing suggestions immediately on focus (UX improvement)

Backend test confirms it works:
$ curl "http://localhost:8081/api/suggestions?q="
Returns: 6 popular suggestions (Montreal, Quebec City, Toronto, etc.)

$ curl "http://localhost:8081/api/suggestions?q=to"
Returns: Toronto, Seattle, Boston

Now users will see suggestions as they type + popular items on focus

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 15:30:45 -05:00
Your Name c659c0267d Fix: Hide PWA install button when installed, improve clustering, add debug logs
Fixes three major issues:

1. PWA Install Button (TopBar.jsx):
   - Import isRunningAsPWA() and canInstall() from pwaInstall.js
   - Add state to track if button should be shown
   - Listen to beforeinstallprompt and appinstalled events
   - Hide button when app is already installed or running as PWA

2. Search Suggestions Debug (SmartSearchBar.jsx, recoSearch.js):
   - Add console.log statements to trace search flow
   - Track: search query, results count, errors
   - Helps diagnose why suggestions don't appear
   - recoSearch: Log each endpoint attempt and response

3. Clustering Improvements (usePostsEngine.js, postPriority.js):
   - Reduce maxFullCards: 15 → 12 (fewer full cards)
   - Increase clusterRadius: 0.0015 → 0.002 (~200m for better grouping)
   - Increase minScoreForCard: 35 → 50 (stricter threshold)
   - Reduce default recoScore: 50 → 40 (lower baseline)
   - Add console.log for prioritization results
   - Result: More posts shown as simple markers, less clutter

Debug logs will be visible in browser console to diagnose issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 15:23:44 -05:00
Your Name 76adb74833 Add intelligent post clustering and simple markers
Implement smart prioritization system to reduce map clutter:
- Create priority scoring based on reco score, category, freshness, distance, engagement
- Cluster nearby posts and show best post as full card, others as simple markers
- Simple markers: circular icons with category colors, hover preview, click to expand
- Max 15 full cards displayed, rest shown as compact markers
- Optimize search debounce: 220ms → 150ms for faster suggestions

New files:
- postPriority.js: Scoring and clustering algorithm

Updated:
- markerManager.js: Add createSimpleMarkerForPost() with hover cards
- usePostsEngine.js: Use prioritizePosts() to separate full cards vs simple markers
- SmartSearchBar.jsx: Faster debounce (150ms), increased limit to 12 suggestions

Result: Less visual clutter, better UX with prioritized content

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 15:15:53 -05:00
Your Name 290e713796 Add autocomplete suggestions with smart zoom
- Update recoSearch to use /api/suggestions endpoint
- Improve zoom levels for different types:
  * Cities: zoom 11
  * Regions: zoom 7
  * Posts: zoom 16
  * Profiles: zoom 14
- Support lat/lon in normalized results
- Real-time suggestions as user types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 11:59:11 -05:00
Your Name 86d6f153c6 update frontend 2025-12-20 22:32:11 -05:00