frontend
frontend copied to clipboard
Refactor frontend part 7
Description
Supersedes #2518.
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [x] Code quality improvements
How to test
Checklist
- [x] I have tested this code
- [ ] I have updated the documentation
Pull Request Test Coverage Report for Build 8673716388
Details
- 22 of 93 (23.66%) changed or added relevant lines in 12 files are covered.
- 10 unchanged lines in 3 files lost coverage.
- Overall coverage increased (+0.04%) to 33.973%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| src/pages/academy/gameSimulator/subcomponents/chapterSimulator/ChapterSimulatorTextLoader.tsx | 0 | 1 | 0.0% |
| src/pages/academy/groundControl/configureControls/ExportScoreLeaderboardButton.tsx | 0 | 1 | 0.0% |
| src/pages/academy/groundControl/configureControls/ExportVoteLeaderboardButton.tsx | 0 | 1 | 0.0% |
| src/pages/sicp/Sicp.tsx | 1 | 2 | 50.0% |
| src/features/sicp/chatCompletion/chatCompletion.ts | 3 | 6 | 50.0% |
| src/commons/utils/Hooks.ts | 1 | 6 | 16.67% |
| src/features/sicp/chatCompletion/api.ts | 0 | 7 | 0.0% |
| src/commons/mobileWorkspace/MobileWorkspace.tsx | 2 | 21 | 9.52% |
| src/pages/sicp/subcomponents/chatbot/ChatBox.tsx | 4 | 37 | 10.81% |
| <!-- | Total: | 22 | 93 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| src/commons/sagas/RequestsSaga.ts | 1 | 13.1% |
| src/pages/sicp/subcomponents/chatbot/ChatBox.tsx | 3 | 6.49% |
| src/pages/sicp/subcomponents/chatbot/Chatbot.tsx | 6 | 4.76% |
| <!-- | Total: | 10 |
| Totals | |
|---|---|
| Change from base Build 8673551384: | 0.04% |
| Covered Lines: | 5249 |
| Relevant Lines: | 14371 |
💛 - Coveralls
More important/relevant commits:
https://github.com/source-academy/frontend/pull/2846/commits/85f914a0d8289c018e835c52c78016f691b5e506 Refactoring of chat completion prompt logic
https://github.com/source-academy/frontend/pull/2846/commits/b8cf72b65fe3eac92ddaf5994d3cd3f566c2a207 Refactoring of chat box component state & logic
https://github.com/source-academy/frontend/pull/2846/commits/cc0052f6cfe3d0485b1f10e2bcd21f326a14956e Decoupling of chat box UI rendering from completion logic
@RichDom2185 Thank you for the wonderful effort. LGTM.
@RichDom2185 Thank you for the wonderful effort. LGTM.
Thanks for helping to catch the double request bug and suggestions!