Skip to content

Perf/optimize chat input#362

Merged
pancacake merged 2 commits intoHKUDS:devfrom
jiakeboge:perf/optimize-chat-input
Apr 22, 2026
Merged

Perf/optimize chat input#362
pancacake merged 2 commits intoHKUDS:devfrom
jiakeboge:perf/optimize-chat-input

Conversation

@jiakeboge
Copy link
Copy Markdown
Contributor

Description

  1. Created a reusable SimpleComposerInput to isolate input state for the TutorBot interface.
  2. Refactored web/app/(workspace)/agents/[botId]/chat/page.tsx to remove the top-level input state.
  3. Verified that keystrokes in TutorBot now only trigger local renders, matching the "buttery smooth" performance of the main interface.

Related Issues

Module(s) Affected

  • agents
  • api
  • config
  • core
  • knowledge
  • logging
  • services
  • tools
  • utils
  • web (Frontend)
  • docs (Documentation)
  • scripts
  • tests
  • Other: ...

Checklist

  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run pre-commit run --all-files and fixed any issues.
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary).
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

…ions (HKUDS#351)

Extract `ComposerInput` component to isolate frequent keystroke renders.
Refactor `ChatComposer` to use `hasContent` flag instead of full `input` state.
 Apply `React.memo` to heavy config panels (Quiz, Math, Research, Visualize).
Stabilize parent callbacks in `ChatPage` using `useCallback`.
Fix residual syntax errors and missing `canSend` definition in composer.
Address HKUDS#351 by implementing deep state colocation.
Extract lightweight `SimpleComposerInput` to isolate keystroke renders.
 Colocate input state in `agents/[botId]/chat/page.tsx` to prevent full-page lag.
Export @mention utility helpers from `ComposerInput.tsx` for cross-component use.
Address follow-up feedback from StarNight2021 regarding tutorbot-only performance.
This completes the performance overhaul by ensuring all chat entry points use optimized state colocation patterns.
@pancacake pancacake changed the base branch from main to dev April 22, 2026 11:12
pancacake added a commit that referenced this pull request Apr 22, 2026
…dev)

perf(web): decouple chat input state to resolve lag in long conversations (#351)
- Extract ComposerInput / SimpleComposerInput to isolate keystroke renders
- Apply React.memo to heavy config panels
- Stabilize parent callbacks with useCallback
@pancacake pancacake merged commit 5662c1c into HKUDS:dev Apr 22, 2026
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.

2 participants