-
Notifications
You must be signed in to change notification settings - Fork 225
chore(ask_gh): Add login modal #875
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
Conversation
|
@brendan-kellam your pull request is missing a changelog! |
Code ReviewI found one issue that should be addressed: Missing error handling for JSON.parseLocation: The While the data is written by the same code via Suggested fix: try {
const message = JSON.parse(stored) as Descendant[];
// Restore the message content to the editor by replacing all nodes
// Remove all existing nodes
while (editor.children.length > 0) {
Transforms.removeNodes(editor, { at: [0] });
}
// Insert the restored content at the beginning
Transforms.insertNodes(editor, message, { at: [0] });
// Allow the UI to render the restored text before auto-submitting
createNewChatThread(message, selectedSearchScopes);
} catch (error) {
console.error('Failed to restore pending message:', error);
sessionStorage.removeItem(PENDING_MESSAGE_KEY);
// Optionally notify the user that their message couldn't be restored
}Reference: sourcebot/packages/web/src/app/[domain]/askgh/[owner]/[repo]/components/landingPage.tsx Lines 70 to 85 in 2d057a7
Summary: Checked for bugs and CLAUDE.md compliance. Found 1 issue requiring attention. |
|
Caution Review failedThe pull request is closed. WalkthroughAdds authentication-aware submission flow: unauthenticated submissions open a login modal and persist the pending message to sessionStorage; after authentication the pending message is restored into the Slate editor and auto-submitted. Introduces a new LoginModal component and passes providers/isAuthenticated from the page to LandingPage. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant LandingPage
participant LoginModal
participant Auth
participant SlateEditor as Slate Editor
participant ThreadService
User->>LandingPage: Submit message (unauthenticated)
LandingPage->>LandingPage: Check isAuthenticated
LandingPage->>LandingPage: Store pending message in sessionStorage
LandingPage->>LoginModal: Open modal with providers
User->>Auth: Authenticate via provider
Auth-->>LandingPage: Authentication successful (session)
LandingPage->>LandingPage: Retrieve pending message from sessionStorage
LandingPage->>SlateEditor: Clear content, insert restored message
LandingPage->>ThreadService: Create thread / submit message
ThreadService-->>User: Chat thread created / response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit