Skip to content

Resolves critique App Response Delay#41

Merged
matthewctechnology merged 2 commits into
mainfrom
stacked-40
Dec 29, 2025
Merged

Resolves critique App Response Delay#41
matthewctechnology merged 2 commits into
mainfrom
stacked-40

Conversation

@matthewctechnology
Copy link
Copy Markdown
Owner

Summary

Resolves preconfigured chat response delay.

Description

Resolves preconfigured chat response delay so that it displays thinking... for 1 second. In a development environment the simulateAIResponse runtime is slow and in production as a static site on GitHub Pages the runtime is fast. There needs to be a manual delay and display thinking....

Changes

  • Sets timeout in useChatReducer on fallbackResponse instead of length simulateAIResponse duration

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
  • Given dynamic site, a user enters and submits input, when the agent responds after fetching while thinking... is displayed, then a response is provided

Steps

Chat with Static AI Response

  1. Browse <user>.github.io/<repo>
  • Shows text field with enter an idea placeholder text and submit button
  1. Enter text in the input field
  • Input field updates and submit button becomes enabled
  1. Click the submit button
  • Does not show thinking... indicator below for ~1 second

Tests

Chat with Static AI Response

  1. Simulate API error with unreachable code in critique/src/app/api/critique/route.ts with return new Response(JSON.stringify({ error: 'no implementation' }), { status: 501 }); on ln19 before the try
    • Falls back to static response
    • Shows error message in node log and browser console
  2. Run npm run dev and browse <codespace>-3000.app.github.dev
  • Shows text field with enter an idea placeholder text and submit button
  1. Enter text in the input field
  • Input field updates and submit button becomes enabled
  1. Click the submit button
  • Displays user message in chat view
  • Shows thinking... indicator below
  • Displays empty Input field
  1. Wait ~1 second
  • Displays random static AI response below the user message
  • Does not display thinking... indicator
  1. Confirm user and AI messages show in chat view
  • Displays messages as independent elements in the chat view
  • Displays AI messages from the preconfigured AI Responses

@matthewctechnology matthewctechnology self-assigned this Dec 29, 2025
@matthewctechnology matthewctechnology linked an issue Dec 29, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Owner Author

@matthewctechnology matthewctechnology left a comment

Choose a reason for hiding this comment

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

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 useChatReducer on fallbackResponse instead of length simulateAIResponse duration ✔️

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 🟢 ☑️

  1. Simulate API error with unreachable code in critique/src/app/api/critique/route.ts with return new Response(JSON.stringify({ error: 'no implementation' }), { status: 501 }); on ln19 before the try
    • Falls back to static response ✔️
    • Shows error message in node log and browser console ✔️
  2. Run npm run dev and browse <codespace>-3000.app.github.dev
  • Shows text field with enter an idea placeholder text and submit button ✔️
  1. Enter text in the input field
  • Input field updates and submit button becomes enabled ✔️
  1. Click the submit button
  • Displays user message in chat view ✔️
  • Shows thinking... indicator for ~1 second ✔️
  • Displays empty Input field ✔️
  1. Wait ~1 second
  • Displays random static AI response below the user message ✔️
  • Does not display thinking... indicator ✔️
  1. 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 🟢 ☑️

  1. Run npm run dev and browse <codespace>-3000.app.github.dev
  • Shows text field with enter an idea placeholder text and submit button ✔️
  1. Enter text in the input field
  • Input field updates and submit button becomes enabled ✔️
  1. Click the submit button
  • Displays user message in chat view ✔️
  • Shows thinking... indicator for ~1 second ✔️
  • Displays empty Input field ✔️
  1. Wait ~3 second
  • Displays actual AI response below the user message ✔️
  • Does not display thinking... indicator ✔️
  1. Confirm user and AI messages show in chat view
  • Displays messages as independent elements in the chat view ✔️
  • Displays User message ✔️
  • Displays AI message ✔️

@matthewctechnology matthewctechnology merged commit 371e510 into main Dec 29, 2025
1 check passed
@matthewctechnology matthewctechnology deleted the stacked-40 branch December 29, 2025 18:30
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.

Resolve critique App Response Delay

1 participant