-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iris
: Hide suggestions during response generation
#9919
base: develop
Are you sure you want to change the base?
Iris
: Hide suggestions during response generation
#9919
Conversation
WalkthroughThe changes in this pull request involve modifications to the conditional rendering logic in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/test/javascript/spec/component/iris/ui/iris-base-chatbot.component.spec.ts (1)
483-571
: Consider extracting common test setup.While the current implementation is clear, consider extracting the repeated setup code into a shared helper function to reduce duplication:
function setupSuggestionsTest(component: IrisBaseChatbotComponent, chatService: IrisChatService) { const expectedSuggestions = ['suggestion1', 'suggestion2']; const mockMessages = [mockClientMessage, mockServerMessage]; jest.spyOn(chatService, 'currentSuggestions').mockReturnValue(of(expectedSuggestions)); jest.spyOn(chatService, 'currentMessages').mockReturnValue(of(mockMessages)); component.ngOnInit(); return expectedSuggestions; }This would simplify each test case while maintaining clarity:
it('should not render suggestions if isLoading is true', () => { // Arrange setupSuggestionsTest(component, chatService); // Act component.isLoading = true; fixture.detectChanges(); // Assert const suggestionButtons = fixture.nativeElement.querySelectorAll('.suggestion-button'); expect(suggestionButtons).toHaveLength(0); });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
src/main/webapp/app/iris/base-chatbot/iris-base-chatbot.component.html
(1 hunks)src/test/javascript/spec/component/iris/ui/iris-base-chatbot.component.spec.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/webapp/app/iris/base-chatbot/iris-base-chatbot.component.html (1)
Pattern src/main/webapp/**/*.html
: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.
src/test/javascript/spec/component/iris/ui/iris-base-chatbot.component.spec.ts (1)
Pattern src/test/javascript/spec/**/*.ts
: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}
🔇 Additional comments (2)
src/main/webapp/app/iris/base-chatbot/iris-base-chatbot.component.html (1)
63-70
: LGTM! Well-structured conditional logic.
The conditions for displaying suggestions are comprehensive and efficiently ordered, with simple checks preceding complex ones. This implementation successfully prevents suggestions from appearing during response generation.
src/test/javascript/spec/component/iris/ui/iris-base-chatbot.component.spec.ts (1)
483-571
: LGTM! Excellent test coverage.
The test suite comprehensively covers all conditions for hiding suggestions with well-structured, focused test cases. Each test follows the AAA pattern and uses appropriate mocking strategies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Server: 03
Works as expected. I like this change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS3. Works as described. Nice feature!
Checklist
General
Client
Motivation and Context
This PR addresses an inconsistency in the Iris chat interface where suggestions remain visible and clickable while responses are being generated, despite the text input field being disabled during this time. The change implements validation checks to hide suggestions during response generation, ensuring consistent behavior across the interface.
Description
Added validation logic to control suggestion visibility based on the chat's response generation state. This ensures suggestions are automatically disabled when a response is being generated.
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Code Review
Manual Tests
Test Coverage
TBD - Coverage script gives an empty result.
Screenshots
Summary by CodeRabbit
New Features
Tests