Skip to content

Migrate UI to React with comprehensive features#26

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1762204826-react-ui-migration
Open

Migrate UI to React with comprehensive features#26
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1762204826-react-ui-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Nov 3, 2025

Migrate UI to React with comprehensive features

Summary

This PR completely migrates the LLM Proxy UI from vanilla HTML/JavaScript to a modern React + TypeScript stack. The new implementation preserves all existing functionality while adding previously missing features (History, Settings, and About pages that were linked in the sidebar but not implemented).

Tech Stack:

  • React 18 + TypeScript
  • Vite for build tooling
  • Tailwind CSS for styling
  • shadcn/ui component library
  • React Router for navigation

Key Changes:

  1. New React Frontend (frontend/ directory) with component-based architecture
  2. Updated Go Server to serve React build from frontend/dist with SPA routing support
  3. Feature Additions:
    • History page with search, filtering, and export
    • Settings page for API configuration
    • About page with system information
    • Query history persistence in localStorage
    • Theme management (light/dark mode)
  4. Updated Model Versions including latest models (Gemini 2.0 Flash, Claude 3.5 Sonnet, GPT-4o)

Screenshots:

Dashboard with multi-model query:
Dashboard

History page:
History

About page:
About

Review & Testing Checklist for Human

CRITICAL ITEMS (verify these carefully):

  • Test full query workflow end-to-end: Submit both single and multi-model queries, verify responses display correctly in all view modes (Grid, Side-by-Side, Stacked)
  • Verify model versions against provider documentation: The model IDs (especially gemini-2.0-flash, claude-3-5-sonnet-20241022, gpt-4o) should match current API versions - these may need updates
  • Test download functionality: Download responses in TXT, PDF, and DOCX formats. PDF/DOCX use CDN-loaded libraries (jspdf and docx) which could fail or have security implications
  • Test in production environment: The Go server's SPA routing fallback (frontend/dist/index.html) and API URL configuration (VITE_API_URL) need verification in actual deployment

MEDIUM PRIORITY:

  • Test theme toggle persistence across page refreshes
  • Test history persistence in localStorage and export functionality
  • Verify responsive design on mobile devices
  • Test settings page - changes should persist to localStorage

Recommended Test Plan:

  1. Build the frontend: cd frontend && npm install && npm run build
  2. Start the server: go run cmd/server/main.go
  3. Navigate to all pages (Dashboard, History, Settings, About)
  4. Submit queries with different model combinations
  5. Test all download formats
  6. Toggle theme and verify persistence
  7. Check browser console for any errors

Notes

Known Issues/Limitations:

  • The old ui/ directory is still present but no longer served. Should it be removed in a follow-up?
  • Download libraries are loaded from CDN at runtime - consider bundling them or using npm packages for better reliability
  • TypeScript types for download functions use unknown casts which reduces type safety
  • Model versions hardcoded in constants.ts may need periodic updates as providers release new versions

Session Info:

- Created React app with TypeScript, Tailwind CSS, and shadcn/ui
- Implemented all existing UI features:
  - Model status display with real-time updates
  - Single and multi-model query support
  - Model version selection for each provider
  - Response display with multiple view modes (Grid, Side-by-Side, Stacked)
  - Copy to clipboard functionality
  - Download responses in TXT, PDF, and DOCX formats
  - Theme toggle (light/dark mode)
  - Responsive design with mobile support

- Added missing features:
  - History page with query history, search, and filtering
  - Settings page with API configuration options
  - About page with system information and supported models
  - React Router for navigation between pages
  - Context providers for theme and history management
  - Local storage for history persistence

- Updated Go server to serve React build from frontend/dist
- All lint checks passing (only warnings from pre-installed shadcn/ui components)
- Updated model versions to include latest models (Gemini 2.0 Flash, Claude 3.5 Sonnet, GPT-4o)

Co-Authored-By: samorin7@gmail.com <samorin7@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

- Add 'unknown' type assertion for window type casting
- Update jsPDF text method signature to accept string or string[]
- Fixes build errors that prevented successful compilation

Co-Authored-By: samorin7@gmail.com <samorin7@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants