- Extract common `applyAutoCollapseLogic` function for reasoning panel collapse behavior - Consolidate duplicated auto-collapse logic across multiple functions - Simplify conditional expressions using logical OR operator - Replace repetitive property assignments with object spread syntax - Update dependency arrays to include new shared function - Ensure consistent behavior across stream/non-stream/error scenarios This refactoring improves code maintainability by following DRY principles and centralizing the auto-collapse logic in a single reusable function. All message handling functions now use consistent logic for determining when to auto-collapse the reasoning panel. Benefits: - Reduced code duplication from ~20 lines to 6 lines per function - Single source of truth for auto-collapse behavior - Improved readability and maintainability - Easier to modify collapse logic in the future Files changed: - web/src/hooks/useApiRequest.js: Refactored message handling functions
React Template
Basic Usages
# Runs the app in the development mode
npm start
# Builds the app for production to the `build` folder
npm run build
If you want to change the default server, please set REACT_APP_SERVER environment variables before build,
for example: REACT_APP_SERVER=http://your.domain.com.
Before you start editing, make sure your Actions on Save options have Optimize imports & Run Prettier enabled.