Skip to content

feat(webpage): add AI landing page generation with preview#23

Open
ram-from-tvl wants to merge 2 commits into
DemocratiseResearch:mainfrom
ram-from-tvl:feature/webpage-ai-landing
Open

feat(webpage): add AI landing page generation with preview#23
ram-from-tvl wants to merge 2 commits into
DemocratiseResearch:mainfrom
ram-from-tvl:feature/webpage-ai-landing

Conversation

@ram-from-tvl

Copy link
Copy Markdown

Description
This update introduces an end-to-end webpage generation feature that creates a polished, AI-generated landing page from parsed paper content. The output is focused on clear paper highlights, figure visibility, and repository/resource links, with adaptive structure based on paper content.

Demo video

saral-webpage-demo-1_ym2wvnQd.mp4

Key improvements:

  1. Added backend webpage generation and preview/download endpoints.
  2. Implemented AI-driven prompt flow with quality checks for layout and figure usage.
  3. Enforced single-page generation per run for a cleaner workflow.
  4. Simplified frontend to a single live preview experience.
  5. Removed sidebar variant clutter and kept a prominent Download HTML action.
  6. Updated download naming to neutral, production-friendly filenames.

Copilot AI review requested due to automatic review settings April 4, 2026 01:23
@ram-from-tvl
ram-from-tvl force-pushed the feature/webpage-ai-landing branch from 4d8475e to cd31625 Compare April 4, 2026 01:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an end-to-end “AI landing page” feature that generates a single polished HTML research webpage per run, exposes it via backend endpoints (generate/list/preview/download/assets), and provides a simplified frontend UI with live preview + HTML download.

Changes:

  • Backend: added webpage generation service (Gemini prompt + validation/repair), plus API routes for generate/list/preview/download and figure asset serving.
  • Frontend: added a new “Webpage Generation” page with viewport preview controls and a Download HTML action, plus API client methods.
  • App wiring: added route and sidebar entry for the new page and created a temp directory for webpage outputs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
frontend/src/services/api.js Adds WebpageService + ApiService helpers for generate/list/preview/download.
frontend/src/pages/WebpageGeneration.jsx New UI for generate, live preview iframe, and HTML download.
frontend/src/components/navigation/Sidebar.jsx Adds sidebar nav item for the new feature.
frontend/src/App.jsx Registers /webpage-generation route behind ProtectedRoute.
backend/app/services/webpage_generator.py Implements Gemini prompting, validation/repair, and variant persistence.
backend/app/routes/webpage.py Adds generate/list/preview/download/asset endpoints.
backend/app/models/request_models.py Adds request/response models for webpage generation and variants.
backend/app/main.py Includes the new router and creates temp/webpages dir at startup.
Comments suppressed due to low confidence (1)

frontend/src/components/navigation/Sidebar.jsx:78

  • Webpage Generation is added with step: 0 and handleLinkClick calls setStep(0). After this, other navigation items become inaccessible because isAccessible requires step <= currentStep (and currentStep is now 0), effectively locking the user out of the main workflow unless steps were already completed. Consider decoupling this page from the step-gated workflow (e.g., omit step/setStep for this item, or assign it a step number that doesn’t break gating and adjust isAccessible accordingly).
  const navigationItems = [
    { to: '/api-setup', icon: FiKey, label: 'API Setup', step: 1 },
    { to: '/paper-processing', icon: FiUpload, label: 'Paper Upload', step: 2 },
    { to: '/script-generation', icon: FiEdit3, label: 'Script Generation', step: 3 },
    { to: '/slide-creation', icon: FiSliders, label: 'Slide Creation', step: 4 },
    { to: '/media-generation', icon: FiPlay, label: 'Media Generation', step: 5 },
    { to: '/poster', icon: FiZap, label: 'Poster Generation', step: 6 },
    { to: '/results', icon: FiDownload, label: 'Results', step: 7 },
    { to: '/webpage-generation', icon: FiGlobe, label: 'Webpage Generation', step: 0 },
  ];

  const handleLinkClick = (step) => {
    if (step === 0 || step <= currentStep || completedSteps.includes(step)) {
      setStep(step);
      disableAutoProgress();
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/pages/WebpageGeneration.jsx
Comment thread frontend/src/pages/WebpageGeneration.jsx Outdated
Comment thread backend/app/routes/webpage.py
Comment thread backend/app/routes/webpage.py
Comment thread backend/app/services/webpage_generator.py
Comment thread backend/app/services/webpage_generator.py Outdated
Comment thread backend/app/services/webpage_generator.py Outdated
@ram-from-tvl

Copy link
Copy Markdown
Author

Hi @RahulSundar
checking in to see if there is any feedback on this PR. Happy to address any requested updates to help get this merged.
Thanks!

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.

2 participants