Feat: Apply AI#19
Merged
Merged
Conversation
Collaborator
Author
There was a problem hiding this comment.
Pull request overview
Adds an in-reader AI chatbot feature that calls a new authenticated backend endpoint and surfaces the UI from the chapter reading screen, with supporting navigation and i18n strings.
Changes:
- Added
ReaderChatbotmodal UI and a floating action button (FAB) on the chapter reader screen to open it. - Added an authenticated
askReaderChatbotAPI call and a newendpoints.readerChatbot(comicId)endpoint helper. - Updated navigation to allow routing to
Profilefor login, plus added EN/VI i18n strings for the chatbot and adjusted some EN login-required copy.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/api/endpoints.js | Adds readerChatbot(comicId) endpoint helper. |
| src/navigation/AppNavigator.jsx | Adds Profile as a stack screen to support navigation from the chatbot login prompt. |
| src/i18n/locales/vi.js | Adds Vietnamese strings for story.chatbot.*. |
| src/i18n/locales/en.js | Adds English strings for story.chatbot.* and modifies login-required copy. |
| src/features/chapters/reader/ReaderChatbot.jsx | New chatbot modal component (messages, samples, login gate, send flow). |
| src/features/chapters/api.js | Adds askReaderChatbot POST call using authenticated axios config. |
| src/app/story/chapter/[id].jsx | Adds FAB + modal wiring to open ReaderChatbot from chapter reader. |
| src/app/(tabs)/profile.jsx | Adds goBack behavior after login when navigated from chatbot. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+90
to
+93
| contentContainerStyle={[ | ||
| styles.bodyContent, | ||
| !isAuthenticated | ||
| ]} |
|
|
||
| useEffect(() => { | ||
| if (messages.length > 0) { | ||
| setTimeout(() => scrollRef.current?.scrollToEnd({ animated: true }), 100); |
Comment on lines
+58
to
+59
| vi: t('story.chatbot.errorMessage'), | ||
| en: t('story.chatbot.errorMessage'), |
Comment on lines
+20
to
+26
| export function ReaderChatbot({ visible, onClose, comicId, currentChapterNumber }) { | ||
| const { colors, language } = useSettings(); | ||
| const { isAuthenticated } = useAuth(); | ||
| const { t } = useTranslation(); | ||
| const styles = makeStyles(colors); | ||
| const navigation = useNavigation(); | ||
|
|
Comment on lines
+59
to
63
| loginRequired: 'Sign in to have this feature', | ||
| loginRequiredPrefix: '', | ||
| loginRequiredLink: 'Sign in', | ||
| loginRequiredSuffix: ' to see this feature', | ||
| loginRequiredSuffix: ' to have this feature', | ||
| noHistory: 'No reading history yet', |
Comment on lines
85
to
92
| loading: 'Loading favorites...', | ||
| loginRequired: 'Sign in to see your followed comics.', | ||
| loginRequired: 'Sign in to have this feature', | ||
| empty: "You haven't followed any comics yet.", | ||
| }, | ||
| history: { | ||
| loading: 'Loading history...', | ||
| loginRequired: 'Sign in to see your reading history.', | ||
| loginRequired: 'Sign in to have this feature', | ||
| empty: 'Your history is empty.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.