Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add stop button when generating code #63

Merged
merged 6 commits into from
Nov 21, 2023

Conversation

clean99
Copy link
Contributor

@clean99 clean99 commented Nov 21, 2023

  • Add a stop button when it is generating code.
  • When the stop button is clicked, WebSocket will close with status code 4333.
  • When the client side receives 4333 status code, it will set the AppStatus to CODE_READY and display stop successful toast.

@clean99
Copy link
Contributor Author

clean99 commented Nov 21, 2023

#60

Copy link
Contributor

sweep-ai bot commented Nov 21, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

@vagusX
Copy link
Contributor

vagusX commented Nov 21, 2023

Should we cancel the request in python too?

@clean99
Copy link
Contributor Author

clean99 commented Nov 21, 2023

Should we cancel the request in python too?

In my understanding, once the client side calls close() method, the sever side will be informed and cancel too

@@ -26,8 +26,8 @@ import { UrlInputSection } from "./components/UrlInputSection";
import TermsOfServiceDialog from "./components/TermsOfServiceDialog";

function App() {
const [appState, setAppState] = useState<"INITIAL" | "CODING" | "CODE_READY">(
"INITIAL"
const [appState, setAppState] = useState<AppStatus>(
Copy link
Owner

Choose a reason for hiding this comment

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

In the future, would be good to keep names like this consistent: AppStatus -> AppState. I'll update

CODE_READY = "CODE_READY",
}

export const USER_CLOSE_WEB_SOCKET_CODE = 4333;
Copy link
Owner

Choose a reason for hiding this comment

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

would move this to constants.ts

Copy link
Owner

Choose a reason for hiding this comment

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

it's not a type

@abi
Copy link
Owner

abi commented Nov 21, 2023

Great job on this @clean99 thanks for your contribution

@abi abi merged commit 52b7ff7 into abi:main Nov 21, 2023
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.

3 participants