Files
new-api/web
Apple\Apple 78353cb538 ♻️ refactor(playground): Refactor auto-collapse logic to eliminate code duplication
- 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
2025-05-31 01:35:13 +08:00
..
2025-05-20 23:21:48 +08:00
2023-04-22 20:39:27 +08:00
2025-04-04 17:37:27 +08:00
2025-04-04 17:37:27 +08:00
2025-05-06 01:36:23 +08:00
2024-03-23 21:24:39 +08:00
2025-05-06 01:36:23 +08:00
2023-04-22 20:39:27 +08:00
2025-05-06 01:36:23 +08:00

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.

Reference

  1. https://github.com/OIerDb-ng/OIerDb
  2. https://github.com/cornflourblue/react-hooks-redux-registration-login-example