Resolves critique App Response Delay#41
Merged
Merged
Conversation
Owner
Author
matthewctechnology
left a comment
There was a problem hiding this comment.
Approved ✅
There will be a 1s delay before predetermined response to simulate thinking.
Reminder
Pull request authors can’t approve their own pull request.
- Must Merge without waiting for requirements to be met (bypass rules)
Summary
Resolves preconfigured chat response delay.
Description
Resolves preconfigured chat response delay so that it displays thinking... for 1 second.
Changes
- Sets timeout in
useChatReduceronfallbackResponseinstead of lengthsimulateAIResponseduration ✔️
Criteria
- Given static site, when a user enters and submits input, then the agent responds after about a 1 second delay while
thinking...is displayed and then a predetermided response is provided ✔️ - about 1 second - Given dynamic site, a user enters and submits input, when the agent responds after fetching while
thinking...is displayed, then a response is provided ✔️ - about 3 seconds
Tests
Chat with Static AI Response 🟢 ☑️
- Simulate API error with unreachable code in
critique/src/app/api/critique/route.tswithreturn new Response(JSON.stringify({ error: 'no implementation' }), { status: 501 });on ln19 before thetry- Falls back to static response ✔️
- Shows error message in node log and browser console ✔️
- Run
npm run devand browse<codespace>-3000.app.github.dev
- Shows text field with
enter an ideaplaceholder text andsubmitbutton ✔️
- Enter text in the input field
- Input field updates and
submitbutton becomes enabled ✔️
- Click the
submitbutton
- Displays user message in chat view ✔️
- Shows
thinking...indicator for ~1 second ✔️ - Displays empty Input field ✔️
- Wait ~1 second
- Displays random static AI response below the user message ✔️
- Does not display
thinking...indicator ✔️
- Confirm user and AI messages show in chat view
- Displays messages as independent elements in the chat view ✔️
- Displays User message ✔️
- Displays AI messages from the preconfigured AI Responses ✔️
Chat with AI Response 🟢 ☑️
- Run
npm run devand browse<codespace>-3000.app.github.dev
- Shows text field with
enter an ideaplaceholder text andsubmitbutton ✔️
- Enter text in the input field
- Input field updates and
submitbutton becomes enabled ✔️
- Click the
submitbutton
- Displays user message in chat view ✔️
- Shows
thinking...indicator for ~1 second ✔️ - Displays empty Input field ✔️
- Wait ~3 second
- Displays actual AI response below the user message ✔️
- Does not display
thinking...indicator ✔️
- Confirm user and AI messages show in chat view
- Displays messages as independent elements in the chat view ✔️
- Displays User message ✔️
- Displays AI message ✔️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves preconfigured chat response delay.
Description
Resolves preconfigured chat response delay so that it displays
thinking...for 1 second. In a development environment thesimulateAIResponseruntime is slow and in production as a static site on GitHub Pages the runtime is fast. There needs to be a manual delay and displaythinking....Changes
useChatReduceronfallbackResponseinstead of lengthsimulateAIResponsedurationCriteria
thinking...is displayed and then a predetermided response is providedthinking...is displayed, then a response is providedSteps
Chat with Static AI Response
<user>.github.io/<repo>enter an ideaplaceholder text andsubmitbuttonsubmitbutton becomes enabledsubmitbuttonthinking...indicator below for ~1 secondTests
Chat with Static AI Response
critique/src/app/api/critique/route.tswithreturn new Response(JSON.stringify({ error: 'no implementation' }), { status: 501 });on ln19 before thetrynpm run devand browse<codespace>-3000.app.github.deventer an ideaplaceholder text andsubmitbuttonsubmitbutton becomes enabledsubmitbuttonthinking...indicator belowthinking...indicator