Skip to content

Full overhaul: API updates, UI/UX redesign, audio generation support - #38

Merged
CloudCompile merged 4 commits into
mainfrom
claude/overhaul-pollinations-api-CxNOr
May 8, 2026
Merged

Full overhaul: API updates, UI/UX redesign, audio generation support#38
CloudCompile merged 4 commits into
mainfrom
claude/overhaul-pollinations-api-CxNOr

Conversation

@CloudCompile

Copy link
Copy Markdown
Owner

$(cat <<'EOF'

Summary

  • API layer: Fixed video endpoint (/video/{prompt} not /image/{prompt}), added generateAudio() via GET /audio/{text}, added audio models fetching, consistent error parsing for 401/402/403 shape, removed hardcoded token fallback
  • UI/UX redesign: Replaced slash commands with Chat | Image | Video | Audio mode pills; redesigned input card, theme tokens, sidebar, welcome screen, and message bubbles
  • New features: Full audio generation UI with voice selector (6 voices), audio player message cards with metadata; improved media cards for image/video

Changes

src/utils/api.js

  • Fix video endpoint: was incorrectly using /image/{prompt}, now uses /video/{prompt}
  • Add generateAudio(text, options) — calls GET /audio/{text}?voice=&model=
  • Add /audio/models to loadModels() and initializeModels() (returns audioModels)
  • parseApiError() reads structured { error: { code, message } } response shape; maps 401/402/403 to friendly messages
  • Remove hardcoded sk_... token fallback; uses VITE_POLLINATIONS_API_KEY env var or sends unauthenticated

src/theme.css

  • New design tokens: --radius-*, --shadow-* scale, --bg-elevated, --bg-input, --border-focus
  • Improved dark mode depth (true black #0d0d0d base, layered elevation)
  • Light mode refinements (off-white base, better shadows)

src/components/ChatInput.jsx + ChatInput.css

  • Mode pills replace slash commands: Chat | Image | Video | Audio buttons at the top of the input card
  • Audio mode adds a voice selector (alloy, echo, fable, onyx, nova, shimmer)
  • Attachment preview redesigned as a compact chip
  • Input card has a clean focus ring, border-radius, and shadow system
  • Mobile: mode pill labels hide, dropdown becomes a bottom sheet

src/App.jsx

  • Wires handleGenerateAudio()generateAudio() from api.js
  • Loads and passes audioModels, selectedAudioModel, onAudioModelChange
  • Default theme changed to dark; error messages now show actual error text
  • Export/clear-all passed down to Sidebar

src/components/MessageBubble.jsx

  • Audio card: player with header (icon, voice label), native <audio> controls, transcript, model metadata
  • Image and video use new media-card + media-card-meta layout
  • Copy button shows checkmark feedback for 1.5 s
  • Action bar only shows when there's content to act on

src/components/MessageArea.jsx + MessageArea.css

  • Welcome screen: animated logo circle, gradient headline, subtitle, 2×2 feature card grid (Chat / Image / Video / Audio)
  • New CSS classes: .media-card, .audio-card, .audio-player, .audio-transcript, .media-meta-row

src/components/Sidebar.jsx + Sidebar.css

  • Brand logo (gradient dot + "Pollinations" wordmark) when expanded
  • Chat items show relative timestamp (2h ago, Mon) beneath title
  • "Clear all" link in chat list header; export icon in icon row
  • theme prop drives light/dark sun/moon icon
  • Collapsed state: narrower (64 px), cleaner icon row

Test plan

  • Start dev server (npm run dev in react-app/)
  • Chat mode: send a message, verify streaming response
  • Image mode: switch pill to Image, type a prompt, verify image card renders
  • Video mode: switch pill to Video, verify video card with controls
  • Audio mode: switch pill to Audio, select a voice, verify audio player card
  • Model dropdown: search, select, verify chip updates
  • Attachment: drag-drop or paste image, send with message
  • Sidebar: expand/collapse, timestamps visible, delete chat, clear all, theme toggle
  • Dark/light theme toggle from sidebar and keyboard shortcut (Ctrl+Shift+L)
  • Welcome screen shows on empty chat with feature cards
  • Regenerate and copy buttons work on assistant messages

https://claude.ai/code/session_0123K4e3ay6qWfSGVHD7Q2SS
EOF
)


Generated by Claude Code

API (api.js):
- Fix video endpoint to use /video/{prompt} (was incorrectly /image/{prompt})
- Add generateAudio() using GET /audio/{text}?voice=&model=
- Add audio models endpoint (/audio/models) to loadModels/initializeModels
- Consistent parseApiError() for 401/402/403 and structured error JSON
- Remove hardcoded token fallback; VITE_POLLINATIONS_API_KEY or unauthenticated

UI/UX overhaul:
- theme.css: refined tokens — radius, shadow, border; improved dark mode depth
- ChatInput: Chat/Image/Video/Audio mode pills replace slash commands; voice selector; polished input card
- App.jsx: wire audio generation + audio models; default theme dark; cleaner handlers
- MessageBubble: audio player card with voice/model metadata; media-card layout for image/video; copy-feedback
- MessageArea: feature-card welcome screen (Chat, Image, Video, Audio); logo + subtitle
- Sidebar: brand logo dot/wordmark; timestamps on chat items; clear-all; icon-row quick actions

https://claude.ai/code/session_0123K4e3ay6qWfSGVHD7Q2SS
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

🤖 PR Summary by Pollinations.AI
(referrer: prisimai.github.io)

Summary

⚠️ IMPORTANT NOTICE ⚠️

The Pollinations legacy text API is being deprecated for authenticated users.

Please migrate to our new service at https://enter.pollinations.ai for better performance and access to all the latest models.

Note: Anonymous requests to text.pollinations.ai are NOT affected and will continue to work normally.

Risk Level: medium
Breaking Change: false

Diff Stats

  • Files changed: 10
  • Lines added: 2146
  • Lines removed: 2668
  • Total lines changed: 4814

This comment updates automatically.

claude added 3 commits May 8, 2026 16:03
Phase 1: Design System Foundation
- Added comprehensive typography variables (font-size, font-weight, line-height, letter-spacing)
- Introduced spacing scale (--spacing-0.5 through --spacing-8)
- Added neutral gray color palette (--color-gray-50 through --color-gray-900)
- Expanded gradient system (soft, vibrant, neutral, success, warning, error)
- Centralized z-index scale for better layer management
- Added animation keyframes (fadeIn, fadeOut, slideIn, scaleIn, bounce, pulse, shimmer, spin)

Phase 2: Sidebar Component Enhancements
- Improved icon button focus states with accessible ring styling
- Enhanced chat item hover and focus states for better UX
- Added keyboard navigation support (Enter/Space to activate chat items)
- Improved touch targets on mobile (44px minimum)
- Enhanced empty state message with visual indicator
- Added comprehensive aria labels and aria-current to all sidebar elements
- Better mobile responsiveness with proper animations

https://claude.ai/code/session_0123K4e3ay6qWfSGVHD7Q2SS
Improvements to ChatInput CSS:
- Added focus states for mode pills, voice selector, toolbar buttons, send button
- Improved touch targets on mobile (44px minimum for buttons)
- Better disabled state styling across all inputs
- Enhanced voice selector with improved hover and focus states
- Better placeholder styling with improved opacity
- Added active state feedback for send button
- Improved mobile responsiveness with better spacing and layout adjustments
- Better animations and transitions

Improvements to ChatInput JSX:
- Added aria labels to all interactive elements (mode pills, buttons, selectors)
- Added role="tablist" and role="tab" for mode pill accessibility
- Added aria-selected, aria-expanded, and aria-describedby attributes
- Better title attributes for all buttons
- Improved keyboard navigation support

Mobile optimizations:
- Touch targets increased to 40px+ on tablets, 44px+ on phones
- Better spacing and layout for small screens
- Improved mode pill visibility with proper scaling

https://claude.ai/code/session_0123K4e3ay6qWfSGVHD7Q2SS
Improvements to MessageArea CSS:
- Added hover effects with subtle lift animations to feature cards
- Added focus states to header icon buttons and dropdowns
- Added focus states to theme cards with proper keyboard navigation
- Enhanced media card animations with slideIn effect and hover lift
- Better transitions and transform effects for visual feedback
- Improved user dropdown item styling with better focus states
- Better active state styling for theme cards
- Improved touch feedback and visual hierarchy

These changes improve the overall polish and accessibility of the message display area, making the UI feel more responsive and delightful while maintaining good keyboard navigation support.

https://claude.ai/code/session_0123K4e3ay6qWfSGVHD7Q2SS
@CloudCompile
CloudCompile merged commit abeb9e8 into main May 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants