lightrail-ai / lightrail

Lightrail Monorepo
https://lightrail.ai
MIT License
221 stars 4 forks source link

Edit in VSCode - generated code doesn't match Lightrail proposed code #31

Closed shanelle627 closed 1 year ago

shanelle627 commented 1 year ago

OSX, command: "Pass user state into the userinput component "

Code Generated in Lightrail Command Bar:

'use client'
import Image from 'next/image';
import UserInput from '@/components/UserInput';
import Message from '@/components/Message';
import Button from '@/components/Button';
import Link from 'next/link';
import { useEffect, useState } from 'react';
import supabase from '@/supabase.js';

export default function Home() {

  // Existing code...

  return (
    <div>
      <main className="min-h-screen justify-between p-2">
        <div className="flex justify-between items-center p-2">
          <h1 className="text-xl text-grey-500" >ChatGPT Clone</h1>
          {user ? (
            <button className="text-grey-500" onClick={handleLogout}>Log Out</button>
          ) : (
            <Link href="/login">
              <button className="text-grey-500">Log In</button>
            </Link>
          )}
        </div>
        <div>
          <UserInput 
            onNewResponse={handleNewResponse} 
            prevMessages={messages} 
            setLoading={handleLoading} 
            user={user} // Pass user state to UserInput component
          ></UserInput>
          // Existing code...
        </div>
      </main>
    </div>
  )
}

In VSCode:

image
vishnumenon commented 1 year ago

This seems like more an issue of code-generation that skipped large chunks, the diff looks like its comparing against the generation with elided content, but leaving open in case there's something else happening here